From a17cbf2880a1d5656ea841ac9c5c6a3ff48b2eb0 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 10 Jan 2008 14:56:08 -0700 Subject: [PATCH] fix reversed operand encoding for shift instructions --- src/compiler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler.cpp b/src/compiler.cpp index 2f1c8e8961..ac265b548a 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -2082,7 +2082,7 @@ MemoryOperand::accept(Context* c, Operation op, RegisterOperand* operand) // shld c->code.append(0x0f); c->code.append(0xa5); - c->code.append(0xc0 | (high->value(c) << 3) | low->value(c)); + c->code.append(0xc0 | (low->value(c) << 3) | high->value(c)); // shl c->code.append(0xd3); @@ -2124,7 +2124,7 @@ MemoryOperand::accept(Context* c, Operation op, RegisterOperand* operand) // shrd c->code.append(0x0f); c->code.append(0xad); - c->code.append(0xc0 | (low->value(c) << 3) | high->value(c)); + c->code.append(0xc0 | (high->value(c) << 3) | low->value(c)); // sar c->code.append(0xd3); @@ -2169,7 +2169,7 @@ MemoryOperand::accept(Context* c, Operation op, RegisterOperand* operand) // shld c->code.append(0x0f); c->code.append(0xa5); - c->code.append(0xc0 | (low->value(c) << 3) | high->value(c)); + c->code.append(0xc0 | (high->value(c) << 3) | low->value(c)); // shl c->code.append(0xd3);