source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm@ 99

Last change on this file since 99 was 99, checked in by Tomi Tilli, 14 years ago

Changes to XTIDE Universal BIOS:

  • Even more initialization code inlining.
File size: 2.2 KB
Line 
1; Project name : XTIDE Universal BIOS
2; Description : Functions for accessing DPT data.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; Returns L-CHS values from DPT.
9;
10; AccessDPT_GetLCHSfromPCHS
11; Parameters:
12; DS:DI: Ptr to Disk Parameter Table
13; Returns:
14; AX: Number of L-CHS sectors per track
15; BX: Number of L-CHS cylinders
16; DX: Number of L-CHS heads
17; Corrupts registers:
18; Nothing
19;--------------------------------------------------------------------
20ALIGN JUMP_ALIGN
21AccessDPT_GetLCHSfromPCHS:
22 xchg ax, cx
23 mov cl, [di+DPT.bShLtoP] ; Load shift count
24 mov bx, [di+DPT.wPCyls] ; Load P-CHS cylinders
25 shr bx, cl ; Shift to L-CHS cylinders
26 xchg cx, ax
27 mov dx, [di+DPT.wLHeads] ; Load L-CHS heads
28 eMOVZX ax, BYTE [di+DPT.bPSect] ; Load Sectors per track
29 ret
30
31
32;--------------------------------------------------------------------
33; Tests IDEVARS flags for master or slave drive.
34;
35; AccessDPT_TestIdeVarsFlagsForMasterOrSlaveDrive
36; Parameters:
37; AX: Bitmask to test DRVPARAMS.wFlags
38; DS:DI: Ptr to Disk Parameter Table
39; Returns:
40; ZF: Set if tested bit was zero
41; Cleared if tested bit was non-zero
42; CF: 0
43; Corrupts registers:
44; BX
45;--------------------------------------------------------------------
46ALIGN JUMP_ALIGN
47AccessDPT_TestIdeVarsFlagsForMasterOrSlaveDrive:
48 call AccessDPT_GetPointerToDRVPARAMStoCSBX
49 test [cs:bx+DRVPARAMS.wFlags], ax
50 ret
51
52;--------------------------------------------------------------------
53; Returns pointer to DRVPARAMS for master or slave drive.
54;
55; AccessDPT_GetPointerToDRVPARAMStoCSBX
56; Parameters:
57; DS:DI: Ptr to Disk Parameter Table
58; Returns:
59; CS:BX: Ptr to DRVPARAMS
60; Corrupts registers:
61; Nothing
62;--------------------------------------------------------------------
63ALIGN JUMP_ALIGN
64AccessDPT_GetPointerToDRVPARAMStoCSBX:
65 eMOVZX bx, [di+DPT.bIdeOff] ; CS:BX points to IDEVARS
66 test BYTE [di+DPT.bDrvSel], FLG_IDE_DRVHD_DRV
67 jnz SHORT .ReturnPointerToSlaveDRVPARAMS
68 add bx, BYTE IDEVARS.drvParamsMaster
69 ret
70ALIGN JUMP_ALIGN
71.ReturnPointerToSlaveDRVPARAMS:
72 add bx, BYTE IDEVARS.drvParamsSlave
73 ret
Note: See TracBrowser for help on using the repository browser.