diff --git a/lib/fast486/common.inl b/lib/fast486/common.inl index 97c5d4e309b..fff8fc01474 100644 --- a/lib/fast486/common.inl +++ b/lib/fast486/common.inl @@ -296,7 +296,7 @@ Fast486StackPush(PFAST486_STATE State, USHORT ShortValue = LOWORD(Value); /* Check if SP is 1 */ - if (State->GeneralRegs[FAST486_REG_ESP].Long == 1) + if (State->GeneralRegs[FAST486_REG_ESP].LowWord == 1) { Fast486Exception(State, FAST486_EXCEPTION_SS); return FALSE; diff --git a/lib/fast486/opgroups.c b/lib/fast486/opgroups.c index 7480296a46e..0e560d5e151 100644 --- a/lib/fast486/opgroups.c +++ b/lib/fast486/opgroups.c @@ -1632,6 +1632,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFF) { /* Set the IP to the address */ State->InstPtr.LowWord = Value; + + /* Clear the top half of EIP */ + State->InstPtr.Long &= 0xFFFF; } else if (ModRegRm.Register == 5) {