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

Subversion Repositories ao68000

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

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 17 alfik
        p       .ALU_ABCD_SBCD_ADDX_SUBX_prepare();
761 12 alfik
        p       .ALU_ABCD_SBCD_ADDX_SUBX()
762
                .BRANCH_procedure().PROCEDURE_call_write();
763
 
764
        p.label(<span class="stringliteral">&quot;MICROPC_EXG&quot;</span>);
765
 
766
        p       .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DN_AN();
767
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
768
 
769
        p       .ALU_SIMPLE_MOVE()
770
                .SIZE_LONG().EA_REG_IR_11_9().EA_MOD_DN_AN_EXG().EA_TYPE_ALL();
771
 
772
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
773
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
774
 
775
        p       .ALU_SIMPLE_MOVE()
776
                .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DN_AN();
777
 
778
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
779
 
780
        p       .BRANCH_procedure().PROCEDURE_return();
781
 
782
 
783
        p.label(<span class="stringliteral">&quot;MICROPC_CMPM&quot;</span>);
784
 
785
        p       .SIZE_3().EA_REG_IR_2_0().EA_MOD_POSTINC().EA_TYPE_ALL();
786
 
787
        p       .BRANCH_procedure().PROCEDURE_call_read();
788
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
789
 
790
        p       .OP2_FROM_OP1()
791
                .SIZE_3().EA_REG_IR_11_9().EA_MOD_POSTINC().EA_TYPE_ALL();
792
 
793
        p       .BRANCH_procedure().PROCEDURE_call_read();
794
 
795
        p       .ALU_ARITHMETIC_LOGIC()
796
                .BRANCH_procedure().PROCEDURE_call_save_ea();
797
 
798
        p       .BRANCH_procedure().PROCEDURE_return();
799
 
800
        p.label(<span class="stringliteral">&quot;MICROPC_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_all_immediate_register&quot;</span>);
801
 
802
        p       .SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
803
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
804
 
805
        p       .OP2_FROM_OP1()
806
                .SIZE_3().EA_REG_IR_2_0().EA_MOD_DN().EA_TYPE_ALL();
807
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
808
 
809
        p       .OP2_LOAD_COUNT();
810
 
811
        p       .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_prepare();
812
 
813
        p       .BRANCH_procedure().PROCEDURE_push_micropc();
814
 
815
        p       .BRANCH_operand2().offset(<span class="stringliteral">&quot;shift_rotate_immediate_loop&quot;</span>);
816
 
817
        p               .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR();
818
        p               .OP1_FROM_RESULT()
819
                        .OP2_DECR_BY_1()
820
                        .BRANCH_procedure().PROCEDURE_return();
821
 
822
                <span class="comment">// jump here if loop finished</span>
823
        p       .label(<span class="stringliteral">&quot;shift_rotate_immediate_loop&quot;</span>);
824
 
825
        p       .BRANCH_procedure().PROCEDURE_pop_micropc();
826
 
827
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
828
 
829
        p       .BRANCH_procedure().PROCEDURE_return();
830
 
831
        p.label(<span class="stringliteral">&quot;MICROPC_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_all_memory&quot;</span>);
832
 
833
        p       .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_MEMORYALTER();
834
 
835
        p       .BRANCH_procedure().PROCEDURE_call_read();
836
 
837
        p       .OP2_LOAD_1();
838
 
839
        p       .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR_prepare();
840
        p       .ALU_ASL_LSL_ROL_ROXL_ASR_LSR_ROR_ROXR();
841
 
842
        p       .BRANCH_procedure().PROCEDURE_call_write();
843
 
844
        p.label(<span class="stringliteral">&quot;MICROPC_MOVE&quot;</span>);
845
 
846
        p       .SIZE_4().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
847
 
848
        p       .BRANCH_procedure().PROCEDURE_call_read();
849
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
850
 
851
        p       .ALU_SIMPLE_MOVE()
852
                .SIZE_4().EA_REG_IR_11_9().EA_MOD_IR_8_6().EA_TYPE_DATAALTER();
853
 
854
        p       .BRANCH_procedure().PROCEDURE_call_load_ea();
855
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
856
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
857
        p       .ALU_MOVE()
858
                .BRANCH_procedure().PROCEDURE_return();
859
 
860
        p.label(<span class="stringliteral">&quot;MICROPC_MOVEA&quot;</span>);
861
 
862
        p       .SIZE_4().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
863
 
864
        p       .BRANCH_procedure().PROCEDURE_call_read();
865
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
866
 
867
        p       .ALU_SIGN_EXTEND()
868
                .SIZE_4().EA_REG_IR_11_9().EA_MOD_AN().EA_TYPE_ALL();
869
 
870
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
871
 
872
        p       .BRANCH_procedure().PROCEDURE_return();
873
 
874
        p.label(<span class="stringliteral">&quot;MICROPC_EOR&quot;</span>);
875
 
876
        p       .SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
877
 
878
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
879
 
880
        p       .OP2_FROM_OP1()
881
                .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
882
 
883
        p       .BRANCH_procedure().PROCEDURE_call_read();
884
 
885
        p       .ALU_ARITHMETIC_LOGIC()
886
                .BRANCH_procedure().PROCEDURE_call_write();
887
 
888
        p.label(<span class="stringliteral">&quot;MICROPC_ADD_to_mem_SUB_to_mem_AND_to_mem_OR_to_mem&quot;</span>);
889
 
890
        p       .SIZE_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
891
 
892
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
893
 
894
        p       .OP2_FROM_OP1()
895
                .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_MEMORYALTER();
896
 
897
        p       .BRANCH_procedure().PROCEDURE_call_read();
898
 
899
        p       .ALU_ARITHMETIC_LOGIC()
900
                .BRANCH_procedure().PROCEDURE_call_write();
901
 
902
        p.label(<span class="stringliteral">&quot;MICROPC_ADD_to_Dn_SUB_to_Dn_AND_to_Dn_OR_to_Dn&quot;</span>);
903
 
904
        p       .SIZE_3().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_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
911
 
912
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
913
 
914
        p       .ALU_ARITHMETIC_LOGIC()
915
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
916
 
917
        p       .BRANCH_procedure().PROCEDURE_return();
918
 
919
        p.label(<span class="stringliteral">&quot;MICROPC_CMP&quot;</span>);
920
 
921
        p       .SIZE_3().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_3().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
928
 
929
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
930
 
931
        p       .ALU_ARITHMETIC_LOGIC()
932
                .BRANCH_procedure().PROCEDURE_return();
933
 
934
        p.label(<span class="stringliteral">&quot;MICROPC_ADDA_SUBA&quot;</span>);
935
 
936
        p       .SIZE_5().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
937
 
938
        p       .BRANCH_procedure().PROCEDURE_call_read();
939
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
940
 
941
        p       .OP2_FROM_OP1()
942
                .SIZE_LONG().EA_REG_IR_11_9().EA_MOD_AN().EA_TYPE_ALL();
943
 
944
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
945
 
946
        p       .ALU_ADDA_SUBA_CMPA_ADDQ_SUBQ()
947
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
948
 
949
        p       .BRANCH_procedure().PROCEDURE_return();
950
 
951
        p.label(<span class="stringliteral">&quot;MICROPC_CMPA&quot;</span>);
952
 
953
        p       .SIZE_5().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_ALL();
954
 
955
        p       .BRANCH_procedure().PROCEDURE_call_read();
956
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
957
 
958
        p       .OP2_FROM_OP1()
959
                .SIZE_LONG().EA_REG_IR_11_9().EA_MOD_AN().EA_TYPE_ALL();
960
 
961
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
962
 
963
        p       .ALU_ADDA_SUBA_CMPA_ADDQ_SUBQ()
964
                .BRANCH_procedure().PROCEDURE_return();
965
 
966
        p.label(<span class="stringliteral">&quot;MICROPC_CHK&quot;</span>);
967
 
968
        p       .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
969
 
970
        p       .BRANCH_procedure().PROCEDURE_call_read();
971
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
972
 
973
        p       .OP2_FROM_OP1()
974
                .SIZE_WORD().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
975
 
976
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
977
 
978
        p       .ALU_CHK();
979
 
980 13 alfik
        p       .BRANCH_alu_signal().offset(<span class="stringliteral">&quot;chk_no_trap&quot;</span>);
981 12 alfik
        p               .TRAP_CHK()
982
                        .BRANCH_procedure().PROCEDURE_call_trap();
983
                        <span class="comment">// after return continue</span>
984
 
985
                <span class="comment">// jump here if no trap</span>
986
        p       .label(<span class="stringliteral">&quot;chk_no_trap&quot;</span>);
987
 
988
        p       .BRANCH_procedure().PROCEDURE_return();
989
 
990
        p.label(<span class="stringliteral">&quot;MICROPC_MULS_MULU_DIVS_DIVU&quot;</span>);
991
 
992
        p       .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
993
 
994
        p       .BRANCH_procedure().PROCEDURE_call_read();
995
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
996
 
997
        p       .OP2_FROM_OP1()
998
                .SIZE_LONG().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
999
 
1000
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1001
 
1002 13 alfik
        p       .ALU_MULS_MULU_DIVS_DIVU();
1003 12 alfik
 
1004 13 alfik
        p       .BRANCH_alu_signal().offset(<span class="stringliteral">&quot;div_no_div_by_zero_trap&quot;</span>);
1005 12 alfik
        p               .TRAP_DIV_BY_ZERO()
1006
                        .BRANCH_procedure().PROCEDURE_call_trap();
1007
                        <span class="comment">// return after return</span>
1008
        p               .BRANCH_procedure().PROCEDURE_return();
1009
 
1010
                <span class="comment">// jump here if no trap</span>
1011
        p       .label(<span class="stringliteral">&quot;div_no_div_by_zero_trap&quot;</span>);
1012
 
1013
                <span class="comment">// push current micro pc on stack</span>
1014
        p       .BRANCH_procedure().PROCEDURE_push_micropc();
1015
 
1016 13 alfik
                 <span class="comment">// check if operation finished</span>
1017
        p       .BRANCH_alu_mult_div_ready().offset(<span class="stringliteral">&quot;mult_div_loop&quot;</span>);
1018
        p               .BRANCH_procedure().PROCEDURE_return();
1019 12 alfik
 
1020
                <span class="comment">// jump here after first loop finished</span>
1021 13 alfik
        p       .label(<span class="stringliteral">&quot;mult_div_loop&quot;</span>);
1022 12 alfik
 
1023
        p       .ALU_MULS_MULU_DIVS_DIVU()
1024
                .BRANCH_procedure().PROCEDURE_pop_micropc();
1025
 
1026 13 alfik
        p       .BRANCH_alu_signal().offset(<span class="stringliteral">&quot;mult_div_no_overflow&quot;</span>);
1027
        p           .BRANCH_procedure().PROCEDURE_return();
1028 12 alfik
 
1029
                <span class="comment">// jump here if overflow</span>
1030 13 alfik
        p       .label(<span class="stringliteral">&quot;mult_div_no_overflow&quot;</span>);
1031
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1032 12 alfik
        p       .BRANCH_procedure().PROCEDURE_return();
1033
 
1034
        p.label(<span class="stringliteral">&quot;MICROPC_MOVEQ&quot;</span>);
1035
 
1036
        p       .OP1_MOVEQ()
1037
                .SIZE_LONG().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
1038
 
1039
        p       .ALU_MOVE()
1040
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1041
 
1042
        p       .BRANCH_procedure().PROCEDURE_return();
1043
 
1044
        p.label(<span class="stringliteral">&quot;MICROPC_BCHG_BCLR_BSET_immediate&quot;</span>);
1045
 
1046
        p       .SIZE_BYTE().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
1047
                .BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
1048
 
1049
        p       .OP1_FROM_IMMEDIATE()
1050
                .PC_INCR_BY_SIZE();
1051
 
1052
        p       .OP2_FROM_OP1()
1053
                .SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1054
 
1055
        p       .BRANCH_procedure().PROCEDURE_call_read();
1056
 
1057
        p       .ALU_BCHG_BCLR_BSET_BTST()
1058
                .BRANCH_procedure().PROCEDURE_call_write();
1059
 
1060
        p.label(<span class="stringliteral">&quot;MICROPC_BTST_immediate&quot;</span>);
1061
 
1062
        p       .SIZE_BYTE().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
1063
                .BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
1064
 
1065
        p       .OP1_FROM_IMMEDIATE()
1066
                .PC_INCR_BY_SIZE();
1067
 
1068
        p       .OP2_FROM_OP1()
1069
                .SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
1070
 
1071
        p       .BRANCH_procedure().PROCEDURE_call_read();
1072
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1073
 
1074
        p       .ALU_BCHG_BCLR_BSET_BTST()
1075
                .BRANCH_procedure().PROCEDURE_return();
1076
 
1077
        p.label(<span class="stringliteral">&quot;MICROPC_BCHG_BCLR_BSET_register&quot;</span>);
1078
 
1079
        p       .SIZE_6().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
1080
 
1081
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1082
 
1083
        p       .OP2_FROM_OP1()
1084
                .SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1085
 
1086
        p       .BRANCH_procedure().PROCEDURE_call_read();
1087
 
1088
        p       .ALU_BCHG_BCLR_BSET_BTST()
1089
                .BRANCH_procedure().PROCEDURE_call_write();
1090
 
1091
        p.label(<span class="stringliteral">&quot;MICROPC_BTST_register&quot;</span>);
1092
 
1093
        p       .SIZE_6().EA_REG_IR_11_9().EA_MOD_DN().EA_TYPE_ALL();
1094
 
1095
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1096
 
1097
        p       .OP2_FROM_OP1()
1098
                .SIZE_6().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
1099
 
1100
        p       .BRANCH_procedure().PROCEDURE_call_read();
1101
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1102
 
1103
        p       .ALU_BCHG_BCLR_BSET_BTST()
1104
                .BRANCH_procedure().PROCEDURE_return();
1105
 
1106
        p.label(<span class="stringliteral">&quot;MICROPC_TAS&quot;</span>);
1107
 
1108
        p       .READ_MODIFY_WRITE_FLAG_SET()
1109
                .SIZE_BYTE().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1110
 
1111
        p       .BRANCH_procedure().PROCEDURE_call_read();
1112
 
1113
        p       .ALU_TAS()
1114
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1115
 
1116
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1117
 
1118
        p       .READ_MODIFY_WRITE_FLAG_CLEAR()
1119
                .BRANCH_procedure().PROCEDURE_return();
1120
 
1121
        p.label(<span class="stringliteral">&quot;MICROPC_NEGX_CLR_NEG_NOT_NBCD&quot;</span>);
1122
 
1123
        p       .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1124
 
1125
        p       .BRANCH_procedure().PROCEDURE_call_read();
1126
 
1127
        p       .ALU_NEGX_CLR_NEG_NOT_NBCD_SWAP_EXT()
1128
                .BRANCH_procedure().PROCEDURE_call_write();
1129
 
1130
        p.label(<span class="stringliteral">&quot;MICROPC_SWAP_EXT&quot;</span>);
1131
 
1132
        p       .SIZE_2().EA_REG_IR_2_0().EA_MOD_DN().EA_TYPE_ALL();
1133
 
1134
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1135
 
1136
        p       .ALU_NEGX_CLR_NEG_NOT_NBCD_SWAP_EXT()
1137
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1138
 
1139
        p       .BRANCH_procedure().PROCEDURE_return();
1140
 
1141
        p.label(<span class="stringliteral">&quot;MICROPC_TST&quot;</span>);
1142
 
1143
        p       .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1144
 
1145
        p       .BRANCH_procedure().PROCEDURE_call_read();
1146
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1147
 
1148
        p       .ALU_MOVE()
1149
                .BRANCH_procedure().PROCEDURE_return();
1150
 
1151
        p.label(<span class="stringliteral">&quot;MICROPC_ADDQ_SUBQ_not_An&quot;</span>);
1152
 
1153
        p       .OP2_ADDQ_SUBQ()
1154
                .SIZE_3().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1155
 
1156
        p       .BRANCH_procedure().PROCEDURE_call_read();
1157
 
1158
        p       .ALU_ARITHMETIC_LOGIC()
1159
                .BRANCH_procedure().PROCEDURE_call_write();
1160
 
1161
        p.label(<span class="stringliteral">&quot;MICROPC_ADDQ_SUBQ_An&quot;</span>);
1162
 
1163
        p       .OP2_ADDQ_SUBQ()
1164
                .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
1165
 
1166
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1167
 
1168
        p       .ALU_ADDA_SUBA_CMPA_ADDQ_SUBQ()
1169
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1170
 
1171
        p       .BRANCH_procedure().PROCEDURE_return();
1172
 
1173
        p.label(<span class="stringliteral">&quot;MICROPC_Scc&quot;</span>);
1174
 
1175
        p       .BRANCH_condition_0().offset(<span class="stringliteral">&quot;scc_condition_0&quot;</span>);
1176
        p               .OP1_LOAD_ONES();
1177
 
1178
                <span class="comment">// jump here if condition is false</span>
1179
        p       .label(<span class="stringliteral">&quot;scc_condition_0&quot;</span>);
1180
 
1181
        p       .BRANCH_condition_1().offset(<span class="stringliteral">&quot;scc_condition_1&quot;</span>);
1182
        p               .OP1_LOAD_ZEROS();
1183
 
1184
                <span class="comment">// jump here if condition is true</span>
1185
        p       .label(<span class="stringliteral">&quot;scc_condition_1&quot;</span>);
1186
 
1187
        p       .ALU_SIMPLE_MOVE()
1188
                .SIZE_BYTE().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1189
 
1190
        p       .BRANCH_procedure().PROCEDURE_call_load_ea();
1191
        p       .BRANCH_procedure().PROCEDURE_call_write();
1192
 
1193
        p.label(<span class="stringliteral">&quot;MICROPC_Bcc_BRA&quot;</span>);
1194
 
1195
        p       .OP1_FROM_PC();
1196
 
1197
        p       .ALU_SIMPLE_MOVE()
1198
                .BRANCH_ir().offset(<span class="stringliteral">&quot;bcc_bra_no_word&quot;</span>);
1199
 
1200
        p               .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
1201
                        .BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
1202
 
1203
        p               .OP1_FROM_IMMEDIATE()
1204
                        .PC_INCR_BY_SIZE();
1205
 
1206
                <span class="comment">// jump here if no need to load extra immediate word</span>
1207
        p       .label(<span class="stringliteral">&quot;bcc_bra_no_word&quot;</span>);
1208
 
1209
        p       .BRANCH_condition_0().offset(<span class="stringliteral">&quot;bcc_bra_no_branch&quot;</span>);
1210
 
1211
        p               .OP2_FROM_OP1();
1212
        p               .OP2_MOVE_OFFSET()
1213
                        .OP1_FROM_RESULT();
1214
 
1215
        p               .ALU_SIMPLE_LONG_ADD();
1216
 
1217
                        <span class="comment">// wait for instruction prefetch</span>
1218
        p               .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
1219
 
1220
        p               .PC_FROM_RESULT();
1221
 
1222
                        <span class="comment">// wait for PC check</span>
1223
        p               .ALU_SIMPLE_MOVE();
1224
 
1225
                <span class="comment">// jump here if no branch</span>
1226
        p       .label(<span class="stringliteral">&quot;bcc_bra_no_branch&quot;</span>);
1227
 
1228
        p       .BRANCH_procedure().PROCEDURE_return();
1229
 
1230
        p.label(<span class="stringliteral">&quot;MICROPC_DBcc&quot;</span>);
1231
 
1232
        p       .BRANCH_condition_1().offset(<span class="stringliteral">&quot;dbcc_condition_true&quot;</span>);
1233
 
1234
        p               .OP2_LOAD_1()
1235
                        .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_DN().EA_TYPE_ALL();
1236
 
1237
        p               .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1238
 
1239
        p               .ALU_SIMPLE_LONG_SUB();
1240
 
1241
        p               .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1242
 
1243
        p               .OP1_FROM_PC()
1244
                        .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
1245
                        .BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
1246
 
1247
        p               .BRANCH_result().offset(<span class="stringliteral">&quot;dbcc_condition_true&quot;</span>);
1248
 
1249
        p                       .OP1_FROM_IMMEDIATE()
1250
                                .ALU_SIMPLE_MOVE();
1251
 
1252
        p                       .OP2_FROM_OP1()
1253
                                .OP1_FROM_RESULT();
1254
 
1255
        p                       .ALU_SIMPLE_LONG_ADD()
1256
                                <span class="comment">// wait for instruction prefetch</span>
1257
                                .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
1258
 
1259
        p                       .PC_FROM_RESULT();
1260
 
1261
                                <span class="comment">// wait for PC check</span>
1262
        p                       .ALU_SIMPLE_MOVE();
1263
 
1264
        p                       .BRANCH_procedure().PROCEDURE_return();
1265
 
1266
                <span class="comment">// jump here if condition is true</span>
1267
        p       .label(<span class="stringliteral">&quot;dbcc_condition_true&quot;</span>);
1268
 
1269
        p       .PC_INCR_BY_2()
1270
                .BRANCH_procedure().PROCEDURE_return();
1271
 
1272
        p.label(<span class="stringliteral">&quot;MICROPC_MOVE_FROM_SR&quot;</span>);
1273
 
1274
        p       .OP1_FROM_SR()
1275
                .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATAALTER();
1276
 
1277
        p       .ALU_SIMPLE_MOVE()
1278
                .BRANCH_procedure().PROCEDURE_call_load_ea();
1279
 
1280
        p       .BRANCH_procedure().PROCEDURE_call_write();
1281
 
1282
        p.label(<span class="stringliteral">&quot;MICROPC_MOVE_TO_CCR_MOVE_TO_SR&quot;</span>);
1283
 
1284
        p       .SIZE_WORD().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_DATA();
1285
 
1286
        p       .BRANCH_procedure().PROCEDURE_call_read();
1287
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1288
 
1289
        p       .ALU_MOVE_TO_CCR_SR_RTE_RTR_STOP_LOGIC_TO_CCR_SR()
1290
                .BRANCH_procedure().PROCEDURE_return();
1291
 
1292
        p.label(<span class="stringliteral">&quot;MICROPC_MOVE_USP_to_USP&quot;</span>);
1293
 
1294
        p       .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
1295
 
1296
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1297
 
1298
        p       .ALU_SIMPLE_MOVE();
1299
 
1300
        p       .AN_ADDRESS_USP()
1301
                .AN_WRITE_ENABLE_SET();
1302
 
1303
        p       .BRANCH_procedure().PROCEDURE_return();
1304
 
1305
 
1306
        p.label(<span class="stringliteral">&quot;MICROPC_MOVE_USP_to_An&quot;</span>);
1307
 
1308
        p       .OP1_FROM_USP()
1309
                .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
1310
 
1311
        p       .ALU_SIMPLE_MOVE()
1312
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1313
 
1314
        p       .BRANCH_procedure().PROCEDURE_return();
1315
 
1316
        p.label(<span class="stringliteral">&quot;MICROPC_LINK&quot;</span>);
1317
 
1318
                <span class="comment">// load An to OP1</span>
1319
        p       .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
1320
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1321
 
1322
                <span class="comment">// move OP1 to result</span>
1323
        p       .ALU_LINK_MOVE()
1324
                .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
1325
 
1326
                <span class="comment">// write result to (SP)</span>
1327
        p       .BRANCH_procedure().PROCEDURE_call_load_ea();
1328
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1329
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1330
 
1331
                <span class="comment">// load SP to OP1</span>
1332
        p       .SIZE_LONG().EA_REG_3b111().EA_MOD_AN().EA_TYPE_ALL();
1333
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1334
 
1335
                <span class="comment">// move OP1 to result</span>
1336
        p       .ALU_SIMPLE_MOVE()
1337
                .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
1338
 
1339
                <span class="comment">// save result to An</span>
1340
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1341
 
1342
                <span class="comment">// load offset word to OP1</span>
1343
        p       .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
1344
                .BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
1345
 
1346
        p       .OP1_FROM_IMMEDIATE()
1347
                .PC_INCR_BY_SIZE();
1348
 
1349
                <span class="comment">// move OP1 to OP2</span>
1350
        p       .OP2_FROM_OP1()
1351
                .SIZE_LONG().EA_REG_3b111().EA_MOD_AN().EA_TYPE_ALL();
1352
 
1353
                <span class="comment">// load SP to OP1</span>
1354
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1355
 
1356
                <span class="comment">// add offset and SP to SP</span>
1357
        p       .ALU_SIMPLE_LONG_ADD()
1358
                .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1359
 
1360
        p       .BRANCH_procedure().PROCEDURE_return();
1361
 
1362
        p.label(<span class="stringliteral">&quot;MICROPC_ULNK&quot;</span>);
1363
                <span class="comment">// load An to OP1</span>
1364
        p       .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
1365
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1366
 
1367
                <span class="comment">// move OP1 to result</span>
1368
        p       .ALU_SIMPLE_MOVE()
1369
                .SIZE_LONG().EA_REG_3b111().EA_MOD_AN().EA_TYPE_ALL();
1370
 
1371
                <span class="comment">// save result to SP</span>
1372
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1373
 
1374
                <span class="comment">// load (SP) to OP1</span>
1375
        p       .SIZE_LONG().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
1376
        p       .BRANCH_procedure().PROCEDURE_call_load_ea();
1377
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_read();
1378
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1379
 
1380
                <span class="comment">// move OP1 to result</span>
1381
        p       .ALU_SIMPLE_MOVE()
1382
                .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_AN().EA_TYPE_ALL();
1383
 
1384
                <span class="comment">// save result to An</span>
1385
        p       .BRANCH_procedure().PROCEDURE_call_perform_ea_write();
1386
 
1387
        p       .BRANCH_procedure().PROCEDURE_return();
1388
 
1389
        p.label(<span class="stringliteral">&quot;MICROPC_BSR&quot;</span>);
1390
 
1391
        p       .OP1_FROM_PC();
1392
 
1393
        p       .ALU_SIMPLE_MOVE()
1394
                .BRANCH_ir().offset(<span class="stringliteral">&quot;bsr_no_word&quot;</span>);
1395
        p               .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
1396
                        .BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
1397
 
1398
        p               .OP1_FROM_IMMEDIATE()
1399
                        .PC_INCR_BY_SIZE();
1400
 
1401
                <span class="comment">// jump here if no need to load extra immediate word</span>
1402
        p       .label(<span class="stringliteral">&quot;bsr_no_word&quot;</span>);
1403
 
1404
        p       .OP2_FROM_OP1();
1405
        p       .OP2_MOVE_OFFSET()
1406
                .OP1_FROM_RESULT();
1407
 
1408
        p       .ALU_SIMPLE_LONG_ADD();
1409
 
1410
                <span class="comment">// wait for instruction prefetch</span>
1411
        p       .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
1412
 
1413
        p       .OP1_FROM_PC()
1414
                .PC_FROM_RESULT();
1415
 
1416
        p       .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
1417
 
1418
        p       .ALU_SIMPLE_MOVE()
1419
                .BRANCH_procedure().PROCEDURE_call_load_ea();
1420
 
1421
        p       .BRANCH_procedure().PROCEDURE_call_write();
1422
 
1423
        p.label(<span class="stringliteral">&quot;MICROPC_JMP&quot;</span>);
1424
 
1425
        p       .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL();
1426
 
1427
        p       .BRANCH_procedure().PROCEDURE_call_load_ea();
1428
 
1429
        p       .OP1_FROM_ADDRESS();
1430
        p       .ALU_SIMPLE_MOVE();
1431
 
1432
                <span class="comment">// wait for instruction prefetch</span>
1433
        p       .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
1434
 
1435
        p       .PC_FROM_RESULT();
1436
 
1437
                <span class="comment">// wait for PC check</span>
1438
        p       .ALU_SIMPLE_MOVE();
1439
 
1440
        p       .BRANCH_procedure().PROCEDURE_return();
1441
 
1442
        p.label(<span class="stringliteral">&quot;MICROPC_JSR&quot;</span>);
1443
 
1444
        p       .SIZE_LONG().EA_REG_IR_2_0().EA_MOD_IR_5_3().EA_TYPE_CONTROL();
1445
 
1446
        p       .BRANCH_procedure().PROCEDURE_call_load_ea();
1447
 
1448
        p       .OP1_FROM_ADDRESS();
1449
        p       .ALU_SIMPLE_MOVE();
1450
 
1451
                <span class="comment">// wait for instruction prefetch</span>
1452
        p       .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
1453
 
1454
        p       .OP1_FROM_PC()
1455
                .PC_FROM_RESULT();
1456
 
1457
        p       .SIZE_LONG().EA_REG_3b111().EA_MOD_PREDEC().EA_TYPE_ALL();
1458
 
1459
        p       .ALU_SIMPLE_MOVE()
1460
                .BRANCH_procedure().PROCEDURE_call_load_ea();
1461
 
1462
        p       .BRANCH_procedure().PROCEDURE_call_write();
1463
 
1464
        p.label(<span class="stringliteral">&quot;MICROPC_RTE_RTR&quot;</span>);
1465
 
1466
        p       .SIZE_WORD().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
1467
 
1468
        p       .BRANCH_procedure().PROCEDURE_call_read();
1469
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1470
 
1471
        p       .ALU_SIMPLE_MOVE()
1472
                .SIZE_LONG().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
1473
 
1474
        p       .BRANCH_procedure().PROCEDURE_call_read();
1475
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1476
 
1477
        p       .ALU_SIMPLE_MOVE()
1478
                .OP1_FROM_RESULT();
1479
        p       .ALU_MOVE_TO_CCR_SR_RTE_RTR_STOP_LOGIC_TO_CCR_SR();
1480
 
1481
                <span class="comment">// wait for instruction prefetch</span>
1482
        p       .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
1483
 
1484
        p       .PC_FROM_RESULT();
1485
 
1486
                <span class="comment">// wait for PC check</span>
1487
        p       .ALU_SIMPLE_MOVE();
1488
 
1489
        p       .BRANCH_procedure().PROCEDURE_return();
1490
 
1491
        p.label(<span class="stringliteral">&quot;MICROPC_RTS&quot;</span>);
1492
 
1493
        p       .SIZE_LONG().EA_REG_3b111().EA_MOD_POSTINC().EA_TYPE_ALL();
1494
 
1495
        p       .BRANCH_procedure().PROCEDURE_call_read();
1496
        p       .BRANCH_procedure().PROCEDURE_call_save_ea();
1497
 
1498
        p       .ALU_SIMPLE_MOVE();
1499
 
1500
                <span class="comment">// wait for instruction prefetch</span>
1501
        p       .BRANCH_procedure().PROCEDURE_wait_prefetch_valid();
1502
 
1503
        p       .PC_FROM_RESULT();
1504
 
1505
                <span class="comment">// wait for PC check</span>
1506
        p       .ALU_SIMPLE_MOVE();
1507
 
1508
        p       .BRANCH_procedure().PROCEDURE_return();
1509
 
1510
        p.label(<span class="stringliteral">&quot;MICROPC_NOP&quot;</span>);
1511
 
1512
        p       .BRANCH_procedure().PROCEDURE_return();
1513
 
1514
        p.label(<span class="stringliteral">&quot;MICROPC_TRAP&quot;</span>);
1515
 
1516
        p       .TRAP_TRAP()
1517
                .BRANCH_procedure().PROCEDURE_call_trap();
1518
 
1519
        p       .BRANCH_procedure().PROCEDURE_return();
1520
 
1521
        p.label(<span class="stringliteral">&quot;MICROPC_TRAPV&quot;</span>);
1522
 
1523
        p       .BRANCH_V().offset(<span class="stringliteral">&quot;trapv_no_trap&quot;</span>);
1524
 
1525
        p               .TRAP_TRAPV()
1526
                        .BRANCH_procedure().PROCEDURE_call_trap();
1527
 
1528
                <span class="comment">// jump here if overflow == 0</span>
1529
        p       .label(<span class="stringliteral">&quot;trapv_no_trap&quot;</span>);
1530
 
1531
        p       .BRANCH_procedure().PROCEDURE_return();
1532
 
1533
        p.label(<span class="stringliteral">&quot;MICROPC_RESET&quot;</span>);
1534
 
1535
        p       .DO_RESET_FLAG_SET();
1536
        p       .BRANCH_procedure().PROCEDURE_wait_finished();
1537
 
1538
        p       .DO_RESET_FLAG_CLEAR()
1539
                .BRANCH_procedure().PROCEDURE_return();
1540
 
1541
        p.label(<span class="stringliteral">&quot;MICROPC_STOP&quot;</span>);
1542
 
1543
        p       .SIZE_WORD().EA_REG_3b100().EA_MOD_3b111().EA_TYPE_ALL()
1544
                .BRANCH_procedure().PROCEDURE_wait_prefetch_valid_32();
1545
 
1546
        p       .OP1_FROM_IMMEDIATE()
1547
                .PC_INCR_BY_SIZE();
1548
 
1549
        p       .ALU_MOVE_TO_CCR_SR_RTE_RTR_STOP_LOGIC_TO_CCR_SR()
1550
                .STOP_FLAG_SET()
1551
                .BRANCH_procedure().PROCEDURE_return();
1552
    }
1553
}
1554
</pre></div> </div>
1555 17 alfik
<hr class="footer"/><address class="footer"><small>Generated on Sun Jan 16 2011 11:00:03 for ao68000 by&#160;
1556 12 alfik
<a href="http://www.doxygen.org/index.html">
1557
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
1558
</body>
1559
</html>

powered by: WebSVN 2.1.0

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