summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpp2cc.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pp2cc.py b/pp2cc.py
index b270191..232c581 100755
--- a/pp2cc.py
+++ b/pp2cc.py
@@ -444,6 +444,10 @@ class Parse(object):
# we can safe another NOOP by adding the label here
lines.append(self.asm.branch_op("BGT", lbl_shift,
label=lbl_shift_end))
+ # expression rely on the fact that the result of an expression is
+ # available in the last register. Without the below line, it'd look
+ # in reg_shift
+ lines.append(self.asm.binary_op("LOAD", reg_number, reg_number))
else:
shift_bits = self.convertStrToInteger(operand_shift)
if shift_bits <= 0: