Code: Select all
cmp
Code: Select all
BITS 16
start:
in al, 0x92
test al, 2
jnz skip
or al, 2
and al, 0xFE
out 0x92, al
jmp skip
skip:
mov ax, 07C0h
add ax, 288
mov ss, ax
mov sp, 4096
mov ax, 07C0h
mov ds, ax
mov si, welcome
call print_si
jmp term
welcome db 'Welcome to starfruit', 0
print_si:
mov ah, 0Eh
.repeat:
lodsb
cmp al, 0
je .done
int 10h
jmp .repeat
.done:
ret
times 510-($-$$) db 0
dw 0xAA55
term:
int 80h
[color=#FF0000]cmp 80h, 0x65[/color]
je .done
[color=#FF0000]cmp 80h, 0x76[/color]
je vdisplay
[color=#FF0000]cmp 80h, 0x62[/color]
je boothdd
jmp error
error:
mov si, emsga
call print_si
mov si, emsgb
jmp term
emsga db 'Commands are 1 byte long', 0
emsgb db 'Try v, b, or e', 0
vdisplay:
mov si, version
call print_si
jmp term
version db 'Version 1.00', 0
boothdd:
mov si, haltmsg
call print_si
hlt
haltmsg db 'System Halt', 0
This is how I build it:
Code: Select all
nasm -f bin -o boot.bin boot.asm
dd status=noxfer conv=notrunc if=boot.bin of=floppy.flp
mkisofs -o disc.iso -b floppy.flp