Advertisement
theguild42

print_string

Mar 14th, 2021
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. ;
  2. ; A boot sector that prints a string using our fuctions.
  3. ;
  4. org 07c00h ; Tell the assembler where this code will be loaded
  5. mov ah, 00eh
  6.  
  7. mov bp, 08000h
  8. mov sp, bp
  9.  
  10. mov bx, HELLO_MSG
  11. call print_string
  12.  
  13. jmp $
  14.  
  15. print_string:
  16. mov al, [bx]
  17. or al, al
  18. je end
  19. int 0x10
  20. inc bx
  21. jmp print_string
  22.  
  23. HELLO_MSG:
  24. db "Hello, World!"
  25.  
  26. ; Padding and magic BIOS number
  27. end:
  28.  
  29. cli
  30. hlt
  31.  
  32. times 510-($-$$) db 0
  33. dw 0aa55h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement