summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <>2001-04-16 16:22:22 +0000
committerPixel <>2001-04-16 16:22:22 +0000
commit5e99304900cc743236a3420d5463a97d84a8c0ee (patch)
tree14ef541b7c23912e86103f85355008a4cf9dfff3
parentb57a1af1c920bf374a75e040a8c938e237e84512 (diff)
Sauts relatifs
-rw-r--r--include/simulator.h6
-rw-r--r--lib/simulator.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/include/simulator.h b/include/simulator.h
index 852fb7d..834a46c 100644
--- a/include/simulator.h
+++ b/include/simulator.h
@@ -1,5 +1,6 @@
#ifndef __SIMULATOR_H__
#define __SIMULATOR_H__
+#include "types.h"
#define TAILLE_MEMOIRE 1024 /* Nombre maximum de mots que peut contenir la mémoire principale */
#define NB_REGISTRES_PHYSIQUES 64 /* Nombre réel de registres */
@@ -11,10 +12,9 @@
#define REG_STACKPTR 36 /* Numero du registre de Push-Pop */
#define ADD_SP (TAILLE_MEMOIRE-1) /* Emplacement de la pile */
-#include "types.h"
-Uint32 memoire_principale[TAILLE_MEMOIRE];
-Uint32 registre[NB_REGISTRES_PHYSIQUES]; /* Registres classiques */
+extern Uint32 memoire_principale[TAILLE_MEMOIRE];
+extern Uint32 registre[NB_REGISTRES_PHYSIQUES]; /* Registres classiques */
Uint32 LireInstruction(void);
void IncrementeCompteurOrdinal(void);
Uint32 Adresse(Uint32 u, Uint32 instruction);
diff --git a/lib/simulator.c b/lib/simulator.c
index 4cc5d6f..92286c1 100644
--- a/lib/simulator.c
+++ b/lib/simulator.c
@@ -278,8 +278,12 @@ void DecodeExec(Uint32 instruction, Uint32 entrypoint)
}
if (test1) {
Uint32 tmp;
-
+
+
tmp = LireInstruction();
+ if (Opcode(instruction) & 1) {
+ tmp += LireRegistrePC();
+ }
EcrireRegistrePC(tmp);
}
break;