kernel heap: dont trash ES

This commit is contained in:
Nero 2019-03-23 21:27:06 +00:00
parent 4489dd1b47
commit 40a7c52bae

View File

@ -5,10 +5,14 @@ heap_init:
push ax ; byte value (0) push ax ; byte value (0)
push cx ; loop counter push cx ; loop counter
push di ; target ptr push di ; target ptr
push es
mov ax, ds
mov es, ax
xor ax, ax xor ax, ax
mov cx, [heap_size] mov cx, [heap_size]
mov di, heap mov di, heap
rep stosb ; rep makes this loop cx times, incrementing di, writing al rep stosb ; rep makes this loop cx times, incrementing di, writing al
pop es
pop di pop di
pop cx pop cx
pop ax pop ax