{
ULONG Data, DataSize;
BOOLEAN OperandSize, AddressSize;
+ SOFT386_SEG_REGS Segment = SOFT386_REG_DS;
OperandSize = AddressSize = State->SegmentRegs[SOFT386_REG_CS].Size;
AddressSize = !AddressSize;
}
+ if (State->PrefixFlags & SOFT386_PREFIX_SEG)
+ {
+ /* Use the override segment instead of DS */
+ Segment = State->SegmentOverride;
+ }
+
/* Calculate the size */
if (Opcode == 0xA4) DataSize = sizeof(UCHAR);
else DataSize = OperandSize ? sizeof(ULONG) : sizeof(USHORT);
/* Read from memory */
if (!Soft386ReadMemory(State,
- SOFT386_REG_DS,
+ Segment,
AddressSize ? State->GeneralRegs[SOFT386_REG_ESI].Long
: State->GeneralRegs[SOFT386_REG_ESI].LowWord,
FALSE,
ULONG FirstValue = 0, SecondValue = 0, Result;
ULONG DataSize, DataMask, SignFlag;
BOOLEAN OperandSize, AddressSize;
+ SOFT386_SEG_REGS Segment = SOFT386_REG_DS;
OperandSize = AddressSize = State->SegmentRegs[SOFT386_REG_CS].Size;
AddressSize = !AddressSize;
}
- if ((State->PrefixFlags & SOFT386_PREFIX_REP)
- || (State->PrefixFlags & SOFT386_PREFIX_REPNZ))
+ if (State->PrefixFlags & SOFT386_PREFIX_SEG)
{
- // TODO: The REP/REPZ/REPNZ prefixes need to be implemented!
- Soft386Exception(State, SOFT386_EXCEPTION_UD);
- return FALSE;
+ /* Use the override segment instead of DS */
+ Segment = State->SegmentOverride;
}
/* Calculate the size */
/* Read from the first source operand */
if (!Soft386ReadMemory(State,
- SOFT386_REG_DS,
+ Segment,
AddressSize ? State->GeneralRegs[SOFT386_REG_ESI].Long
: State->GeneralRegs[SOFT386_REG_ESI].LowWord,
FALSE,
{
ULONG DataSize;
BOOLEAN OperandSize, AddressSize;
+ SOFT386_SEG_REGS Segment = SOFT386_REG_DS;
OperandSize = AddressSize = State->SegmentRegs[SOFT386_REG_CS].Size;
AddressSize = !AddressSize;
}
+ if (State->PrefixFlags & SOFT386_PREFIX_SEG)
+ {
+ /* Use the override segment instead of DS */
+ Segment = State->SegmentOverride;
+ }
+
/* Calculate the size */
if (Opcode == 0xAC) DataSize = sizeof(UCHAR);
else DataSize = OperandSize ? sizeof(ULONG) : sizeof(USHORT);
/* Read from the source operand */
if (!Soft386ReadMemory(State,
- SOFT386_REG_DS,
+ Segment,
AddressSize ? State->GeneralRegs[SOFT386_REG_ESI].Long
: State->GeneralRegs[SOFT386_REG_ESI].LowWord,
FALSE,