summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2018-09-25 09:33:46 -0700
committerMichael Pavone <pavone@retrodev.com>2018-09-25 09:33:46 -0700
commit2a3088ca16babe0ce74d6e7205f4c0301c1eb56d (patch)
treeddda42b6876de5773f292f942688a7bcd1b6f127
parent4283aeaeab7dac5e73d4efcd11fbe6115a1687d5 (diff)
Fix implementation cmp+condition version of if in CPU DSL
-rwxr-xr-xcpu_dsl.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/cpu_dsl.py b/cpu_dsl.py
index a836541..307f9e8 100755
--- a/cpu_dsl.py
+++ b/cpu_dsl.py
@@ -566,10 +566,8 @@ class Switch(ChildBlock):
def _geuCImpl(prog, parent, fieldVals, output):
if prog.lastOp.op == 'cmp':
output.pop()
- params = prog.lastOp.params
- for i in range(0, len(params)):
- params[i] = prog.resolveParam(params[i], parent, fieldVals)
- return '\n\tif ({a} >= {b}) '.format(a=params[0], b = params[1]) + '{'
+ params = [prog.resolveParam(p, parent, fieldVals) for p in prog.lastOp.params]
+ return '\n\tif ({a} >= {b}) '.format(a=params[1], b = params[0]) + '{'
else:
raise ion(">=U not implemented in the general case yet")