2019-03-24 19:24:25 +01:00
|
|
|
; assumptions about the starting envionment
|
|
|
|
cpu 8086
|
|
|
|
org 0x0000
|
|
|
|
|
|
|
|
_startup:
|
|
|
|
mov ax, cs
|
2019-03-31 22:54:51 +02:00
|
|
|
mov ds, ax
|
|
|
|
mov es, ax
|
2019-03-28 00:07:04 +01:00
|
|
|
mov ss, ax
|
|
|
|
mov sp, 0x0000
|
2019-03-23 21:23:17 +01:00
|
|
|
main:
|
2019-03-31 22:54:51 +02:00
|
|
|
xor ax, ax
|
2019-03-23 21:23:17 +01:00
|
|
|
mov ds, ax
|
2019-03-31 22:54:51 +02:00
|
|
|
mov si, ax
|
|
|
|
mov cx, ax
|
2019-03-23 21:23:17 +01:00
|
|
|
|
2019-03-24 18:59:45 +01:00
|
|
|
call debug_init
|
|
|
|
int 0x2E
|
2019-03-23 21:23:17 +01:00
|
|
|
|
2019-03-31 22:54:51 +02:00
|
|
|
call ivt_backup
|
|
|
|
|
|
|
|
xor ax, ax
|
|
|
|
mov ds, ax
|
|
|
|
mov es, ax
|
|
|
|
xor cx, cx
|
|
|
|
mov si, ax
|
|
|
|
.loop:
|
|
|
|
mov ax, cx
|
|
|
|
call kprint8
|
|
|
|
mov al, '='
|
|
|
|
call kputc
|
|
|
|
lodsw
|
|
|
|
xchg ax, dx
|
|
|
|
lodsw
|
|
|
|
call kprint16
|
|
|
|
mov al, ':'
|
|
|
|
call kputc
|
|
|
|
xchg ax, dx
|
|
|
|
call kprint16
|
|
|
|
mov al, ' '
|
|
|
|
call kputc
|
|
|
|
inc cx
|
|
|
|
test cx, 0x0003
|
|
|
|
jnz .loop
|
|
|
|
mov al, 0x0A
|
|
|
|
call kputc
|
|
|
|
mov al, 0x0D
|
|
|
|
call kputc
|
|
|
|
cmp cx, 0x0060
|
|
|
|
jl .loop
|
|
|
|
|
2019-03-28 00:07:04 +01:00
|
|
|
.halt:
|
|
|
|
hlt
|
|
|
|
jmp .halt
|
2019-03-23 21:23:17 +01:00
|
|
|
|
2019-03-24 19:24:25 +01:00
|
|
|
%include "heap.asm"
|
|
|
|
%include "intr.asm"
|
|
|
|
%include "debug.asm"
|
|
|
|
%include "kprintf.asm"
|
|
|
|
|
|
|
|
_reloc_end:
|
2019-03-23 21:23:17 +01:00
|
|
|
|
|
|
|
align 16
|
|
|
|
heap:
|