Ignore:
File:
1 edited

Legend:

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

    r3 r28  
    22; Project name  :   IDE BIOS
    33; Created date  :   9.12.2007
    4 ; Last update   :   12.4.2010
     4; Last update   :   1.8.2010
    55; Author        :   Tomi Tilli
    66; Description   :   Int 13h function AH=Dh, Reset Hard Disk (Alternate reset).
     
    2525ALIGN JUMP_ALIGN
    2626AHDh_HandlerForResetHardDisk:
    27     push    dx
    28     push    cx
    29     push    bx
    30     push    ax
    3127    call    AHDh_ResetDrive
    32     jmp     Int13h_PopXRegsAndReturn
     28    jmp     Int13h_StoreErrorCodeToBDAandPopDSDIandReturn
    3329
    3430
     
    4440;       CF:     0 if succesfull, 1 if error
    4541;   Corrupts registers:
    46 ;       AL, BX, CX, DX
     42;       DI
    4743;--------------------------------------------------------------------
    4844ALIGN JUMP_ALIGN
    4945AHDh_ResetDrive:
    50     push    di
     46    push    dx
     47    push    cx
     48    push    bx
     49    push    ax
     50
    5151    call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    5252    call    AHDh_ResetMasterAndSlave
     
    5757    mov     dx, [RAMVARS.wIdeBase]      ; Load base port address
    5858    call    AHDh_InitializeMasterAndSlave
    59     jc      SHORT .ReturnError
    60     xor     ax, ax                      ; Clear AH since success
    61     pop     di
    62     ret
    63 .ReturnError:
    64     mov     ah, RET_HD_RESETFAIL        ; Load Reset Failed error code
    65     pop     di
     59
     60    pop     bx                          ; Pop old AX
     61    mov     al, bl                      ; Restore AL
     62    pop     bx
     63    pop     cx
     64    pop     dx
    6665    ret
    6766
     
    110109;       DX:     IDE Base Port address
    111110;   Returns:
     111;       AH:     Error code
    112112;       CF:     0 if initialization succesfull
    113113;               1 if any error
    114114;   Corrupts registers:
    115 ;       AX, BX, CX, DX, DI
     115;       AL, BX, CX, DX, DI
    116116;--------------------------------------------------------------------
    117117ALIGN JUMP_ALIGN
     
    136136    ret
    137137.ReturnError:
     138    mov     ah, RET_HD_RESETFAIL        ; Load Reset Failed error code
    138139    stc
    139140    ret
Note: See TracChangeset for help on using the changeset viewer.