summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPixel <>2001-04-23 21:09:03 +0000
committerPixel <>2001-04-23 21:09:03 +0000
commit5796178981fe51ea279b56a2dca19cf19fb73edf (patch)
treec630f6d1ae5356870c7590c690cea29679ae69b2 /lib
parenta3456122423c7784a5f72c202f3636256e0da7c9 (diff)
Bug dans le simulateur (2) et ajout de l'exemple "Puissance4"
Diffstat (limited to 'lib')
-rw-r--r--lib/simulator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/simulator.c b/lib/simulator.c
index f2749e0..c7c709c 100644
--- a/lib/simulator.c
+++ b/lib/simulator.c
@@ -228,14 +228,14 @@ void DecodeExec(Uint32 instruction)
/* Pas de MOV conditionnel */
if (ValeurBit(Extension(instruction), 1) == 0) { /* Mov arg1 arg2 */
if (ValeurBit(Extension(instruction), 0) == 0) { /* arg2 = reg */
- if (champ(Champ1(instruction), 2) == 0) { /* r/m de arg1 = 0 */
+ if (champ(Champ1(instruction), 4) == 0) { /* r/m de arg1 = 0 */
EcrireRegistre(Champ3(instruction), LireRegistre(Champ2(instruction)));
} else {
ST(Adresse
(Champ1(instruction), instruction), LireRegistre(Champ2(instruction)));
}
} else { /* arg2 = imm32 */
- if (champ(Champ1(instruction), 2) == 0) { /* r/m de arg1 = 0 */
+ if (champ(Champ1(instruction), 4) == 0) { /* r/m de arg1 = 0 */
EcrireRegistre(Champ3(instruction), LireInstruction());
IncrementeCompteurOrdinal();
} else {
@@ -246,7 +246,7 @@ void DecodeExec(Uint32 instruction)
}
} else { /* mov arg2, arg1 */
if (ValeurBit(Extension(instruction), 0) == 0) { /* arg2 = reg */
- if (champ(Champ1(instruction), 2) == 0) { /* r/m de arg1 = 0 */
+ if (champ(Champ1(instruction), 4) == 0) { /* r/m de arg1 = 0 */
EcrireRegistre(Champ2(instruction), LireRegistre(Champ3(instruction)));
} else {
EcrireRegistre(Champ2