66 lines
889 B
NASM
66 lines
889 B
NASM
cpu 8086
|
|
|
|
; Memory layout (starting from top)
|
|
%define self 0xF000
|
|
|
|
; A single sector for disk i/o
|
|
%define diskbuf (self-0x200)
|
|
|
|
; DWORD partition offset for C: and D:
|
|
%define parttab (diskbuf - (2*4))
|
|
|
|
%define stack (parttab)
|
|
|
|
%define default_drive BYTE [0x5B]
|
|
|
|
%define fcb_size 31
|
|
|
|
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 dx, 0x79
|
|
mov byte [0x79], 0x7F
|
|
call read_buffer
|
|
mov ax, [0x79]
|
|
int3
|
|
|
|
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"
|