[FAST486]

XADD: Fix the order of operations.
POP <modrm>: The value must be popped from the stack before parsing the
Mod-Reg-R/M, because of the "POP DWORD [ESP]" case.


svn path=/branches/ntvdm/; revision=60984
This commit is contained in:
Aleksandar Andrejevic 2013-11-13 22:33:37 +00:00
parent 53dfb7da48
commit cd496c8e21
3 changed files with 20 additions and 17 deletions

View file

@ -486,12 +486,22 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8F)
TOGGLE_OPSIZE(OperandSize);
TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
/* Pop a value from the stack - this must be done first */
if (!Fast486StackPop(State, &Value))
{
/* Exception occurred */
return FALSE;
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred - restore SP */
if (OperandSize) State->GeneralRegs[FAST486_REG_ESP].Long += sizeof(ULONG);
else State->GeneralRegs[FAST486_REG_ESP].LowWord += sizeof(USHORT);
return FALSE;
}
if (ModRegRm.Register != 0)
{
/* Invalid */
@ -499,13 +509,6 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8F)
return FALSE;
}
/* Pop a value from the stack */
if (!Fast486StackPop(State, &Value))
{
/* Exception occurred */
return FALSE;
}
if (OperandSize)
{
return Fast486WriteModrmDwordOperands(State,