summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/simulator.c8
1 files 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);