]> Joshua Wise's Git repositories - fpgaboy.git/blame - core/insn_ldx_ahl.v
IP
[fpgaboy.git] / core / insn_ldx_ahl.v
CommitLineData
e7fe9dc2
JW
1`define INSN_LDx_AHL 9'b0001xx010 // LDD/LDI A,(HL) / (HL),A
2
3ad960bd
JW
3`ifdef EXECUTE
4 `INSN_LDx_AHL: begin
5 case (cycle)
5c33c5c0
JW
6 0: if (opcode[3]) // LDx A, (HL)
7 `EXEC_READ(`_HL)
8 else
9 `EXEC_WRITE(`_HL, `_A)
3ad960bd 10 1: begin
5c33c5c0
JW
11 `EXEC_NEWCYCLE
12 `EXEC_INC_PC
3ad960bd
JW
13 end
14 endcase
15 end
16`endif
17
18`ifdef WRITEBACK
19 `INSN_LDx_AHL: begin
20 case (cycle)
21 0: begin /* Type F */ end
22 1: begin
23 if (opcode[3])
5c33c5c0
JW
24 `_A <= rdata;
25 `_HL <= opcode[4] ? // if set, LDD, else LDI
26 (`_HL - 1) :
27 (`_HL + 1);
3ad960bd
JW
28 end
29 endcase
30 end
31`endif
This page took 0.047323 seconds and 5 git commands to generate.