Advertisement
Guest User

Untitled

a guest
May 21st, 2020
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. ; Solution for biosless
  2. bits 32
  3. org 0x91e4
  4.  
  5. _start:
  6.  
  7. mov dx, 0x3f2
  8. mov ax, 0x80 + 0
  9. out dx, ax
  10. mov dx, 0x3f4
  11. in ax, dx
  12.  
  13. ; ISSUE READ
  14. ; 1)
  15. mov dx, 0x3f5
  16. mov ax, 6
  17. out dx, ax
  18.  
  19. ; 2)
  20. mov ax, 0 ; specify head and drive
  21. out dx, ax
  22.  
  23. ; 2)
  24. mov ax, 0 ; specify cyl
  25. out dx, ax
  26.  
  27. ; 3) specify head
  28. mov ax, 1
  29. out dx, ax
  30.  
  31. ; 4) specify sector
  32. mov ax, 17
  33. out dx, ax
  34.  
  35. ; 5) specify sector size code
  36. mov ax, 3 ; this means 512
  37. out dx, ax
  38.  
  39. ; 6) specify num sectors
  40. mov ax, 0
  41. out dx, ax
  42.  
  43. ; 7) specify gap
  44. mov ax, 0
  45. out dx, ax
  46.  
  47. ; 8) specify data len
  48. mov ax, 0xff
  49. out dx, ax
  50.  
  51. ; READ
  52. xor ax, ax
  53. mov dx, 0x3f5
  54. mov ebx, 0xb8000
  55. print_flag:
  56. cmp ebx, 0xb8000 + 256
  57. jg endless_loop
  58. in ax, dx
  59. mov byte [ebx], al
  60. add ebx, 2
  61. jmp print_flag
  62.  
  63. endless_loop:
  64. jmp endless_loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement