Ignore:
Timestamp:
Mar 19, 2011, 8:09:41 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • INT 13h optimizations to save almost 100 bytes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm

    r93 r148  
    1010; AH8h_HandlerForReadDiskDriveParameters
    1111;   Parameters:
    12 ;       AH:     Bios function 8h
    13 ;       DL:     Drive number
    14 ;   Parameters loaded by Int13h_Jump:
    15 ;       DS:     RAMVARS segment
    16 ;   Returns:
     12;       DL:     Translated Drive number
     13;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     14;       SS:BP:  Ptr to INTPACK
     15;   Returns with INTPACK in SS:BP:
    1716;       CH:     Maximum cylinder number, bits 7...0
    1817;       CL:     Bits 7...6: Cylinder number bits 9...8
     
    2221;       AH:     Int 13h/40h floppy return status
    2322;       CF:     0 if successfull, 1 if error
    24 ;       IF:     1
    25 ;   Corrupts registers:
    26 ;       Flags
    2723;--------------------------------------------------------------------
    2824ALIGN JUMP_ALIGN
     
    3026    call    RamVars_IsDriveHandledByThisBIOS
    3127    jnc     SHORT .GetDriveParametersForForeignHardDiskInDL
     28    call    AH8h_GetDriveParameters
     29    jmp     SHORT .ReturnAfterStoringValuesToIntpack
    3230
    33     push    bx
    34     call    AH8h_GetDriveParameters
    35     pop     bx
    36     jmp     Int13h_ReturnWithValueInDL
    37 
    38 ALIGN JUMP_ALIGN
    3931.GetDriveParametersForForeignHardDiskInDL:
    4032    call    Int13h_CallPreviousInt13hHandler
    4133    jc      SHORT .ReturnErrorFromPreviousInt13hHandler
    4234    call    RamVars_GetCountOfKnownDrivesToDL
    43     jmp     Int13h_ReturnWithValueInDL
     35.ReturnAfterStoringValuesToIntpack:
     36    mov     [bp+INTPACK.cx], cx
     37    mov     [bp+INTPACK.dx], dx
     38    xor     ah, ah
    4439.ReturnErrorFromPreviousInt13hHandler:
    45     jmp     Int13h_PopDiDsAndReturn
     40    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    4641
    4742
     
    5146; AH8h_GetDriveParameters
    5247;   Parameters:
    53 ;       DL:     Drive number
    54 ;       DS:     RAMVARS segment
     48;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    5549;   Returns:
    5650;       CH:     Maximum cylinder number, bits 7...0
     
    5953;       DH:     Maximum head number (0...255)
    6054;       DL:     Number of drives
    61 ;       DS:DI:  Ptr to DPT
    62 ;       AH:     Int 13h/40h floppy return status
    63 ;       CF:     0 if successfull, 1 if error
    6455;   Corrupts registers:
    65 ;       AL, BX
     56;       AX, BX
    6657;--------------------------------------------------------------------
    6758ALIGN JUMP_ALIGN
    6859AH8h_GetDriveParameters:
    69     call    FindDPT_ForDriveNumber
    7060    call    AccessDPT_GetLCHSfromPCHS   ; AX=sectors, BX=cylinders, DX=heads
    71     call    AH8h_PackReturnValues
    72     xor     ax, ax                      ; Clear AH and CF
    73     ret
    74 
     61    ; Fall to .PackReturnValues
    7562
    7663;--------------------------------------------------------------------
    7764; Packs L-CHS values to INT 13h, AH=08h return values.
    7865;
    79 ; AH8h_PackReturnValues
     66; .PackReturnValues
    8067;   Parameters:
    8168;       AX:     Number of L-CHS sectors per track (1...63)
     
    9279;       AX, BX
    9380;--------------------------------------------------------------------
    94 ALIGN JUMP_ALIGN
    95 AH8h_PackReturnValues:
     81.PackReturnValues:
    9682    dec     bx                      ; Cylinder count to last cylinder
    9783    dec     dx                      ; Head count to max head number
Note: See TracChangeset for help on using the changeset viewer.