mirror of
https://github.com/reactos/reactos.git
synced 2025-05-20 17:45:06 +00:00
[SOFT386]
Fix prefix handling. svn path=/branches/ntvdm/; revision=60260
This commit is contained in:
parent
9d7137b757
commit
6a2d76ab68
1 changed files with 51 additions and 44 deletions
|
@ -1425,18 +1425,19 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeAddEax)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x05);
|
ASSERT(Opcode == 0x05);
|
||||||
|
|
||||||
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
|
||||||
/* The OPSIZE prefix toggles the size */
|
|
||||||
Size = !Size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Invalid prefix */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
|
||||||
if (Size)
|
if (Size)
|
||||||
{
|
{
|
||||||
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
||||||
|
@ -1695,18 +1696,19 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeOrEax)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x0D);
|
ASSERT(Opcode == 0x0D);
|
||||||
|
|
||||||
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
|
||||||
/* The OPSIZE prefix toggles the size */
|
|
||||||
Size = !Size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Invalid prefix */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
|
||||||
if (Size)
|
if (Size)
|
||||||
{
|
{
|
||||||
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
||||||
|
@ -1925,9 +1927,9 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeAndAl)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x24);
|
ASSERT(Opcode == 0x24);
|
||||||
|
|
||||||
if (State->PrefixFlags)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
{
|
||||||
/* This opcode doesn't take any prefixes */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1961,18 +1963,19 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeAndEax)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x25);
|
ASSERT(Opcode == 0x25);
|
||||||
|
|
||||||
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
|
||||||
/* The OPSIZE prefix toggles the size */
|
|
||||||
Size = !Size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Invalid prefix */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
|
||||||
if (Size)
|
if (Size)
|
||||||
{
|
{
|
||||||
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
||||||
|
@ -2227,18 +2230,19 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeXorEax)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x35);
|
ASSERT(Opcode == 0x35);
|
||||||
|
|
||||||
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
|
||||||
/* The OPSIZE prefix toggles the size */
|
|
||||||
Size = !Size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Invalid prefix */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
|
||||||
if (Size)
|
if (Size)
|
||||||
{
|
{
|
||||||
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
||||||
|
@ -2478,18 +2482,19 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeTestEax)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0xA9);
|
ASSERT(Opcode == 0xA9);
|
||||||
|
|
||||||
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
|
||||||
/* The OPSIZE prefix toggles the size */
|
|
||||||
Size = !Size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Invalid prefix */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
|
||||||
if (Size)
|
if (Size)
|
||||||
{
|
{
|
||||||
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
||||||
|
@ -2965,18 +2970,19 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeAdcEax)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x15);
|
ASSERT(Opcode == 0x15);
|
||||||
|
|
||||||
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
|
||||||
/* The OPSIZE prefix toggles the size */
|
|
||||||
Size = !Size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Invalid prefix */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
|
||||||
if (Size)
|
if (Size)
|
||||||
{
|
{
|
||||||
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
||||||
|
@ -3418,18 +3424,19 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeCmpSubEax)
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT((Opcode & 0xEF) == 0x2D);
|
ASSERT((Opcode & 0xEF) == 0x2D);
|
||||||
|
|
||||||
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
if (State->PrefixFlags & SOFT386_PREFIX_LOCK)
|
||||||
{
|
|
||||||
/* The OPSIZE prefix toggles the size */
|
|
||||||
Size = !Size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Invalid prefix */
|
/* Invalid prefix */
|
||||||
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
|
||||||
if (Size)
|
if (Size)
|
||||||
{
|
{
|
||||||
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
ULONG FirstValue = State->GeneralRegs[SOFT386_REG_EAX].Long;
|
||||||
|
|
Loading…
Reference in a new issue