From c0ccf16e1819199f3a4ba1ae104c8ba040af28d0 Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Mon, 16 Apr 2001 16:25:34 +0000 Subject: HALT fixed --- lib/simulator.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/simulator.c b/lib/simulator.c index 92286c1..148aca0 100644 --- a/lib/simulator.c +++ b/lib/simulator.c @@ -21,6 +21,9 @@ catch du ctrl-c */ + +int HasToRun = 1; + Uint32 LireInstruction(void) { return (LD(LireRegistrePC())); @@ -331,7 +334,7 @@ void DecodeExec(Uint32 instruction, Uint32 entrypoint) break; case 127: /* HALT-RESET */ if (ValeurBit(Extension(instruction), 0)) - exit(0); /* Halt *//* *******************FIXMI********************* */ + HasToRun = 0; /* Halt */ else ResetRegistres(); Traitement(entrypoint); /* Reset *//* ************FIXMI************** */ @@ -346,7 +349,8 @@ void Traitement(Uint32 entrypoint) Uint32 instruction; EcrireRegistrePC(entrypoint); - while (!0) { + HasToRun = 1; + while (HasToRun) { instruction = LireInstruction(); IncrementeCompteurOrdinal(); DecodeExec(instruction, entrypoint); -- cgit v1.2.3