[116] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
[3] | 2 | ; Description : Int 13h function AH=Ch, Seek.
|
---|
| 3 |
|
---|
| 4 | ; Section containing code
|
---|
| 5 | SECTION .text
|
---|
| 6 |
|
---|
| 7 | ;--------------------------------------------------------------------
|
---|
| 8 | ; Int 13h function AH=Ch, Seek.
|
---|
| 9 | ;
|
---|
| 10 | ; AHCh_HandlerForSeek
|
---|
| 11 | ; Parameters:
|
---|
[148] | 12 | ; CX, DH: Same as in INTPACK
|
---|
| 13 | ; DL: Translated Drive number
|
---|
| 14 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
[150] | 15 | ; SS:BP: Ptr to IDEREGS_AND_INTPACK
|
---|
| 16 | ; Parameters on INTPACK:
|
---|
[3] | 17 | ; CH: Cylinder number, bits 7...0
|
---|
| 18 | ; CL: Bits 7...6: Cylinder number bits 9 and 8
|
---|
| 19 | ; Bits 5...0: Starting sector number (1...63)
|
---|
| 20 | ; DH: Starting head number (0...255)
|
---|
[150] | 21 | ; Returns with INTPACK:
|
---|
[3] | 22 | ; AH: BIOS Error code
|
---|
| 23 | ; CF: 0 if succesfull, 1 if error
|
---|
| 24 | ;--------------------------------------------------------------------
|
---|
| 25 | ALIGN JUMP_ALIGN
|
---|
| 26 | AHCh_HandlerForSeek:
|
---|
[84] | 27 | %ifndef USE_186
|
---|
[3] | 28 | call AHCh_SeekToCylinder
|
---|
[148] | 29 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
[84] | 30 | %else
|
---|
[148] | 31 | push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
[162] | 32 | ; Fall to AHCh_SeekToCylinder
|
---|
[84] | 33 | %endif
|
---|
[3] | 34 |
|
---|
| 35 | ;--------------------------------------------------------------------
|
---|
| 36 | ; AHCh_SeekToCylinder
|
---|
| 37 | ; Parameters:
|
---|
| 38 | ; CH: Cylinder number, bits 7...0
|
---|
| 39 | ; CL: Bits 7...6: Cylinder number bits 9 and 8
|
---|
| 40 | ; Bits 5...0: Starting sector number (1...63)
|
---|
| 41 | ; DH: Starting head number (0...255)
|
---|
[148] | 42 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
[150] | 43 | ; SS:BP: Ptr to IDEREGS_AND_INTPACK
|
---|
[3] | 44 | ; Returns:
|
---|
| 45 | ; AH: BIOS Error code
|
---|
| 46 | ; CF: 0 if succesfull, 1 if error
|
---|
| 47 | ; Corrupts registers:
|
---|
| 48 | ; AL, BX, CX, DX
|
---|
| 49 | ;--------------------------------------------------------------------
|
---|
| 50 | AHCh_SeekToCylinder:
|
---|
[150] | 51 | mov ah, COMMAND_SEEK
|
---|
| 52 | mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
|
---|
| 53 | jmp Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
|
---|