[FAST486]
[reactos.git] / lib / fast486 / fast486.c
index efdeb63..28b8381 100644 (file)
@@ -58,7 +58,12 @@ Fast486ExecutionControl(PFAST486_STATE State, INT Command)
         if (State->PrefixFlags == 0) State->SavedInstPtr = State->InstPtr;
 
         /* Perform an instruction fetch */
-        if (!Fast486FetchByte(State, &Opcode)) continue;
+        if (!Fast486FetchByte(State, &Opcode))
+        {
+            /* Exception occurred */
+            State->PrefixFlags = 0;
+            continue;
+        }
 
         // TODO: Check for CALL/RET to update ProcedureCallCount.
 
@@ -98,6 +103,9 @@ Fast486ExecutionControl(PFAST486_STATE State, INT Command)
                                          IdtEntry.Selector,
                                          MAKELONG(IdtEntry.Offset, IdtEntry.OffsetHigh),
                                          IdtEntry.Type);
+
+                /* Restore the prefix flags, which would be set to OPSIZE for 32-bit real mode */
+                State->PrefixFlags = 0;
             }
 
             /* Clear the interrupt status */