__zero__

kb_vid

Nov 6th, 2019
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. rm temp.s
  3. touch temp.s
  4. cpp boot.s >> temp.s
  5. as -o boot.o temp.s
  6. ld -o boot.bin --oformat binary boot.o
  7. qemu-system-x86_64 boot.bin
  8. */
  9.  
  10.  
  11. #define vidcall int $0x10
  12. #define kb int $0x16
  13.  
  14. .code16
  15.  
  16. .section .data
  17.     .ascii "Hello world"
  18. .section .text
  19. .globl _start
  20.  
  21. _start:
  22.     movb $0x9,%ah
  23.     movb $0x9,%bl
  24.     movb $1,%cx
  25.     vidcall
  26.     movb $0x0,%ah
  27.     kb
  28.     jmp _start
  29.     cli
  30.     hlt
  31.  
  32. .fill 510-(.-_start), 1, 0
  33. .word 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment