convert MBR, VBR, & Stage2 to use a BSS section. #3
@@ -51,20 +51,13 @@ init:
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Zero BSS section
|
; Zero BSS section
|
||||||
;
|
|
||||||
mov cx, (end_bss - begin_bss) ; count = bss length
|
mov cx, (end_bss - begin_bss) ; count = bss length
|
||||||
|
|
||||||
mov ax, begin_bss
|
mov ax, begin_bss
|
||||||
shr ax, 4
|
mov di, ax ; es:di is dest
|
||||||
mov es, ax ; es = begining of bss section
|
|
||||||
|
|
||||||
xor ax, ax
|
xor ax, ax
|
||||||
mov di, ax ; dst = 0
|
|
||||||
|
|
||||||
cld
|
cld
|
||||||
rep stosb ; zero bss section
|
rep stosb ; zero bss section
|
||||||
|
|
||||||
xor ax, ax
|
|
||||||
mov ss, ax ; Set Stack Segment to 0
|
mov ss, ax ; Set Stack Segment to 0
|
||||||
mov sp, stack_top ; Setup stack
|
mov sp, stack_top ; Setup stack
|
||||||
mov bp, sp ; base ptr = stack ptr
|
mov bp, sp ; base ptr = stack ptr
|
||||||
|
|||||||
Reference in New Issue
Block a user