Changeset 566 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device
- Timestamp:
- Aug 29, 2013, 12:49:15 AM (11 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm
r526 r566 55 55 ALIGN JUMP_ALIGN 56 56 GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX: 57 test al, FLG_STATUS_BSY 58 jz SHORT .CheckErrorBitsFromStatusRegisterInAL 59 mov ah, RET_HD_TIMEOUT 60 jmp SHORT .ReturnBiosErrorCodeInAH 57 test al, FLG_STATUS_BSY | FLG_STATUS_DF | FLG_STATUS_CORR | FLG_STATUS_ERR ; Clears CF 58 jnz SHORT .CheckErrorBitsFromStatusRegisterInAL 59 ; The MSB of AL (FLG_STATUS_BSY) is cleared at this point. 60 cbw ; No errors, zero AH (CF already cleared) 61 ret 61 62 62 63 ALIGN JUMP_ALIGN 63 64 .CheckErrorBitsFromStatusRegisterInAL: 64 test al, FLG_STATUS_DF | FLG_STATUS_CORR | FLG_STATUS_ERR 65 jnz SHORT .ProcessErrorFromStatusRegisterInAL 66 xor ah, ah ; No errors, zero AH and CF 67 ret 68 69 .ProcessErrorFromStatusRegisterInAL: 65 js SHORT .Flg_Status_Bsy ; Jump if FLG_STATUS_BSY 70 66 test al, FLG_STATUS_ERR ; Error specified in Error register? 71 67 jnz SHORT .ConvertBiosErrorToAHfromErrorRegisterInAH … … 74 70 jnz SHORT .ReturnBiosErrorCodeInAH 75 71 mov ah, RET_HD_CONTROLLER ; Must be Device Fault 76 jmp SHORT .ReturnBiosErrorCodeInAH 72 SKIP2B bx 73 .Flg_Status_Bsy: 74 mov ah, RET_HD_TIMEOUT 75 .ReturnBiosErrorCodeInAH: 76 stc 77 ret 77 78 78 79 .ConvertBiosErrorToAHfromErrorRegisterInAH: 79 xor bx, bx ; Clear CF 80 stc ; Needed in case Error register (AH) is zero 81 mov bx, .rgbRetCodeLookup-1 80 82 .ErrorBitLoop: 81 rcr ah, 1 ; Set CF if error bit set82 jc SHORT .LookupErrorCode83 83 inc bx 84 test ah, ah ; Clear CF 85 jnz SHORT .ErrorBitLoop 86 .LookupErrorCode: 87 mov ah, [cs:bx+.rgbRetCodeLookup] 88 .ReturnBiosErrorCodeInAH: 89 stc ; Set CF since error 84 rcr ah, 1 85 jnc SHORT .ErrorBitLoop ; CF will be set eventually 86 mov ah, [cs:bx] 90 87 ret 88 91 89 92 90 .rgbRetCodeLookup:
Note:
See TracChangeset
for help on using the changeset viewer.