From 53015149f581d73e44a75bb5322f8f803411a04e Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 2 Feb 2019 15:35:15 -0800 Subject: Implemented RES instruction in new Z80 core --- z80.cpu | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'z80.cpu') diff --git a/z80.cpu b/z80.cpu index 57d3b2d..7a6b14c 100644 --- a/z80.cpu +++ b/z80.cpu @@ -1750,4 +1750,45 @@ fdcb 01BBBRRR bit_iyd lsl 1 B tmp lsr wz 8 last_flag_result and scratch1 tmp tmp - update_flags SZH1PN0 \ No newline at end of file + update_flags SZH1PN0 + +cb 10BBBRRR res_reg + local tmp 8 + lsl 1 B tmp + not tmp tmp + and main.R tmp main.R + +cb 10BBB110 res_hl + z80_fetch_hl + cycles 1 + local tmp 8 + lsl 1 B tmp + not tmp tmp + and scratch1 tmp scratch1 + z80_store_hl + +z80_res_index + arg bit 8 + arg tmp 8 + lsl 1 bit tmp + not tmp tmp + mov wz scratch1 + ocall read_8 + cycles 1 + and scratch1 tmp tmp + mov tmp scratch1 + z80_store_index + +ddcb 10BBB110 res_ixd + local tmp 8 + z80_res_index B tmp + +ddcb 10BBBRRR res_ixd_reg + z80_res_index B main.R + +fdcb 10BBB110 res_iyd + local tmp 8 + z80_res_index B tmp + +fdcb 10BBBRRR res_iyd_reg + z80_res_index B main.R \ No newline at end of file -- cgit v1.2.3