From f53bf21c6ad9fb3d2f1a40e2ce06816a6b2e3106 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 6 Dec 2011 16:56:06 +0000 Subject: Add tests for memory address handling, fix compiler for negative constant --- pp2cc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pp2cc.py') diff --git a/pp2cc.py b/pp2cc.py index 2f58f9b..81f6a79 100755 --- a/pp2cc.py +++ b/pp2cc.py @@ -1317,7 +1317,8 @@ class Parse(object): linked_node)) if op == "-": # negating a value in PP2 is flipping the WORDSIZE-th bit - value = operand ^ msb + value = -operand + #(operand ^ (pow(2, self.WORDSIZE) - 1)) + 1 elif op == "~": # invert all bits value = operand ^ (pow(2, self.WORDSIZE) - 1) -- cgit v1.2.1