Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. ; For people who are trying to get started with developing a bootloader
  2. ; Assemble with nasm
  3.  
  4. org 0x7C00
  5. bits 16
  6.  
  7. start: mov si, message ; Put addr of 'message' into si
  8. mov ah, 0x0E ; 16-bit interrupt for printing
  9. mov bx, 0x0000 ; Ensure page and color (not used in text modes) are 0
  10. .loop: lodsb ; Load byte at si into al and increment si
  11. or al, al ; al | al
  12. jz .exit ; If al == 0, the zero flag is set, and string ended
  13. int 10h ; Print char
  14. jmp .loop ; Repeat
  15. .exit: hlt ; If you can, halt
  16. jmp .exit ; If not, loop forever
  17. msg: db `Hello World`,0 ; Message
  18.  
  19. times 510 - ($ - $$) db 0
  20. dw 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement