cfenollosa_os-tutorial/05-bootsector-functions-strings/boot_sect_main.asm

35 lines
550 B
NASM
Raw Normal View History

2014-10-05 10:54:46 +00:00
[org 0x7c00] ; tell the assembler that our offset is bootsector code
; The main routine makes sure the parameters are ready and then calls the function
mov bx, HELLO
call print
2014-10-05 18:12:33 +00:00
call print_nl
2014-10-05 10:54:46 +00:00
mov bx, GOODBYE
call print
2014-10-05 18:12:33 +00:00
call print_nl
2014-10-08 16:25:10 +00:00
mov dx, 0x12fe
2014-10-05 18:12:33 +00:00
call print_hex
2014-10-05 10:54:46 +00:00
; that's it! we can hang now
jmp $
; remember to include subroutines below the hang
%include "boot_sect_print.asm"
2014-10-05 18:12:33 +00:00
%include "boot_sect_print_hex.asm"
2014-10-05 10:54:46 +00:00
; data
HELLO:
db 'Hello, World', 0
GOODBYE:
db 'Goodbye', 0
; padding and magic number
times 510-($-$$) db 0
dw 0xaa55