Advertisement
Guest User

Untitled

a guest
Feb 11th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. bits 16
  2. org 0x7c00
  3.  
  4.  
  5. jmp 0:main
  6.  
  7.  
  8. main:
  9.  
  10. cli
  11. xor ax, ax
  12. mov ds, ax
  13. mov es, ax
  14. mov ss, ax
  15.  
  16. ; Found this online, clutching at straws now
  17.  
  18. mov ax, 07C0h ; Set 'ax' equal to the location of this bootloader divided by 16
  19. add ax, 20h ; Skip over the size of the bootloader divided by 16
  20. mov ss, ax ; Set 'ss' to this location (the beginning of our stack region)
  21. mov sp, 4096 ; Set 'ss:sp' to the top of our 4K stack
  22.  
  23. ;sti
  24.  
  25. ; Example bios call
  26.  
  27. mov ax, 0x1112
  28. int 0x10
  29.  
  30. mov eax, cr0
  31. or eax, 1
  32. mov cr0, eax
  33.  
  34.  
  35. times 510 - ($-$$) db 0
  36. dw 0xAA55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement