nor86/kernel.asm

51 lines
720 B
NASM

cpu 8086
org 0x500
greet:
mov si, kernel_greeting
call printz
mov al, dl
add al, '0'
call printc
mov al, 10
call printc
memsize:
; Get and display memory size
int 0x12
mov bx, buffer
call itoa
mov si, bx
call printz
mov si, memsize_trailer
call printz
floppies:
; Get and display number of floppy disks
int 0x11
times 6 shr ax, 1
and ax, 3
inc ax
add al, '0'
call printc
mov si, floppies_trailer
call printz
hang:
hlt
jmp hang
%include "console.inc"
%include "printhex.inc"
%include "strint.inc"
kernel_greeting db 10, "Nor86 kernel succesfully loaded", 10, "Loaded from disk ", 0
memsize_trailer db "k RAM", 10, 0
floppies_trailer db " floppy drive(s)", 10, 0
buffer times 256 db 0