]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - insn_jp-jpcc.v
Rework it all to use the new macros.
[fpgaboy.git] / insn_jp-jpcc.v
index 2b2e52b297d31b521c1cebb43d184e8352bdf43e..7c8fb22efbf70a536c9e621367274d23c4ac3723 100644 (file)
@@ -2,30 +2,26 @@
        `INSN_JP_imm,`INSN_JPCC_imm: begin
                case (cycle)
                0:      begin
-                               `EXEC_INC_PC;
-                               `EXEC_NEXTADDR_PCINC;
-                               rd <= 1;
+                               `EXEC_INC_PC
+                               `EXEC_READ(`_PC + 1)
                        end
                1:      begin
-                               `EXEC_INC_PC;
-                               `EXEC_NEXTADDR_PCINC;
-                               rd <= 1;
+                               `EXEC_INC_PC
+                               `EXEC_READ(`_PC + 1)
                        end
                2:      begin
-                               `EXEC_INC_PC;
+                               `EXEC_INC_PC
                                if (!opcode[0]) begin   // i.e., JP cc,nn
                                        /* We need to check the condition code to bail out. */
                                        case (opcode[4:3])
-                                       `INSN_cc_NZ:    if (registers[`REG_F][7]) begin `EXEC_NEWCYCLE; end
-                                       `INSN_cc_Z:     if (~registers[`REG_F][7]) begin `EXEC_NEWCYCLE; end
-                                       `INSN_cc_NC:    if (registers[`REG_F][4]) begin `EXEC_NEWCYCLE; end
-                                       `INSN_cc_C:     if (~registers[`REG_F][4]) begin `EXEC_NEWCYCLE; end
+                                       `INSN_cc_NZ:    if (`_F[7]) `EXEC_NEWCYCLE
+                                       `INSN_cc_Z:     if (~`_F[7]) `EXEC_NEWCYCLE
+                                       `INSN_cc_NC:    if (`_F[4]) `EXEC_NEWCYCLE
+                                       `INSN_cc_C:     if (~`_F[4]) `EXEC_NEWCYCLE
                                        endcase
                                end
                        end
-               3:      begin
-                               `EXEC_NEWCYCLE;
-                       end
+               3:      `EXEC_NEWCYCLE
                endcase
        end
 `endif
@@ -36,8 +32,7 @@
                0:      begin /* type F */ end
                1:      tmp <= rdata;   // tmp contains newpcl
                2:      tmp2 <= rdata;  // tmp2 contains newpch
-               3:      {registers[`REG_PCH],registers[`REG_PCL]} <=
-                               {tmp2,tmp};
+               3:      `_PC <= {tmp2,tmp};
                endcase
        end
 `endif
This page took 0.0261980000000001 seconds and 4 git commands to generate.