[165] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
| 2 | ; Description : Int 13h function AH=42h, Extended Read Sectors.
|
---|
| 3 |
|
---|
[376] | 4 | ;
|
---|
[526] | 5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
| 6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
[376] | 7 | ;
|
---|
| 8 | ; This program is free software; you can redistribute it and/or modify
|
---|
| 9 | ; it under the terms of the GNU General Public License as published by
|
---|
| 10 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
| 11 | ; (at your option) any later version.
|
---|
[526] | 12 | ;
|
---|
[376] | 13 | ; This program is distributed in the hope that it will be useful,
|
---|
| 14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 16 | ; GNU General Public License for more details.
|
---|
[526] | 17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
| 18 | ;
|
---|
[376] | 19 |
|
---|
[165] | 20 | ; Section containing code
|
---|
| 21 | SECTION .text
|
---|
| 22 |
|
---|
| 23 | ;--------------------------------------------------------------------
|
---|
| 24 | ; Int 13h function AH=42h, Extended Read Sectors.
|
---|
| 25 | ;
|
---|
| 26 | ; AH42h_HandlerForExtendedReadSectors
|
---|
| 27 | ; Parameters:
|
---|
| 28 | ; SI: Same as in INTPACK
|
---|
| 29 | ; DL: Translated Drive number
|
---|
| 30 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
| 31 | ; SS:BP: Ptr to IDEPACK
|
---|
| 32 | ; Parameters on INTPACK:
|
---|
| 33 | ; DS:SI: Ptr to Disk Address Packet
|
---|
| 34 | ; Returns with INTPACK:
|
---|
| 35 | ; AH: Int 13h return status
|
---|
[294] | 36 | ; CF: 0 if successful, 1 if error
|
---|
[165] | 37 | ; Return with Disk Address Packet in INTPACK:
|
---|
[249] | 38 | ; .wSectorCount Number of sectors read successfully
|
---|
[165] | 39 | ;--------------------------------------------------------------------
|
---|
| 40 | ALIGN JUMP_ALIGN
|
---|
| 41 | AH42h_HandlerForExtendedReadSectors:
|
---|
[221] | 42 | call Prepare_ByLoadingDapToESSIandVerifyingForTransfer
|
---|
[165] | 43 | mov ah, [cs:bx+g_rgbReadCommandLookup]
|
---|
| 44 | mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
|
---|
| 45 | call Idepack_ConvertDapToIdepackAndIssueCommandFromAH
|
---|
[249] | 46 | ; Fall to AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
|
---|
| 47 |
|
---|
| 48 |
|
---|
| 49 | ;--------------------------------------------------------------------
|
---|
| 50 | ; AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
|
---|
| 51 | ; Parameters:
|
---|
| 52 | ; AH: INT 13h Error Code
|
---|
| 53 | ; CX: Number of successfully transferred sectors
|
---|
| 54 | ; SS:BP: Ptr to IDEPACK
|
---|
| 55 | ; Returns:
|
---|
| 56 | ; Nothing, jumps to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
| 57 | ; Corrupts registers:
|
---|
| 58 | ; SI, DS
|
---|
| 59 | ;--------------------------------------------------------------------
|
---|
| 60 | AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX:
|
---|
| 61 | mov ds, [bp+IDEPACK.intpack+INTPACK.ds]
|
---|
| 62 | mov si, [bp+IDEPACK.intpack+INTPACK.si]
|
---|
| 63 | mov [si+DAP.wSectorCount], cx
|
---|
[165] | 64 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|