boot_sect_main.asm 650 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. ; feel free to integrate newline code into "boot_sect_print"
  7. mov ah, 0x0e
  8. mov al, 0x0A ; newline char
  9. int 0x10
  10. mov al, 0x0D ; carriage return char
  11. int 0x10
  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