{
FAST486_SEG_REGS Segment = FAST486_REG_DS;
- /* Get the register value */
- if (ModRegRm->Register & 0x04)
+ if (RegValue)
{
- /* AH, CH, DH, BH */
- *RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].HighByte;
- }
- else
- {
- /* AL, CL, DL, BL */
- *RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].LowByte;
- }
-
- if (!ModRegRm->Memory)
- {
- /* Get the second register value */
- if (ModRegRm->SecondRegister & 0x04)
+ /* Get the register value */
+ if (ModRegRm->Register & 0x04)
{
/* AH, CH, DH, BH */
- *RmValue = State->GeneralRegs[ModRegRm->SecondRegister & 0x03].HighByte;
+ *RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].HighByte;
}
else
{
/* AL, CL, DL, BL */
- *RmValue = State->GeneralRegs[ModRegRm->SecondRegister & 0x03].LowByte;
+ *RegValue = State->GeneralRegs[ModRegRm->Register & 0x03].LowByte;
}
}
- else
+
+ if (RmValue)
{
- /* Check for the segment override */
- if (State->PrefixFlags & FAST486_PREFIX_SEG)
+ if (!ModRegRm->Memory)
{
- /* Use the override segment instead */
- Segment = State->SegmentOverride;
+ /* Get the second register value */
+ 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;
+ }
}
-
- /* Read memory */
- if (!Fast486ReadMemory(State,
- Segment,
- ModRegRm->MemoryAddress,
- FALSE,
- RmValue,
- sizeof(UCHAR)))
+ else
{
- /* Exception occurred */
- return FALSE;
+ /* 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;
+ }
}
}
{
FAST486_SEG_REGS Segment = FAST486_REG_DS;
- /* Get the register value */
- *RegValue = State->GeneralRegs[ModRegRm->Register].LowWord;
-
- if (!ModRegRm->Memory)
+ if (RegValue)
{
- /* Get the second register value */
- *RmValue = State->GeneralRegs[ModRegRm->SecondRegister].LowWord;
+ /* Get the register value */
+ *RegValue = State->GeneralRegs[ModRegRm->Register].LowWord;
}
- else
+
+ if (RmValue)
{
- /* Check for the segment override */
- if (State->PrefixFlags & FAST486_PREFIX_SEG)
+ if (!ModRegRm->Memory)
{
- /* Use the override segment instead */
- Segment = State->SegmentOverride;
+ /* Get the second register value */
+ *RmValue = State->GeneralRegs[ModRegRm->SecondRegister].LowWord;
}
-
- /* Read memory */
- if (!Fast486ReadMemory(State,
- Segment,
- ModRegRm->MemoryAddress,
- FALSE,
- RmValue,
- sizeof(USHORT)))
+ else
{
- /* Exception occurred */
- return FALSE;
+ /* 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;
+ }
}
}
{
FAST486_SEG_REGS Segment = FAST486_REG_DS;
- /* Get the register value */
- *RegValue = State->GeneralRegs[ModRegRm->Register].Long;
-
- if (!ModRegRm->Memory)
+ if (RegValue)
{
- /* Get the second register value */
- *RmValue = State->GeneralRegs[ModRegRm->SecondRegister].Long;
+ /* Get the register value */
+ *RegValue = State->GeneralRegs[ModRegRm->Register].Long;
}
- else
+
+ if (RmValue)
{
- /* Check for the segment override */
- if (State->PrefixFlags & FAST486_PREFIX_SEG)
+ if (!ModRegRm->Memory)
{
- /* Use the override segment instead */
- Segment = State->SegmentOverride;
+ /* Get the second register value */
+ *RmValue = State->GeneralRegs[ModRegRm->SecondRegister].Long;
}
-
- /* Read memory */
- if (!Fast486ReadMemory(State,
- Segment,
- ModRegRm->MemoryAddress,
- FALSE,
- RmValue,
- sizeof(ULONG)))
+ else
{
- /* Exception occurred */
- return FALSE;
+ /* 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;
+ }
}
}
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the value */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the value */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the value */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the value */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the value */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the value */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxByte)
{
- UCHAR Dummy, Value;
+ UCHAR Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxWord)
{
- USHORT Dummy, Value;
+ USHORT Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm;
}
/* Read the operands */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the value */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the value */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf)
{
INT i;
- ULONG Dummy = 0, Value = 0;
+ ULONG Value = 0;
BOOLEAN OperandSize, AddressSize;
FAST486_MOD_REG_RM ModRegRm;
ULONG BitNumber;
/* Read the value */
if (OperandSize)
{
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
{
if (!Fast486ReadModrmWordOperands(State,
&ModRegRm,
- (PUSHORT)&Dummy,
+ (PUSHORT)NULL,
(PUSHORT)&Value))
{
/* Exception occurred */
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsr)
{
INT i;
- ULONG Dummy = 0, Value = 0;
+ ULONG Value = 0;
BOOLEAN OperandSize, AddressSize;
FAST486_MOD_REG_RM ModRegRm;
ULONG BitNumber;
/* Read the value */
if (OperandSize)
{
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
{
if (!Fast486ReadModrmWordOperands(State,
&ModRegRm,
- (PUSHORT)&Dummy,
+ (PUSHORT)NULL,
(PUSHORT)&Value))
{
/* Exception occurred */
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxByte)
{
- UCHAR Dummy;
CHAR Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, (PUCHAR)&Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, (PUCHAR)&Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxWord)
{
- USHORT Dummy;
SHORT Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
FAST486_MOD_REG_RM ModRegRm;
}
/* Read the operands */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, (PUSHORT)&Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, (PUSHORT)&Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Selector;
+ ULONG Selector;
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Selector))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Selector))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Selector;
+ USHORT Selector;
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Selector))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8082)
{
- UCHAR Immediate, Dummy, Value;
+ UCHAR Immediate, Value;
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Immediate, Value, Dummy;
+ ULONG Immediate, Value;
/* Fetch the immediate operand */
if (!Fast486FetchDword(State, &Immediate))
}
/* Read the operands */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Immediate, Value, Dummy;
+ USHORT Immediate, Value;
/* Fetch the immediate operand */
if (!Fast486FetchWord(State, &Immediate))
}
/* Read the operands */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
ULONG Immediate = (ULONG)((LONG)ImmByte); // Sign extend
- ULONG Value, Dummy;
+ ULONG Value;
/* Read the operands */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
else
{
USHORT Immediate = (USHORT)((SHORT)ImmByte); // Sign extend
- USHORT Value, Dummy;
+ USHORT Value;
/* Read the operands */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC0)
{
- UCHAR Dummy, Value, Count;
+ UCHAR Value, Count;
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the operands */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the operands */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD0)
{
- UCHAR Dummy, Value;
+ UCHAR Value;
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the operands */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the operands */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD2)
{
- UCHAR Dummy, Value;
+ UCHAR Value;
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the operands */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the operands */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF6)
{
- UCHAR Dummy, Value = 0;
+ UCHAR Value = 0;
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF7)
{
- ULONG Dummy, Value = 0, SignFlag;
+ ULONG Value = 0, SignFlag;
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN OperandSize, AddressSize;
if (OperandSize)
{
/* 32-bit */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
else
{
/* 16-bit */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, (PUSHORT)&Dummy, (PUSHORT)&Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, (PUSHORT)&Value))
{
/* Exception occurred */
return FALSE;
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFE)
{
- UCHAR Dummy, Value;
+ UCHAR Value;
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
}
/* Read the operands */
- if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
/* Read the operands */
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
/* LMSW */
case 6:
{
- USHORT MachineStatusWord, Dummy;
+ USHORT MachineStatusWord;
/* This is a privileged instruction */
if (Fast486GetCurrentPrivLevel(State) != 0)
}
/* Read the new Machine Status Word */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &MachineStatusWord))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &MachineStatusWord))
{
/* Exception occurred */
return FALSE;
if (OperandSize)
{
- ULONG Dummy, Value;
+ ULONG Value;
/* Read the value */
- if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;
}
else
{
- USHORT Dummy, Value;
+ USHORT Value;
/* Read the value */
- if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Dummy, &Value))
+ if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
return FALSE;