From ff1f5fcda29d65c4149f09ffb3359d9373dfa948 Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Mon, 14 May 2001 08:55:15 +0000 Subject: Pouet --- lib/simulator.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'lib/simulator.c') 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; } } -- cgit v1.2.3