Changeset 258 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
- Timestamp:
- Feb 22, 2012, 7:01:53 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r152 r258 22 22 eMOVZX bx, dl ; Copy requested drive to BL, zero BH to assume no errors 23 23 call ResetFloppyDrivesWithInt40h 24 test bl, bl25 jns SHORT .SkipHardDiskReset26 24 call ResetForeignHardDisks 27 25 call AH0h_ResetHardDisksHandledByOurBIOS … … 64 62 xor ah, ah ; Disk Controller Reset 65 63 call Int13h_CallPreviousInt13hHandler 66 jmp SHORT BackupErrorCodeFromTheRequestedDriveToBH 67 64 ;;; fall-through to BackupErrorCodeFromTheRequestedDriveToBH 65 66 67 ;-------------------------------------------------------------------- 68 ; BackupErrorCodeFromTheRequestedDriveToBH 69 ; Parameters: 70 ; AH: Error code from the last resetted drive 71 ; DL: Drive last resetted 72 ; BL: Requested drive (DL when entering AH=00h) 73 ; Returns: 74 ; BH: Backuped error code 75 ; Corrupts registers: 76 ; Nothing 77 ;-------------------------------------------------------------------- 78 ALIGN JUMP_ALIGN 79 BackupErrorCodeFromTheRequestedDriveToBH: 80 cmp dl, bl ; Requested drive? 81 eCMOVE bh, ah 82 ret 83 68 84 69 85 ;-------------------------------------------------------------------- … … 82 98 mov dl, bl 83 99 call RamVars_IsDriveHandledByThisBIOS 84 j nc SHORT .Return ; Return what was in BL unmodified100 jc SHORT .Return ; Return what was in BL unmodified 85 101 mov dl, 80h 86 102 .Return: … … 101 117 ALIGN JUMP_ALIGN 102 118 AH0h_ResetHardDisksHandledByOurBIOS: 103 mov d h, [RAMVARS.bDrvCnt] ; Load drive count to DH119 mov dx, [RAMVARS.wDrvCntAndFirst] ; DL = drive number, DH = drive count 104 120 test dh, dh 105 121 jz SHORT .AllDrivesReset ; Return if no drives 106 mov dl, [RAMVARS.bFirstDrv] ; Load number of our first drive107 122 add dh, dl ; DH = one past last drive to reset 108 123 ALIGN JUMP_ALIGN … … 114 129 jb SHORT .DriveResetLoop ; If not, reset next drive 115 130 .AllDrivesReset: 116 ret 117 131 %ifdef MODULE_SERIAL_FLOPPY 132 ; 133 ; "Reset" emulatd serial floppy drives, if any. There is nothing to actually do for this reset, 134 ; but record the proper error return code if one of these floppy drives is the drive requested. 135 ; 136 call RamVars_UnpackFlopCntAndFirstToAL 137 138 cbw ; Clears AH (there are flop drives) or ffh (there are not) 139 ; Either AH has success code (flop drives are present) 140 ; or it doesn't matter because we won't match drive ffh 141 142 cwd ; clears DX (there are flop drives) or ffffh (there are not) 143 144 adc dl, al ; second drive (CF set) if present 145 ; If no drive is present, this will result in ffh which 146 ; won't match a drive 147 call BackupErrorCodeFromTheRequestedDriveToBH 148 mov dl, al ; We may end up doing the first drive twice (if there is 149 jmp BackupErrorCodeFromTheRequestedDriveToBH ; only one drive), but doing it again is not harmful. 150 %else 151 ret 152 %endif 153 118 154 ;-------------------------------------------------------------------- 119 155 ; .BackupErrorCodeFromMasterOrSlaveToBH … … 144 180 ret 145 181 182 146 183 ;-------------------------------------------------------------------- 147 184 ; GetBasePortToCX … … 167 204 168 205 169 ;--------------------------------------------------------------------170 ; BackupErrorCodeFromTheRequestedDriveToBH171 ; Parameters:172 ; AH: Error code from the last resetted drive173 ; DL: Drive last resetted174 ; BL: Requested drive (DL when entering AH=00h)175 ; Returns:176 ; BH: Backuped error code177 ; Corrupts registers:178 ; Nothing179 ;--------------------------------------------------------------------180 ALIGN JUMP_ALIGN181 BackupErrorCodeFromTheRequestedDriveToBH:182 cmp dl, bl ; Requested drive?183 eCMOVE bh, ah184 ret
Note:
See TracChangeset
for help on using the changeset viewer.