[165] | 1 | ; Project name : XTIDE Universal BIOS |
---|
| 2 | ; Description : Int 13h function AH=42h, Extended Read Sectors. |
---|
| 3 | |
---|
| 4 | ; Section containing code |
---|
| 5 | SECTION .text |
---|
| 6 | |
---|
| 7 | ;-------------------------------------------------------------------- |
---|
| 8 | ; Int 13h function AH=42h, Extended Read Sectors. |
---|
| 9 | ; |
---|
| 10 | ; AH42h_HandlerForExtendedReadSectors |
---|
| 11 | ; Parameters: |
---|
| 12 | ; SI: Same as in INTPACK |
---|
| 13 | ; DL: Translated Drive number |
---|
| 14 | ; DS:DI: Ptr to DPT (in RAMVARS segment) |
---|
| 15 | ; SS:BP: Ptr to IDEPACK |
---|
| 16 | ; Parameters on INTPACK: |
---|
| 17 | ; DS:SI: Ptr to Disk Address Packet |
---|
| 18 | ; Returns with INTPACK: |
---|
| 19 | ; AH: Int 13h return status |
---|
| 20 | ; CF: 0 if succesfull, 1 if error |
---|
| 21 | ; Return with Disk Address Packet in INTPACK: |
---|
[249] | 22 | ; .wSectorCount Number of sectors read successfully |
---|
[165] | 23 | ;-------------------------------------------------------------------- |
---|
| 24 | ALIGN JUMP_ALIGN |
---|
| 25 | AH42h_HandlerForExtendedReadSectors: |
---|
[221] | 26 | call Prepare_ByLoadingDapToESSIandVerifyingForTransfer |
---|
[165] | 27 | mov ah, [cs:bx+g_rgbReadCommandLookup] |
---|
| 28 | mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) |
---|
| 29 | call Idepack_ConvertDapToIdepackAndIssueCommandFromAH |
---|
[249] | 30 | ; Fall to AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | ;-------------------------------------------------------------------- |
---|
| 34 | ; AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX |
---|
| 35 | ; Parameters: |
---|
| 36 | ; AH: INT 13h Error Code |
---|
| 37 | ; CX: Number of successfully transferred sectors |
---|
| 38 | ; SS:BP: Ptr to IDEPACK |
---|
| 39 | ; Returns: |
---|
| 40 | ; Nothing, jumps to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH |
---|
| 41 | ; Corrupts registers: |
---|
| 42 | ; SI, DS |
---|
| 43 | ;-------------------------------------------------------------------- |
---|
| 44 | AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX: |
---|
| 45 | mov ds, [bp+IDEPACK.intpack+INTPACK.ds] |
---|
| 46 | mov si, [bp+IDEPACK.intpack+INTPACK.si] |
---|
| 47 | mov [si+DAP.wSectorCount], cx |
---|
[165] | 48 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH |
---|