Author: aandrejevic
Date: Sat Sep 21 01:00:36 2013
New Revision: 60259
URL:
http://svn.reactos.org/svn/reactos?rev=60259&view=rev
Log:
[SOFT386]
Fix the CALL instruction. The offset must be fetched before EIP is pushed.
Modified:
branches/ntvdm/lib/soft386/opcodes.c
Modified: branches/ntvdm/lib/soft386/opcodes.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/opcodes.c?rev…
==============================================================================
--- branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] Sat Sep 21 01:00:36 2013
@@ -4506,13 +4506,6 @@
return FALSE;
}
- /* Push the current value of the instruction pointer */
- if (!Soft386StackPush(State, State->InstPtr.Long))
- {
- /* Exception occurred */
- return FALSE;
- }
-
if (Size)
{
LONG Offset = 0;
@@ -4524,6 +4517,13 @@
return FALSE;
}
+ /* Push the current value of the instruction pointer */
+ if (!Soft386StackPush(State, State->InstPtr.Long))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
/* Move the instruction pointer */
State->InstPtr.Long += Offset;
}
@@ -4538,6 +4538,13 @@
return FALSE;
}
+ /* Push the current value of the instruction pointer */
+ if (!Soft386StackPush(State, State->InstPtr.Long))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
/* Move the instruction pointer */
State->InstPtr.LowWord += Offset;
}