mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 04:39:38 +02:00
+ zero fill the bss section on startup in the msdos loader
git-svn-id: trunk@24339 -
This commit is contained in:
parent
12fd50c890
commit
11a915e682
@ -18,15 +18,25 @@
|
||||
|
||||
..start:
|
||||
; init the stack
|
||||
mov ax, dgroup
|
||||
mov ss, ax
|
||||
mov bx, dgroup
|
||||
mov ss, bx
|
||||
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
|
||||
push ds
|
||||
|
||||
; init DS
|
||||
mov ds, ax
|
||||
mov ds, bx
|
||||
|
||||
; pop the PSP from stack and store it in the pascal variable dos_psp
|
||||
pop ax
|
||||
|
Loading…
Reference in New Issue
Block a user