Created
September 9, 2014 18:01
-
-
Save benwaffle/bf22511d841a7164ce56 to your computer and use it in GitHub Desktop.
boot and display a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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