boot_sect_print.asm 430 B

1234567891011121314151617181920212223
  1. print:
  2. pusha
  3. ; keep this in mind:
  4. ; while (string[i] != 0) { print string[i]; i++ }
  5. ; the comparison for string end (null byte)
  6. start:
  7. mov al, [bx] ; 'bx' is the base address for the string
  8. cmp al, 0
  9. je done
  10. ; the part where we print with the BIOS help
  11. mov ah, 0x0e
  12. int 0x10 ; 'al' already contains the char
  13. ; increment pointer and do next loop
  14. add bx, 1
  15. jmp start
  16. done:
  17. popa
  18. ret