Changeset 223 in xtideuniversalbios for trunk/Assembly_Library/Inc
- Timestamp:
- Jan 25, 2012, 8:20:06 PM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/Emulate.inc
r181 r223 370 370 371 371 ;-------------------------------------------------------------------- 372 ; Segment override prefix instruction.373 ;374 ; eSEG375 ; Parameters:376 ; %1: Name of the segment (ES, CS, SS, DS, FS or GS)377 ; Returns:378 ; Nothing379 ; Corrupts registers:380 ; Nothing381 ;--------------------------------------------------------------------382 %macro eSEG 1383 %ifidni %1, es384 db 00100110b385 %elifidni %1, cs386 db 00101110b387 %elifidni %1, ss388 db 00110110b389 %elifidni %1, ds390 db 00111110b391 %elifidni %1, fs392 db 01100100b393 %elifidni %1, gs394 db 01100101b395 %else396 %error "Invalid segment override passed to eSEG!"397 %endif398 %endmacro399 400 401 ;--------------------------------------------------------------------402 372 ; Repeats string instruction with segment override. 403 373 ; This macro prevents 8088/8086 restart bug. … … 416 386 %macro eSEG_STR 3 417 387 %ifndef USE_186 ; 8088/8086 has string instruction restart bug when more than one prefix 418 419 420 eSEG %2; SEG is the prefix that won't be lost421 422 423 424 388 %%Loop: 389 %1 ; REP is the prefix that can be lost 390 %2 ; SEG is the prefix that won't be lost 391 %3 ; String instruction 392 jcxz %%End ; Jump to end if no repeats left (preserves FLAGS) 393 jmp SHORT %%Loop ; Loop while repeats left 394 %%End: 425 395 %else ; No bug on V20/V30 and later, don't know about 188/186 426 eSEG%2427 %1 396 %2 397 %1 %3 428 398 %endif 429 399 %endmacro
Note:
See TracChangeset
for help on using the changeset viewer.