Improve memory position handling

This commit is contained in:
Nero 2019-10-28 10:49:42 +00:00
parent 47630b2c03
commit af61db5e40
3 changed files with 11 additions and 10 deletions

View file

@ -1,6 +1,5 @@
%define segment 0x00100
%define self (0x7C00-(segment<<4)) ; 1 sector
%define prog (RAM-0x1000) ; 4K at the end for OS
cpu 8086
org self
@ -58,7 +57,7 @@ main:
; Stack grows down from 64k
mov ax, cs
mov ss, ax
mov sp, prog
mov sp, BDOS
mov ds, ax
mov es, ax
@ -67,7 +66,7 @@ main:
mov ax, 1
mov cx, 8
mov dx, 0
mov bx, prog
mov bx, BDOS
.loop:
push ax
@ -106,8 +105,8 @@ main:
mov dl, [fdc.drv]
; jump into kernel
jmp segment:(prog+0x0800)
; jump into bios cold boot entry point
jmp segment:BIOS
error:
mov ax, bp