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

    r143 r148  
    1010; AHDh_HandlerForResetHardDisk
    1111;   Parameters:
    12 ;       AH:     Bios function Dh
    13 ;       DL:     Drive number
    14 ;   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:
    1516;       AH:     Int 13h return status
    1617;       CF:     0 if succesfull, 1 if error
    17 ;       IF:     1
    18 ;   Corrupts registers:
    19 ;       Flags
    2018;--------------------------------------------------------------------
    2119ALIGN JUMP_ALIGN
     
    2321%ifndef USE_186
    2422    call    AHDh_ResetDrive
    25     jmp     Int13h_PopDiDsAndReturn
     23    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    2624%else
    27     push    Int13h_PopDiDsAndReturn
     25    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    2826    ; Fall through to AHDh_ResetDrive
    2927%endif
     
    4139;       CF:     0 if succesfull, 1 if error
    4240;   Corrupts registers:
    43 ;       DI
     41;       AL, CX, DI
    4442;--------------------------------------------------------------------
    4543ALIGN JUMP_ALIGN
    4644AHDh_ResetDrive:
    4745    push    dx
    48     push    cx
    4946    push    bx
    50     push    ax
    5147
    5248    call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
     
    6056    call    AHDh_InitializeMasterAndSlave
    6157
    62     pop     bx                          ; Pop old AX
    63     mov     al, bl                      ; Restore AL
    6458    pop     bx
    65     pop     cx
    6659    pop     dx
    6760    ret
     
    9083    call    HDrvSel_OutputDeviceControlByte
    9184    mov     ax, 5                       ; Delay at least 5us
    92     call    HTimer_MicrosecondsFromAX
     85    call    HTimer_DelayMicrosecondsFromAX
    9386
    9487    ; HSR1: Clear_wait
     
    9689    out     dx, al                      ; End Reset
    9790    mov     ax, 2000                    ; Delay at least 2ms
    98     call    HTimer_MicrosecondsFromAX
     91    call    HTimer_DelayMicrosecondsFromAX
    9992
    10093    ; HSR2: Check_status
Note: See TracChangeset for help on using the changeset viewer.