From 14c7b8af3a04f739ebd192b9efd22cd5422525c1 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 7 Dec 2011 09:55:18 +0000 Subject: Fix the result of a >> expression --- pp2cc.py | 4 ++++ 1 file changed, 4 insertions(+) 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: -- cgit v1.2.1