Route RAM to pads
[fpgaboy.git] / insn_call-callcc.v
CommitLineData
df770340
JW
1`ifdef EXECUTE
2 `INSN_CALL,`INSN_CALLCC: begin
3 case (cycle)
4 0: begin
5c33c5c0
JW
5 `EXEC_INC_PC
6 `EXEC_READ(`_PC + 1)
df770340
JW
7 end
8 1: begin
5c33c5c0
JW
9 `EXEC_INC_PC
10 `EXEC_READ(`_PC + 1)
df770340
JW
11 end
12 2: begin
5c33c5c0 13 `EXEC_INC_PC
df770340
JW
14 if (!opcode[0]) // i.e., is callcc
15 /* We need to check the condition code to bail out. */
16 case (opcode[4:3])
5c33c5c0
JW
17 `INSN_cc_NZ: if (`_F[7]) `EXEC_NEWCYCLE
18 `INSN_cc_Z: if (~`_F[7]) `EXEC_NEWCYCLE
19 `INSN_cc_NC: if (`_F[4]) `EXEC_NEWCYCLE
20 `INSN_cc_C: if (~`_F[4]) `EXEC_NEWCYCLE
df770340
JW
21 endcase
22 end
5c33c5c0
JW
23 3: `EXEC_WRITE(`_SP - 1, `_PCH)
24 4: `EXEC_WRITE(`_SP - 2, `_PCL)
25 5: `EXEC_NEWCYCLE
df770340
JW
26 endcase
27 end
28`endif
29
30`ifdef WRITEBACK
31 `INSN_CALL,`INSN_CALLCC: begin
32 case (cycle)
33 0: begin /* type F */ end
34 1: tmp <= rdata; // tmp contains newpcl
35 2: tmp2 <= rdata; // tmp2 contains newpch
36 3: begin /* type F */ end
5c33c5c0
JW
37 4: `_PCH <= tmp2;
38 5: begin
39 `_PCL <= tmp;
40 `_SP <= `_SP - 2;
df770340
JW
41 end
42 endcase
43 end
44`endif
This page took 0.024342 seconds and 4 git commands to generate.