diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-02-03 10:40:41 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-02-03 10:40:41 -0800 |
commit | 822f91d0a3dd99351d881868f780058949099ffe (patch) | |
tree | 09d141a46a93ddf70f642ad310f68a8b0bb24b8b | |
parent | 1f7eb1afff1a9b13cde11a786145ba313df3334a (diff) |
Implemented the rest of the block move instructions in new Z80 core
-rwxr-xr-x | cpu_dsl.py | 4 | ||||
-rw-r--r-- | z80.cpu | 45 |
2 files changed, 41 insertions, 8 deletions
@@ -167,7 +167,7 @@ class SubRoutine(Block): self.args.append((name, size)) elif op.op == 'local': name = op.params[0] - size = op.params[1] + size = int(op.params[1]) self.locals[name] = size else: self.implementation.append(op) @@ -339,7 +339,7 @@ def _updateFlagsCImpl(prog, params, rawParams): if prog.carryFlowDst: lastDst = prog.carryFlowDst else: - lastDst = prog.resolveParam(prog.lastDst, None, {}) + lastDst = prog.resolveParam(prog.lastDst, prog.currentScope, {}) storage = prog.flags.getStorage(flag) if calc == 'bit' or calc == 'sign' or calc == 'carry' or calc == 'half' or calc == 'overflow': myRes = lastDst @@ -2016,31 +2016,37 @@ fdcb 11BBB110 set_iyd fdcb 11BBBRRR set_iyd_reg z80_set_index B main.R - -ed 10100000 ldi + +z80_fetch_mod_hl local tmp 16 - local tmp8 8 + arg change 16 lsl h 8 tmp or l tmp tmp mov tmp scratch1 - add 1 tmp tmp + add change tmp tmp mov tmp l lsr tmp 8 h ocall read_8 cycles 1 +z80_ldd_ldi + arg change 16 + local tmp 16 + local tmp8 8 + z80_fetch_mod_hl change + add a scratch1 tmp8 update_flags H0XN0 and 0x2 tmp8 tmp8 - lsl 4 tmp8 tmp8 + lsl tmp8 4 tmp8 and 0x88 last_flag_result last_flag_result or tmp8 last_flag_result last_flag_result lsl d 8 tmp or e tmp tmp mov tmp scratch2 - add 1 tmp tmp + add change tmp tmp mov tmp e lsr tmp 8 d ocall write_8 @@ -2054,7 +2060,34 @@ ed 10100000 ldi mov c pvflag or b pvflag pvflag + cycles 5 + +ed 10100000 ldi + z80_ldd_ldi 1 + +ed 10101000 ldd + z80_ldd_ldi -1 + +ed 10110000 ldir + z80_ldd_ldi 1 + if pvflag + + add 1 pc wz + sub 1 pc pc + cycles 5 + + end + +ed 10111000 lddr + z80_ldd_ldi -1 + if pvflag + add 1 pc wz + sub 1 pc pc cycles 5 + + end + +
\ No newline at end of file |