]> Joshua Wise's Git repositories - fpgaboy.git/blame - core/insn_incdec_hl.v
IP
[fpgaboy.git] / core / insn_incdec_hl.v
CommitLineData
e7fe9dc2
JW
1`define INSN_INCDEC_HL 9'b00011010x
2
f2b745a7
JW
3`ifdef EXECUTE
4 `INSN_INCDEC_HL: begin
5 case (cycle)
6 0: `EXEC_READ(`_HL)
65d3506e
JW
7 1: begin
8 `EXEC_WRITE(`_HL, rdata + (opcode[0] ? 8'hFF : 8'h01))
9 tmp <= rdata + (opcode[0] ? 8'hFF : 8'h01);
10 end
f2b745a7
JW
11 2: begin
12 `EXEC_INC_PC
13 `EXEC_NEWCYCLE
14 end
15 endcase
16 end
17`endif
18
19`ifdef WRITEBACK
20 `INSN_INCDEC_HL: begin
65d3506e
JW
21 if (cycle == 1)
22 `_F <= {
23 (tmp == 8'h00) ? 1'b1 : 1'b0, /* Z */
24 opcode[0], /* N */
25 (tmp[3:0] == (opcode[0] ? 4'hF : 4'h0)) ? 1'b1 : 1'b0,
26 `_F[4:0]
27 };
f2b745a7
JW
28 end
29`endif
This page took 0.03867 seconds and 4 git commands to generate.