Ignore:
Timestamp:
Aug 24, 2010, 6:44:44 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Cleaned recent changes a bit to save few bytes.

File:
1 edited

Legend:

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

    r34 r35  
    22; Project name  :   IDE BIOS
    33; Created date  :   30.11.2007
    4 ; Last update   :   23.8.2010
     4; Last update   :   24.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Error checking functions for BIOS Hard disk functions.
     
    2323ALIGN JUMP_ALIGN
    2424HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit:
    25     push    ds
    26     push    dx
    27 
    2825    call    HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA
    2926    call    GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX
    30     jc      SHORT StoreErrorCodeFromAHtoBDA
     27    jc      SHORT .ReturnErrorCodeInAH
    3128    mov     ah, RET_HD_TIMEOUT          ; Force timeout since no actual error...
    3229    stc                                 ; ...but wanted bit was never set
    33     jmp     SHORT StoreErrorCodeFromAHtoBDA
     30.ReturnErrorCodeInAH:
     31    ret
    3432
    3533
    3634ALIGN JUMP_ALIGN
    3735HError_ProcessErrorsAfterPollingBSY:
    38     push    ds
    39     push    dx
    40 
    4136    call    HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA
    42     call    GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX
    43 StoreErrorCodeFromAHtoBDA:
    44     mov     [BDA.bHDLastSt], ah         ; Store BIOS error code to BDA
    45 
    46     pop     dx
    47     pop     ds
    48     ret
     37    jmp     SHORT GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX
    4938
    5039
     
    5645;       AL:     IDE Status Register contents
    5746;       AH:     IDE Error Register contents
    58 ;       DS:     BDA segment
    5947;   Corrupts registers:
    60 ;       DX
     48;       Nothing
    6149;--------------------------------------------------------------------
    6250ALIGN JUMP_ALIGN
    6351HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA:
     52    push    ds
     53    push    dx
     54
    6455    mov     dx, [RAMVARS.wIdeBase]      ; Load IDE base port address
    6556    inc     dx                          ; Increment to Error Register
     
    6859    add     dx, BYTE REGR_IDE_ST - REGR_IDE_ERROR
    6960    in      al, dx                      ; Read Status Register to AL
    70     ; Fall to .StoreStatusAndErrorRegistersFromAXtoBDA
    7161
    72 ;--------------------------------------------------------------------
    73 ; .StoreStatusAndErrorRegistersFromAXtoBDA
    74 ;   Parameters:
    75 ;       AL:     IDE Status Register contents
    76 ;       AH:     IDE Error Register contents
    77 ;   Returns:
    78 ;       DS:     BDA segment (zero)
    79 ;   Corrupts registers:
    80 ;       DX
    81 ;--------------------------------------------------------------------
    82 .StoreStatusAndErrorRegistersFromAXtoBDA:
    8362    LOAD_BDA_SEGMENT_TO ds, dx
    8463    mov     [HDBDA.wHDStAndErr], ax
     64
     65    pop     dx
     66    pop     ds
    8567    ret
    8668
     
    148130    db  RET_HD_BADSECTOR    ; Bit7=BBK, Bad Block Detected
    149131    db  RET_HD_STATUSERR    ; When Error Register is zero
    150 
    151 
    152 ;--------------------------------------------------------------------
    153 ; HError_StoreBiosErrorCodeFromAHtoBDA
    154 ;   Parameters:
    155 ;       AH:     BIOS error code
    156 ;   Returns:
    157 ;       Nothing
    158 ;   Corrupts registers:
    159 ;       DI
    160 ;--------------------------------------------------------------------
    161 ALIGN JUMP_ALIGN
    162 HError_StoreBiosErrorCodeFromAHtoBDA:
    163     push    ds
    164     mov     di, 0                   ; Zero DI and preserve FLAGS
    165     mov     ds, di                  ; Copy BDA segment to DS
    166     mov     [BDA.bHDLastSt], ah
    167     pop     ds
    168     ret
Note: See TracChangeset for help on using the changeset viewer.