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 INTPACK
|
---|
16 | ; Parameters on INTPACK in SS:BP:
|
---|
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 in SS:BP:
|
---|
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 through to AHCh_SeekToCylinder
|
---|
33 | %endif
|
---|
34 |
|
---|
35 |
|
---|
36 | ;--------------------------------------------------------------------
|
---|
37 | ; AHCh_SeekToCylinder
|
---|
38 | ; Parameters:
|
---|
39 | ; CH: Cylinder number, bits 7...0
|
---|
40 | ; CL: Bits 7...6: Cylinder number bits 9 and 8
|
---|
41 | ; Bits 5...0: Starting sector number (1...63)
|
---|
42 | ; DH: Starting head number (0...255)
|
---|
43 | ; DS:DI: Ptr to DPT (in RAMVARS segment)
|
---|
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 ax, HCMD_SEEK<<8 ; Load cmd to AH, AL=zero sector cnt
|
---|
52 | call HCommand_OutputCountAndLCHSandCommand
|
---|
53 | jc SHORT .ReturnWithErrorCodeInAH
|
---|
54 | mov bx, di ; DS:BX now points to DPT
|
---|
55 | jmp HStatus_WaitIrqOrRdy ; Wait for IRQ or RDY
|
---|
56 | .ReturnWithErrorCodeInAH:
|
---|
57 | ret
|
---|