summaryrefslogtreecommitdiff
path: root/lib/simulator.c
diff options
context:
space:
mode:
authorPixel <>2001-04-16 16:25:34 +0000
committerPixel <>2001-04-16 16:25:34 +0000
commitc0ccf16e1819199f3a4ba1ae104c8ba040af28d0 (patch)
tree48f73fb426caa53d3eda5fa8db9d65ad2c138c88 /lib/simulator.c
parent5e99304900cc743236a3420d5463a97d84a8c0ee (diff)
HALT fixed
Diffstat (limited to 'lib/simulator.c')
-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);