]> Joshua Wise's Git repositories - fpgaboy.git/blame_incremental - core/insn_ldx_ahl.v
Fix ld (nn), sp, for real this time.
[fpgaboy.git] / core / insn_ldx_ahl.v
... / ...
CommitLineData
1`define INSN_LDx_AHL 9'b0001xx010 // LDD/LDI A,(HL) / (HL),A
2
3`ifdef EXECUTE
4 `INSN_LDx_AHL: begin
5 case (cycle)
6 0: if (opcode[3]) // LDx A, (HL)
7 `EXEC_READ(`_HL)
8 else
9 `EXEC_WRITE(`_HL, `_A)
10 1: begin
11 `EXEC_NEWCYCLE
12 `EXEC_INC_PC
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])
24 `_A <= rdata;
25 `_HL <= opcode[4] ? // if set, LDD, else LDI
26 (`_HL - 1) :
27 (`_HL + 1);
28 end
29 endcase
30 end
31`endif
This page took 0.024965 seconds and 4 git commands to generate.