summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/simulator.h1
-rw-r--r--lib/alu.c6
-rw-r--r--lib/simulator.c10
3 files changed, 8 insertions, 9 deletions
diff --git a/include/simulator.h b/include/simulator.h
index 834a46c..c158a56 100644
--- a/include/simulator.h
+++ b/include/simulator.h
@@ -25,5 +25,4 @@ void AfficheReg(void);
void Debogueur(void);
-
#endif
diff --git a/lib/alu.c b/lib/alu.c
index 14136a0..5a2819a 100644
--- a/lib/alu.c
+++ b/lib/alu.c
@@ -42,7 +42,7 @@ Uint32 RMultiplicationNonSigne(Uint32 a, Uint32 b)
temp = a * b;
SecondResult = temp >> 32;
- return (temp & ((1 << 32) -1));
+ return (temp);
}
Uint32 RMultiplicationSigne(Uint32 a, Uint32 b)
@@ -51,7 +51,7 @@ Uint32 RMultiplicationSigne(Uint32 a, Uint32 b)
temp = a * b;
SecondResult = temp >> 32;
- return (temp & ((1 << 32) -1));
+ return (temp);
}
Uint32 RDivisionNonSigne(Uint32 a, Uint32 b)
@@ -62,7 +62,7 @@ Uint32 RDivisionNonSigne(Uint32 a, Uint32 b)
Uint32 RDivisionSigne(Uint32 a, Uint32 b)
{
- SecondResuld = a % b;
+ SecondResult = a % b;
return (a / b);
}
diff --git a/lib/simulator.c b/lib/simulator.c
index dd213fe..5ce27b7 100644
--- a/lib/simulator.c
+++ b/lib/simulator.c
@@ -62,15 +62,17 @@ Uint32 Adresse(Uint32 u, Uint32 instruction)
void Initialisation(void)
{
int i;
-
+/*
for (i = 0; i < TAILLE_MEMOIRE; i++)
- Reset(&memoire_principale[i]);
+ Reset(&memoire_principale[i]); */
EcrireRegistreSP(ADD_SP);
}
void DecodeExec(Uint32 instruction, Uint32 entrypoint)
{
Uint32 champ_registre_resultat, val1, val2, resultat;
+ int test1, test2;
+ Uint32 val; /* valeur qui va etre stockée */
if (Opcode(instruction) & 0x80) {
fpu(Opcode(instruction));
@@ -152,7 +154,7 @@ void DecodeExec(Uint32 instruction, Uint32 entrypoint)
}
if ((Opcode(instruction) & 2) && !(Opcode(instruction & 3))) {
EcrireRegistreRG(resultat);
- EcrireRegistreRD(SecondResultat);
+ EcrireRegistreRD(SecondResult);
} else {
EcrireRegistre(champ_registre_resultat, resultat); /* On écrit le résultat dans le registre de sortie */
}
@@ -231,7 +233,6 @@ void DecodeExec(Uint32 instruction, Uint32 entrypoint)
case 10: /* J[cond] */
case 11:
- int test1, test2;
switch (champ(Extension(instruction), 4)) {
case 0:
@@ -316,7 +317,6 @@ void DecodeExec(Uint32 instruction, Uint32 entrypoint)
}
break;
case 14: /* PUSH */
- Uint32 val; /* valeur qui va etre stockée */
if (ValeurBit(Extension(instruction), 0) == 0)
val = LireRegistre(Champ1(instruction));