summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPixel <>2001-04-16 16:28:21 +0000
committerPixel <>2001-04-16 16:28:21 +0000
commitddb272490e8c958e2c46db9e145f518c4c656cf0 (patch)
treef8e388bae5a23b7d01a5c3d887fe4b016a3c234a /lib
parentc0ccf16e1819199f3a4ba1ae104c8ba040af28d0 (diff)
Reset Fixe
Diffstat (limited to 'lib')
-rw-r--r--lib/simulator.c22
1 files changed, 13 insertions, 9 deletions
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);
+ }
}
}