OpenCores
URL https://opencores.org/ocsvn/ao68000/ao68000/trunk

Subversion Repositories ao68000

[/] [ao68000/] [trunk/] [doc/] [doxygen/] [html/] [page_microcode.html] - Blame information for rev 13

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.