From 2cbcfd75c5e1442dab88dcd619dee036b45926bc Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Sat, 30 Nov 2013 22:17:18 +0000 Subject: [PATCH] [FAST486] Move the prefix reset below the interrupt check, because Fast486InterruptInternal might set OPSIZE in some circumstances. svn path=/branches/ntvdm/; revision=61158 --- lib/fast486/fast486.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/fast486/fast486.c b/lib/fast486/fast486.c index efdeb632368..a249ab43901 100644 --- a/lib/fast486/fast486.c +++ b/lib/fast486/fast486.c @@ -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. @@ -79,9 +84,6 @@ Fast486ExecutionControl(PFAST486_STATE State, INT Command) continue; } - /* A non-prefix opcode has been executed, reset the prefix flags */ - State->PrefixFlags = 0; - /* * Check if there is an interrupt to execute, or a hardware interrupt signal * while interrupts are enabled. @@ -113,6 +115,9 @@ Fast486ExecutionControl(PFAST486_STATE State, INT Command) /* Set the interrupt status to execute on the next instruction */ State->IntStatus = FAST486_INT_EXECUTE; } + + /* A non-prefix opcode has been executed, reset the prefix flags */ + State->PrefixFlags = 0; } while ((Command == FAST486_CONTINUE) || (Command == FAST486_STEP_OVER && ProcedureCallCount > 0)