# HG changeset patch # User Michael Pavone # Date 1549219241 28800 # Node ID 88fbc4e711fddf0a8d723945fc2996742d13afb7 # Parent 1f0a86f5e0552579cc2ec9e43a8623046f68a799 Implemented the rest of the block move instructions in new Z80 core diff -r 1f0a86f5e055 -r 88fbc4e711fd cpu_dsl.py --- a/cpu_dsl.py Sat Feb 02 23:02:19 2019 -0800 +++ b/cpu_dsl.py Sun Feb 03 10:40:41 2019 -0800 @@ -167,7 +167,7 @@ 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 @@ 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 diff -r 1f0a86f5e055 -r 88fbc4e711fd z80.cpu --- a/z80.cpu Sat Feb 02 23:02:19 2019 -0800 +++ b/z80.cpu Sun Feb 03 10:40:41 2019 -0800 @@ -2016,31 +2016,37 @@ 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 @@ 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