27548625708c1e00221742d012e32a0dc7eaf494
[fpgaboy.git] / insn_ldm8_a.v
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
5         `INSN_LD8M_A: begin
6                 case (cycle)
7                 0:      begin
8                                 `EXEC_INC_PC
9                                 `EXEC_READ(`_PC + 16'h0001)
10                         end
11                 1:      if (opcode[4])  // LD A,x
12                                 `EXEC_READ(({8'hFF, rdata}))
13                         else
14                                 `EXEC_WRITE(({8'hFF, rdata}), `_A)
15                 2:      begin
16                                 `EXEC_NEWCYCLE
17                                 `EXEC_INC_PC
18                         end
19                 endcase
20         end
21 `endif
22
23 `ifdef WRITEBACK
24         `INSN_LD8M_A: begin
25                 case (cycle)
26                 0:      begin end
27                 2:      begin end
28                 3:      if (opcode[4]) `_A <= rdata;
29                 endcase
30         end
31 `endif
32
This page took 0.012758 seconds and 2 git commands to generate.