ULONG Value;
BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Make sure this is the right instruction */
ULONG Value;
BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Make sure this is the right instruction */
ULONG Value;
BOOLEAN Size = State->SegmentRegs[FAST486_REG_SS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Make sure this is the right instruction */
FAST486_OPCODE_HANDLER(Fast486OpcodeNop)
{
- if (State->PrefixFlags & ~(FAST486_PREFIX_OPSIZE | FAST486_PREFIX_REP))
- {
- /* Allowed prefixes are REP and OPSIZE */
- Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
- }
-
if (State->PrefixFlags & FAST486_PREFIX_REP)
{
/* Idle cycle */
INT Reg = Opcode & 0x07;
BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Make sure this is the right instruction */
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xF7) == 0xE5);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Opcode == 0xE5)
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xF7) == 0xE7);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Opcode == 0xE7)
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xF8) == 0xB8);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Size)
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFD) == 0x00);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
- else if (State->PrefixFlags
- & ~(FAST486_PREFIX_ADSIZE
- | FAST486_PREFIX_SEG
- | FAST486_PREFIX_LOCK))
- {
- /* Invalid prefix */
- Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0x05);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFD) == 0x08);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0x0D);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFD) == 0x20);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0x25);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFD) == 0x30);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0x35);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x84);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0xA9);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x86);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFD) == 0x10);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0x15);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFD) == 0x18);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0x1D);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xED) == 0x28);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT((Opcode & 0xEF) == 0x2D);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x60);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Push all the registers in order */
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x61);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Pop all the registers in reverse order */
return FALSE;
}
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0x68);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Fetch the parameters */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFD) == 0x88);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x8C);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x8E);
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the address size */
- AddressSize = !AddressSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the operand size */
- OperandSize = !OperandSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
+ TOGGLE_OPSIZE(OperandSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x98);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Size)
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x99);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Size)
/* Make sure this is the right instruction */
ASSERT(Opcode == 0x9A);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Fetch the offset */
BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size;
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* This OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
/* Check for VM86 mode when IOPL is not 3 */
if (State->Flags.Vm && (State->Flags.Iopl != 3))
ULONG NewFlags;
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* This OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
/* Pop the new flags */
if (!Fast486StackPop(State, &NewFlags))
ASSERT((Opcode & 0xFE) == 0xC2);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Opcode == 0xC2)
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Get the operands */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
ASSERT(Opcode == 0xC8);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (!Fast486FetchWord(State, &FrameSize))
{
ASSERT(Opcode == 0xC9);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0xCA);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Opcode == 0xCA)
ASSERT(Opcode == 0xCF);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
/* Pop EIP */
if (!Fast486StackPop(State, &InstPtr))
UCHAR Value;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
/* Read a byte from DS:[(E)BX + AL] */
if (!Fast486ReadMemory(State,
ASSERT((Opcode >= 0xE0) && (Opcode <= 0xE2));
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size) Condition = ((--State->GeneralRegs[FAST486_REG_ECX].Long) != 0);
else Condition = ((--State->GeneralRegs[FAST486_REG_ECX].LowWord) != 0);
ASSERT(Opcode == 0xE3);
NO_LOCK_PREFIX();
-
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size) Condition = (State->GeneralRegs[FAST486_REG_ECX].Long == 0);
else Condition = (State->GeneralRegs[FAST486_REG_ECX].LowWord == 0);
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xE8);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Size)
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xE9);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
if (Size)
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xEA);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
-
+ TOGGLE_OPSIZE(Size);
NO_LOCK_PREFIX();
/* Fetch the offset */
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xA0);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xA1);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xA2);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xA3);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- Size = !Size;
- }
+ TOGGLE_OPSIZE(Size);
if (Size)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0xA4);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0xA6);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0xAA);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
/* Calculate the size */
if (Opcode == 0xAA) DataSize = sizeof(UCHAR);
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0xAC);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (State->PrefixFlags & FAST486_PREFIX_SEG)
{
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0xAE);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
/* Calculate the size */
if (Opcode == 0xAE) DataSize = sizeof(UCHAR);
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0x6C);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
/* Calculate the size */
if (Opcode == 0x6C) DataSize = sizeof(UCHAR);
/* Make sure this is the right instruction */
ASSERT((Opcode & 0xFE) == 0x6E);
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
/* Calculate the size */
if (Opcode == 0x6E) DataSize = sizeof(UCHAR);
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
FAST486_MOD_REG_RM ModRegRm;
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
- if (State->PrefixFlags & FAST486_PREFIX_OPSIZE)
- {
- /* The OPSIZE prefix toggles the size */
- OperandSize = !OperandSize;
- }
-
- if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
- {
- /* The ADSIZE prefix toggles the size */
- AddressSize = !AddressSize;
- }
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{