1 |
20 |
robfinch |
// ============================================================================
|
2 |
|
|
// __
|
3 |
|
|
// \\__/ o\ (C) 2013 Robert Finch, Stratford
|
4 |
|
|
// \ __ / All rights reserved.
|
5 |
|
|
// \/_// robfinch<remove>@opencores.org
|
6 |
|
|
// ||
|
7 |
|
|
//
|
8 |
|
|
// This source file is free software: you can redistribute it and/or modify
|
9 |
|
|
// it under the terms of the GNU Lesser General Public License as published
|
10 |
|
|
// by the Free Software Foundation, either version 3 of the License, or
|
11 |
|
|
// (at your option) any later version.
|
12 |
|
|
//
|
13 |
|
|
// This source file is distributed in the hope that it will be useful,
|
14 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
|
|
// GNU General Public License for more details.
|
17 |
|
|
//
|
18 |
|
|
// You should have received a copy of the GNU General Public License
|
19 |
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20 |
|
|
//
|
21 |
|
|
// ============================================================================
|
22 |
|
|
//
|
23 |
|
|
IFETCH:
|
24 |
|
|
begin
|
25 |
25 |
robfinch |
suppress_pcinc <= 4'hF; // default: no suppression of increment
|
26 |
23 |
robfinch |
opc <= pc;
|
27 |
25 |
robfinch |
hwi <= `FALSE;
|
28 |
|
|
if (nmi_edge & !imiss & gie & !isExec & !isAtni) begin // imiss indicates cache controller is active and this state is in a waiting loop
|
29 |
20 |
robfinch |
nmi_edge <= 1'b0;
|
30 |
|
|
wai <= 1'b0;
|
31 |
|
|
bf <= 1'b0;
|
32 |
25 |
robfinch |
hwi <= `TRUE;
|
33 |
20 |
robfinch |
if (em & !nmoi) begin
|
34 |
|
|
radr <= {spage[31:8],sp[7:2]};
|
35 |
|
|
radr2LSB <= sp[1:0];
|
36 |
|
|
wadr <= {spage[31:8],sp[7:2]};
|
37 |
|
|
wadr2LSB <= sp[1:0];
|
38 |
|
|
wdat <= {4{pc[31:24]}};
|
39 |
|
|
cyc_o <= 1'b1;
|
40 |
|
|
stb_o <= 1'b1;
|
41 |
|
|
we_o <= 1'b1;
|
42 |
|
|
case(sp[1:0])
|
43 |
|
|
2'd0: sel_o <= 4'b0001;
|
44 |
|
|
2'd1: sel_o <= 4'b0010;
|
45 |
|
|
2'd2: sel_o <= 4'b0100;
|
46 |
|
|
2'd3: sel_o <= 4'b1000;
|
47 |
|
|
endcase
|
48 |
|
|
adr_o <= {spage[31:8],sp[7:2],2'b00};
|
49 |
|
|
dat_o <= {4{pc[31:24]}};
|
50 |
|
|
sp <= sp_dec;
|
51 |
|
|
vect <= `BYTE_NMI_VECT;
|
52 |
|
|
state <= BYTE_IRQ1;
|
53 |
|
|
end
|
54 |
|
|
else begin
|
55 |
|
|
radr <= isp_dec;
|
56 |
|
|
wadr <= isp_dec;
|
57 |
|
|
wdat <= pc;
|
58 |
|
|
cyc_o <= 1'b1;
|
59 |
|
|
stb_o <= 1'b1;
|
60 |
|
|
we_o <= 1'b1;
|
61 |
|
|
sel_o <= 4'hF;
|
62 |
|
|
adr_o <= {isp_dec,2'b00};
|
63 |
|
|
dat_o <= pc;
|
64 |
|
|
vect <= `NMI_VECT;
|
65 |
|
|
state <= IRQ1;
|
66 |
|
|
end
|
67 |
|
|
end
|
68 |
25 |
robfinch |
else if (irq_i && !imiss & gie & !isExec & !isAtni) begin
|
69 |
20 |
robfinch |
if (im) begin
|
70 |
|
|
wai <= 1'b0;
|
71 |
25 |
robfinch |
if (isExec) begin
|
72 |
|
|
ir <= exbuf;
|
73 |
|
|
exbuf <= 64'd0;
|
74 |
|
|
suppress_pcinc <= 4'h0;
|
75 |
|
|
state <= em ? BYTE_DECODE : DECODE;
|
76 |
|
|
end
|
77 |
|
|
else if (unCachedInsn) begin
|
78 |
20 |
robfinch |
if (bhit) begin
|
79 |
25 |
robfinch |
ir <= ibuf + exbuf;
|
80 |
|
|
exbuf <= 64'd0;
|
81 |
20 |
robfinch |
state <= em ? BYTE_DECODE : DECODE;
|
82 |
|
|
end
|
83 |
|
|
else
|
84 |
|
|
imiss <= `TRUE;
|
85 |
|
|
end
|
86 |
|
|
else begin
|
87 |
|
|
if (ihit) begin
|
88 |
25 |
robfinch |
ir <= insn + exbuf;
|
89 |
|
|
exbuf <= 64'd0;
|
90 |
20 |
robfinch |
state <= em ? BYTE_DECODE : DECODE;
|
91 |
|
|
end
|
92 |
|
|
else
|
93 |
|
|
imiss <= `TRUE;
|
94 |
|
|
end
|
95 |
|
|
end
|
96 |
|
|
else begin
|
97 |
|
|
bf <= 1'b0;
|
98 |
|
|
wai <= 1'b0;
|
99 |
25 |
robfinch |
hwi <= `TRUE;
|
100 |
20 |
robfinch |
if (em & !nmoi) begin
|
101 |
|
|
radr <= {spage[31:8],sp[7:2]};
|
102 |
|
|
radr2LSB <= sp[1:0];
|
103 |
|
|
wadr <= {spage[31:8],sp[7:2]};
|
104 |
|
|
wadr2LSB <= sp[1:0];
|
105 |
|
|
wdat <= {4{pc[31:24]}};
|
106 |
|
|
cyc_o <= 1'b1;
|
107 |
|
|
stb_o <= 1'b1;
|
108 |
|
|
we_o <= 1'b1;
|
109 |
|
|
case(sp[1:0])
|
110 |
|
|
2'd0: sel_o <= 4'b0001;
|
111 |
|
|
2'd1: sel_o <= 4'b0010;
|
112 |
|
|
2'd2: sel_o <= 4'b0100;
|
113 |
|
|
2'd3: sel_o <= 4'b1000;
|
114 |
|
|
endcase
|
115 |
|
|
adr_o <= {spage[31:8],sp[7:2],2'b00};
|
116 |
|
|
dat_o <= {4{pc[31:24]}};
|
117 |
|
|
sp <= sp_dec;
|
118 |
|
|
vect <= `BYTE_IRQ_VECT;
|
119 |
|
|
state <= BYTE_IRQ1;
|
120 |
|
|
end
|
121 |
|
|
else begin
|
122 |
|
|
radr <= isp_dec;
|
123 |
|
|
wadr <= isp_dec;
|
124 |
|
|
wdat <= pc;
|
125 |
|
|
cyc_o <= 1'b1;
|
126 |
|
|
stb_o <= 1'b1;
|
127 |
|
|
we_o <= 1'b1;
|
128 |
|
|
sel_o <= 4'hF;
|
129 |
|
|
adr_o <= {isp_dec,2'b00};
|
130 |
|
|
dat_o <= pc;
|
131 |
|
|
vect <= {vbr[31:9],irq_vect,2'b00};
|
132 |
|
|
state <= IRQ1;
|
133 |
|
|
end
|
134 |
|
|
end
|
135 |
|
|
end
|
136 |
|
|
else if (!wai) begin
|
137 |
25 |
robfinch |
if (isExec) begin
|
138 |
|
|
ir <= exbuf;
|
139 |
|
|
exbuf <= 64'd0;
|
140 |
|
|
suppress_pcinc <= 4'h0;
|
141 |
|
|
state <= em ? BYTE_DECODE : DECODE;
|
142 |
|
|
end
|
143 |
|
|
else if (unCachedInsn) begin
|
144 |
20 |
robfinch |
if (bhit) begin
|
145 |
25 |
robfinch |
ir <= ibuf + exbuf;
|
146 |
|
|
exbuf <= 64'd0;
|
147 |
20 |
robfinch |
state <= em ? BYTE_DECODE : DECODE;
|
148 |
|
|
end
|
149 |
|
|
else
|
150 |
|
|
imiss <= `TRUE;
|
151 |
|
|
end
|
152 |
|
|
else begin
|
153 |
|
|
if (ihit) begin
|
154 |
25 |
robfinch |
ir <= insn + exbuf;
|
155 |
|
|
exbuf <= 64'd0;
|
156 |
20 |
robfinch |
state <= em ? BYTE_DECODE : DECODE;
|
157 |
|
|
end
|
158 |
|
|
else
|
159 |
|
|
imiss <= `TRUE;
|
160 |
|
|
end
|
161 |
|
|
end
|
162 |
|
|
if (first_ifetch) begin
|
163 |
|
|
first_ifetch <= `FALSE;
|
164 |
|
|
if (em) begin
|
165 |
|
|
case(ir[7:0])
|
166 |
|
|
`TAY,`TXY,`DEY,`INY: begin y[7:0] <= res8; nf <= resn8; zf <= resz8; end
|
167 |
|
|
`TAX,`TYX,`TSX,`DEX,`INX: begin x[7:0] <= res8; nf <= resn8; zf <= resz8; end
|
168 |
|
|
`TSA,`TYA,`TXA,`INA,`DEA: begin acc[7:0] <= res8; nf <= resn8; zf <= resz8; end
|
169 |
|
|
`TAS,`TXS: begin sp <= res8[7:0]; end
|
170 |
|
|
`ADC_IMM:
|
171 |
|
|
begin
|
172 |
|
|
acc[7:0] <= df ? bcaio : res8;
|
173 |
|
|
cf <= df ? bcaico : resc8;
|
174 |
|
|
// vf <= resv8;
|
175 |
|
|
vf <= (res8[7] ^ b8[7]) & (1'b1 ^ acc[7] ^ b8[7]);
|
176 |
|
|
nf <= df ? bcaio[7] : resn8;
|
177 |
|
|
zf <= df ? bcaio==8'h00 : resz8;
|
178 |
|
|
end
|
179 |
|
|
`ADC_ZP,`ADC_ZPX,`ADC_IX,`ADC_IY,`ADC_ABS,`ADC_ABSX,`ADC_ABSY,`ADC_I:
|
180 |
|
|
begin
|
181 |
|
|
acc[7:0] <= df ? bcao : res8;
|
182 |
|
|
cf <= df ? bcaco : resc8;
|
183 |
|
|
vf <= (res8[7] ^ b8[7]) & (1'b1 ^ acc[7] ^ b8[7]);
|
184 |
|
|
nf <= df ? bcao[7] : resn8;
|
185 |
|
|
zf <= df ? bcao==8'h00 : resz8;
|
186 |
|
|
end
|
187 |
|
|
`SBC_IMM:
|
188 |
|
|
begin
|
189 |
|
|
acc[7:0] <= df ? bcsio : res8;
|
190 |
|
|
cf <= ~(df ? bcsico : resc8);
|
191 |
|
|
vf <= (1'b1 ^ res8[7] ^ b8[7]) & (acc[7] ^ b8[7]);
|
192 |
|
|
nf <= df ? bcsio[7] : resn8;
|
193 |
|
|
zf <= df ? bcsio==8'h00 : resz8;
|
194 |
|
|
end
|
195 |
|
|
`SBC_ZP,`SBC_ZPX,`SBC_IX,`SBC_IY,`SBC_ABS,`SBC_ABSX,`SBC_ABSY,`SBC_I:
|
196 |
|
|
begin
|
197 |
|
|
acc[7:0] <= df ? bcso : res8;
|
198 |
|
|
vf <= (1'b1 ^ res8[7] ^ b8[7]) & (acc[7] ^ b8[7]);
|
199 |
|
|
cf <= ~(df ? bcsco : resc8);
|
200 |
|
|
nf <= df ? bcso[7] : resn8;
|
201 |
|
|
zf <= df ? bcso==8'h00 : resz8;
|
202 |
|
|
end
|
203 |
|
|
`CMP_IMM,`CMP_ZP,`CMP_ZPX,`CMP_IX,`CMP_IY,`CMP_ABS,`CMP_ABSX,`CMP_ABSY,`CMP_I,
|
204 |
|
|
`CPX_IMM,`CPX_ZP,`CPX_ABS,
|
205 |
|
|
`CPY_IMM,`CPY_ZP,`CPY_ABS:
|
206 |
|
|
begin cf <= ~resc8; nf <= resn8; zf <= resz8; end
|
207 |
|
|
`BIT_IMM,`BIT_ZP,`BIT_ZPX,`BIT_ABS,`BIT_ABSX:
|
208 |
|
|
begin nf <= b8[7]; vf <= b8[6]; zf <= resz8; end
|
209 |
|
|
`TRB_ZP,`TRB_ABS,`TSB_ZP,`TSB_ABS:
|
210 |
|
|
begin zf <= resz8; end
|
211 |
|
|
`LDA_IMM,`LDA_ZP,`LDA_ZPX,`LDA_IX,`LDA_IY,`LDA_ABS,`LDA_ABSX,`LDA_ABSY,`LDA_I,
|
212 |
|
|
`AND_IMM,`AND_ZP,`AND_ZPX,`AND_IX,`AND_IY,`AND_ABS,`AND_ABSX,`AND_ABSY,`AND_I,
|
213 |
|
|
`ORA_IMM,`ORA_ZP,`ORA_ZPX,`ORA_IX,`ORA_IY,`ORA_ABS,`ORA_ABSX,`ORA_ABSY,`ORA_I,
|
214 |
|
|
`EOR_IMM,`EOR_ZP,`EOR_ZPX,`EOR_IX,`EOR_IY,`EOR_ABS,`EOR_ABSX,`EOR_ABSY,`EOR_I:
|
215 |
|
|
begin acc[7:0] <= res8; nf <= resn8; zf <= resz8; end
|
216 |
|
|
`ASL_ACC: begin acc[7:0] <= res8; cf <= resc8; nf <= resn8; zf <= resz8; end
|
217 |
|
|
`ROL_ACC: begin acc[7:0] <= res8; cf <= resc8; nf <= resn8; zf <= resz8; end
|
218 |
|
|
`LSR_ACC: begin acc[7:0] <= res8; cf <= resc8; nf <= resn8; zf <= resz8; end
|
219 |
|
|
`ROR_ACC: begin acc[7:0] <= res8; cf <= resc8; nf <= resn8; zf <= resz8; end
|
220 |
|
|
`ASL_ZP,`ASL_ZPX,`ASL_ABS,`ASL_ABSX: begin cf <= resc8; nf <= resn8; zf <= resz8; end
|
221 |
|
|
`ROL_ZP,`ROL_ZPX,`ROL_ABS,`ROL_ABSX: begin cf <= resc8; nf <= resn8; zf <= resz8; end
|
222 |
|
|
`LSR_ZP,`LSR_ZPX,`LSR_ABS,`LSR_ABSX: begin cf <= resc8; nf <= resn8; zf <= resz8; end
|
223 |
|
|
`ROR_ZP,`ROR_ZPX,`ROR_ABS,`ROR_ABSX: begin cf <= resc8; nf <= resn8; zf <= resz8; end
|
224 |
|
|
`INC_ZP,`INC_ZPX,`INC_ABS,`INC_ABSX: begin nf <= resn8; zf <= resz8; end
|
225 |
|
|
`DEC_ZP,`DEC_ZPX,`DEC_ABS,`DEC_ABSX: begin nf <= resn8; zf <= resz8; end
|
226 |
|
|
`PLA: begin acc[7:0] <= res8; zf <= resz8; nf <= resn8; end
|
227 |
|
|
`PLX: begin x[7:0] <= res8; zf <= resz8; nf <= resn8; end
|
228 |
|
|
`PLY: begin y[7:0] <= res8; zf <= resz8; nf <= resn8; end
|
229 |
|
|
`LDX_IMM,`LDX_ZP,`LDX_ZPY,`LDX_ABS,`LDX_ABSY: begin x[7:0] <= res8; nf <= resn8; zf <= resz8; end
|
230 |
|
|
`LDY_IMM,`LDY_ZP,`LDY_ZPX,`LDY_ABS,`LDY_ABSX: begin y[7:0] <= res8; nf <= resn8; zf <= resz8; end
|
231 |
|
|
endcase
|
232 |
|
|
end
|
233 |
|
|
else begin
|
234 |
|
|
regfile[Rt] <= res;
|
235 |
|
|
case(Rt)
|
236 |
|
|
4'h1: acc <= res;
|
237 |
|
|
4'h2: x <= res;
|
238 |
|
|
4'h3: y <= res;
|
239 |
|
|
default: ;
|
240 |
|
|
endcase
|
241 |
|
|
case(ir[7:0])
|
242 |
|
|
`TAY,`TXY,`DEY,`INY: begin y <= res; nf <= resn32; zf <= resz32; end
|
243 |
|
|
`TAX,`TYX,`TSX,`DEX,`INX: begin x <= res; nf <= resn32; zf <= resz32; end
|
244 |
25 |
robfinch |
`TAS,`TXS: begin isp <= res; gie <= 1'b1; end
|
245 |
|
|
`SUB_SP8,`SUB_SP16,`SUB_SP32: isp <= res;
|
246 |
20 |
robfinch |
`TSA,`TYA,`TXA,`INA,`DEA: begin acc <= res; nf <= resn32; zf <= resz32; end
|
247 |
|
|
`TRS:
|
248 |
|
|
begin
|
249 |
|
|
case(ir[15:12])
|
250 |
|
|
4'h0: begin
|
251 |
|
|
$display("res=%h",res);
|
252 |
|
|
icacheOn <= res[0];
|
253 |
|
|
dcacheOn <= res[1];
|
254 |
|
|
write_allocate <= res[2];
|
255 |
|
|
end
|
256 |
|
|
4'h1: dp <= res;
|
257 |
|
|
4'h5: lfsr <= res;
|
258 |
|
|
4'h6: dp8 <= res;
|
259 |
|
|
4'h7: abs8 <= res;
|
260 |
|
|
4'h8: begin vbr <= {res[31:9],9'h000}; nmoi <= res[0]; end
|
261 |
|
|
4'hE: begin sp <= res[7:0]; spage[31:8] <= res[31:8]; end
|
262 |
|
|
4'hF: begin isp <= res; gie <= 1'b1; end
|
263 |
|
|
endcase
|
264 |
|
|
end
|
265 |
|
|
`RR:
|
266 |
|
|
case(ir[23:20])
|
267 |
|
|
`ADD_RR: begin vf <= resv32; cf <= resc32; nf <= resn32; zf <= resz32; end
|
268 |
|
|
`SUB_RR:
|
269 |
|
|
if (Rt==4'h0) // CMP doesn't set overflow
|
270 |
|
|
begin cf <= ~resc32; nf <= resn32; zf <= resz32; end
|
271 |
|
|
else
|
272 |
|
|
begin vf <= resv32; cf <= ~resc32; nf <= resn32; zf <= resz32; end
|
273 |
|
|
`AND_RR:
|
274 |
|
|
if (Rt==4'h0) // BIT sets overflow
|
275 |
|
|
begin nf <= b[31]; vf <= b[30]; zf <= resz32; end
|
276 |
|
|
else
|
277 |
|
|
begin nf <= resn32; zf <= resz32; end
|
278 |
|
|
`OR_RR: begin nf <= resn32; zf <= resz32; end
|
279 |
|
|
`EOR_RR: begin nf <= resn32; zf <= resz32; end
|
280 |
|
|
`MUL_RR: begin nf <= resn32; zf <= resz32; end
|
281 |
|
|
`MULS_RR: begin nf <= resn32; zf <= resz32; end
|
282 |
|
|
`DIV_RR: begin nf <= resn32; zf <= resz32; end
|
283 |
|
|
`DIVS_RR: begin nf <= resn32; zf <= resz32; end
|
284 |
|
|
`MOD_RR: begin nf <= resn32; zf <= resz32; end
|
285 |
|
|
`MODS_RR: begin nf <= resn32; zf <= resz32; end
|
286 |
|
|
`ASL_RRR: begin nf <= resn32; zf <= resz32; end
|
287 |
|
|
`LSR_RRR: begin nf <= resn32; zf <= resz32; end
|
288 |
|
|
endcase
|
289 |
|
|
`LD_RR: begin zf <= resz32; nf <= resn32; end
|
290 |
|
|
`DEC_RR,`INC_RR: begin zf <= resz32; nf <= resn32; end
|
291 |
|
|
`ASL_RR,`ROL_RR,`LSR_RR,`ROR_RR: begin cf <= resc32; nf <= resn32; zf <= resz32; end
|
292 |
|
|
`ADD_IMM8,`ADD_IMM16,`ADD_IMM32,`ADD_ZPX,`ADD_IX,`ADD_IY,`ADD_ABS,`ADD_ABSX,`ADD_RIND:
|
293 |
|
|
begin vf <= resv32; cf <= resc32; nf <= resn32; zf <= resz32; end
|
294 |
|
|
`SUB_IMM8,`SUB_IMM16,`SUB_IMM32,`SUB_ZPX,`SUB_IX,`SUB_IY,`SUB_ABS,`SUB_ABSX,`SUB_RIND:
|
295 |
|
|
if (Rt==4'h0) // CMP doesn't set overflow
|
296 |
|
|
begin cf <= ~resc32; nf <= resn32; zf <= resz32; end
|
297 |
|
|
else
|
298 |
|
|
begin vf <= resv32; cf <= ~resc32; nf <= resn32; zf <= resz32; end
|
299 |
|
|
`AND_IMM8,`AND_IMM16,`AND_IMM32,`AND_ZPX,`AND_IX,`AND_IY,`AND_ABS,`AND_ABSX,`AND_RIND:
|
300 |
|
|
if (Rt==4'h0) // BIT sets overflow
|
301 |
|
|
begin nf <= b[31]; vf <= b[30]; zf <= resz32; end
|
302 |
|
|
else
|
303 |
|
|
begin nf <= resn32; zf <= resz32; end
|
304 |
|
|
`ORB_ZPX,`ORB_ABS,`ORB_ABSX,
|
305 |
|
|
`OR_IMM8,`OR_IMM16,`OR_IMM32,`OR_ZPX,`OR_IX,`OR_IY,`OR_ABS,`OR_ABSX,`OR_RIND,
|
306 |
|
|
`EOR_IMM8,`EOR_IMM16,`EOR_IMM32,`EOR_ZPX,`EOR_IX,`EOR_IY,`EOR_ABS,`EOR_ABSX,`EOR_RIND:
|
307 |
|
|
begin nf <= resn32; zf <= resz32; end
|
308 |
|
|
`ASL_ACC: begin acc <= res; cf <= resc32; nf <= resn32; zf <= resz32; end
|
309 |
|
|
`ROL_ACC: begin acc <= res; cf <= resc32; nf <= resn32; zf <= resz32; end
|
310 |
|
|
`LSR_ACC: begin acc <= res; cf <= resc32; nf <= resn32; zf <= resz32; end
|
311 |
|
|
`ROR_ACC: begin acc <= res; cf <= resc32; nf <= resn32; zf <= resz32; end
|
312 |
|
|
`ASL_ZPX,`ASL_ABS,`ASL_ABSX: begin cf <= resc32; nf <= resn32; zf <= resz32; end
|
313 |
|
|
`ROL_ZPX,`ROL_ABS,`ROL_ABSX: begin cf <= resc32; nf <= resn32; zf <= resz32; end
|
314 |
|
|
`LSR_ZPX,`LSR_ABS,`LSR_ABSX: begin cf <= resc32; nf <= resn32; zf <= resz32; end
|
315 |
|
|
`ROR_ZPX,`ROR_ABS,`ROR_ABSX: begin cf <= resc32; nf <= resn32; zf <= resz32; end
|
316 |
|
|
`ASL_IMM8: begin nf <= resn32; zf <= resz32; end
|
317 |
|
|
`LSR_IMM8: begin nf <= resn32; zf <= resz32; end
|
318 |
|
|
`INC_ZPX,`INC_ABS,`INC_ABSX: begin nf <= resn32; zf <= resz32; end
|
319 |
|
|
`DEC_ZPX,`DEC_ABS,`DEC_ABSX: begin nf <= resn32; zf <= resz32; end
|
320 |
|
|
`PLA: begin acc <= res; zf <= resz32; nf <= resn32; end
|
321 |
|
|
`PLX: begin x <= res; zf <= resz32; nf <= resn32; end
|
322 |
|
|
`PLY: begin y <= res; zf <= resz32; nf <= resn32; end
|
323 |
|
|
`LDX_IMM32,`LDX_IMM16,`LDX_IMM8,`LDX_ZPY,`LDX_ABS,`LDX_ABSY: begin x <= res; nf <= resn32; zf <= resz32; end
|
324 |
|
|
`LDY_IMM32,`LDY_ZPX,`LDY_ABS,`LDY_ABSX: begin y <= res; nf <= resn32; zf <= resz32; end
|
325 |
|
|
`CPX_IMM32,`CPX_ZPX,`CPX_ABS: begin cf <= ~resc32; nf <= resn32; zf <= resz32; end
|
326 |
|
|
`CPY_IMM32,`CPY_ZPX,`CPY_ABS: begin cf <= ~resc32; nf <= resn32; zf <= resz32; end
|
327 |
|
|
`CMP_IMM8: begin cf <= ~resc32; nf <= resn32; zf <= resz32; end
|
328 |
|
|
`LDA_IMM32,`LDA_IMM16,`LDA_IMM8: begin acc <= res; nf <= resn32; zf <= resz32; end
|
329 |
|
|
endcase
|
330 |
|
|
end
|
331 |
|
|
end
|
332 |
|
|
end
|