boot_sect_main.asm 657 B

123456789101112131415161718192021222324252627282930313233
  1. [org 0x7c00] ; tell the assembler that our offset is bootsector code
  2. ; The main routine makes sure the parameters are ready and then calls the function
  3. mov bx, HELLO
  4. call print
  5. ; We will get fancy and print a newline
  6. mov ah, 0x0e
  7. mov al, 0x0A ; newline char
  8. int 0x10
  9. mov al, 0x0D ; carriage return char
  10. int 0x10
  11. ; feel free to integrate this into "boot_sect_print" if you want to
  12. mov bx, GOODBYE
  13. call print
  14. ; that's it! we can hang now
  15. jmp $
  16. ; remember to include subroutines below the hang
  17. %include "boot_sect_print.asm"
  18. ; data
  19. HELLO:
  20. db 'Hello, World', 0
  21. GOODBYE:
  22. db 'Goodbye', 0
  23. ; padding and magic number
  24. times 510-($-$$) db 0
  25. dw 0xaa55