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,8 +1,9 @@
FLOPPY = 360
RAM = 0x10000
BDOS = 0xF000
BDOSIMG = bdos.bin
BIOS = 0xF800
BIOSIMG = bios8086.bin
PROGRAMS = $(patsubst %.asm,%.com,$(wildcard com/*.asm))
@ -15,7 +16,7 @@ QEMU_ARGS = $(addprefix --option-rom ,$(ROMS))
NASM = nasm
NASM_ARGS = -s -Ilib -Plib/nasmcomp.asm -w-macro-params
NASM_ARGS += -DRAM=$(RAM)
NASM_ARGS += -DBDOS=$(BDOS) -DBIOS=$(BIOS)
EMUL = utils/emul

View File

@ -1,4 +1,4 @@
ORG (RAM - 0x0800)
ORG BIOS
CPU 8086
DISKCX: EQU 0x8
@ -28,7 +28,8 @@ BOOT:
DB "BIOS", 0
WBOOT:
JMP (RAM - 0x1000)
XOR AX, AX
JMP BDOS
RET
; CHAR I/O

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