diff options
author | Peter Wu <lekensteyn@gmail.com> | 2011-11-28 21:00:56 +0000 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2011-11-28 21:00:56 +0000 |
commit | 308fc185484231d3d73174b68f455c0578469373 (patch) | |
tree | 4a2575a33517d8f217c130e22c756e587a4bb2b0 | |
parent | 83d005c9c6937236523ae15eaef792c8ef3dae06 (diff) | |
download | pp2cc-308fc185484231d3d73174b68f455c0578469373.tar.gz |
Fix right shift for -1 (all bits 1)
-rwxr-xr-x | pp2cc.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -551,6 +551,8 @@ class Parse(object): lines.append(self.asm.binary_op("CMP", reg_first, 0)) # if it's positive, skip handling for negative values lines.append(self.asm.branch_op("BPL", lbl_make_positive)) + # -1 / 2 = 0, so make sure that the last bit is zero + lines.append(self.asm.binary_op("AND", reg_first, "%10")) # shift it by one lines.append(self.asm.binary_op("DIV", reg_first, 1)) # make it positive if not already |