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/AH9h_HInit.asm

    r84 r148  
    1 ; File name     :   AH9h_HInit.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   9.12.2007
    4 ; Last update   :   14.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
     1; Project name  :   XTIDE Universal BIOS
    72; Description   :   Int 13h function AH=9h, Initialize Drive Parameters.
    83
     
    1510; AH9h_HandlerForInitializeDriveParameters
    1611;   Parameters:
    17 ;       AH:     Bios function 9h
    18 ;       DL:     Drive number
    19 ;   Parameters loaded by Int13h_Jump:
    20 ;       DS:     RAMVARS segment
    21 ;   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:
    2216;       AH:     Int 13h return status
    2317;       CF:     0 if succesfull, 1 if error
    24 ;       IF:     1
    25 ;   Corrupts registers:
    26 ;       Flags
    2718;--------------------------------------------------------------------
    2819ALIGN JUMP_ALIGN
    2920AH9h_HandlerForInitializeDriveParameters:
    30     push    dx
    31     push    cx
    32     push    bx
    33     push    ax
    3421%ifndef USE_186
    3522    call    AH9h_InitializeDriveForUse
    36     jmp     Int13h_PopXRegsAndReturn
     23    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3724%else
    38     push    Int13h_PopXRegsAndReturn
     25    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3926    ; Fall through to AH9h_InitializeDriveForUse
    4027%endif
     
    4633; AH9h_InitializeDriveForUse
    4734;   Parameters:
    48 ;       DL:     Drive number
    49 ;       DS:     RAMVARS segment
     35;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    5036;   Returns:
    51 ;       DS:DI:  Ptr to DPT
    5237;       AH:     Int 13h return status
    5338;       CF:     0 if succesfull, 1 if error
    5439;   Corrupts registers:
    55 ;       AL, BX
     40;       AL, BX, DX
    5641;--------------------------------------------------------------------
    5742ALIGN JUMP_ALIGN
    5843AH9h_InitializeDriveForUse:
    59     push    dx
    6044    push    cx
    6145
    6246    ; Try to select drive and wait until ready
    63     call    FindDPT_ForDriveNumber
    6447    or      BYTE [di+DPT.bReset], MASK_RESET_ALL        ; Everything uninitialized
    6548    call    HDrvSel_SelectDriveAndDisableIRQ
     
    7659.RecalibrateDrive:
    7760    call    AH11h_RecalibrateDrive
    78     mov     dl, [di+DPT.bDrvNum]        ; Restore DL
    7961    jc      SHORT .InitializeBlockMode
    8062    and     BYTE [di+DPT.bReset], ~FLG_RESET_nRECALIBRATE
    8163
    8264    ; Initialize block mode transfers
    83 ALIGN JUMP_ALIGN
    8465.InitializeBlockMode:
    8566    call    AH9h_InitializeBlockMode
    86     ;mov        dl, [di+DPT.bDrvNum]        ; Restore DL
    8767    jc      SHORT .ReturnNotSuccessfull
    88     and     BYTE [di+DPT.bReset], ~FLG_RESET_nSETBLOCK
     68    and     BYTE [di+DPT.bReset], ~FLG_RESET_nSETBLOCK  ; Keeps CF clear
    8969
    9070.ReturnNotSuccessfull:
    9171    pop     cx
    92     pop     dx
    9372    ret
    9473
     
    135114; AH9h_InitializeBlockMode
    136115;   Parameters:
    137 ;       DL:     Drive number
    138116;       DS:DI:  Ptr to DPT
    139117;   Returns:
Note: See TracChangeset for help on using the changeset viewer.