You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.4 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. int data_from_disk(index, number_sectors, data_buffer, data_buffer_segment);
  2. int sec_stub();
  3. int stub(index, number_sectors, data_buffer, data_buffer_segment);
  4. int stub(index, number_sectors, data_buffer, data_buffer_segment)
  5. long* index;
  6. long number_sectors;
  7. void* data_buffer;
  8. int data_buffer_segment;
  9. {
  10. #asm
  11. #define index 4[bp];
  12. #define number_sectors 6[bp];
  13. #define data_buffer 8[bp];
  14. #define data_buffer_segment 10[bp];
  15. push bp
  16. mov bp,sp
  17. pusha
  18. //mov ax, ds
  19. //call 0x0000:0x7C2A
  20. //mov ax, DAPACK
  21. //call 0x0000:0x7C2A
  22. mov ax, #DAPACK
  23. call 0x0000:0x7C2A
  24. lsfs_load_data:
  25. mov ax, index
  26. mov WORD [DAPACK.lba_addr_dw_low], ax
  27. mov bx, number_sectors
  28. mov WORD [DAPACK.blkcnt], bx
  29. mov cx, data_buffer_segment
  30. mov WORD [DAPACK.db_addr_segment], cx
  31. mov dx, data_buffer;
  32. mov WORD [DAPACK.db_addr_offset], dx
  33. mov si, #DAPACK ; address of
  34. mov ah, #0x42 ; READ
  35. mov dl, [global_disk_identifier]
  36. int #0x13
  37. call 0x0000:0x7C2A
  38. popa
  39. pop bp
  40. ret
  41. DAPACK:
  42. DAPACK.dap_Size: db 0x10
  43. DAPACK.rev_byte: db 0x0
  44. DAPACK.blkcnt: dw 0x0
  45. DAPACK.db_addr_offset: dw 0x0
  46. DAPACK.db_addr_segment: dw 0x0
  47. DAPACK.lba_addr_dw_low: dd 0x0
  48. DAPACK.lba_addr_dw_high: dd 0x0
  49. global_disk_identifier: db 0x80
  50. #endasm
  51. }
  52. int sec_stub()
  53. {
  54. return 42;
  55. }