Limit prefix bug to when REP/REPZ is being used

This commit is contained in:
Allofich
2021-11-06 17:10:45 +09:00
parent 82088f930c
commit c45a1f6e26
5 changed files with 26 additions and 4 deletions

View File

@@ -13,6 +13,8 @@
opcodes 0x70-0x7F. (Allofich)
- Fixed 0x0F opcode being valid on 80186 core when
it should be invalid. (Allofich)
- Adjusted multiple-prefix bug for 8086/286 to only
apply when REP or REPZ is used. (Allofich)
- Added stub IBM ROM BASIC points in the BIOS area
so that when MS-DOS 1.x and 2.x BASIC.COM and BASICA.COM
are run, a polite message is displayed instead of

View File

@@ -88,7 +88,12 @@ extern Bitu cycle_count;
#define TEST_PREFIX_REP (core.prefixes & PREFIX_REP)
#define DO_PREFIX_SEG(_SEG) \
if (GETFLAG(IF) && CPU_Cycles <= 0 && !mustCompleteInstruction) goto prefix_out; \
if (GETFLAG(IF) && CPU_Cycles <= 0 && !mustCompleteInstruction) \
{ \
uint8_t next = LoadMb(core.cseip + 1); \
if (next == 0xf2 || next == 0xf3) \
goto prefix_out; \
} \
BaseDS=SegBase(_SEG); \
BaseSS=SegBase(_SEG); \
core.base_val_ds=_SEG; \

View File

@@ -124,7 +124,12 @@ extern Bitu cycle_count;
#define TEST_PREFIX_REP (core.prefixes & PREFIX_REP)
#define DO_PREFIX_SEG(_SEG) \
if (GETFLAG(IF) && CPU_Cycles <= 0 && !mustCompleteInstruction) goto prefix_out; \
if (GETFLAG(IF) && CPU_Cycles <= 0 && !mustCompleteInstruction) \
{ \
uint8_t next = LoadMb(core.cseip + 1); \
if (next == 0xf2 || next == 0xf3) \
goto prefix_out; \
} \
BaseDS=SegBase(_SEG); \
BaseSS=SegBase(_SEG); \
core.base_val_ds=_SEG; \

View File

@@ -91,7 +91,12 @@ Bits CPU_Core_Prefetch_Trap_Run(void);
#define TEST_PREFIX_REP (core.prefixes & PREFIX_REP)
#define DO_PREFIX_SEG(_SEG) \
if (GETFLAG(IF) && CPU_Cycles <= 0) goto prefix_out; \
if (GETFLAG(IF) && CPU_Cycles <= 0) \
{ \
uint8_t next = LoadMb(core.cseip + 1); \
if (next == 0xf2 || next == 0xf3) \
goto prefix_out; \
} \
BaseDS=SegBase(_SEG); \
BaseSS=SegBase(_SEG); \
core.base_val_ds=_SEG; \

View File

@@ -129,7 +129,12 @@ Bits CPU_Core_Prefetch_Trap_Run(void);
#define TEST_PREFIX_REP (core.prefixes & PREFIX_REP)
#define DO_PREFIX_SEG(_SEG) \
if (GETFLAG(IF) && CPU_Cycles <= 0) goto prefix_out; \
if (GETFLAG(IF) && CPU_Cycles <= 0) \
{ \
uint8_t next = LoadMb(core.cseip + 1); \
if (next == 0xf2 || next == 0xf3) \
goto prefix_out; \
} \
BaseDS=SegBase(_SEG); \
BaseSS=SegBase(_SEG); \
core.base_val_ds=_SEG; \