Changeset 589 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
- Timestamp:
- May 22, 2016, 12:26:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r584 r589 173 173 cmp [bp+PIOVARS.bSectorsLeft], cl 174 174 jbe SHORT .WriteLastBlockToDrive 175 push ds 176 push es 177 pop ds 175 178 call [bp+PIOVARS.fnXfer] 176 179 pop ds 177 180 ; Wait until ready for next block and check for errors 178 181 call IdeWait_IRQorDRQ ; Wait until ready to transfer … … 189 192 mov cl, [bp+PIOVARS.bSectorsLeft] ; CH is already zero 190 193 push cx 194 push ds 195 push es 196 pop ds 191 197 call [bp+PIOVARS.fnXfer] ; Transfer possibly partial block 198 pop ds 192 199 jmp SHORT CheckErrorsAfterTransferringLastBlock 193 200 … … 237 244 ; Convert ES:SI to physical address 238 245 %ifdef USE_386 239 240 246 mov dx, es 241 247 xor ax, ax … … 247 253 248 254 %elifdef USE_186 249 ; Bytes EU Cycles(286) 250 mov ax, es ; 2 2 251 rol ax, 4 ; 3 9 252 mov dx, ax ; 2 2 253 and ax, BYTE 0Fh; 3 3 254 xor dx, ax ; 2 2 255 add si, dx ; 2 2 256 adc al, ah ; 2 2 257 mov es, ax ; 2 2 258 ;------------------------------------ 259 ; 18 24 255 mov ax, es 256 rol ax, 4 257 mov dx, ax 258 and ax, 0Fh 259 xor dx, ax 260 add si, dx 261 adc al, ah 262 mov es, ax 263 260 264 %else ; 808x 261 ; Bytes EU Cycles(808x) 262 mov al, 4 ; 2 4 263 mov dx, es ; 2 2 264 xchg cx, ax ; 1 3 265 rol dx, cl ; 2 24 266 mov cx, dx ; 2 2 267 xchg cx, ax ; 1 3 268 and ax, BYTE 0Fh; 3 4 269 xor dx, ax ; 2 3 270 add si, dx ; 2 3 271 adc al, ah ; 2 3 272 mov es, ax ; 2 2 273 ;------------------------------------ 274 ; 21 53 275 ; 276 ; Judging by the Execution Unit cycle count the above block of code is 277 ; apparently slower. However, the shifts and rotates in the block below 278 ; execute faster than the Bus Interface Unit on an 8088 can fetch them, 279 ; thus causing the EU to starve. The difference in true execution speed 280 ; (if any) might not be worth the extra 5 bytes. 281 ; In other words, we could use a real world test here. 282 ; 283 %if 0 284 ; Bytes EU Cycles(808x/286) 285 xor dx, dx ; 2 3/2 286 mov ax, es ; 2 2/2 287 %rep 4 288 shl ax, 1 ; 8 8/8 289 rcl dx, 1 ; 8 8/8 290 %endrep 291 add si, ax ; 2 3/2 292 adc dl, dh ; 2 3/2 293 mov es, dx ; 2 2/2 294 ;------------------------------------ 295 ; 26 29/26 296 %endif ; 0 265 mov al, 4 266 mov dx, es 267 xchg cx, ax 268 rol dx, cl 269 mov cx, dx 270 xchg cx, ax 271 and ax, 0Fh 272 xor dx, ax 273 add si, dx 274 adc al, ah 275 mov es, ax 276 297 277 %endif 298 278 … … 334 314 %ifdef USE_AT ; CF is always clear for XT builds 335 315 ; AH = RET_HD_INVALID (01) if CF set, RET_HD_SUCCESS (00) if not. CF unchanged. 316 %ifdef USE_386 317 setc ah 318 %else 336 319 sbb ah, ah 337 320 neg ah 338 321 %endif 322 %endif ; USE_AT 339 323 ret 340 324 … … 345 329 g_rgfnPioRead: 346 330 dw IdePioBlock_ReadFrom16bitDataPort ; 0, DEVICE_16BIT_ATA 331 %ifdef MODULE_ADVANCED_ATA 347 332 dw IdePioBlock_ReadFrom32bitDataPort ; 1, DEVICE_32BIT_ATA 333 %elifdef MODULE_8BIT_IDE 334 dw NULL 335 %endif ; MODULE_ADVANCED_ATA 348 336 %ifdef MODULE_8BIT_IDE 349 337 dw IdePioBlock_ReadFrom8bitDataPort ; 2, DEVICE_8BIT_ATA … … 361 349 g_rgfnPioWrite: 362 350 dw IdePioBlock_WriteTo16bitDataPort ; 0, DEVICE_16BIT_ATA 351 %ifdef MODULE_ADVANCED_ATA 363 352 dw IdePioBlock_WriteTo32bitDataPort ; 1, DEVICE_32BIT_ATA 353 %elifdef MODULE_8BIT_IDE 354 dw NULL 355 %endif ; MODULE_ADVANCED_ATA 364 356 %ifdef MODULE_8BIT_IDE 365 357 dw IdePioBlock_WriteTo8bitDataPort ; 2, DEVICE_8BIT_ATA
Note:
See TracChangeset
for help on using the changeset viewer.