|
@@ -18,15 +18,25 @@
|
|
|
|
|
|
..start:
|
|
..start:
|
|
; init the stack
|
|
; init the stack
|
|
- mov ax, dgroup
|
|
|
|
- mov ss, ax
|
|
|
|
|
|
+ mov bx, dgroup
|
|
|
|
+ mov ss, bx
|
|
mov sp, stacktop
|
|
mov sp, stacktop
|
|
|
|
|
|
|
|
+ ; zero fill the BSS section
|
|
|
|
+ mov es, bx
|
|
|
|
+ mov di, _edata wrt dgroup
|
|
|
|
+ mov cx, _end wrt dgroup
|
|
|
|
+ sub cx, di
|
|
|
|
+ jz no_bss
|
|
|
|
+ xor al, al
|
|
|
|
+ rep stosb
|
|
|
|
+no_bss:
|
|
|
|
+
|
|
; save the Program Segment Prefix
|
|
; save the Program Segment Prefix
|
|
push ds
|
|
push ds
|
|
|
|
|
|
; init DS
|
|
; init DS
|
|
- mov ds, ax
|
|
|
|
|
|
+ mov ds, bx
|
|
|
|
|
|
; pop the PSP from stack and store it in the pascal variable dos_psp
|
|
; pop the PSP from stack and store it in the pascal variable dos_psp
|
|
pop ax
|
|
pop ax
|