Advertisement
pedraom2007

disk.inc

Oct 5th, 2021
2,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %ifndef __DISK_LIB__
  2. %define __DISK_LIB__
  3.  
  4. SegmentAddr dw 0000h
  5. OffsetAddr dw 0000h
  6. Sector db 0
  7. Track db 0
  8. Head db 0
  9. Drive db 0
  10. NumSectors db 0
  11.  
  12. Reader db 02h
  13. Writer db 03h
  14.  
  15. SectorPerTrack db 0
  16. TrackPerHead db 0
  17.  
  18. ReadDisk:
  19.     mov ah, byte[Reader]
  20.     call DiskOperation
  21. ret
  22.  
  23. WriteDisk:
  24.     mov ah, byte[Writer]
  25.     call DiskOperation
  26. ret
  27.  
  28. DiskOperation:
  29.     mov al, byte[NumSectors]
  30.     mov ch, byte[Track]
  31.     mov cl, byte[Sector]
  32.     mov dh, byte[Head]
  33.     mov dl, byte[Drive]
  34.     mov bx, word[SegmentAddr]
  35.     mov es, bx
  36.     mov bx, word[OffsetAddr]
  37.     int 13h
  38. ret
  39.  
  40.  
  41. %endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement