source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm @ 252

Last change on this file since 252 was 227, checked in by aitotat@…, 12 years ago

Changes to XTIDE Universal BIOS:

  • EBIOS functions now work in lite mode.
File size: 3.1 KB
RevLine 
[93]1; Project name  :   XTIDE Universal BIOS
[3]2; Description   :   Int 13h function AH=8h, Read Disk Drive Parameters.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; Int 13h function AH=8h, Read Disk Drive Parameters.
9;
10; AH8h_HandlerForReadDiskDriveParameters
11;   Parameters:
[148]12;       DL:     Translated Drive number
13;       DS:DI:  Ptr to DPT (in RAMVARS segment)
[150]14;       SS:BP:  Ptr to IDEPACK
15;   Returns with INTPACK:
[3]16;       CH:     Maximum cylinder number, bits 7...0
17;       CL:     Bits 7...6: Cylinder number bits 9...8
18;               Bits 5...0: Maximum sector number (1...63)
19;       DH:     Maximum head number (0...255)
20;       DL:     Number of drives
21;       AH:     Int 13h/40h floppy return status
22;       CF:     0 if successfull, 1 if error
23;--------------------------------------------------------------------
24AH8h_HandlerForReadDiskDriveParameters:
[32]25    call    RamVars_IsDriveHandledByThisBIOS
26    jnc     SHORT .GetDriveParametersForForeignHardDiskInDL
[3]27    call    AH8h_GetDriveParameters
[148]28    jmp     SHORT .ReturnAfterStoringValuesToIntpack
[3]29
[32]30.GetDriveParametersForForeignHardDiskInDL:
31    call    Int13h_CallPreviousInt13hHandler
[43]32    jc      SHORT .ReturnErrorFromPreviousInt13hHandler
[32]33    call    RamVars_GetCountOfKnownDrivesToDL
[148]34.ReturnAfterStoringValuesToIntpack:
[150]35    mov     [bp+IDEPACK.intpack+INTPACK.cx], cx
36    mov     [bp+IDEPACK.intpack+INTPACK.dx], dx
[148]37    xor     ah, ah
[43]38.ReturnErrorFromPreviousInt13hHandler:
[148]39    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
[3]40
[32]41
[3]42;--------------------------------------------------------------------
43; Returns L-CHS parameters for drive and total hard disk count.
44;
[28]45; AH8h_GetDriveParameters
[3]46;   Parameters:
[148]47;       DS:DI:  Ptr to DPT (in RAMVARS segment)
[3]48;   Returns:
49;       CH:     Maximum cylinder number, bits 7...0
50;       CL:     Bits 7...6: Cylinder number bits 9...8
51;               Bits 5...0: Maximum sector number (1...63)
52;       DH:     Maximum head number (0...255)
53;       DL:     Number of drives
54;   Corrupts registers:
[148]55;       AX, BX
[3]56;--------------------------------------------------------------------
57AH8h_GetDriveParameters:
[227]58    call    AccessDPT_GetLCHStoAXBLBH
[148]59    ; Fall to .PackReturnValues
[3]60
61;--------------------------------------------------------------------
62; Packs L-CHS values to INT 13h, AH=08h return values.
63;
[148]64; .PackReturnValues
[3]65;   Parameters:
[227]66;       AX:     Number of L-CHS cylinders available (1...1024)
67;       BL:     Number of L-CHS heads (1...256)
68;       BH:     Number of L-CHS sectors per track (1...63)
[32]69;       DS:     RAMVARS segment
[3]70;   Returns:
71;       CH:     Maximum cylinder number, bits 7...0
72;       CL:     Bits 7...6: Cylinder number bits 9...8
73;               Bits 5...0: Maximum sector number (1...63)
74;       DH:     Maximum head number (0...255)
75;       DL:     Number of drives
76;   Corrupts registers:
77;       AX, BX
78;--------------------------------------------------------------------
[148]79.PackReturnValues:
[227]80    dec     ax                      ; AX = Number of last cylinder
81    dec     bx                      ; BL = Number of last head
82    xchg    cx, ax
83    xchg    cl, ch                  ; CH = Last cylinder bits 0...7
84    eROR_IM cl, 2                   ; CL bits 6...7 = Last cylinder bits 8...9
85    or      cl, bh                  ; CL bits 0...5 = Sectors per track
86    mov     dh, bl                  ; DH = Maximum head number
[32]87    jmp     RamVars_GetCountOfKnownDrivesToDL
Note: See TracBrowser for help on using the repository browser.