Skip to content

Instantly share code, notes, and snippets.

@benwaffle
Created September 9, 2014 18:01
Show Gist options
  • Save benwaffle/bf22511d841a7164ce56 to your computer and use it in GitHub Desktop.
Save benwaffle/bf22511d841a7164ce56 to your computer and use it in GitHub Desktop.
boot and display a string
mov ax, 0x07c0
mov ds, ax
mov si, msg
call clear
call zerocursor
call print
hang:
jmp hang
zerocursor:
mov ah, 0x02
mov bh, 0
mov dx, 0
int 0x10
ret
clear:
mov ah, 0x06
mov al, 0
mov bh, 0xE2
mov cx, 0
mov dh, 24
mov dl, 80
int 0x10
ret
print: ; print a string
lodsb
or al, al
jz done
mov ah, 0x0E
int 0x10
jmp print
done:
ret
msg db 'Loading GNIX...'
times 510-($-$$) db 0
db 0x55
db 0xAA
all:
nasm boot.asm -f bin -o boot.bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment