[FAST486]

Make the parameters to Fast486ReadModrm*Operands optional, so that
unnecessary extra reads aren't performed. This also eliminates the
need for dummy variables.


svn path=/branches/ntvdm/; revision=61055
This commit is contained in:
Aleksandar Andrejevic 2013-11-20 08:01:10 +00:00
parent 8998a96d56
commit b456a8b355
4 changed files with 175 additions and 159 deletions

View file

@ -935,51 +935,57 @@ Fast486ReadModrmByteOperands(PFAST486_STATE State,
{ {
FAST486_SEG_REGS Segment = FAST486_REG_DS; FAST486_SEG_REGS Segment = FAST486_REG_DS;
/* Get the register value */ if (RegValue)
if (ModRegRm->Register & 0x04)
{ {
/* AH, CH, DH, BH */ /* Get the register value */
*RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].HighByte; if (ModRegRm->Register & 0x04)
}
else
{
/* AL, CL, DL, BL */
*RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].LowByte;
}
if (!ModRegRm->Memory)
{
/* Get the second register value */
if (ModRegRm->SecondRegister & 0x04)
{ {
/* AH, CH, DH, BH */ /* AH, CH, DH, BH */
*RmValue = State->GeneralRegs[ModRegRm->SecondRegister & 0x03].HighByte; *RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].HighByte;
} }
else else
{ {
/* AL, CL, DL, BL */ /* AL, CL, DL, BL */
*RmValue = State->GeneralRegs[ModRegRm->SecondRegister & 0x03].LowByte; *RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].LowByte;
} }
} }
else
{
/* Check for the segment override */
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Use the override segment instead */
Segment = State->SegmentOverride;
}
/* Read memory */ if (RmValue)
if (!Fast486ReadMemory(State, {
Segment, if (!ModRegRm->Memory)
ModRegRm->MemoryAddress,
FALSE,
RmValue,
sizeof(UCHAR)))
{ {
/* Exception occurred */ /* Get the second register value */
return FALSE; if (ModRegRm->SecondRegister & 0x04)
{
/* AH, CH, DH, BH */
*RmValue = State->GeneralRegs[ModRegRm->SecondRegister & 0x03].HighByte;
}
else
{
/* AL, CL, DL, BL */
*RmValue = State->GeneralRegs[ModRegRm->SecondRegister & 0x03].LowByte;
}
}
else
{
/* Check for the segment override */
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Use the override segment instead */
Segment = State->SegmentOverride;
}
/* Read memory */
if (!Fast486ReadMemory(State,
Segment,
ModRegRm->MemoryAddress,
FALSE,
RmValue,
sizeof(UCHAR)))
{
/* Exception occurred */
return FALSE;
}
} }
} }
@ -995,33 +1001,39 @@ Fast486ReadModrmWordOperands(PFAST486_STATE State,
{ {
FAST486_SEG_REGS Segment = FAST486_REG_DS; FAST486_SEG_REGS Segment = FAST486_REG_DS;
/* Get the register value */ if (RegValue)
*RegValue = State->GeneralRegs[ModRegRm->Register].LowWord;
if (!ModRegRm->Memory)
{ {
/* Get the second register value */ /* Get the register value */
*RmValue = State->GeneralRegs[ModRegRm->SecondRegister].LowWord; *RegValue = State->GeneralRegs[ModRegRm->Register].LowWord;
} }
else
{
/* Check for the segment override */
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Use the override segment instead */
Segment = State->SegmentOverride;
}
/* Read memory */ if (RmValue)
if (!Fast486ReadMemory(State, {
Segment, if (!ModRegRm->Memory)
ModRegRm->MemoryAddress,
FALSE,
RmValue,
sizeof(USHORT)))
{ {
/* Exception occurred */ /* Get the second register value */
return FALSE; *RmValue = State->GeneralRegs[ModRegRm->SecondRegister].LowWord;
}
else
{
/* Check for the segment override */
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Use the override segment instead */
Segment = State->SegmentOverride;
}
/* Read memory */
if (!Fast486ReadMemory(State,
Segment,
ModRegRm->MemoryAddress,
FALSE,
RmValue,
sizeof(USHORT)))
{
/* Exception occurred */
return FALSE;
}
} }
} }
@ -1037,33 +1049,39 @@ Fast486ReadModrmDwordOperands(PFAST486_STATE State,
{ {
FAST486_SEG_REGS Segment = FAST486_REG_DS; FAST486_SEG_REGS Segment = FAST486_REG_DS;
/* Get the register value */ if (RegValue)
*RegValue = State->GeneralRegs[ModRegRm->Register].Long;
if (!ModRegRm->Memory)
{ {
/* Get the second register value */ /* Get the register value */
*RmValue = State->GeneralRegs[ModRegRm->SecondRegister].Long; *RegValue = State->GeneralRegs[ModRegRm->Register].Long;
} }
else
{
/* Check for the segment override */
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Use the override segment instead */
Segment = State->SegmentOverride;
}
/* Read memory */ if (RmValue)
if (!Fast486ReadMemory(State, {
Segment, if (!ModRegRm->Memory)
ModRegRm->MemoryAddress,
FALSE,
RmValue,
sizeof(ULONG)))
{ {
/* Exception occurred */ /* Get the second register value */
return FALSE; *RmValue = State->GeneralRegs[ModRegRm->SecondRegister].Long;
}
else
{
/* Check for the segment override */
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Use the override segment instead */
Segment = State->SegmentOverride;
}
/* Read memory */
if (!Fast486ReadMemory(State,
Segment,
ModRegRm->MemoryAddress,
FALSE,
RmValue,
sizeof(ULONG)))
{
/* Exception occurred */
return FALSE;
}
} }
} }

View file

@ -570,10 +570,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBitTest)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -584,10 +584,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBitTest)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -755,10 +755,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBts)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -779,10 +779,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBts)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1216,10 +1216,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtr)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1240,10 +1240,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtr)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1339,7 +1339,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLfsLgs)
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxByte) FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxByte)
{ {
UCHAR Dummy, Value; UCHAR Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
@ -1356,7 +1356,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxByte)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1371,7 +1371,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxByte)
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxWord) FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxWord)
{ {
USHORT Dummy, Value; USHORT Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
@ -1388,7 +1388,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxWord)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1441,10 +1441,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtc)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1465,10 +1465,10 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtc)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1495,7 +1495,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtc)
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf) FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf)
{ {
INT i; INT i;
ULONG Dummy = 0, Value = 0; ULONG Value = 0;
BOOLEAN OperandSize, AddressSize; BOOLEAN OperandSize, AddressSize;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
ULONG BitNumber; ULONG BitNumber;
@ -1522,7 +1522,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf)
/* Read the value */ /* Read the value */
if (OperandSize) if (OperandSize)
{ {
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1532,7 +1532,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf)
{ {
if (!Fast486ReadModrmWordOperands(State, if (!Fast486ReadModrmWordOperands(State,
&ModRegRm, &ModRegRm,
(PUSHORT)&Dummy, (PUSHORT)NULL,
(PUSHORT)&Value)) (PUSHORT)&Value))
{ {
/* Exception occurred */ /* Exception occurred */
@ -1580,7 +1580,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf)
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsr) FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsr)
{ {
INT i; INT i;
ULONG Dummy = 0, Value = 0; ULONG Value = 0;
BOOLEAN OperandSize, AddressSize; BOOLEAN OperandSize, AddressSize;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
ULONG BitNumber; ULONG BitNumber;
@ -1607,7 +1607,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsr)
/* Read the value */ /* Read the value */
if (OperandSize) if (OperandSize)
{ {
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1617,7 +1617,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsr)
{ {
if (!Fast486ReadModrmWordOperands(State, if (!Fast486ReadModrmWordOperands(State,
&ModRegRm, &ModRegRm,
(PUSHORT)&Dummy, (PUSHORT)NULL,
(PUSHORT)&Value)) (PUSHORT)&Value))
{ {
/* Exception occurred */ /* Exception occurred */
@ -1664,7 +1664,6 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsr)
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxByte) FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxByte)
{ {
UCHAR Dummy;
CHAR Value; CHAR Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
@ -1682,7 +1681,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxByte)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, (PUCHAR)&Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, (PUCHAR)&Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1697,7 +1696,6 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxByte)
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxWord) FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxWord)
{ {
USHORT Dummy;
SHORT Value; SHORT Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
@ -1715,7 +1713,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxWord)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, (PUSHORT)&Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, (PUSHORT)&Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;

View file

@ -3951,9 +3951,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Selector; ULONG Selector;
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Selector)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Selector))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -3963,9 +3963,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg)
} }
else else
{ {
USHORT Dummy, Selector; USHORT Selector;
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Selector)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;

View file

@ -293,7 +293,7 @@ Fast486RotateOperation(PFAST486_STATE State,
FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8082) FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8082)
{ {
UCHAR Immediate, Dummy, Value; UCHAR Immediate, Value;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
@ -313,7 +313,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8082)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -349,7 +349,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup81)
if (OperandSize) if (OperandSize)
{ {
ULONG Immediate, Value, Dummy; ULONG Immediate, Value;
/* Fetch the immediate operand */ /* Fetch the immediate operand */
if (!Fast486FetchDword(State, &Immediate)) if (!Fast486FetchDword(State, &Immediate))
@ -359,7 +359,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup81)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -376,7 +376,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup81)
} }
else else
{ {
USHORT Immediate, Value, Dummy; USHORT Immediate, Value;
/* Fetch the immediate operand */ /* Fetch the immediate operand */
if (!Fast486FetchWord(State, &Immediate)) if (!Fast486FetchWord(State, &Immediate))
@ -386,7 +386,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup81)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -432,10 +432,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup83)
if (OperandSize) if (OperandSize)
{ {
ULONG Immediate = (ULONG)((LONG)ImmByte); // Sign extend ULONG Immediate = (ULONG)((LONG)ImmByte); // Sign extend
ULONG Value, Dummy; ULONG Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -453,10 +453,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup83)
else else
{ {
USHORT Immediate = (USHORT)((SHORT)ImmByte); // Sign extend USHORT Immediate = (USHORT)((SHORT)ImmByte); // Sign extend
USHORT Value, Dummy; USHORT Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -527,7 +527,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8F)
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC0) FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC0)
{ {
UCHAR Dummy, Value, Count; UCHAR Value, Count;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
@ -547,7 +547,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC0)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -593,10 +593,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC1)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -614,10 +614,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC1)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -728,7 +728,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC7)
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD0) FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD0)
{ {
UCHAR Dummy, Value; UCHAR Value;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
@ -741,7 +741,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD0)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -776,10 +776,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD1)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -793,10 +793,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD1)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -812,7 +812,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD1)
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD2) FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD2)
{ {
UCHAR Dummy, Value; UCHAR Value;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
@ -825,7 +825,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD2)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -863,10 +863,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD3)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -884,10 +884,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD3)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -907,7 +907,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD3)
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF6) FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF6)
{ {
UCHAR Dummy, Value = 0; UCHAR Value = 0;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
@ -920,7 +920,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF6)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1039,7 +1039,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF6)
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF7) FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF7)
{ {
ULONG Dummy, Value = 0, SignFlag; ULONG Value = 0, SignFlag;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN OperandSize, AddressSize; BOOLEAN OperandSize, AddressSize;
@ -1062,7 +1062,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF7)
if (OperandSize) if (OperandSize)
{ {
/* 32-bit */ /* 32-bit */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1071,7 +1071,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF7)
else else
{ {
/* 16-bit */ /* 16-bit */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, (PUSHORT)&Dummy, (PUSHORT)&Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, (PUSHORT)&Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1284,7 +1284,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF7)
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFE) FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFE)
{ {
UCHAR Dummy, Value; UCHAR Value;
FAST486_MOD_REG_RM ModRegRm; FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
@ -1304,7 +1304,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFE)
} }
/* Read the operands */ /* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1363,9 +1363,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFF)
/* Read the operands */ /* Read the operands */
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1506,9 +1506,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFF)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1813,7 +1813,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01)
/* LMSW */ /* LMSW */
case 6: case 6:
{ {
USHORT MachineStatusWord, Dummy; USHORT MachineStatusWord;
/* This is a privileged instruction */ /* This is a privileged instruction */
if (Fast486GetCurrentPrivLevel(State) != 0) if (Fast486GetCurrentPrivLevel(State) != 0)
@ -1823,7 +1823,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0F01)
} }
/* Read the new Machine Status Word */ /* Read the new Machine Status Word */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &MachineStatusWord)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &MachineStatusWord))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1928,10 +1928,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0FBA)
if (OperandSize) if (OperandSize)
{ {
ULONG Dummy, Value; ULONG Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;
@ -1968,10 +1968,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup0FBA)
} }
else else
{ {
USHORT Dummy, Value; USHORT Value;
/* Read the value */ /* Read the value */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value)) if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{ {
/* Exception occurred */ /* Exception occurred */
return FALSE; return FALSE;