From 88a8e74a53af20e0d7b102a2810177a7320c9aee Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 18 Jan 2008 15:01:50 -0700 Subject: [PATCH] fix register to memory mov1 implementation --- src/compiler.cpp | 5 +++-- test/Misc.java | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/compiler.cpp b/src/compiler.cpp index 240a88ca64..7323668644 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -1959,9 +1959,10 @@ MemoryOperand::accept(Context* c, Operation op, RegisterOperand* operand) case mov1: if (BytesPerWord == 8) { if (operand->value(c) > rbx) { - c->code.append(0x40); + encode2(c, 0x4088, operand->value(c), this, false); + } else { + encode(c, 0x88, operand->value(c), this, false); } - encode(c, 0x88, operand->value(c), this, false); } else { if (operand->value(c) > rbx) { RegisterOperand* ax = temporary(c, rax); diff --git a/test/Misc.java b/test/Misc.java index cf92bfb127..f75b38d92c 100644 --- a/test/Misc.java +++ b/test/Misc.java @@ -1,6 +1,7 @@ public class Misc { private static int alpha; private static int beta; + private static byte byte1, byte2, byte3; private int gamma; private String foo(String s) { @@ -51,6 +52,9 @@ public class Misc { } public static void main(String[] args) { + byte2 = 0; + expect(byte2 == 0); + Misc m = new Misc(); m.toString();