From ddb272490e8c958e2c46db9e145f518c4c656cf0 Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Mon, 16 Apr 2001 16:28:21 +0000 Subject: Reset Fixe --- lib/simulator.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/simulator.c b/lib/simulator.c index 148aca0..dd213fe 100644 --- a/lib/simulator.c +++ b/lib/simulator.c @@ -22,7 +22,7 @@ */ -int HasToRun = 1; +int HasToRun = 1, Reset; Uint32 LireInstruction(void) { @@ -333,11 +333,12 @@ void DecodeExec(Uint32 instruction, Uint32 entrypoint) break; case 127: /* HALT-RESET */ - if (ValeurBit(Extension(instruction), 0)) + if (ValeurBit(Extension(instruction), 0)) { HasToRun = 0; /* Halt */ - else + } else { + Reset = 1; /* Reset */ ResetRegistres(); - Traitement(entrypoint); /* Reset *//* ************FIXMI************** */ + } break; default: exception(1, _("DecodeExec: Invalid Opcode")); @@ -348,12 +349,15 @@ void Traitement(Uint32 entrypoint) { /* ******************** FIXMI ************************* */ Uint32 instruction; - EcrireRegistrePC(entrypoint); - HasToRun = 1; while (HasToRun) { - instruction = LireInstruction(); - IncrementeCompteurOrdinal(); - DecodeExec(instruction, entrypoint); + EcrireRegistrePC(entrypoint); + HasToRun = 1; + Reset = 0; + while ((HasToRun) && (!Reset)) { + instruction = LireInstruction(); + IncrementeCompteurOrdinal(); + DecodeExec(instruction, entrypoint); + } } } -- cgit v1.2.3