1 | ; Project name : XTIDE Universal BIOS
|
---|
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:
|
---|
12 | ; CX, DH: Same as in INTPACK
|
---|
13 | ; DL: Translated Drive number
|
---|
14 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
15 | ; SS:BP: Ptr to IDEREGS_AND_INTPACK
|
---|
16 | ; Parameters on INTPACK:
|
---|
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)
|
---|
21 | ; Returns with INTPACK:
|
---|
22 | ; AH: BIOS Error code
|
---|
23 | ; CF: 0 if succesfull, 1 if error
|
---|
24 | ;--------------------------------------------------------------------
|
---|
25 | ALIGN JUMP_ALIGN
|
---|
26 | AHCh_HandlerForSeek:
|
---|
27 | %ifndef USE_186
|
---|
28 | call AHCh_SeekToCylinder
|
---|
29 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
30 | %else
|
---|
31 | push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
|
---|
32 | ; Fall to AHCh_SeekToCylinder
|
---|
33 | %endif
|
---|
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)
|
---|
42 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
43 | ; SS:BP: Ptr to IDEREGS_AND_INTPACK
|
---|
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:
|
---|
51 | mov ah, COMMAND_SEEK
|
---|
52 | mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
|
---|
53 | jmp Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
|
---|