Changeset 200 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs
- Timestamp:
- Nov 22, 2011, 8:38:36 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r193 r200 124 124 .ReturnPointerToDRVPARAMS: 125 125 ret 126 127 ;-------------------------------------------------------------------- 128 ; AccessDPT_GetUnshiftedAddressModeToALZF 129 ; Parameters: 130 ; DS:DI: Ptr to Disk Parameter Table 131 ; Returns: 132 ; AL: Addressing Mode (L-CHS, P-CHS, LBA28, LBA48) 133 ; unshifted (still shifted where it is in bFlagsLow) 134 ; ZF: Set based on value in AL 135 ; Corrupts registers: 136 ; AL 137 ;-------------------------------------------------------------------- 138 ; 139 ; Converted to a macro since only called in two places, and the call/ret overhead 140 ; is not worth it for these two instructions (4 bytes total) 141 ; 142 %macro AccessDPT_GetUnshiftedAddressModeToALZF 0 143 mov al, [di+DPT.bFlagsLow] 144 and al, MASKL_DPT_ADDRESSING_MODE 145 %endmacro 146 147 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
r181 r200 50 50 ret 51 51 52 53 52 ;-------------------------------------------------------------------- 54 53 ; Finds Disk Parameter Table for … … 67 66 ; Corrupts registers: 68 67 ; SI 69 ;-------------------------------------------------------------------- 70 ALIGN JUMP_ALIGN 71 FindDPT_ToDSDIForIdeMasterAtPortDX: 68 ; 69 ; Converted to macros since there is only once call site for each of these 70 ; 71 ;-------------------------------------------------------------------- 72 73 %macro FindDPT_ToDSDIForIdeMasterAtPortDX 0 72 74 mov si, IterateToMasterAtPortCallback 73 jmp SHORTIterateAllDPTs74 75 ALIGN JUMP_ALIGN 76 FindDPT_ToDSDIForIdeSlaveAtPortDX: 75 call IterateAllDPTs 76 %endmacro 77 78 %macro FindDPT_ToDSDIForIdeSlaveAtPortDX 0 77 79 mov si, IterateToSlaveAtPortCallback 78 jmp SHORT IterateAllDPTs 79 80 call IterateAllDPTs 81 %endmacro 82 83 80 84 ;-------------------------------------------------------------------- 81 85 ; Iteration callback for finding DPT using … … 113 117 jne SHORT ReturnWrongDPT 114 118 mov dl, ch ; Return drive number in DL 119 120 ReturnRightDPT: 115 121 stc ; Set CF since wanted DPT 116 122 ret … … 118 124 119 125 ;-------------------------------------------------------------------- 120 ; IterateToDptWith InterruptInServiceFlagSet126 ; IterateToDptWithFlagsHighSet: 121 127 ; Parameters: 122 128 ; DS:DI: Ptr to DPT to examine 129 ; AL: Bit in bFlagsHigh to test 123 130 ; Returns: 124 131 ; CF: Set if wanted DPT found … … 128 135 ;-------------------------------------------------------------------- 129 136 ALIGN JUMP_ALIGN 130 IterateToDptWithInterruptInServiceFlagSet: 131 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_INTERRUPT_IN_SERVICE 132 jz SHORT ReturnWrongDPT 133 stc ; Set CF since wanted DPT 134 ret 137 IterateToDptWithFlagsHighSet: 138 test BYTE [di+DPT.bFlagsHigh], al ; Clears CF (but we need the clc below anyway callers above) 139 jnz SHORT ReturnRightDPT 140 135 141 ReturnWrongDPT: 136 142 clc ; Clear CF since wrong DPT 137 143 ret 138 144 139 140 145 ;-------------------------------------------------------------------- 141 146 ; FindDPT_ToDSDIforInterruptInService 147 ; FindDPT_ToDSDIforSerialDevice 142 148 ; Parameters: 143 149 ; DS: RAMVARS segment … … 147 153 ; Cleared if DPT not found 148 154 ; Corrupts registers: 149 ; SI 150 ;-------------------------------------------------------------------- 151 ALIGN JUMP_ALIGN 155 ; SI, AX, BX (for SerialDevice only) 156 ;-------------------------------------------------------------------- 157 ALIGN JUMP_ALIGN 158 159 %ifdef MODULE_SERIAL 160 FindDPT_ToDSDIforSerialDevice: 161 mov al, FLGH_DPT_SERIAL_DEVICE 162 163 SKIP2B bx 164 %endif 165 166 ; do not align due to SKIP2B above 152 167 FindDPT_ToDSDIforInterruptInService: 153 mov si, IterateToDptWithInterruptInServiceFlagSet 168 mov al, FLGH_DPT_INTERRUPT_IN_SERVICE 169 170 mov si, IterateToDptWithFlagsHighSet 154 171 ; Fall to IterateAllDPTs 155 156 172 157 173 ;-------------------------------------------------------------------- … … 166 182 ; DS:DI: Ptr to wanted DPT (if found) 167 183 ; CF: Set if wanted DPT found 168 ; Cleared if DPT not found 169 ; Unchanged if no drives 184 ; Cleared if DPT not found, or no DPTs present 170 185 ; Corrupts registers: 171 186 ; Nothing unless corrupted by callback function … … 175 190 push cx 176 191 mov cx, [RAMVARS.wDrvCntAndFirst] 177 jcxz . AllDptsIterated; Return if no drives192 jcxz .NotFound ; Return if no drives 178 193 mov di, RAMVARS_size ; Point DS:DI to first DPT 179 194 ALIGN JUMP_ALIGN … … 185 200 dec cl ; Decrement drives left 186 201 jnz SHORT .LoopWhileDPTsLeft 202 .NotFound: 187 203 clc ; Clear CF since DPT not found 188 204 ALIGN JUMP_ALIGN
Note:
See TracChangeset
for help on using the changeset viewer.