rdos/kernel/main.asm
2019-10-14 17:59:48 +00:00

59 lines
768 B
NASM

cpu 8086
; Memory layout (starting from top)
%define self 0xF000
; A single sector for deblocking
%define diskbuf (self-0x200)
%define stack (diskbuf)
%define default_drive BYTE [0x4]
org self
jmp init
banner:
db "RDOS 2019-09", 0x0A, 0x0D, '$', 0
init:
mov sp, stack
mov default_drive, 0x01
mov dx, banner
call print_string
mov si, init_program
call exec
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 "fcb.asm"
%include "fcbparse.asm"
%include "drive.asm"
%include "log2.asm"
%include "dump.asm"