1 |
12 |
alfik |
/*
|
2 |
|
|
* Copyright 2010, Aleksander Osman, alfik@poczta.fm. All rights reserved.
|
3 |
|
|
*
|
4 |
|
|
* Redistribution and use in source and binary forms, with or without modification, are
|
5 |
|
|
* permitted provided that the following conditions are met:
|
6 |
|
|
*
|
7 |
|
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
8 |
|
|
* conditions and the following disclaimer.
|
9 |
|
|
*
|
10 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
11 |
|
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
12 |
|
|
* provided with the distribution.
|
13 |
|
|
*
|
14 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
15 |
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
16 |
|
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
|
17 |
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
18 |
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
19 |
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
20 |
|
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
21 |
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
22 |
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
23 |
|
|
*/
|
24 |
|
|
|
25 |
|
|
package ao68000_tool;
|
26 |
|
|
|
27 |
|
|
public class Microcode {
|
28 |
|
|
static void microcode(Parser p) throws Exception {
|
29 |
|
|
|
30 |
|
|
p.label("reset");
|
31 |
|
|
|
32 |
|
|
p .GROUP_0_FLAG_SET();
|
33 |
|
|
|
34 |
|
|
// wait for instruction prefetch
|
35 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
36 |
|
|
|
37 |
|
|
// move SSP and PC from prefetch
|
38 |
|
|
p .AN_INPUT_FROM_PREFETCH_IR().AN_ADDRESS_SSP().AN_WRITE_ENABLE_SET()
|
39 |
|
|
.PC_FROM_PREFETCH_IR()
|
40 |
|
|
// jump to main loop
|
41 |
|
|
.BRANCH_procedure().PROCEDURE_jump_to_main_loop();
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
p.label("MICROPC_ADDRESS_BUS_TRAP");
|
45 |
|
|
|
46 |
|
|
// save trap number and bus cycle extended information
|
47 |
|
|
p .TRAP_FROM_INTERRUPT()
|
48 |
|
|
.OP2_MOVE_ADDRESS_BUS_INFO()
|
49 |
|
|
// clear internal flags
|
50 |
|
|
.READ_MODIFY_WRITE_FLAG_CLEAR()
|
51 |
|
|
.INSTRUCTION_FLAG_SET()
|
52 |
|
|
.DO_READ_FLAG_CLEAR()
|
53 |
|
|
.DO_WRITE_FLAG_CLEAR()
|
54 |
|
|
.DO_INTERRUPT_FLAG_CLEAR()
|
55 |
|
|
|
56 |
|
|
// check if group_0_flag already active
|
57 |
|
|
.BRANCH_group_0_flag().offset("address_bus_trap_group_0_flag_cleared");
|
58 |
|
|
|
59 |
|
|
// if group_0_flag active: block processor
|
60 |
|
|
p .DO_BLOCKED_FLAG_SET()
|
61 |
|
|
.BRANCH_procedure()
|
62 |
|
|
.PROCEDURE_wait_finished();
|
63 |
|
|
|
64 |
|
|
// continue processing trap
|
65 |
|
|
p .label("address_bus_trap_group_0_flag_cleared");
|
66 |
|
|
p .GROUP_0_FLAG_SET();
|
67 |
|
|
|
68 |
|
|
//--
|
69 |
|
|
// move PC to OP1
|
70 |
|
|
p .OP1_FROM_PC();
|
71 |
|
|
// move OP1 to result
|
72 |
|
|
p .ALU_SIMPLE_MOVE()
|
73 |
|
|
// move SR to OP1
|
74 |
|
|
.OP1_FROM_SR();
|
75 |
|
|
|
76 |
|
|
// set supervisor, clear trace
|
77 |
|
|
p .ALU_SR_SET_TRAP();
|
78 |
|
|
|
79 |
|
|
//--
|
80 |
|
|
// stack PC
|
81 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
82 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
83 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
84 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea()
|
85 |
|
|
// move SR to result
|
86 |
|
|
.ALU_SIMPLE_MOVE()
|
87 |
|
|
// move IR to OP1
|
88 |
|
|
.OP1_FROM_IR();
|
89 |
|
|
|
90 |
|
|
// stack SR
|
91 |
|
|
p .SIZE_WORD().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
92 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
93 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
94 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea()
|
95 |
|
|
// move IR to result
|
96 |
|
|
.ALU_SIMPLE_MOVE()
|
97 |
|
|
// move fault address to OP1
|
98 |
|
|
.OP1_FROM_FAULT_ADDRESS();
|
99 |
|
|
|
100 |
|
|
//--
|
101 |
|
|
// stack IR
|
102 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
103 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
104 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea()
|
105 |
|
|
// move fault address to result
|
106 |
|
|
.ALU_SIMPLE_MOVE()
|
107 |
|
|
// move bus cycle info stored in OP2 to OP1
|
108 |
|
|
.OP1_FROM_OP2();
|
109 |
|
|
|
110 |
|
|
// stack fault address
|
111 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
112 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
113 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
114 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea()
|
115 |
|
|
// move bus cycle info from OP1 to result
|
116 |
|
|
.ALU_SIMPLE_MOVE();
|
117 |
|
|
|
118 |
|
|
// stack bus cycle info
|
119 |
|
|
p .SIZE_WORD().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
120 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
121 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
122 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
123 |
|
|
|
124 |
|
|
//--
|
125 |
|
|
// load PC from exception vector table
|
126 |
|
|
p .ADDRESS_FROM_TRAP()
|
127 |
|
|
.SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
128 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
129 |
|
|
p .ALU_SIMPLE_MOVE();
|
130 |
|
|
|
131 |
|
|
// wait for instruction prefetch
|
132 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
133 |
|
|
|
134 |
|
|
p .PC_FROM_RESULT();
|
135 |
|
|
|
136 |
|
|
// wait one cycle to check loaded PC: is it even ?
|
137 |
|
|
p .OP1_FROM_OP2();
|
138 |
|
|
//--
|
139 |
|
|
// jump to main loop
|
140 |
|
|
p .BRANCH_procedure().PROCEDURE_jump_to_main_loop();
|
141 |
|
|
|
142 |
|
|
p.label("MICROPC_TRAP_ENTRY");
|
143 |
|
|
|
144 |
|
|
//--
|
145 |
|
|
// move PC to OP1
|
146 |
|
|
p .OP1_FROM_PC();
|
147 |
|
|
// move OP1 to result
|
148 |
|
|
p .ALU_SIMPLE_MOVE()
|
149 |
|
|
// move SR to OP1
|
150 |
|
|
.OP1_FROM_SR();
|
151 |
|
|
|
152 |
|
|
// set supervisor, clear trace
|
153 |
|
|
p .ALU_SR_SET_TRAP();
|
154 |
|
|
|
155 |
|
|
//--
|
156 |
|
|
// stack PC
|
157 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
158 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
159 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
160 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea()
|
161 |
|
|
// move SR to result
|
162 |
|
|
.ALU_SIMPLE_MOVE();
|
163 |
|
|
|
164 |
|
|
// stack SR
|
165 |
|
|
p .SIZE_WORD().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
166 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
167 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
168 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
169 |
|
|
|
170 |
|
|
//--
|
171 |
|
|
// load PC from exception vector table
|
172 |
|
|
p .ADDRESS_FROM_TRAP()
|
173 |
|
|
.SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
174 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
175 |
|
|
p .ALU_SIMPLE_MOVE();
|
176 |
|
|
|
177 |
|
|
// wait for instruction prefetch
|
178 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
179 |
|
|
|
180 |
|
|
p .PC_FROM_RESULT();
|
181 |
|
|
|
182 |
|
|
// wait one cycle to check loaded PC: is it even ?
|
183 |
|
|
p .OP1_FROM_OP2();
|
184 |
|
|
|
185 |
|
|
//--
|
186 |
|
|
// return
|
187 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
188 |
|
|
|
189 |
|
|
|
190 |
|
|
p.label("MICROPC_MAIN_LOOP");
|
191 |
|
|
|
192 |
|
|
// check if stop flag set and wait for valid prefetch and decode instruction
|
193 |
|
|
// execute instruction, instruction generated trap possible
|
194 |
|
|
p .BRANCH_stop_flag_wait_ir_decode().offset("main_loop_after_execution")
|
195 |
|
|
// clear read-modify-write flag always
|
196 |
|
|
.READ_MODIFY_WRITE_FLAG_CLEAR()
|
197 |
|
|
|
198 |
|
|
// save trace flag, only when valid prefetch and valid instruction and stop flag cleared
|
199 |
|
|
.TRACE_FLAG_COPY_WHEN_NO_STOP()
|
200 |
|
|
|
201 |
|
|
// save first instruction word, only when prefetch valid and stop flag cleared
|
202 |
|
|
.IR_LOAD_WHEN_PREFETCH_VALID()
|
203 |
|
|
// clear group 0 flag, only when valid prefetch and stop flag cleared
|
204 |
|
|
.GROUP_0_FLAG_CLEAR_WHEN_VALID_PREFETCH()
|
205 |
|
|
|
206 |
|
|
// increment PC by 2, only when valid prefetch and valid instruction and stop flag cleared
|
207 |
|
|
.PC_INCR_BY_2_IN_MAIN_LOOP()
|
208 |
|
|
// clear instruction flag, only when valid prefetch and valid instruction and stop flag cleared
|
209 |
|
|
.INSTRUCTION_FLAG_CLEAR_IN_MAIN_LOOP();
|
210 |
|
|
|
211 |
|
|
// call trap
|
212 |
|
|
p .TRAP_FROM_DECODER()
|
213 |
|
|
.INSTRUCTION_FLAG_SET()
|
214 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
215 |
|
|
// after trap jump to main loop
|
216 |
|
|
p .BRANCH_procedure().PROCEDURE_jump_to_main_loop();
|
217 |
|
|
|
218 |
|
|
// jump here after execution
|
219 |
|
|
p .label("main_loop_after_execution");
|
220 |
|
|
|
221 |
|
|
// check if trace flag set and check external interrupt
|
222 |
|
|
p .BRANCH_trace_flag_and_interrupt().offset("main_loop_interrupt")
|
223 |
|
|
// set instruction flag, always
|
224 |
|
|
.INSTRUCTION_FLAG_SET();
|
225 |
|
|
|
226 |
|
|
// call trap
|
227 |
|
|
p .TRAP_TRACE()
|
228 |
|
|
.STOP_FLAG_CLEAR()
|
229 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
230 |
|
|
// after trap continue
|
231 |
|
|
|
232 |
|
|
// jump here if trace flag not set and interupt pending
|
233 |
|
|
p .label("main_loop_interrupt");
|
234 |
|
|
|
235 |
|
|
// check external interrupt
|
236 |
|
|
p .DO_INTERRUPT_FLAG_SET_IF_ACTIVE()
|
237 |
|
|
.BRANCH_procedure().PROCEDURE_interrupt_mask();
|
238 |
|
|
|
239 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_finished()
|
240 |
|
|
.ALU_SR_SET_INTERRUPT();
|
241 |
|
|
|
242 |
|
|
p .DO_INTERRUPT_FLAG_CLEAR()
|
243 |
|
|
.TRAP_FROM_INTERRUPT()
|
244 |
|
|
.STOP_FLAG_CLEAR()
|
245 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
246 |
|
|
|
247 |
|
|
// after trap jump to main loop
|
248 |
|
|
p .BRANCH_procedure().PROCEDURE_jump_to_main_loop();
|
249 |
|
|
|
250 |
|
|
// **************************************************************** EA
|
251 |
|
|
|
252 |
|
|
// load ea: to address register
|
253 |
|
|
|
254 |
|
|
// (An), (An)+:
|
255 |
|
|
p.label("MICROPC_LOAD_EA_An");
|
256 |
|
|
p.label("MICROPC_LOAD_EA_An_plus");
|
257 |
|
|
|
258 |
|
|
p .ADDRESS_FROM_AN_OUTPUT()
|
259 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
260 |
|
|
|
261 |
|
|
// -(An):
|
262 |
|
|
p.label("MICROPC_LOAD_EA_minus_An");
|
263 |
|
|
|
264 |
|
|
p .ADDRESS_FROM_AN_OUTPUT();
|
265 |
|
|
p .ADDRESS_DECR_BY_SIZE()
|
266 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
267 |
|
|
|
268 |
|
|
// (d16, An):
|
269 |
|
|
p.label("MICROPC_LOAD_EA_d16_An");
|
270 |
|
|
|
271 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
272 |
|
|
|
273 |
|
|
p .INDEX_0()
|
274 |
|
|
.OFFSET_IMM_16()
|
275 |
|
|
.PC_INCR_BY_2()
|
276 |
|
|
.ADDRESS_FROM_AN_OUTPUT();
|
277 |
|
|
|
278 |
|
|
p .ADDRESS_FROM_BASE_INDEX_OFFSET()
|
279 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
280 |
|
|
|
281 |
|
|
// (d8, An, Xn):
|
282 |
|
|
p.label("MICROPC_LOAD_EA_d8_An_Xn");
|
283 |
|
|
|
284 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid()
|
285 |
|
|
.ADDRESS_FROM_AN_OUTPUT();
|
286 |
|
|
|
287 |
|
|
p .AN_ADDRESS_FROM_EXTENDED()
|
288 |
|
|
.DN_ADDRESS_FROM_EXTENDED()
|
289 |
|
|
.OFFSET_IMM_8();
|
290 |
|
|
|
291 |
|
|
p .AN_ADDRESS_FROM_EXTENDED()
|
292 |
|
|
.INDEX_LOAD_EXTENDED()
|
293 |
|
|
.PC_INCR_BY_2();
|
294 |
|
|
|
295 |
|
|
p .ADDRESS_FROM_BASE_INDEX_OFFSET()
|
296 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
297 |
|
|
|
298 |
|
|
// (xxx).W:
|
299 |
|
|
p.label("MICROPC_LOAD_EA_xxx_W");
|
300 |
|
|
|
301 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
302 |
|
|
|
303 |
|
|
p .ADDRESS_FROM_IMM_16()
|
304 |
|
|
.PC_INCR_BY_2()
|
305 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
306 |
|
|
|
307 |
|
|
// (xxx).L:
|
308 |
|
|
p.label("MICROPC_LOAD_EA_xxx_L");
|
309 |
|
|
|
310 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
311 |
|
|
|
312 |
|
|
p .ADDRESS_FROM_IMM_32()
|
313 |
|
|
.PC_INCR_BY_4()
|
314 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
315 |
|
|
|
316 |
|
|
// (d16, PC):
|
317 |
|
|
p.label("MICROPC_LOAD_EA_d16_PC");
|
318 |
|
|
|
319 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
320 |
|
|
|
321 |
|
|
p .INDEX_0()
|
322 |
|
|
.OFFSET_IMM_16();
|
323 |
|
|
|
324 |
|
|
p .ADDRESS_FROM_PC_INDEX_OFFSET()
|
325 |
|
|
.PC_INCR_BY_2()
|
326 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
327 |
|
|
|
328 |
|
|
// (d8, PC, Xn):
|
329 |
|
|
p.label("MICROPC_LOAD_EA_d8_PC_Xn");
|
330 |
|
|
|
331 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
332 |
|
|
|
333 |
|
|
p .AN_ADDRESS_FROM_EXTENDED()
|
334 |
|
|
.DN_ADDRESS_FROM_EXTENDED()
|
335 |
|
|
.OFFSET_IMM_8();
|
336 |
|
|
|
337 |
|
|
p .AN_ADDRESS_FROM_EXTENDED()
|
338 |
|
|
.INDEX_LOAD_EXTENDED();
|
339 |
|
|
|
340 |
|
|
p .ADDRESS_FROM_PC_INDEX_OFFSET()
|
341 |
|
|
.PC_INCR_BY_2()
|
342 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
343 |
|
|
|
344 |
|
|
p.label("MICROPC_LOAD_EA_illegal_command");
|
345 |
|
|
|
346 |
|
|
// call trap
|
347 |
|
|
p .TRAP_ILLEGAL_INSTR()
|
348 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
349 |
|
|
// after trap jump to main loop
|
350 |
|
|
p .BRANCH_procedure().PROCEDURE_jump_to_main_loop();
|
351 |
|
|
|
352 |
|
|
|
353 |
|
|
// perform_ea_read: memory, Dn,An,immediate
|
354 |
|
|
|
355 |
|
|
// Dn:
|
356 |
|
|
p.label("MICROPC_PERFORM_EA_READ_Dn");
|
357 |
|
|
|
358 |
|
|
p .OP1_FROM_DN()
|
359 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
360 |
|
|
|
361 |
|
|
// An:
|
362 |
|
|
p.label("MICROPC_PERFORM_EA_READ_An");
|
363 |
|
|
|
364 |
|
|
p .OP1_FROM_AN()
|
365 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
366 |
|
|
|
367 |
|
|
// immediate
|
368 |
|
|
p.label("MICROPC_PERFORM_EA_READ_imm");
|
369 |
|
|
|
370 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
371 |
|
|
|
372 |
|
|
p .OP1_FROM_IMMEDIATE()
|
373 |
|
|
.PC_INCR_BY_SIZE()
|
374 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
375 |
|
|
|
376 |
|
|
// memory
|
377 |
|
|
p.label("MICROPC_PERFORM_EA_READ_memory");
|
378 |
|
|
|
379 |
|
|
p .DO_READ_FLAG_SET()
|
380 |
|
|
.BRANCH_procedure().PROCEDURE_wait_finished();
|
381 |
|
|
|
382 |
|
|
p .DO_READ_FLAG_CLEAR()
|
383 |
|
|
.OP1_FROM_DATA()
|
384 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
385 |
|
|
|
386 |
|
|
// perform ea write: memory, Dn,An
|
387 |
|
|
// size of operand matters: select in memory write
|
388 |
|
|
|
389 |
|
|
// Dn:
|
390 |
|
|
p.label("MICROPC_PERFORM_EA_WRITE_Dn");
|
391 |
|
|
|
392 |
|
|
p .DN_WRITE_ENABLE_SET()
|
393 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
394 |
|
|
|
395 |
|
|
|
396 |
|
|
// An:
|
397 |
|
|
p.label("MICROPC_PERFORM_EA_WRITE_An");
|
398 |
|
|
|
399 |
|
|
p .AN_WRITE_ENABLE_SET()
|
400 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
401 |
|
|
|
402 |
|
|
// memory:
|
403 |
|
|
p.label("MICROPC_PERFORM_EA_WRITE_memory");
|
404 |
|
|
|
405 |
|
|
p .DATA_WRITE_FROM_RESULT()
|
406 |
|
|
.DO_WRITE_FLAG_SET()
|
407 |
|
|
.BRANCH_procedure().PROCEDURE_wait_finished();
|
408 |
|
|
|
409 |
|
|
p .DO_WRITE_FLAG_CLEAR()
|
410 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
411 |
|
|
|
412 |
|
|
// save ea: (An)+,-(An)
|
413 |
|
|
|
414 |
|
|
// (An)+:
|
415 |
|
|
p.label("MICROPC_SAVE_EA_An_plus");
|
416 |
|
|
|
417 |
|
|
p .ADDRESS_INCR_BY_SIZE();
|
418 |
|
|
|
419 |
|
|
p .AN_INPUT_FROM_ADDRESS()
|
420 |
|
|
.AN_WRITE_ENABLE_SET()
|
421 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
422 |
|
|
|
423 |
|
|
// -(An)
|
424 |
|
|
p.label("MICROPC_SAVE_EA_minus_An");
|
425 |
|
|
|
426 |
|
|
p .AN_INPUT_FROM_ADDRESS()
|
427 |
|
|
.AN_WRITE_ENABLE_SET()
|
428 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
429 |
|
|
|
430 |
|
|
// **************************************************************** Instructions
|
431 |
|
|
|
432 |
|
|
p.label("MICROPC_MOVEP_memory_to_register");
|
433 |
|
|
|
434 |
|
|
p .SIZE_BYTE().EA_REG_IR_2_0().EA_MOD_INDIRECTOFFSET().EA_TYPE_ALL();
|
435 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
436 |
|
|
|
437 |
|
|
p .ALU_MOVEP_M2R_1()
|
438 |
|
|
.ADDRESS_INCR_BY_2()
|
439 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
440 |
|
|
|
441 |
|
|
p .ALU_MOVEP_M2R_2()
|
442 |
|
|
.ADDRESS_INCR_BY_2()
|
443 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
444 |
|
|
|
445 |
|
|
p .ALU_MOVEP_M2R_3()
|
446 |
|
|
.ADDRESS_INCR_BY_2()
|
447 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
448 |
|
|
|
449 |
|
|
p .ALU_MOVEP_M2R_4()
|
450 |
|
|
.SIZE_1().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
451 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
452 |
|
|
|
453 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
454 |
|
|
|
455 |
|
|
p.label("MICROPC_MOVEP_register_to_memory");
|
456 |
|
|
|
457 |
|
|
p .SIZE_1_PLUS().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
458 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
459 |
|
|
|
460 |
|
|
p .SIZE_BYTE().EA_REG_IR_2_0().EA_MOD_INDIRECTOFFSET().EA_TYPE_ALL();
|
461 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
462 |
|
|
|
463 |
|
|
p .ALU_MOVEP_R2M_1()
|
464 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
465 |
|
|
|
466 |
|
|
p .ADDRESS_INCR_BY_2()
|
467 |
|
|
.ALU_MOVEP_R2M_2()
|
468 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
469 |
|
|
|
470 |
|
|
p .BRANCH_movep_16().offset("movep_16");
|
471 |
|
|
|
472 |
|
|
p .ADDRESS_INCR_BY_2()
|
473 |
|
|
.ALU_MOVEP_R2M_3()
|
474 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
475 |
|
|
|
476 |
|
|
p .ADDRESS_INCR_BY_2()
|
477 |
|
|
.ALU_MOVEP_R2M_4()
|
478 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
479 |
|
|
|
480 |
|
|
// jump here if word operation
|
481 |
|
|
p .label("movep_16");
|
482 |
|
|
|
483 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
484 |
|
|
|
485 |
|
|
p.label("MICROPC_MOVEM_memory_to_register");
|
486 |
|
|
|
487 |
|
|
p .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
488 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
489 |
|
|
|
490 |
|
|
p .OP1_FROM_IMMEDIATE()
|
491 |
|
|
.PC_INCR_BY_SIZE();
|
492 |
|
|
|
493 |
|
|
p .MOVEM_REG_FROM_OP1()
|
494 |
|
|
.MOVEM_MODREG_LOAD_0()
|
495 |
|
|
.MOVEM_LOOP_LOAD_0()
|
496 |
|
|
.SIZE_2().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL_POSTINC();
|
497 |
|
|
|
498 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
499 |
|
|
|
500 |
|
|
// push current micro pc on stack
|
501 |
|
|
p .BRANCH_procedure().PROCEDURE_push_micropc();
|
502 |
|
|
|
503 |
|
|
// check if loop finished
|
504 |
|
|
p .BRANCH_movem_loop().offset("movem_memory_to_register_loop");
|
505 |
|
|
|
506 |
|
|
// check if operation on register required
|
507 |
|
|
p .BRANCH_movem_reg().offset("movem_memory_to_register_reg");
|
508 |
|
|
|
509 |
|
|
p .SIZE_2().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL_POSTINC();
|
510 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
511 |
|
|
|
512 |
|
|
p .ALU_SIGN_EXTEND()
|
513 |
|
|
.ADDRESS_INCR_BY_SIZE()
|
514 |
|
|
.SIZE_LONG().EA_REG_MOVEM_REG_2_0().EA_MOD_MOVEM_MOD_5_3().EA_TYPE_DN_AN();
|
515 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
516 |
|
|
|
517 |
|
|
// jump here if operation on register not required
|
518 |
|
|
p .label("movem_memory_to_register_reg");
|
519 |
|
|
|
520 |
|
|
p .MOVEM_MODREG_INCR_BY_1()
|
521 |
|
|
.MOVEM_REG_SHIFT_RIGHT()
|
522 |
|
|
.MOVEM_LOOP_INCR_BY_1()
|
523 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
524 |
|
|
|
525 |
|
|
// jump here if loop finished
|
526 |
|
|
p .label("movem_memory_to_register_loop");
|
527 |
|
|
|
528 |
|
|
p .BRANCH_procedure().PROCEDURE_pop_micropc()
|
529 |
|
|
.SIZE_2().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL_POSTINC();
|
530 |
|
|
|
531 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea()
|
532 |
|
|
.ADDRESS_DECR_BY_SIZE();
|
533 |
|
|
|
534 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
535 |
|
|
|
536 |
|
|
p.label("MICROPC_MOVEM_register_to_memory_predecrement");
|
537 |
|
|
|
538 |
|
|
p .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
539 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
540 |
|
|
|
541 |
|
|
p .OP1_FROM_IMMEDIATE()
|
542 |
|
|
.PC_INCR_BY_SIZE();
|
543 |
|
|
|
544 |
|
|
p .MOVEM_REG_FROM_OP1()
|
545 |
|
|
.MOVEM_MODREG_LOAD_6b001111()
|
546 |
|
|
.MOVEM_LOOP_LOAD_0()
|
547 |
|
|
.SIZE_2().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROLALTER_PREDEC();
|
548 |
|
|
|
549 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
550 |
|
|
|
551 |
|
|
// push current micro pc on stack
|
552 |
|
|
p .BRANCH_procedure().PROCEDURE_push_micropc();
|
553 |
|
|
|
554 |
|
|
// check if loop finished
|
555 |
|
|
p .BRANCH_movem_loop().offset("movem_register_to_memory_predecrement_loop");
|
556 |
|
|
|
557 |
|
|
// check if operation on register required
|
558 |
|
|
p .BRANCH_movem_reg().offset("movem_register_to_memory_predecrement_reg");
|
559 |
|
|
|
560 |
|
|
p .SIZE_2().EA_REG_MOVEM_REG_2_0().EA_MOD_MOVEM_MOD_5_3().EA_TYPE_DN_AN();
|
561 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
562 |
|
|
|
563 |
|
|
p .ALU_SIGN_EXTEND()
|
564 |
|
|
.SIZE_2().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROLALTER_PREDEC();
|
565 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
566 |
|
|
|
567 |
|
|
p .ADDRESS_DECR_BY_SIZE();
|
568 |
|
|
|
569 |
|
|
// jump here if operation on register not required
|
570 |
|
|
p .label("movem_register_to_memory_predecrement_reg");
|
571 |
|
|
|
572 |
|
|
p .MOVEM_MODREG_DECR_BY_1()
|
573 |
|
|
.MOVEM_REG_SHIFT_RIGHT()
|
574 |
|
|
.MOVEM_LOOP_INCR_BY_1()
|
575 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
576 |
|
|
|
577 |
|
|
// jump here if loop finished
|
578 |
|
|
p .label("movem_register_to_memory_predecrement_loop");
|
579 |
|
|
|
580 |
|
|
p .BRANCH_procedure().PROCEDURE_pop_micropc()
|
581 |
|
|
.ADDRESS_INCR_BY_SIZE();
|
582 |
|
|
|
583 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
584 |
|
|
|
585 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
586 |
|
|
|
587 |
|
|
p.label("MICROPC_MOVEM_register_to_memory_control");
|
588 |
|
|
|
589 |
|
|
p .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
590 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
591 |
|
|
|
592 |
|
|
p .OP1_FROM_IMMEDIATE()
|
593 |
|
|
.PC_INCR_BY_SIZE();
|
594 |
|
|
|
595 |
|
|
p .MOVEM_REG_FROM_OP1()
|
596 |
|
|
.MOVEM_MODREG_LOAD_0()
|
597 |
|
|
.MOVEM_LOOP_LOAD_0()
|
598 |
|
|
.SIZE_2().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROLALTER_PREDEC();
|
599 |
|
|
|
600 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
601 |
|
|
|
602 |
|
|
// push current micro pc on stack
|
603 |
|
|
p .BRANCH_procedure().PROCEDURE_push_micropc();
|
604 |
|
|
|
605 |
|
|
// check if loop finished
|
606 |
|
|
p .BRANCH_movem_loop().offset("movem_register_to_memory_control_loop");
|
607 |
|
|
|
608 |
|
|
// check if operation on register required
|
609 |
|
|
p .BRANCH_movem_reg().offset("movem_register_to_memory_control_reg");
|
610 |
|
|
|
611 |
|
|
p .SIZE_2().EA_REG_MOVEM_REG_2_0().EA_MOD_MOVEM_MOD_5_3().EA_TYPE_DN_AN();
|
612 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
613 |
|
|
|
614 |
|
|
p .ALU_SIGN_EXTEND()
|
615 |
|
|
.SIZE_2().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROLALTER_PREDEC();
|
616 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
617 |
|
|
|
618 |
|
|
p .ADDRESS_INCR_BY_SIZE();
|
619 |
|
|
|
620 |
|
|
// jump here if operation on register not required
|
621 |
|
|
p .label("movem_register_to_memory_control_reg");
|
622 |
|
|
|
623 |
|
|
p .MOVEM_MODREG_INCR_BY_1()
|
624 |
|
|
.MOVEM_REG_SHIFT_RIGHT()
|
625 |
|
|
.MOVEM_LOOP_INCR_BY_1()
|
626 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
627 |
|
|
|
628 |
|
|
// jump here if loop finished
|
629 |
|
|
p .label("movem_register_to_memory_control_loop");
|
630 |
|
|
|
631 |
|
|
p .BRANCH_procedure().PROCEDURE_pop_micropc();
|
632 |
|
|
|
633 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
634 |
|
|
|
635 |
|
|
p.label("MICROPC_LEA");
|
636 |
|
|
|
637 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL();
|
638 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
639 |
|
|
|
640 |
|
|
p .OP1_FROM_ADDRESS();
|
641 |
|
|
|
642 |
|
|
p .ALU_SIMPLE_MOVE()
|
643 |
|
|
.SIZE_LONG().EA_REG_IR_11_9().EA_MOD_AN().EA_TYPE_ALL();
|
644 |
|
|
|
645 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
646 |
|
|
|
647 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
648 |
|
|
|
649 |
|
|
p.label("MICROPC_PEA");
|
650 |
|
|
|
651 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL();
|
652 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
653 |
|
|
|
654 |
|
|
p .OP1_FROM_ADDRESS();
|
655 |
|
|
|
656 |
|
|
p .ALU_SIMPLE_MOVE()
|
657 |
|
|
.SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
658 |
|
|
|
659 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
660 |
|
|
|
661 |
|
|
p .BRANCH_procedure().PROCEDURE_call_write();
|
662 |
|
|
|
663 |
|
|
p.label("MICROPC_ANDI_EORI_ORI_ADDI_SUBI");
|
664 |
|
|
//+++
|
665 |
|
|
p .SIZE_3().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
666 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
667 |
|
|
|
668 |
|
|
p .OP1_FROM_IMMEDIATE()
|
669 |
|
|
.PC_INCR_BY_SIZE()
|
670 |
|
|
|
671 |
|
|
.SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
672 |
|
|
|
673 |
|
|
p .OP2_FROM_OP1()
|
674 |
|
|
.BRANCH_procedure().PROCEDURE_call_read();
|
675 |
|
|
|
676 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
677 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
678 |
|
|
|
679 |
|
|
p.label("MICROPC_ORI_to_CCR_ORI_to_SR_ANDI_to_CCR_ANDI_to_SR_EORI_to_CCR_EORI_to_SR");
|
680 |
|
|
//+
|
681 |
|
|
p .SIZE_3().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
682 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
683 |
|
|
|
684 |
|
|
p .OP1_FROM_IMMEDIATE()
|
685 |
|
|
.PC_INCR_BY_SIZE();
|
686 |
|
|
|
687 |
|
|
p .OP2_FROM_OP1()
|
688 |
|
|
.OP1_FROM_SR();
|
689 |
|
|
|
690 |
|
|
p .ALU_ARITHMETIC_LOGIC();
|
691 |
|
|
|
692 |
|
|
p .OP1_FROM_RESULT();
|
693 |
|
|
|
694 |
|
|
p .ALU_MOVE_TO_CCR_SR_RTE_RTR_STOP_LOGIC_TO_CCR_SR()
|
695 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
696 |
|
|
|
697 |
|
|
p.label("MICROPC_CMPI");
|
698 |
|
|
//+
|
699 |
|
|
p .SIZE_3().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
700 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
701 |
|
|
|
702 |
|
|
p .OP1_FROM_IMMEDIATE()
|
703 |
|
|
.PC_INCR_BY_SIZE()
|
704 |
|
|
|
705 |
|
|
.SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
706 |
|
|
|
707 |
|
|
p .OP2_FROM_OP1()
|
708 |
|
|
.BRANCH_procedure().PROCEDURE_call_read();
|
709 |
|
|
|
710 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
711 |
|
|
.BRANCH_procedure().PROCEDURE_call_save_ea();
|
712 |
|
|
|
713 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
714 |
|
|
|
715 |
|
|
p.label("MICROPC_ABCD_SBCD_ADDX_SUBX");
|
716 |
|
|
|
717 |
|
|
p .SIZE_3().EA_REG_IR_2_0().EA_MOD_DN_PREDEC().EA_TYPE_ALL();
|
718 |
|
|
|
719 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
720 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
721 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
722 |
|
|
|
723 |
|
|
p .OP2_FROM_OP1()
|
724 |
|
|
.SIZE_3().EA_REG_IR_11_9().EA_MOD_DN_PREDEC().EA_TYPE_ALL();
|
725 |
|
|
|
726 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
727 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
728 |
|
|
|
729 |
|
|
p .ALU_ABCD_SBCD_ADDX_SUBX()
|
730 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
731 |
|
|
|
732 |
|
|
p.label("MICROPC_EXG");
|
733 |
|
|
|
734 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DN_AN();
|
735 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
736 |
|
|
|
737 |
|
|
p .ALU_SIMPLE_MOVE()
|
738 |
|
|
.SIZE_LONG().EA_REG_IR_11_9().EA_MOD_DN_AN_EXG().EA_TYPE_ALL();
|
739 |
|
|
|
740 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
741 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
742 |
|
|
|
743 |
|
|
p .ALU_SIMPLE_MOVE()
|
744 |
|
|
.SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DN_AN();
|
745 |
|
|
|
746 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
747 |
|
|
|
748 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
749 |
|
|
|
750 |
|
|
|
751 |
|
|
p.label("MICROPC_CMPM");
|
752 |
|
|
|
753 |
|
|
p .SIZE_3().EA_REG_IR_2_0().EA_MOD_POSTINC().EA_TYPE_ALL();
|
754 |
|
|
|
755 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
756 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
757 |
|
|
|
758 |
|
|
p .OP2_FROM_OP1()
|
759 |
|
|
.SIZE_3().EA_REG_IR_11_9().EA_MOD_POSTINC().EA_TYPE_ALL();
|
760 |
|
|
|
761 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
762 |
|
|
|
763 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
764 |
|
|
.BRANCH_procedure().PROCEDURE_call_save_ea();
|
765 |
|
|
|
766 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
767 |
|
|
|
768 |
|
|
p.label("MICROPC_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_all_immediate_register");
|
769 |
|
|
|
770 |
|
|
p .SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
771 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
772 |
|
|
|
773 |
|
|
p .OP2_FROM_OP1()
|
774 |
|
|
.SIZE_3().EA_REG_IR_2_0().EA_MOD_DN().EA_TYPE_ALL();
|
775 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
776 |
|
|
|
777 |
|
|
p .OP2_LOAD_COUNT();
|
778 |
|
|
|
779 |
|
|
p .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_prepare();
|
780 |
|
|
|
781 |
|
|
p .BRANCH_procedure().PROCEDURE_push_micropc();
|
782 |
|
|
|
783 |
|
|
p .BRANCH_operand2().offset("shift_rotate_immediate_loop");
|
784 |
|
|
|
785 |
|
|
p .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR();
|
786 |
|
|
p .OP1_FROM_RESULT()
|
787 |
|
|
.OP2_DECR_BY_1()
|
788 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
789 |
|
|
|
790 |
|
|
// jump here if loop finished
|
791 |
|
|
p .label("shift_rotate_immediate_loop");
|
792 |
|
|
|
793 |
|
|
p .BRANCH_procedure().PROCEDURE_pop_micropc();
|
794 |
|
|
|
795 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
796 |
|
|
|
797 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
798 |
|
|
|
799 |
|
|
p.label("MICROPC_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_all_memory");
|
800 |
|
|
|
801 |
|
|
p .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_MEMORYALTER();
|
802 |
|
|
|
803 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
804 |
|
|
|
805 |
|
|
p .OP2_LOAD_1();
|
806 |
|
|
|
807 |
|
|
p .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_prepare();
|
808 |
|
|
p .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR();
|
809 |
|
|
|
810 |
|
|
p .BRANCH_procedure().PROCEDURE_call_write();
|
811 |
|
|
|
812 |
|
|
p.label("MICROPC_MOVE");
|
813 |
|
|
|
814 |
|
|
p .SIZE_4().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
|
815 |
|
|
|
816 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
817 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
818 |
|
|
|
819 |
|
|
p .ALU_SIMPLE_MOVE()
|
820 |
|
|
.SIZE_4().EA_REG_IR_11_9().EA_MOD_IR_8_6().EA_TYPE_DATAALTER();
|
821 |
|
|
|
822 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
823 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
824 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
825 |
|
|
p .ALU_MOVE()
|
826 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
827 |
|
|
|
828 |
|
|
p.label("MICROPC_MOVEA");
|
829 |
|
|
|
830 |
|
|
p .SIZE_4().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
|
831 |
|
|
|
832 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
833 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
834 |
|
|
|
835 |
|
|
p .ALU_SIGN_EXTEND()
|
836 |
|
|
.SIZE_4().EA_REG_IR_11_9().EA_MOD_AN().EA_TYPE_ALL();
|
837 |
|
|
|
838 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
839 |
|
|
|
840 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
841 |
|
|
|
842 |
|
|
p.label("MICROPC_EOR");
|
843 |
|
|
|
844 |
|
|
p .SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
845 |
|
|
|
846 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
847 |
|
|
|
848 |
|
|
p .OP2_FROM_OP1()
|
849 |
|
|
.SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
850 |
|
|
|
851 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
852 |
|
|
|
853 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
854 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
855 |
|
|
|
856 |
|
|
p.label("MICROPC_ADD_to_mem_SUB_to_mem_AND_to_mem_OR_to_mem");
|
857 |
|
|
|
858 |
|
|
p .SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
859 |
|
|
|
860 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
861 |
|
|
|
862 |
|
|
p .OP2_FROM_OP1()
|
863 |
|
|
.SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_MEMORYALTER();
|
864 |
|
|
|
865 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
866 |
|
|
|
867 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
868 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
869 |
|
|
|
870 |
|
|
p.label("MICROPC_ADD_to_Dn_SUB_to_Dn_AND_to_Dn_OR_to_Dn");
|
871 |
|
|
|
872 |
|
|
p .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
|
873 |
|
|
|
874 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
875 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
876 |
|
|
|
877 |
|
|
p .OP2_FROM_OP1()
|
878 |
|
|
.SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
879 |
|
|
|
880 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
881 |
|
|
|
882 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
883 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
884 |
|
|
|
885 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
886 |
|
|
|
887 |
|
|
p.label("MICROPC_CMP");
|
888 |
|
|
|
889 |
|
|
p .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
|
890 |
|
|
|
891 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
892 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
893 |
|
|
|
894 |
|
|
p .OP2_FROM_OP1()
|
895 |
|
|
.SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
896 |
|
|
|
897 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
898 |
|
|
|
899 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
900 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
901 |
|
|
|
902 |
|
|
p.label("MICROPC_ADDA_SUBA");
|
903 |
|
|
|
904 |
|
|
p .SIZE_5().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
|
905 |
|
|
|
906 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
907 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
908 |
|
|
|
909 |
|
|
p .OP2_FROM_OP1()
|
910 |
|
|
.SIZE_LONG().EA_REG_IR_11_9().EA_MOD_AN().EA_TYPE_ALL();
|
911 |
|
|
|
912 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
913 |
|
|
|
914 |
|
|
p .ALU_ADDA_SUBA_CMPA_ADDQ_SUBQ()
|
915 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
916 |
|
|
|
917 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
918 |
|
|
|
919 |
|
|
p.label("MICROPC_CMPA");
|
920 |
|
|
|
921 |
|
|
p .SIZE_5().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
|
922 |
|
|
|
923 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
924 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
925 |
|
|
|
926 |
|
|
p .OP2_FROM_OP1()
|
927 |
|
|
.SIZE_LONG().EA_REG_IR_11_9().EA_MOD_AN().EA_TYPE_ALL();
|
928 |
|
|
|
929 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
930 |
|
|
|
931 |
|
|
p .ALU_ADDA_SUBA_CMPA_ADDQ_SUBQ()
|
932 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
933 |
|
|
|
934 |
|
|
p.label("MICROPC_CHK");
|
935 |
|
|
|
936 |
|
|
p .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
|
937 |
|
|
|
938 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
939 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
940 |
|
|
|
941 |
|
|
p .OP2_FROM_OP1()
|
942 |
|
|
.SIZE_WORD().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
943 |
|
|
|
944 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
945 |
|
|
|
946 |
|
|
p .ALU_CHK();
|
947 |
|
|
|
948 |
13 |
alfik |
p .BRANCH_alu_signal().offset("chk_no_trap");
|
949 |
12 |
alfik |
p .TRAP_CHK()
|
950 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
951 |
|
|
// after return continue
|
952 |
|
|
|
953 |
|
|
// jump here if no trap
|
954 |
|
|
p .label("chk_no_trap");
|
955 |
|
|
|
956 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
957 |
|
|
|
958 |
|
|
p.label("MICROPC_MULS_MULU_DIVS_DIVU");
|
959 |
|
|
|
960 |
|
|
p .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
|
961 |
|
|
|
962 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
963 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
964 |
|
|
|
965 |
|
|
p .OP2_FROM_OP1()
|
966 |
|
|
.SIZE_LONG().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
967 |
|
|
|
968 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
969 |
|
|
|
970 |
13 |
alfik |
p .ALU_MULS_MULU_DIVS_DIVU();
|
971 |
12 |
alfik |
|
972 |
13 |
alfik |
p .BRANCH_alu_signal().offset("div_no_div_by_zero_trap");
|
973 |
12 |
alfik |
p .TRAP_DIV_BY_ZERO()
|
974 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
975 |
|
|
// return after return
|
976 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
977 |
|
|
|
978 |
|
|
// jump here if no trap
|
979 |
|
|
p .label("div_no_div_by_zero_trap");
|
980 |
|
|
|
981 |
|
|
// push current micro pc on stack
|
982 |
|
|
p .BRANCH_procedure().PROCEDURE_push_micropc();
|
983 |
|
|
|
984 |
13 |
alfik |
// check if operation finished
|
985 |
|
|
p .BRANCH_alu_mult_div_ready().offset("mult_div_loop");
|
986 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
987 |
12 |
alfik |
|
988 |
|
|
// jump here after first loop finished
|
989 |
13 |
alfik |
p .label("mult_div_loop");
|
990 |
12 |
alfik |
|
991 |
|
|
p .ALU_MULS_MULU_DIVS_DIVU()
|
992 |
|
|
.BRANCH_procedure().PROCEDURE_pop_micropc();
|
993 |
|
|
|
994 |
13 |
alfik |
p .BRANCH_alu_signal().offset("mult_div_no_overflow");
|
995 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
996 |
12 |
alfik |
|
997 |
|
|
// jump here if overflow
|
998 |
13 |
alfik |
p .label("mult_div_no_overflow");
|
999 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1000 |
12 |
alfik |
p .BRANCH_procedure().PROCEDURE_return();
|
1001 |
|
|
|
1002 |
|
|
p.label("MICROPC_MOVEQ");
|
1003 |
|
|
|
1004 |
|
|
p .OP1_MOVEQ()
|
1005 |
|
|
.SIZE_LONG().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
1006 |
|
|
|
1007 |
|
|
p .ALU_MOVE()
|
1008 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1009 |
|
|
|
1010 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1011 |
|
|
|
1012 |
|
|
p.label("MICROPC_BCHG_BCLR_BSET_immediate");
|
1013 |
|
|
|
1014 |
|
|
p .SIZE_BYTE().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
1015 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
1016 |
|
|
|
1017 |
|
|
p .OP1_FROM_IMMEDIATE()
|
1018 |
|
|
.PC_INCR_BY_SIZE();
|
1019 |
|
|
|
1020 |
|
|
p .OP2_FROM_OP1()
|
1021 |
|
|
.SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1022 |
|
|
|
1023 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1024 |
|
|
|
1025 |
|
|
p .ALU_BCHG_BCLR_BSET_BTST()
|
1026 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
1027 |
|
|
|
1028 |
|
|
p.label("MICROPC_BTST_immediate");
|
1029 |
|
|
|
1030 |
|
|
p .SIZE_BYTE().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
1031 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
1032 |
|
|
|
1033 |
|
|
p .OP1_FROM_IMMEDIATE()
|
1034 |
|
|
.PC_INCR_BY_SIZE();
|
1035 |
|
|
|
1036 |
|
|
p .OP2_FROM_OP1()
|
1037 |
|
|
.SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
|
1038 |
|
|
|
1039 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1040 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1041 |
|
|
|
1042 |
|
|
p .ALU_BCHG_BCLR_BSET_BTST()
|
1043 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1044 |
|
|
|
1045 |
|
|
p.label("MICROPC_BCHG_BCLR_BSET_register");
|
1046 |
|
|
|
1047 |
|
|
p .SIZE_6().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
1048 |
|
|
|
1049 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1050 |
|
|
|
1051 |
|
|
p .OP2_FROM_OP1()
|
1052 |
|
|
.SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1053 |
|
|
|
1054 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1055 |
|
|
|
1056 |
|
|
p .ALU_BCHG_BCLR_BSET_BTST()
|
1057 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
1058 |
|
|
|
1059 |
|
|
p.label("MICROPC_BTST_register");
|
1060 |
|
|
|
1061 |
|
|
p .SIZE_6().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
|
1062 |
|
|
|
1063 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1064 |
|
|
|
1065 |
|
|
p .OP2_FROM_OP1()
|
1066 |
|
|
.SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
|
1067 |
|
|
|
1068 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1069 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1070 |
|
|
|
1071 |
|
|
p .ALU_BCHG_BCLR_BSET_BTST()
|
1072 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1073 |
|
|
|
1074 |
|
|
p.label("MICROPC_TAS");
|
1075 |
|
|
|
1076 |
|
|
p .READ_MODIFY_WRITE_FLAG_SET()
|
1077 |
|
|
.SIZE_BYTE().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1078 |
|
|
|
1079 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1080 |
|
|
|
1081 |
|
|
p .ALU_TAS()
|
1082 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1083 |
|
|
|
1084 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1085 |
|
|
|
1086 |
|
|
p .READ_MODIFY_WRITE_FLAG_CLEAR()
|
1087 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1088 |
|
|
|
1089 |
|
|
p.label("MICROPC_NEGX_CLR_NEG_NOT_NBCD");
|
1090 |
|
|
|
1091 |
|
|
p .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1092 |
|
|
|
1093 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1094 |
|
|
|
1095 |
|
|
p .ALU_NEGX_CLR_NEG_NOT_NBCD_SWAP_EXT()
|
1096 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
1097 |
|
|
|
1098 |
|
|
p.label("MICROPC_SWAP_EXT");
|
1099 |
|
|
|
1100 |
|
|
p .SIZE_2().EA_REG_IR_2_0().EA_MOD_DN().EA_TYPE_ALL();
|
1101 |
|
|
|
1102 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1103 |
|
|
|
1104 |
|
|
p .ALU_NEGX_CLR_NEG_NOT_NBCD_SWAP_EXT()
|
1105 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1106 |
|
|
|
1107 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1108 |
|
|
|
1109 |
|
|
p.label("MICROPC_TST");
|
1110 |
|
|
|
1111 |
|
|
p .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1112 |
|
|
|
1113 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1114 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1115 |
|
|
|
1116 |
|
|
p .ALU_MOVE()
|
1117 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1118 |
|
|
|
1119 |
|
|
p.label("MICROPC_ADDQ_SUBQ_not_An");
|
1120 |
|
|
|
1121 |
|
|
p .OP2_ADDQ_SUBQ()
|
1122 |
|
|
.SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1123 |
|
|
|
1124 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1125 |
|
|
|
1126 |
|
|
p .ALU_ARITHMETIC_LOGIC()
|
1127 |
|
|
.BRANCH_procedure().PROCEDURE_call_write();
|
1128 |
|
|
|
1129 |
|
|
p.label("MICROPC_ADDQ_SUBQ_An");
|
1130 |
|
|
|
1131 |
|
|
p .OP2_ADDQ_SUBQ()
|
1132 |
|
|
.SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
|
1133 |
|
|
|
1134 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1135 |
|
|
|
1136 |
|
|
p .ALU_ADDA_SUBA_CMPA_ADDQ_SUBQ()
|
1137 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1138 |
|
|
|
1139 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1140 |
|
|
|
1141 |
|
|
p.label("MICROPC_Scc");
|
1142 |
|
|
|
1143 |
|
|
p .BRANCH_condition_0().offset("scc_condition_0");
|
1144 |
|
|
p .OP1_LOAD_ONES();
|
1145 |
|
|
|
1146 |
|
|
// jump here if condition is false
|
1147 |
|
|
p .label("scc_condition_0");
|
1148 |
|
|
|
1149 |
|
|
p .BRANCH_condition_1().offset("scc_condition_1");
|
1150 |
|
|
p .OP1_LOAD_ZEROS();
|
1151 |
|
|
|
1152 |
|
|
// jump here if condition is true
|
1153 |
|
|
p .label("scc_condition_1");
|
1154 |
|
|
|
1155 |
|
|
p .ALU_SIMPLE_MOVE()
|
1156 |
|
|
.SIZE_BYTE().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1157 |
|
|
|
1158 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
1159 |
|
|
p .BRANCH_procedure().PROCEDURE_call_write();
|
1160 |
|
|
|
1161 |
|
|
p.label("MICROPC_Bcc_BRA");
|
1162 |
|
|
|
1163 |
|
|
p .OP1_FROM_PC();
|
1164 |
|
|
|
1165 |
|
|
p .ALU_SIMPLE_MOVE()
|
1166 |
|
|
.BRANCH_ir().offset("bcc_bra_no_word");
|
1167 |
|
|
|
1168 |
|
|
p .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
1169 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
1170 |
|
|
|
1171 |
|
|
p .OP1_FROM_IMMEDIATE()
|
1172 |
|
|
.PC_INCR_BY_SIZE();
|
1173 |
|
|
|
1174 |
|
|
// jump here if no need to load extra immediate word
|
1175 |
|
|
p .label("bcc_bra_no_word");
|
1176 |
|
|
|
1177 |
|
|
p .BRANCH_condition_0().offset("bcc_bra_no_branch");
|
1178 |
|
|
|
1179 |
|
|
p .OP2_FROM_OP1();
|
1180 |
|
|
p .OP2_MOVE_OFFSET()
|
1181 |
|
|
.OP1_FROM_RESULT();
|
1182 |
|
|
|
1183 |
|
|
p .ALU_SIMPLE_LONG_ADD();
|
1184 |
|
|
|
1185 |
|
|
// wait for instruction prefetch
|
1186 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
1187 |
|
|
|
1188 |
|
|
p .PC_FROM_RESULT();
|
1189 |
|
|
|
1190 |
|
|
// wait for PC check
|
1191 |
|
|
p .ALU_SIMPLE_MOVE();
|
1192 |
|
|
|
1193 |
|
|
// jump here if no branch
|
1194 |
|
|
p .label("bcc_bra_no_branch");
|
1195 |
|
|
|
1196 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1197 |
|
|
|
1198 |
|
|
p.label("MICROPC_DBcc");
|
1199 |
|
|
|
1200 |
|
|
p .BRANCH_condition_1().offset("dbcc_condition_true");
|
1201 |
|
|
|
1202 |
|
|
p .OP2_LOAD_1()
|
1203 |
|
|
.SIZE_WORD().EA_REG_IR_2_0().EA_MOD_DN().EA_TYPE_ALL();
|
1204 |
|
|
|
1205 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1206 |
|
|
|
1207 |
|
|
p .ALU_SIMPLE_LONG_SUB();
|
1208 |
|
|
|
1209 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1210 |
|
|
|
1211 |
|
|
p .OP1_FROM_PC()
|
1212 |
|
|
.SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
1213 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
1214 |
|
|
|
1215 |
|
|
p .BRANCH_result().offset("dbcc_condition_true");
|
1216 |
|
|
|
1217 |
|
|
p .OP1_FROM_IMMEDIATE()
|
1218 |
|
|
.ALU_SIMPLE_MOVE();
|
1219 |
|
|
|
1220 |
|
|
p .OP2_FROM_OP1()
|
1221 |
|
|
.OP1_FROM_RESULT();
|
1222 |
|
|
|
1223 |
|
|
p .ALU_SIMPLE_LONG_ADD()
|
1224 |
|
|
// wait for instruction prefetch
|
1225 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
1226 |
|
|
|
1227 |
|
|
p .PC_FROM_RESULT();
|
1228 |
|
|
|
1229 |
|
|
// wait for PC check
|
1230 |
|
|
p .ALU_SIMPLE_MOVE();
|
1231 |
|
|
|
1232 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1233 |
|
|
|
1234 |
|
|
// jump here if condition is true
|
1235 |
|
|
p .label("dbcc_condition_true");
|
1236 |
|
|
|
1237 |
|
|
p .PC_INCR_BY_2()
|
1238 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1239 |
|
|
|
1240 |
|
|
p.label("MICROPC_MOVE_FROM_SR");
|
1241 |
|
|
|
1242 |
|
|
p .OP1_FROM_SR()
|
1243 |
|
|
.SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
|
1244 |
|
|
|
1245 |
|
|
p .ALU_SIMPLE_MOVE()
|
1246 |
|
|
.BRANCH_procedure().PROCEDURE_call_load_ea();
|
1247 |
|
|
|
1248 |
|
|
p .BRANCH_procedure().PROCEDURE_call_write();
|
1249 |
|
|
|
1250 |
|
|
p.label("MICROPC_MOVE_TO_CCR_MOVE_TO_SR");
|
1251 |
|
|
|
1252 |
|
|
p .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
|
1253 |
|
|
|
1254 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1255 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1256 |
|
|
|
1257 |
|
|
p .ALU_MOVE_TO_CCR_SR_RTE_RTR_STOP_LOGIC_TO_CCR_SR()
|
1258 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1259 |
|
|
|
1260 |
|
|
p.label("MICROPC_MOVE_USP_to_USP");
|
1261 |
|
|
|
1262 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
|
1263 |
|
|
|
1264 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1265 |
|
|
|
1266 |
|
|
p .ALU_SIMPLE_MOVE();
|
1267 |
|
|
|
1268 |
|
|
p .AN_ADDRESS_USP()
|
1269 |
|
|
.AN_WRITE_ENABLE_SET();
|
1270 |
|
|
|
1271 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1272 |
|
|
|
1273 |
|
|
|
1274 |
|
|
p.label("MICROPC_MOVE_USP_to_An");
|
1275 |
|
|
|
1276 |
|
|
p .OP1_FROM_USP()
|
1277 |
|
|
.SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
|
1278 |
|
|
|
1279 |
|
|
p .ALU_SIMPLE_MOVE()
|
1280 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1281 |
|
|
|
1282 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1283 |
|
|
|
1284 |
|
|
p.label("MICROPC_LINK");
|
1285 |
|
|
|
1286 |
|
|
// load An to OP1
|
1287 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
|
1288 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1289 |
|
|
|
1290 |
|
|
// move OP1 to result
|
1291 |
|
|
p .ALU_LINK_MOVE()
|
1292 |
|
|
.SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
1293 |
|
|
|
1294 |
|
|
// write result to (SP)
|
1295 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
1296 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1297 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1298 |
|
|
|
1299 |
|
|
// load SP to OP1
|
1300 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_AN().EA_TYPE_ALL();
|
1301 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1302 |
|
|
|
1303 |
|
|
// move OP1 to result
|
1304 |
|
|
p .ALU_SIMPLE_MOVE()
|
1305 |
|
|
.SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
|
1306 |
|
|
|
1307 |
|
|
// save result to An
|
1308 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1309 |
|
|
|
1310 |
|
|
// load offset word to OP1
|
1311 |
|
|
p .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
1312 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
1313 |
|
|
|
1314 |
|
|
p .OP1_FROM_IMMEDIATE()
|
1315 |
|
|
.PC_INCR_BY_SIZE();
|
1316 |
|
|
|
1317 |
|
|
// move OP1 to OP2
|
1318 |
|
|
p .OP2_FROM_OP1()
|
1319 |
|
|
.SIZE_LONG().EA_REG_3b111().EA_MOD_AN().EA_TYPE_ALL();
|
1320 |
|
|
|
1321 |
|
|
// load SP to OP1
|
1322 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1323 |
|
|
|
1324 |
|
|
// add offset and SP to SP
|
1325 |
|
|
p .ALU_SIMPLE_LONG_ADD()
|
1326 |
|
|
.BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1327 |
|
|
|
1328 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1329 |
|
|
|
1330 |
|
|
p.label("MICROPC_ULNK");
|
1331 |
|
|
// load An to OP1
|
1332 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
|
1333 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1334 |
|
|
|
1335 |
|
|
// move OP1 to result
|
1336 |
|
|
p .ALU_SIMPLE_MOVE()
|
1337 |
|
|
.SIZE_LONG().EA_REG_3b111().EA_MOD_AN().EA_TYPE_ALL();
|
1338 |
|
|
|
1339 |
|
|
// save result to SP
|
1340 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1341 |
|
|
|
1342 |
|
|
// load (SP) to OP1
|
1343 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
|
1344 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
1345 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
|
1346 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1347 |
|
|
|
1348 |
|
|
// move OP1 to result
|
1349 |
|
|
p .ALU_SIMPLE_MOVE()
|
1350 |
|
|
.SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
|
1351 |
|
|
|
1352 |
|
|
// save result to An
|
1353 |
|
|
p .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
|
1354 |
|
|
|
1355 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1356 |
|
|
|
1357 |
|
|
p.label("MICROPC_BSR");
|
1358 |
|
|
|
1359 |
|
|
p .OP1_FROM_PC();
|
1360 |
|
|
|
1361 |
|
|
p .ALU_SIMPLE_MOVE()
|
1362 |
|
|
.BRANCH_ir().offset("bsr_no_word");
|
1363 |
|
|
p .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
1364 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
1365 |
|
|
|
1366 |
|
|
p .OP1_FROM_IMMEDIATE()
|
1367 |
|
|
.PC_INCR_BY_SIZE();
|
1368 |
|
|
|
1369 |
|
|
// jump here if no need to load extra immediate word
|
1370 |
|
|
p .label("bsr_no_word");
|
1371 |
|
|
|
1372 |
|
|
p .OP2_FROM_OP1();
|
1373 |
|
|
p .OP2_MOVE_OFFSET()
|
1374 |
|
|
.OP1_FROM_RESULT();
|
1375 |
|
|
|
1376 |
|
|
p .ALU_SIMPLE_LONG_ADD();
|
1377 |
|
|
|
1378 |
|
|
// wait for instruction prefetch
|
1379 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
1380 |
|
|
|
1381 |
|
|
p .OP1_FROM_PC()
|
1382 |
|
|
.PC_FROM_RESULT();
|
1383 |
|
|
|
1384 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
1385 |
|
|
|
1386 |
|
|
p .ALU_SIMPLE_MOVE()
|
1387 |
|
|
.BRANCH_procedure().PROCEDURE_call_load_ea();
|
1388 |
|
|
|
1389 |
|
|
p .BRANCH_procedure().PROCEDURE_call_write();
|
1390 |
|
|
|
1391 |
|
|
p.label("MICROPC_JMP");
|
1392 |
|
|
|
1393 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL();
|
1394 |
|
|
|
1395 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
1396 |
|
|
|
1397 |
|
|
p .OP1_FROM_ADDRESS();
|
1398 |
|
|
p .ALU_SIMPLE_MOVE();
|
1399 |
|
|
|
1400 |
|
|
// wait for instruction prefetch
|
1401 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
1402 |
|
|
|
1403 |
|
|
p .PC_FROM_RESULT();
|
1404 |
|
|
|
1405 |
|
|
// wait for PC check
|
1406 |
|
|
p .ALU_SIMPLE_MOVE();
|
1407 |
|
|
|
1408 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1409 |
|
|
|
1410 |
|
|
p.label("MICROPC_JSR");
|
1411 |
|
|
|
1412 |
|
|
p .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL();
|
1413 |
|
|
|
1414 |
|
|
p .BRANCH_procedure().PROCEDURE_call_load_ea();
|
1415 |
|
|
|
1416 |
|
|
p .OP1_FROM_ADDRESS();
|
1417 |
|
|
p .ALU_SIMPLE_MOVE();
|
1418 |
|
|
|
1419 |
|
|
// wait for instruction prefetch
|
1420 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
1421 |
|
|
|
1422 |
|
|
p .OP1_FROM_PC()
|
1423 |
|
|
.PC_FROM_RESULT();
|
1424 |
|
|
|
1425 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
|
1426 |
|
|
|
1427 |
|
|
p .ALU_SIMPLE_MOVE()
|
1428 |
|
|
.BRANCH_procedure().PROCEDURE_call_load_ea();
|
1429 |
|
|
|
1430 |
|
|
p .BRANCH_procedure().PROCEDURE_call_write();
|
1431 |
|
|
|
1432 |
|
|
p.label("MICROPC_RTE_RTR");
|
1433 |
|
|
|
1434 |
|
|
p .SIZE_WORD().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
|
1435 |
|
|
|
1436 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1437 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1438 |
|
|
|
1439 |
|
|
p .ALU_SIMPLE_MOVE()
|
1440 |
|
|
.SIZE_LONG().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
|
1441 |
|
|
|
1442 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1443 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1444 |
|
|
|
1445 |
|
|
p .ALU_SIMPLE_MOVE()
|
1446 |
|
|
.OP1_FROM_RESULT();
|
1447 |
|
|
p .ALU_MOVE_TO_CCR_SR_RTE_RTR_STOP_LOGIC_TO_CCR_SR();
|
1448 |
|
|
|
1449 |
|
|
// wait for instruction prefetch
|
1450 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
1451 |
|
|
|
1452 |
|
|
p .PC_FROM_RESULT();
|
1453 |
|
|
|
1454 |
|
|
// wait for PC check
|
1455 |
|
|
p .ALU_SIMPLE_MOVE();
|
1456 |
|
|
|
1457 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1458 |
|
|
|
1459 |
|
|
p.label("MICROPC_RTS");
|
1460 |
|
|
|
1461 |
|
|
p .SIZE_LONG().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
|
1462 |
|
|
|
1463 |
|
|
p .BRANCH_procedure().PROCEDURE_call_read();
|
1464 |
|
|
p .BRANCH_procedure().PROCEDURE_call_save_ea();
|
1465 |
|
|
|
1466 |
|
|
p .ALU_SIMPLE_MOVE();
|
1467 |
|
|
|
1468 |
|
|
// wait for instruction prefetch
|
1469 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
|
1470 |
|
|
|
1471 |
|
|
p .PC_FROM_RESULT();
|
1472 |
|
|
|
1473 |
|
|
// wait for PC check
|
1474 |
|
|
p .ALU_SIMPLE_MOVE();
|
1475 |
|
|
|
1476 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1477 |
|
|
|
1478 |
|
|
p.label("MICROPC_NOP");
|
1479 |
|
|
|
1480 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1481 |
|
|
|
1482 |
|
|
p.label("MICROPC_TRAP");
|
1483 |
|
|
|
1484 |
|
|
p .TRAP_TRAP()
|
1485 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
1486 |
|
|
|
1487 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1488 |
|
|
|
1489 |
|
|
p.label("MICROPC_TRAPV");
|
1490 |
|
|
|
1491 |
|
|
p .BRANCH_V().offset("trapv_no_trap");
|
1492 |
|
|
|
1493 |
|
|
p .TRAP_TRAPV()
|
1494 |
|
|
.BRANCH_procedure().PROCEDURE_call_trap();
|
1495 |
|
|
|
1496 |
|
|
// jump here if overflow == 0
|
1497 |
|
|
p .label("trapv_no_trap");
|
1498 |
|
|
|
1499 |
|
|
p .BRANCH_procedure().PROCEDURE_return();
|
1500 |
|
|
|
1501 |
|
|
p.label("MICROPC_RESET");
|
1502 |
|
|
|
1503 |
|
|
p .DO_RESET_FLAG_SET();
|
1504 |
|
|
p .BRANCH_procedure().PROCEDURE_wait_finished();
|
1505 |
|
|
|
1506 |
|
|
p .DO_RESET_FLAG_CLEAR()
|
1507 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1508 |
|
|
|
1509 |
|
|
p.label("MICROPC_STOP");
|
1510 |
|
|
|
1511 |
|
|
p .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
|
1512 |
|
|
.BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
|
1513 |
|
|
|
1514 |
|
|
p .OP1_FROM_IMMEDIATE()
|
1515 |
|
|
.PC_INCR_BY_SIZE();
|
1516 |
|
|
|
1517 |
|
|
p .ALU_MOVE_TO_CCR_SR_RTE_RTR_STOP_LOGIC_TO_CCR_SR()
|
1518 |
|
|
.STOP_FLAG_SET()
|
1519 |
|
|
.BRANCH_procedure().PROCEDURE_return();
|
1520 |
|
|
}
|
1521 |
|
|
}
|