Author: aandrejevic
Date: Fri Sep 27 21:23:34 2013
New Revision: 60393
URL:
http://svn.reactos.org/svn/reactos?rev=60393&view=rev
Log:
[SOFT386]
Fix the return to VM86 mode. The VM flag must be set before the call to
Soft386LoadSegment.
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] Fri Sep 27 21:23:34 2013
@@ -4791,6 +4791,14 @@
if (!Soft386StackPop(State, &Fs)) return FALSE;
if (!Soft386StackPop(State, &Gs)) return FALSE;
+ /* Set the new IP */
+ State->InstPtr.Long = LOWORD(InstPtr);
+
+ /* Set the new flags */
+ if (Size) State->Flags.Long = NewFlags.Long & REAL_MODE_FLAGS_MASK;
+ else State->Flags.LowWord = NewFlags.LowWord & REAL_MODE_FLAGS_MASK;
+ State->Flags.AlwaysSet = State->Flags.Vm = TRUE;
+
/* Load the new segments */
if (!Soft386LoadSegment(State, SOFT386_REG_CS, CodeSel)) return FALSE;
if (!Soft386LoadSegment(State, SOFT386_REG_SS, StackSel)) return FALSE;
@@ -4798,14 +4806,6 @@
if (!Soft386LoadSegment(State, SOFT386_REG_DS, Ds)) return FALSE;
if (!Soft386LoadSegment(State, SOFT386_REG_FS, Fs)) return FALSE;
if (!Soft386LoadSegment(State, SOFT386_REG_GS, Gs)) return FALSE;
-
- /* Set the new IP */
- State->InstPtr.Long = LOWORD(InstPtr);
-
- /* Set the new flags */
- if (Size) State->Flags.Long = NewFlags.Long & REAL_MODE_FLAGS_MASK;
- else State->Flags.LowWord = NewFlags.LowWord & REAL_MODE_FLAGS_MASK;
- State->Flags.AlwaysSet = State->Flags.Vm = TRUE;
return TRUE;
}