Mercurial > repos > blastem
diff cpu_dsl.py @ 1733:1f0a86f5e055
Implemented LDI in new Z80 core
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 02 Feb 2019 23:02:19 -0800 |
parents | b0e01e64d76d |
children | 88fbc4e711fd |
line wrap: on
line diff
--- a/cpu_dsl.py Sat Feb 02 21:22:02 2019 -0800 +++ b/cpu_dsl.py Sat Feb 02 23:02:19 2019 -0800 @@ -873,11 +873,19 @@ 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") + raise Exception(">=U not implemented in the general case yet") + +def _eqCImpl(prog, parent, fieldVals, output): + return '\n\tif (!{a}) {'.format(a=prog.resolveParam(prog.lastDst, None, {})) + +def _neqCImpl(prog, parent, fieldVals, output): + return '\n\tif ({a}) {'.format(a=prog.resolveParam(prog.lastDst, None, {})) _ifCmpImpl = { 'c': { - '>=U': _geuCImpl + '>=U': _geuCImpl, + '=': _eqCImpl, + '!=': _neqCImpl } } #represents a DSL conditional construct