]> Joshua Wise's Git repositories - fpgaboy.git/blob - insn_ldm8_a.v
Fix ld a, []
[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                 1:      begin end
28                 2:      if (opcode[4]) `_A <= rdata;
29                 endcase
30         end
31 `endif
32
This page took 0.028885 seconds and 4 git commands to generate.