summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/registre.c4
-rw-r--r--lib/simulator.c22
-rw-r--r--po/ProjetArchi.pot20
-rw-r--r--samples/cube.s8
4 files changed, 34 insertions, 20 deletions
diff --git a/lib/registre.c b/lib/registre.c
index 82ecfdd..8f86951 100644
--- a/lib/registre.c
+++ b/lib/registre.c
@@ -111,12 +111,16 @@ void EcrireRegistre(Uint32 champ_registre, Uint32 valeur)
switch (champ(champ_registre, 4)) {
case 0:
EcrireRegistreRG(valeur);
+ break;
case 1:
EcrireRegistreRD(valeur);
+ break;
case 2:
EcrireRegistrePC(valeur);
+ break;
case 3:
EcrireRegistreFLAG(valeur);
+ break;
default:
exception(1, _("Invalid Register Descriptor"));
}
diff --git a/lib/simulator.c b/lib/simulator.c
index 1438143..7cb764b 100644
--- a/lib/simulator.c
+++ b/lib/simulator.c
@@ -99,7 +99,7 @@ void Flush(void)
void DecodeExec(Uint32 instruction)
{
Uint32 champ_registre_resultat, val1, val2, resultat;
- int test1, test2;
+ int test1, test2, i;
Uint32 val, of; /* valeur qui va etre stockée */
@@ -118,7 +118,7 @@ void DecodeExec(Uint32 instruction)
/* ALU */
champ_registre_resultat = Champ1(instruction); /* Champ du registre dans lequel va etre stocké le résultat */
val1 = LireRegistre(Champ2(instruction)); /* Premier entier qui va etre utilisé dans l'opération */
- if (Opcode(instruction) < 6) {
+ if (Opcode(instruction) < 8) {
if (ValeurBit(Extension(instruction), 0) == 0)
val2 = LireRegistre(Champ3(instruction)); /* Deuxième entier, stocké dans un registre, qui va etre utilisé dans l'opération */
else {
@@ -147,10 +147,16 @@ void DecodeExec(Uint32 instruction)
resultat = OR(val1, val2);
break;
case 6:
- resultat = SHL(val1);
+ for (resultat = val1; val2; val2--) {
+ fprintf(stderr, "Doing shl... (%i)\n", val2);
+ resultat = SHL(resultat);
+ }
break;
case 7:
- resultat = SHR(val1);
+ for (resultat = val1; val2; val2--) {
+ fprintf(stderr, "Doing shr...\n");
+ resultat = SHR(resultat);
+ }
break;
}
} else {
@@ -174,10 +180,14 @@ void DecodeExec(Uint32 instruction)
resultat = OR(val1, val2);
break;
case 6:
- resultat = SHL(val1);
+ for (resultat = val1; val2; val2--) {
+ resultat = SHL(resultat);
+ }
break;
case 7:
- resultat = SHR(val1);
+ for (resultat = val1; val2; val2--) {
+ resultat = SHR(resultat);
+ }
break;
}
}
diff --git a/po/ProjetArchi.pot b/po/ProjetArchi.pot
index e7f86ae..de87c72 100644
--- a/po/ProjetArchi.pot
+++ b/po/ProjetArchi.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-05-13 19:06+0200\n"
+"POT-Creation-Date: 2001-05-13 19:44+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -454,7 +454,7 @@ msgid "Invalid Memory Adress"
msgstr ""
#. Si on voudrait diminuer le nombre de registres
-#: lib/registre.c:77 lib/registre.c:93 lib/registre.c:107 lib/registre.c:121
+#: lib/registre.c:77 lib/registre.c:93 lib/registre.c:107 lib/registre.c:125
msgid "Invalid Register Descriptor"
msgstr ""
@@ -531,19 +531,19 @@ msgid "Adresse: Unmatched Addr Field"
msgstr ""
#. arg2 = imm32
-#: lib/simulator.c:257
+#: lib/simulator.c:267
msgid "MOV: Memory to Memory Forbidden On This Type Of Processor"
msgstr ""
-#: lib/simulator.c:390
+#: lib/simulator.c:400
msgid "DecodeExec: Invalid Opcode"
msgstr ""
-#: lib/simulator.c:452
+#: lib/simulator.c:462
msgid "Shutdown requested"
msgstr ""
-#: lib/simulator.c:454
+#: lib/simulator.c:464
msgid ""
"Help:\n"
"G: go\n"
@@ -553,22 +553,22 @@ msgid ""
"Q: quit\n"
msgstr ""
-#: lib/simulator.c:491
+#: lib/simulator.c:501
#, c-format
msgid "Opening file %s"
msgstr ""
#. verification de la signature
-#: lib/simulator.c:495
+#: lib/simulator.c:505
msgid "Invalid Signature"
msgstr ""
-#: lib/simulator.c:499
+#: lib/simulator.c:509
#, c-format
msgid "Loading file %s"
msgstr ""
-#: lib/simulator.c:533
+#: lib/simulator.c:543
#, c-format
msgid "Executing file %s"
msgstr ""
diff --git a/samples/cube.s b/samples/cube.s
index 6da28e6..593bf79 100644
--- a/samples/cube.s
+++ b/samples/cube.s
@@ -28,8 +28,8 @@ Y0 DB 12; centre de l ecran
;
Mult: MUL R5, R6;
- SHR Rd, Rd, 16;
- SHL Rg, Rg, 16;
+ SHR Rd, 16;
+ SHL Rg, 16;
ADD R5, Rg, Rd;
RET;
@@ -300,7 +300,7 @@ BouclProj: MOV R5, Points3D[R3+0];
ADD R6, R6, R7;
DIV R5, R6;
MOV R5, Rg;
- SHR R5, R5, 16;
+ SHR R5, 16;
MOV R6, [X0];
ADD R5, R5, R6;
MOV Points2D[R2], R5;
@@ -314,7 +314,7 @@ BouclProj: MOV R5, Points3D[R3+0];
ADD R6, R6, R7;
DIV R5, R6;
MOV R5, Rg;
- SHR R5, R5, 16;
+ SHR R5, 16;
MOV R6, [Y0];
ADD R5, R5, R6;
MOV Points2D[R2+1], R5;