Fix ld [] and ld []
[fpgaboy.git] / insn_ldm16_a.v
CommitLineData
f9000d73
JW
1// If opcode[4], then ld A, x, else ld x, A
2// If opcode[1], then ld 16m8, else ld 8m8
3
4`ifdef EXECUTE
fe3dc890 5 `INSN_LD16M_A: begin
f9000d73
JW
6 case (cycle)
7 0: begin
8 `EXEC_INC_PC
9 `EXEC_READ(`_PC + 16'h0001)
10 end
11 1: begin
12 `EXEC_INC_PC // we only hit here if 16m8
13 `EXEC_READ(`_PC + 16'h0001)
14 end
15 2: if (opcode[4]) // LD A,x
f6fa1d6e 16 `EXEC_READ(({rdata, tmp}))
f9000d73 17 else
f6fa1d6e 18 `EXEC_WRITE(({rdata, tmp}), `_A)
f9000d73
JW
19 3: begin
20 `EXEC_NEWCYCLE
21 `EXEC_INC_PC
22 end
23 endcase
24 end
25`endif
26
27`ifdef WRITEBACK
fe3dc890 28 `INSN_LD16M_A: begin
f9000d73 29 case (cycle)
fe3dc890 30 0: begin end
f6fa1d6e
JW
31 1: tmp <= rdata;
32 2: begin end
f9000d73
JW
33 3: if (opcode[4]) `_A <= rdata;
34 endcase
35 end
36`endif
37
This page took 0.0202 seconds and 4 git commands to generate.