Mercurial > repos > blastem
comparison cpu_dsl.py @ 1742:6290c88949bd
Fixed CPI/CPD/CPIR/CPDR in new Z80 core
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 04 Feb 2019 23:46:35 -0800 |
parents | 28ab56ff8cea |
children | 91aa789e57bd |
comparison
equal
deleted
inserted
replaced
1741:3dbfb4524ad2 | 1742:6290c88949bd |
---|---|
416 parityDst = name | 416 parityDst = name |
417 else: | 417 else: |
418 raise Exception('Unknown flag calc type: ' + calc) | 418 raise Exception('Unknown flag calc type: ' + calc) |
419 if prog.carryFlowDst: | 419 if prog.carryFlowDst: |
420 if prog.lastOp.op != 'cmp': | 420 if prog.lastOp.op != 'cmp': |
421 output.append('\n\t{dst} = {tmpdst};'.format(dst = prog.resolveParam(prog.lastDst, None, {}), tmpdst = prog.carryFlowDst)) | 421 output.append('\n\t{dst} = {tmpdst};'.format(dst = prog.resolveParam(prog.lastDst, prog.currentScope, {}), tmpdst = prog.carryFlowDst)) |
422 prog.carryFlowDst = None | 422 prog.carryFlowDst = None |
423 if parity: | 423 if parity: |
424 if paritySize > 8: | 424 if paritySize > 8: |
425 if paritySize > 16: | 425 if paritySize > 16: |
426 output.append('\n\t{dst} = {src} ^ ({src} >> 16);'.format(dst=parityDst, src=paritySrc)) | 426 output.append('\n\t{dst} = {src} ^ ({src} >> 16);'.format(dst=parityDst, src=paritySrc)) |
1361 return self.booleans[name] | 1361 return self.booleans[name] |
1362 | 1362 |
1363 def getTemp(self, size): | 1363 def getTemp(self, size): |
1364 if size in self.temp: | 1364 if size in self.temp: |
1365 return ('', self.temp[size]) | 1365 return ('', self.temp[size]) |
1366 self.temp[size] = 'tmp{sz}'.format(sz=size); | 1366 self.temp[size] = 'gen_tmp{sz}__'.format(sz=size); |
1367 return ('\n\tuint{sz}_t tmp{sz};'.format(sz=size), self.temp[size]) | 1367 return ('\n\tuint{sz}_t gen_tmp{sz}__;'.format(sz=size), self.temp[size]) |
1368 | 1368 |
1369 def resolveParam(self, param, parent, fieldVals, allowConstant=True, isdst=False): | 1369 def resolveParam(self, param, parent, fieldVals, allowConstant=True, isdst=False): |
1370 keepGoing = True | 1370 keepGoing = True |
1371 while keepGoing: | 1371 while keepGoing: |
1372 keepGoing = False | 1372 keepGoing = False |