rdos/kernel/main.asm

58 lines
734 B
NASM

cpu 8086
self: equ 0xF000
diskbuf: equ (self-0x200) ; deblocking
stack: equ (diskbuf) ; grows down
defdrv: equ 4
org self
jmp init
pad 3
self_offset:
db (self >> 8)
banner:
db "RDOS 2019-09", 0x0A, 0x0D, '$', 0
init:
mov sp, stack
mov byte [defdrv], 0x01
mov dx, banner
call print_string
call exec_chain
cli
.halt:
hlt
jmp .halt
init_program:
db "HELLO.COM", 0
cpm_syscall:
cmp cl, 0
je init
cmp cl, 1
je console_input
cmp cl, 2
je console_output
cmp cl, 9
je print_string
cmp cl, 10
je read_buffer
stc
ret
%include "char.asm"
%include "exec.asm"
%include "fdc.asm"
%include "fcb.asm"
%include "fcbparse.asm"
%include "drive.asm"
%include "log2.asm"
%include "dump.asm"