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

Subversion Repositories rf68000

[/] [rf68000/] [trunk/] [software/] [examples/] [cputest.asm] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 robfinch
** @name cputest.s Tests 68000 cpu
2
*
3
* Based on https://github.com/MicroCoreLabs/Projects/blob/master/MCL68/MC68000_Test_Code/MC68000_test_all_opcodes.X68
4
*
5
* Converted into a CD-i system ROM image by CD-i Fan:
6
* - comment lines must start in first column
7
* - replaced org instructions by suitable rept
8
* - copy vectors to low memory at startup
9
* - replaced jsr/jmp by bsr/bra for position independence
10
* - replaced move.l by moveq whenever possible
11
* - converted branches to short form whenever possible (e.g. beq => beq.s)
12
* - added immediate suffix to opcodes where required (e.g. and => andi)
13
* The last three modifications are required to make the test work;
14
* apparently the original assembler was somewhat smarter then
15
* the Microware OS-9 assembler and did this automatically.
16
*
17
* In some cases the opcodes of the test are used as test data!
18
*
19
* Original file header follows.
20
*
21
*  File Name   :  MCL68 Opcode Tests
22
*  Used on     :
23
*  Author      :  Ted Fried, MicroCore Labs
24
*  Creation    :  7/14/2020
25
*
26
*   Description:
27
*   ============
28
*
29
*  Program to test all of the Motorola 68000's opcodes.
30
*
31
*  If failures are detected, the code will immediately loop on itself.
32
*  All addressing modes, data sizes, and opcode combinations are tested.
33
*
34
*  This code was developed using the Easy68K simulator where all tests passed!
35
*
36
*------------------------------------------------------------------------
37
*
38
* Modification History:
39
* =====================
40
*
41
* Revision 1 7/14/2020
42
* Initial revision
43
*
44
*
45
*------------------------------------------------------------------------
46
*
47
* Copyright (c) 2020 Ted Fried
48
*
49
* Permission is hereby granted, free of charge, to any person obtaining a copy
50
* of this software and associated documentation files (the "Software"), to deal
51
* in the Software without restriction, including without limitation the rights
52
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
* copies of the Software, and to permit persons to whom the Software is
54
* furnished to do so, subject to the following conditions:
55
*
56
* The above copyright notice and this permission notice shall be included in all
57
* copies or substantial portions of the Software.
58
*
59
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
* SOFTWARE.
66
 
67
* Modified for rf68000 project (c) 2022 Robert Finch
68
 
69
*       data
70
*       dc.l            $0001FFFC                                               ; top of local ram area
71
*       dc.l            start
72
 
73
*    org $1000                                                                                          ; code starts at $400 in local ram
74
*start:
75
*       move.l  $FFFFFFE0,d0            ; get core number
76
*       cmpi.b  #2,d0
77
*       bne                     do_nothing
78
 
79
*       lea                     EXCEPTION_6,a0  * check exception vector
80
*       move.l  a0,6*4
81
*       lea                     EXCEPTION_7,a0  * TRAPV exception vector
82
*       move.l  a0,7*4
83
 
84
cpu_test:
85
        bsr     op_ORI_TO_CCR
86
        bsr     op_ORI_TO_SR
87
        bsr     op_EORI_TO_CCR
88
        bsr     op_EORI_TO_SR
89
        bsr     op_ANDI_TO_CCR
90
        bsr     op_ANDI_TO_SR
91
        bsr     op_BTST
92
        bsr     op_BCHG
93
        bsr     op_BCLR
94
        bsr     op_BSET
95
        bsr op_MOVEP
96
        bsr op_BOOL_I
97
        bsr op_CMP_I
98
        bsr op_ADD_I
99
        bsr op_SUB_I
100
        bsr op_MOVE
101
        bsr op_MOVE_xxx_FLAGS
102
        bsr op_EXT
103
        bsr op_SWAP
104
        bsr op_LEAPEA
105
        bsr op_TAS
106
        bsr op_TST
107
        bsr op_LINKS
108
        bsr op_MOVE_USP
109
        bsr op_CHK
110
        bsr op_NEGS
111
        bsr op_MOVEM
112
*       bsr op_ABCD
113
*       bsr op_SBCD
114
*       bsr op_NBCD
115
        bsr op_TRAPV
116
        bsr op_RTR
117
        bsr op_BSR
118
        bsr op_BCC
119
        bsr op_DBCC
120
        bsr op_SCC
121
        bsr op_ADDQ
122
        bsr op_SUBQ
123
        bsr op_MOVEQ
124
        bsr op_DIVU
125
*       bsr op_DIVS
126
        bsr op_OR
127
        bsr op_AND
128
        bsr op_EOR
129
        bsr op_CMP
130
        bsr op_CMPA
131
        bsr op_CMPM
132
        bsr op_ADD
133
        bsr op_SUB
134
        bsr op_ADDA
135
        bsr op_SUBA
136
        bsr op_ADDX
137
        bsr op_SUBX
138
        bsr op_MULU
139
        bsr op_MULS
140
        bsr op_EXG
141
        bsr op_ROx
142
        bsr op_ROXx
143
        bsr op_SHIFTS
144
        bsr op_SHIFTS2
145
 
146
        rts
147
        bra ALL_DONE
148
 
149
* Loop here when all tests pass
150
*
151
 
152
ALL_DONE: bra.s ALL_DONE
153
 
154
BSR_FAR1:       move.l #$33333333,d3
155
                rts
156
 
157
;       moveq           #-1,d0
158
;       move.l  d0,$FD0FFF00
159
;do_nothing:
160
;       bra                     *
161
 
162
 
163
* Exception Vector = 6   CHK Instruction
164
*
165
*       align   4
166
EXCEPTION_6:
167
        move.l #$EEEE0006,d6      * Set d6 to the exception vector
168
        rte
169
 
170
* Exception Vector = 7   TRAPV Instruction
171
*
172
*       align   4
173
EXCEPTION_7:
174
        move.l #$12345678,d0      * Set d6 to the exception vector
175
        rte
176
 
177
;-----------------------------------------------------------
178
;-----------------------------------------------------------
179
; OPCODE : ORI_TO_CCR
180
;-----------------------------------------------------------
181
;-----------------------------------------------------------
182
op_ORI_TO_CCR:
183
 
184
    ori.b #$FF,CCR
185
    bpl.s *                   ; branch if Z clear
186
    bne.s *                   ; branch if N clear
187
    bvc.s *                   ; branch if V clear
188
    bcc.s *                   ; branch if C clear
189
 
190
    move #$00,CCR
191
    ori.b #$00,CCR
192
    beq.s *                   ; branch if Z set
193
    bmi.s *                   ; branch if N set
194
    bvs.s *                   ; branch if V set
195
    bcs.s *                   ; branch if C set
196
 
197
    move.w #$2700,SR          ; Put flags back to initial value
198
 
199
    rts
200
 
201
;-----------------------------------------------------------
202
;-----------------------------------------------------------
203
; OPCODE : ORI_TO_SR
204
;-----------------------------------------------------------
205
;-----------------------------------------------------------
206
 
207
op_ORI_TO_SR:
208
 
209
    ori.w #$2FFF,SR
210
    bpl.s *                   * branch if Z clear
211
    bne.s *                   * branch if N clear
212
    bvc.s *                   * branch if V clear
213
    bcc.s *                   * branch if C clear
214
 
215
    move.w #$2000,SR
216
    ori.w #$0000,SR
217
    beq.s *                   * branch if Z set
218
    bmi.s *                   * branch if N set
219
    bvs.s *                   * branch if V set
220
    bcs.s *                   * branch if C set
221
 
222
    move.w #$2700,sr         * Put flags back to initial value
223
 
224
    rts
225
;
226
;-----------------------------------------------------------
227
;-----------------------------------------------------------
228
; OPCODE : EORI_TO_CCR
229
;-----------------------------------------------------------
230
;-----------------------------------------------------------
231
op_EORI_TO_CCR:
232
 
233
    move #$00,CCR
234
    eori.b #$FF,CCR
235
    bpl.s *                   ; branch if Z clear
236
    bne.s *                   ; branch if N clear
237
    bvc.s *                   ; branch if V clear
238
    bcc.s *                   ; branch if C clear
239
 
240
    move #$00,CCR
241
    eori.b #$00,CCR
242
    beq.s *                   ; branch if Z set
243
    bmi.s *                   ; branch if N set
244
    bvs.s *                   ; branch if V set
245
    bcs.s *                   ; branch if C set
246
 
247
    move.w #$2700,sr           ; Put flags back to initial value
248
 
249
    rts
250
 
251
 
252
 
253
*-----------------------------------------------------------
254
*-----------------------------------------------------------
255
* OPCODE : EORI_TO_SR
256
*-----------------------------------------------------------
257
*-----------------------------------------------------------
258
op_EORI_TO_SR:
259
 
260
    move.w #$2000,SR
261
    eori.w #$0FFF,SR
262
    bpl.s *                   * branch if Z clear
263
    bne.s *                   * branch if N clear
264
    bvc.s *                   * branch if V clear
265
    bcc.s *                   * branch if C clear
266
 
267
    move.w #$2000,SR
268
    eori.w #$0000,SR
269
    beq.s *                   * branch if Z set
270
    bmi.s *                   * branch if N set
271
    bvs.s *                   * branch if V set
272
    bcs.s *                   * branch if C set
273
 
274
    move.w #$2700,sr          * Put flags back to initial value
275
 
276
    rts
277
 
278
 
279
 
280
*-----------------------------------------------------------
281
*-----------------------------------------------------------
282
* OPCODE : ANDI_TO_CCR
283
*-----------------------------------------------------------
284
*-----------------------------------------------------------
285
op_ANDI_TO_CCR:
286
 
287
    move #$FF,CCR
288
    andi.b #$FF,CCR
289
    bpl.s *                   * branch if Z clear
290
    bne.s *                   * branch if N clear
291
    bvc.s *                   * branch if V clear
292
    bcc.s *                   * branch if C clear
293
 
294
    move #$FF,CCR
295
    andi.b #$00,CCR
296
    beq.s *                   * branch if Z set
297
    bmi.s *                   * branch if N set
298
    bvs.s *                   * branch if V set
299
    bcs.s *                   * branch if C set
300
 
301
    move #$2700,SR           * Put flags back to initial value
302
 
303
    rts
304
 
305
 
306
 
307
*-----------------------------------------------------------
308
*-----------------------------------------------------------
309
* OPCODE : ANDI_TO_SR
310
*-----------------------------------------------------------
311
*-----------------------------------------------------------
312
op_ANDI_TO_SR:
313
    move.w #$20FF,SR
314
    andi.w #$FFFF,SR
315
    bpl.s *                   * branch if Z clear
316
    bne.s *                   * branch if N clear
317
    bvc.s *                   * branch if V clear
318
    bcc.s *                   * branch if C clear
319
 
320
    move.w #$20FF,SR
321
    andi.w #$FF00,SR
322
    beq.s *                   * branch if Z set
323
    bmi.s *                   * branch if N set
324
    bvs.s *                   * branch if V set
325
    bcs.s *                   * branch if C set
326
 
327
    move.w #$2700,sr           * Put flags back to initial value
328
 
329
    rts
330
 
331
 
332
*-----------------------------------------------------------
333
*-----------------------------------------------------------
334
* OPCODE : BTST
335
*-----------------------------------------------------------
336
*-----------------------------------------------------------
337
op_BTST:
338
 
339
*  Bit Number.s Static
340
 
341
*             EA = Dn  - LONG only
342
            move.l #$80000001,d0      * populate test data
343
            btst.l #0,d0
344
            beq.s *               * branch if Z set
345
            btst.l #1,d0              *
346
            bne.s *               * branch if Z clear
347
            btst.l #31,d0             *
348
            beq.s *               * branch if Z set
349
 
350
 
351
*             EA = (An)  - BYTE only
352
            move.l #$00000100,a0      * point to memory to address 0x100
353
            move.b #$81,(a0)          * populate test data
354
            move.b (a0),d1            * Check to see if data in memory is 0x81
355
            btst.b #0,(a0)
356
            beq.s *               * branch if Z set
357
            btst.b #1,(a0)            *
358
            bne.s *               * branch if Z clear
359
            btst.b #7,(a0)            *
360
            beq.s *               * branch if Z set
361
 
362
 
363
*             EA = (An)+  - BYTE only
364
            move.l #$00000100,a0      * point to memory to address 0x100
365
            move.b #$01,(a0)+         * populate test data
366
            move.b #$FC,(a0)+         * populate test data
367
            move.b #$80,(a0)+         * populate test data
368
            move.l #$00000100,a0      * point to memory to address 0x100
369
            btst.b #0,(a0)+
370
            beq.s *               * branch if Z set
371
            btst.b #1,(a0)+           *
372
            bne.s *               * branch if Z clear
373
            btst.b #7,(a0)+           *
374
            beq.s *               * branch if Z set
375
 
376
 
377
*             EA = -(An)  - BYTE only
378
            move.l #$00000100,a0      * point to memory to address
379
            move.b #$80,(a0)+         * populate test data
380
            move.b #$FC,(a0)+         * populate test data
381
            move.b #$01,(a0)+         * populate test data
382
            move.l #$00000103,a0      * point to memory to address
383
            btst.b #0,-(a0)
384
            beq.s *               * branch if Z set
385
            btst.b #1,-(a0)           *
386
            bne.s *               * branch if Z clear
387
            btst.b #7,-(a0)           *
388
            beq.s *               * branch if Z set
389
 
390
 
391
*             EA = n(An)  - BYTE only
392
            move.l #$00000100,a0      * point to memory to address
393
            move.b #$01,(a0)+         * populate test data
394
            move.b #$FC,(a0)+         * populate test data
395
            move.b #$80,(a0)+         * populate test data
396
            move.l #$00000100,a0      * point to memory to address
397
            btst.b #0,0(a0)
398
            beq.s *               * branch if Z set
399
            btst.b #1,1(a0)           *
400
            bne.s *               * branch if Z clear
401
            btst.b #7,2(a0)           *
402
            beq.s *               * branch if Z set
403
 
404
 
405
*             EA = n(An,R.W)  - BYTE only
406
            move.l #$00000100,a0      * point to memory to address
407
            move.l #$00000000,a1      * point to memory to address
408
            move.l #$00000001,a2      * point to memory to address
409
            moveq  #$00000000,d0      * point to memory to address
410
            moveq  #$00000001,d1      * point to memory to address
411
            btst.b #0,0(a0,d0.w)
412
            beq.s *               * branch if Z set
413
            btst.b #1,0(a0,d1.w)      *
414
            bne.s *               * branch if Z clear
415
            btst.b #7,1(a0,d1.w)      *
416
            beq.s *               * branch if Z set
417
*             EA = n(An,R.L)  - BYTE only
418
            btst.b #0,0(a0,d0.l)
419
            beq.s *               * branch if Z set
420
            btst.b #1,0(a0,d1.l)      *
421
            bne.s *               * branch if Z clear
422
            btst.b #7,1(a0,d1.l)      *
423
            beq.s *               * branch if Z set
424
*             EA = n(An,A.W)  - BYTE only
425
            btst.b #0,0(a0,a1.w)
426
            beq.s *               * branch if Z set
427
            btst.b #1,0(a0,a2.w)      *
428
            bne.s *               * branch if Z clear
429
            btst.b #7,1(a0,a2.w)      *
430
            beq.s *               * branch if Z set
431
*             EA = n(An,A.L)  - BYTE only
432
            btst.b #0,0(a0,a1.l)
433
            beq.s *               * branch if Z set
434
            btst.b #1,0(a0,a2.l)      *
435
            bne.s *               * branch if Z clear
436
            btst.b #7,1(a0,a2.l)      *
437
            beq.s *               * branch if Z set
438
 
439
 
440
*             EA = x.W  - BYTE only
441
            btst.b #0,$0100
442
            beq.s *               * branch if Z set
443
            btst.b #1,$0101           *
444
            bne.s *               * branch if Z clear
445
            btst.b #7,$0102           *
446
            beq.s *               * branch if Z set
447
 
448
 
449
*             EA = x.L  - BYTE only
450
            move.l #$F100,a0      * point to memory to address 0x100
451
            move.b #$01,(a0)+         * populate test data
452
            move.b #$FC,(a0)+         * populate test data
453
            move.b #$80,(a0)+         * populate test data
454
            btst.b #0,$F100
455
            beq.s *               * branch if Z set
456
            btst.b #1,$F101       *
457
            bne.s *               * branch if Z clear
458
            btst.b #7,$F102       *
459
            beq.s *               * branch if Z set
460
 
461
 
462
*             EA = x(PC)  - BYTE only
463
            lea op_BTST(pc),a5
464
            btst.b #0,op_BTST(pc)
465
            bne.s *               * branch if Z clear
466
            btst.b #3,op_BTST0(pc)     *
467
            beq.s *               * branch if Z set
468
            btst.b #6,op_BTST12(pc)    *
469
            beq.s *               * branch if Z set
470
 
471
 
472
*             EA = n(PC,R.W)  - BYTE only
473
            move.l #$00000100,a0      * point to memory to address
474
            move.l #$00000000,a1      * point to memory to address
475
            move.l #$00000001,a2      * point to memory to address
476
            moveq  #$00000000,d0      * point to memory to address
477
            moveq  #$00000001,d1      * point to memory to address
478
 
479
op_BTST0:   btst.b #0,op_BTST0(pc,d0.w)
480
            bne.s *               * branch if Z clear
481
 
482
            lea op_BTST1(pc,d1.w),a5
483
op_BTST1:   btst.b #1,op_BTST1(pc,d1.w)      *
484
            beq.s *               * branch if Z set
485
op_BTST2:   btst.b #7,op_BTST2(pc,d1.w)      *
486
            bne.s *               * branch if Z clear
487
*             EA = n(PC,R.L)  - BYTE only
488
op_BTST3:   btst.b #0,op_BTST3(pc,d0.l)
489
            bne.s *               * branch if Z clear
490
op_BTST4:   btst.b #1,op_BTST4(pc,d1.l)      *
491
            beq.s *               * branch if Z set
492
op_BTST5:   btst.b #7,op_BTST5(pc,d1.l)      *
493
            bne.s *               * branch if Z clear
494
*             EA = n(PC,A.W)  - BYTE only
495
op_BTST6    btst.b #0,op_BTST6(pc,a1.w)
496
            bne.s *               * branch if Z clear
497
op_BTST7:   btst.b #1,op_BTST7(pc,a2.w)      *
498
            beq.s *               * branch if Z set
499
op_BTST8:   btst.b #7,op_BTST8(pc,a2.w)      *
500
            bne.s *               * branch if Z clear
501
*             EA = n(PC,A.L)  - BYTE only
502
op_BTST9:   btst.b #0,op_BTST9(pc,a1.l)
503
            bne.s *               * branch if Z clear
504
op_BTST10:  btst.b #1,op_BTST10(pc,a2.l)      *
505
            beq.s *               * branch if Z set
506
op_BTST11:  btst.b #7,op_BTST11(pc,a2.l)      *
507
op_BTST12:  bne.s *               * branch if Z clear
508
 
509
 
510
 
511
* Bit Number.s Dynamic
512
 
513
*             EA = Dn  - LONG only
514
            move.l #$80000001,d0      * populate test data
515
            move.l #0,d5              * populate bit.s number to test
516
            move.l #1,d6              * populate bit.s number to test
517
            move.l #31,d7              * populate bit.s number to test
518
 
519
            btst.l d5,d0
520
            beq.s *               * branch if Z set
521
            btst.l d6,d0              *
522
            bne.s *               * branch if Z clear
523
            btst.l d7,d0             *
524
            beq.s *               * branch if Z set
525
 
526
 
527
*             EA = (An)  - BYTE only
528
            move.l #0,d5              * populate bit.s number to test
529
            move.l #1,d6              * populate bit.s number to test
530
            move.l #7,d7              * populate bit.s number to test
531
            move.l #$00000100,a0      * point to memory to address 0x100
532
            move.b #$81,(a0)          * populate test data
533
            move.b (a0),d1            * Check to see if data in memory is 0x81
534
            btst.b d5,(a0)
535
            beq.s *               * branch if Z set
536
            btst.b d6,(a0)            *
537
            bne.s *               * branch if Z clear
538
            btst.b d7,(a0)            *
539
            beq.s *               * branch if Z set
540
 
541
* ---
542
 
543
 
544
*             EA = (An)+  - BYTE only
545
            move.l #$00000100,a0      * point to memory to address 0x100
546
            move.b #$01,(a0)+         * populate test data
547
            move.b #$FC,(a0)+         * populate test data
548
            move.b #$80,(a0)+         * populate test data
549
            move.l #$00000100,a0      * point to memory to address 0x100
550
            btst.b d5,(a0)+
551
            beq.s *               * branch if Z set
552
            btst.b d6,(a0)+           *
553
            bne.s *               * branch if Z clear
554
            btst.b d7,(a0)+           *
555
            beq.s *               * branch if Z set
556
 
557
 
558
*             EA = -(An)  - BYTE only
559
            move.l #$00000100,a0      * point to memory to address
560
            move.b #$80,(a0)+         * populate test data
561
            move.b #$FC,(a0)+         * populate test data
562
            move.b #$01,(a0)+         * populate test data
563
            move.l #$00000103,a0      * point to memory to address
564
            btst.b d5,-(a0)
565
            beq.s *               * branch if Z set
566
            btst.b d6,-(a0)           *
567
            bne.s *               * branch if Z clear
568
            btst.b d7,-(a0)           *
569
            beq.s *               * branch if Z set
570
 
571
 
572
*             EA = n(An)  - BYTE only
573
            move.l #$00000100,a0      * point to memory to address
574
            move.b #$01,(a0)+         * populate test data
575
            move.b #$FC,(a0)+         * populate test data
576
            move.b #$80,(a0)+         * populate test data
577
            move.l #$00000100,a0      * point to memory to address
578
            btst.b d5,0(a0)
579
            beq.s *               * branch if Z set
580
            btst.b d6,1(a0)           *
581
            bne.s *               * branch if Z clear
582
            btst.b d7,2(a0)           *
583
            beq.s *               * branch if Z set
584
 
585
 
586
*             EA = n(An,R.W)  - BYTE only
587
            move.l #$00000100,a0      * point to memory to address
588
            move.l #$00000000,a1      * point to memory to address
589
            move.l #$00000001,a2      * point to memory to address
590
            moveq  #$00000000,d0      * point to memory to address
591
            moveq  #$00000001,d1      * point to memory to address
592
            btst.b d5,0(a0,d0.w)
593
            beq.s *               * branch if Z set
594
            btst.b d6,0(a0,d1.w)      *
595
            bne.s *               * branch if Z clear
596
            btst.b d7,1(a0,d1.w)      *
597
            beq.s *               * branch if Z set
598
*             EA = n(An,R.L)  - BYTE only
599
            btst.b d5,0(a0,d0.l)
600
            beq.s *               * branch if Z set
601
            btst.b d6,0(a0,d1.l)      *
602
            bne.s *               * branch if Z clear
603
            btst.b d7,1(a0,d1.l)      *
604
            beq.s *               * branch if Z set
605
*             EA = n(An,A.W)  - BYTE only
606
            btst.b d5,0(a0,a1.w)
607
            beq.s *               * branch if Z set
608
            btst.b d6,0(a0,a2.w)      *
609
            bne.s *               * branch if Z clear
610
            btst.b d7,1(a0,a2.w)      *
611
            beq.s *               * branch if Z set
612
*             EA = n(An,A.L)  - BYTE only
613
            btst.b d5,0(a0,a1.l)
614
            beq.s *               * branch if Z set
615
            btst.b d6,0(a0,a2.l)      *
616
            bne.s *               * branch if Z clear
617
            btst.b d7,1(a0,a2.l)      *
618
            beq.s *               * branch if Z set
619
 
620
 
621
*             EA = x.W  - BYTE only
622
            btst.b d5,$0100
623
            beq.s *               * branch if Z set
624
            btst.b d6,$0101           *
625
            bne.s *               * branch if Z clear
626
            btst.b d7,$0102           *
627
            beq.s *               * branch if Z set
628
 
629
 
630
*             EA = x.L  - BYTE only
631
            move.l #$F100,a0      * point to memory to address 0x100
632
            move.b #$01,(a0)+         * populate test data
633
            move.b #$FC,(a0)+         * populate test data
634
            move.b #$80,(a0)+         * populate test data
635
            btst.b d5,$F100
636
            beq.s *               * branch if Z set
637
            btst.b d6,$F101       *
638
            bne.s *               * branch if Z clear
639
            btst.b d7,$F102       *
640
            beq.s *               * branch if Z set
641
 
642
 
643
*             EA = x(PC)  - BYTE only
644
            move.l #3,d6              * populate bit.s number to test
645
            move.l #6,d7              * populate bit.s number to test
646
            lea op_BTST(pc),a5
647
            btst.b d5,op_BTST(pc)
648
            bne.s *               * branch if Z clear
649
            btst.b d6,op_BTST0(pc)     *
650
            beq.s *               * branch if Z set
651
            btst.b d7,op_BTST12(pc)    *
652
            beq.s *               * branch if Z set
653
 
654
 
655
*             EA = n(PC,R.W)  - BYTE only
656
            move.l #$00000100,a0      * point to memory to address
657
            move.l #$00000000,a1      * point to memory to address
658
            move.l #$00000001,a2      * point to memory to address
659
            moveq  #$00000000,d0      * point to memory to address
660
            moveq  #$00000001,d1      * point to memory to address
661
            move.l #1,d6              * populate bit.s number to test
662
            move.l #7,d7              * populate bit.s number to test
663
 
664
op_BTST20:  btst.b d5,op_BTST20(pc,d0.w)
665
            beq.s *               * branch if Z set
666
            lea op_BTST21(pc,d1.w),a5
667
op_BTST21:  btst.b d6,op_BTST21(pc,d1.w)      *
668
            beq.s *               * branch if Z set
669
op_BTST22:  btst.b d7,op_BTST22(pc,d1.w)      *
670
            bne.s *               * branch if Z clear
671
*             EA = n(PC,R.L)  - BYTE only
672
op_BTST23:  btst.b d5,op_BTST23(pc,d0.l)
673
            beq.s *               * branch if Z set
674
op_BTST24: btst.b d6,op_BTST24(pc,d1.l)      *
675
            beq.s *               * branch if Z set
676
op_BTST25  btst.b d7,op_BTST25(pc,d1.l)      *
677
            bne.s *               * branch if Z clear
678
*             EA = n(PC,A.W)  - BYTE only
679
op_BTST26   btst.b d5,op_BTST26(pc,a1.w)
680
            beq.s *               * branch if Z set
681
op_BTST27:  btst.b d6,op_BTST27(pc,a2.w)      *
682
            beq.s *               * branch if Z set
683
op_BTST28:  btst.b d7,op_BTST28(pc,a2.w)      *
684
            bne.s *               * branch if Z clear
685
*             EA = n(PC,A.L)  - BYTE only
686
op_BTST29:  btst.b d5,op_BTST29(pc,a1.l)
687
            beq.s *               * branch if Z set
688
op_BTST30:  btst.b d6,op_BTST30(pc,a2.l)      *
689
            beq.s *               * branch if Z set
690
op_BTST31:  btst.b d7,op_BTST31(pc,a2.l)      *
691
op_BTST32:  bne.s *               * branch if Z clear
692
 
693
*             EA = #x  - BYTE only
694
 
695
            move.l #0,d5              * populate bit.s number to test
696
            move.l #3,d6              * populate bit.s number to test
697
            move.l #7,d7              * populate bit.s number to test
698
 
699
            btst.b d5,#$88
700
            bne.s *               * branch if Z clear
701
            btst.b d6,#$88
702
            beq.s *               * branch if Z set
703
            btst.b d7,#$88
704
            beq.s *               * branch if Z set
705
 
706
 
707
    rts
708
 
709
*-----------------------------------------------------------
710
*-----------------------------------------------------------
711
* OPCODE : BCHG
712
*-----------------------------------------------------------
713
*-----------------------------------------------------------
714
op_BCHG:
715
 
716
 
717
*  Bit Number.s Static
718
 
719
*             EA = Dn  - LONG only
720
            move.l #$80000001,d0      * populate test data
721
            bchg.l #0,d0
722
            beq.s *               * branch if Z set
723
            bchg.l #1,d0              *
724
            bne.s *               * branch if Z clear
725
            bchg.l #31,d0             *
726
            beq.s *               * branch if Z set
727
            cmpi.l #$00000002,d0
728
            bne.s *               * branch if Z clear
729
 
730
 
731
*             EA = (An)  - BYTE only
732
            move.l #$00000100,a0      * point to memory to address 0x100
733
            move.b #$81,(a0)          * populate test data
734
            move.b (a0),d1            * Check to see if data in memory is 0x81
735
            bchg.b #0,(a0)
736
            beq.s *               * branch if Z set
737
            bchg.b #1,(a0)            *
738
            bne.s *               * branch if Z clear
739
            bchg.b #7,(a0)            *
740
            beq.s *               * branch if Z set
741
            cmpi.b #$02,(a0)
742
            bne.s *               * branch if Z clear
743
 
744
*             EA = (An)+  - BYTE only
745
            move.l #$00000100,a0      * point to memory to address 0x100
746
            move.b #$01,(a0)+         * populate test data
747
            move.b #$FC,(a0)+         * populate test data
748
            move.b #$80,(a0)+         * populate test data
749
            move.l #$00000100,a0      * point to memory to address 0x100
750
            bchg.b #0,(a0)+
751
            beq.s *               * branch if Z set
752
            bchg.b #1,(a0)+           *
753
            bne.s *               * branch if Z clear
754
            bchg.b #7,(a0)+           *
755
            beq.s *               * branch if Z set
756
            move.l #$00000100,a0      * point to memory to address 0x100
757
            cmpi.b #$00,(a0)+
758
            bne.s *               * branch if Z clear
759
            cmpi.b #$FE,(a0)+
760
            bne.s *               * branch if Z clear
761
            cmpi.b #$00,(a0)+
762
            bne.s *               * branch if Z clear
763
 
764
*             EA = -(An)  - BYTE only
765
            move.l #$00000100,a0      * point to memory to address
766
            move.b #$80,(a0)+         * populate test data
767
            move.b #$FC,(a0)+         * populate test data
768
            move.b #$01,(a0)+         * populate test data
769
            move.l #$00000103,a0      * point to memory to address
770
            bchg.b #0,-(a0)
771
            beq.s *               * branch if Z set
772
            bchg.b #1,-(a0)           *
773
            bne.s *               * branch if Z clear
774
            bchg.b #7,-(a0)           *
775
            beq.s *               * branch if Z set
776
            move.l #$00000103,a0      * point to memory to address 0x100
777
            cmpi.b #$00,-(a0)
778
            bne.s *               * branch if Z clear
779
            cmpi.b #$FE,-(a0)
780
            bne.s *               * branch if Z clear
781
            cmpi.b #$00,-(a0)
782
            bne.s *               * branch if Z clear
783
 
784
 
785
*             EA = n(An)  - BYTE only
786
            move.l #$00000100,a0      * point to memory to address
787
            move.b #$01,(a0)+         * populate test data
788
            move.b #$FC,(a0)+         * populate test data
789
            move.b #$80,(a0)+         * populate test data
790
            move.l #$00000100,a0      * point to memory to address
791
            bchg.b #0,0(a0)
792
            beq.s *               * branch if Z set
793
            bchg.b #1,1(a0)           *
794
            bne.s *               * branch if Z clear
795
            bchg.b #7,2(a0)           *
796
            beq.s *               * branch if Z set
797
            move.l #$00000100,a0      * point to memory to address 0x100
798
            cmpi.b #$00,(a0)+
799
            bne.s *               * branch if Z clear
800
            cmpi.b #$FE,(a0)+
801
            bne.s *               * branch if Z clear
802
            cmpi.b #$00,(a0)+
803
            bne.s *               * branch if Z clear
804
 
805
 
806
*             EA = n(An,D.W)  - BYTE only
807
            move.l #$00000100,a0      * point to memory to address
808
            move.l #$00000000,a1      * point to memory to address
809
            move.l #$00000001,a2      * point to memory to address
810
            moveq  #$00000000,d0      * point to memory to address
811
            moveq  #$00000001,d1      * point to memory to address
812
            bchg.b #0,0(a0,d0.w)
813
            bne.s *               * branch if Z clear
814
            bchg.b #1,0(a0,d1.w)      *
815
            beq.s *               * branch if Z set
816
            bchg.b #7,1(a0,d1.w)      *
817
            bne.s *               * branch if Z clear
818
*             EA = n(An,D.L)  - BYTE only
819
            bchg.b #0,0(a0,d0.l)
820
            beq.s *               * branch if Z set
821
            bchg.b #1,0(a0,d1.l)      *
822
            bne.s *               * branch if Z clear
823
            bchg.b #7,1(a0,d1.l)      *
824
            beq.s *               * branch if Z set
825
*             EA = n(An,A.W)  - BYTE only
826
            bchg.b #0,0(a0,a1.w)
827
            bne.s *               * branch if Z clear
828
            bchg.b #1,0(a0,a2.w)      *
829
            beq.s *               * branch if Z set
830
            bchg.b #7,1(a0,a2.w)      *
831
            bne.s *               * branch if Z clear
832
*             EA = n(An,A.L)  - BYTE only
833
            bchg.b #0,0(a0,a1.l)
834
            beq.s *               * branch if Z set
835
            bchg.b #1,0(a0,a2.l)      *
836
            bne.s *               * branch if Z clear
837
            bchg.b #7,1(a0,a2.l)      *
838
            beq.s *               * branch if Z set
839
            move.l #$00000100,a0      * point to memory to address 0x100
840
            cmpi.b #$00,(a0)+
841
            bne.s *               * branch if Z clear
842
            cmpi.b #$FE,(a0)+
843
            bne.s *               * branch if Z clear
844
            cmpi.b #$00,(a0)+
845
            bne.s *               * branch if Z clear
846
 
847
 
848
*             EA = x.W  - BYTE only
849
            bchg.b #0,$0100
850
            bne.s *               * branch if Z clear
851
            bchg.b #1,$0101           *
852
            beq.s *               * branch if Z set
853
            bchg.b #7,$0102           *
854
            bne.s *               * branch if Z clear
855
            move.l #$00000100,a0      * point to memory to address 0x100
856
            cmpi.b #$01,(a0)+
857
            bne.s *               * branch if Z clear
858
            cmpi.b #$FC,(a0)+
859
            bne.s *               * branch if Z clear
860
            cmpi.b #$80,(a0)+
861
            bne.s *               * branch if Z clear
862
 
863
*             EA = x.L  - BYTE only
864
            move.l #$F100,a0      * point to memory to address 0x100
865
            move.b #$01,(a0)+         * populate test data
866
            move.b #$FC,(a0)+         * populate test data
867
            move.b #$80,(a0)+         * populate test data
868
            bchg.b #0,$F100
869
            beq.s *               * branch if Z set
870
            bchg.b #1,$F101       *
871
            bne.s *               * branch if Z clear
872
            bchg.b #7,$F102       *
873
            beq.s *               * branch if Z set
874
            move.l #$00000100,a0      * point to memory to address 0x100
875
            cmpi.b #$01,(a0)+
876
            bne.s *               * branch if Z clear
877
            cmpi.b #$FC,(a0)+
878
            bne.s *               * branch if Z clear
879
            cmpi.b #$80,(a0)+
880
            bne.s *               * branch if Z clear
881
 
882
 
883
* Bit Number.s Dynamic
884
 
885
*             EA = Dn  - LONG only
886
            move.l #$80000001,d0      * populate test data
887
            move.l #0,d5              * populate bit.s number to test
888
            move.l #1,d6              * populate bit.s number to test
889
            move.l #31,d7              * populate bit.s number to test
890
 
891
            bchg.l d5,d0
892
            beq.s *               * branch if Z set
893
            bchg.l d6,d0              *
894
            bne.s *               * branch if Z clear
895
            bchg.l d7,d0             *
896
            beq.s *               * branch if Z set
897
            cmpi.l #$00000002,d0
898
            bne.s *               * branch if Z clear
899
 
900
 
901
*             EA = (An)  - BYTE only
902
            move.l #0,d5              * populate bit.s number to test
903
            move.l #1,d6              * populate bit.s number to test
904
            move.l #7,d7              * populate bit.s number to test
905
            move.l #$00000100,a0      * point to memory to address 0x100
906
            move.b #$81,(a0)          * populate test data
907
            move.b (a0),d1            * Check to see if data in memory is 0x81
908
            bchg.b d5,(a0)
909
            beq.s *               * branch if Z set
910
            bchg.b d6,(a0)            *
911
            bne.s *               * branch if Z clear
912
            bchg.b d7,(a0)            *
913
            beq.s *               * branch if Z set
914
            cmpi.b #$02,(a0)
915
            bne.s *               * branch if Z clear
916
 
917
 
918
*             EA = (An)+  - BYTE only
919
            move.l #$00000100,a0      * point to memory to address 0x100
920
            move.b #$01,(a0)+         * populate test data
921
            move.b #$FC,(a0)+         * populate test data
922
            move.b #$80,(a0)+         * populate test data
923
            move.l #$00000100,a0      * point to memory to address 0x100
924
            bchg.b d5,(a0)+
925
            beq.s *               * branch if Z set
926
            bchg.b d6,(a0)+           *
927
            bne.s *               * branch if Z clear
928
            bchg.b d7,(a0)+           *
929
            beq.s *               * branch if Z set
930
            move.l #$00000100,a0      * point to memory to address 0x100
931
            cmpi.b #$00,(a0)+
932
            bne.s *               * branch if Z clear
933
            cmpi.b #$FE,(a0)+
934
            bne.s *               * branch if Z clear
935
            cmpi.b #$00,(a0)+
936
            bne.s *               * branch if Z clear
937
 
938
*             EA = -(An)  - BYTE only
939
            move.l #$00000100,a0      * point to memory to address
940
            move.b #$80,(a0)+         * populate test data
941
            move.b #$FC,(a0)+         * populate test data
942
            move.b #$01,(a0)+         * populate test data
943
            move.l #$00000103,a0      * point to memory to address
944
            bchg.b d5,-(a0)
945
            beq.s *               * branch if Z set
946
            bchg.b d6,-(a0)           *
947
            bne.s *               * branch if Z clear
948
            bchg.b d7,-(a0)           *
949
            beq.s *               * branch if Z set
950
            move.l #$00000103,a0      * point to memory to address 0x100
951
            cmpi.b #$00,-(a0)
952
            bne.s *               * branch if Z clear
953
            cmpi.b #$FE,-(a0)
954
            bne.s *               * branch if Z clear
955
            cmpi.b #$00,-(a0)
956
            bne.s *               * branch if Z clear
957
 
958
*             EA = n(An)  - BYTE only
959
            move.l #$00000100,a0      * point to memory to address
960
            move.b #$01,(a0)+         * populate test data
961
            move.b #$FC,(a0)+         * populate test data
962
            move.b #$80,(a0)+         * populate test data
963
            move.l #$00000100,a0      * point to memory to address
964
            bchg.b d5,0(a0)
965
            beq.s *               * branch if Z set
966
            bchg.b d6,1(a0)           *
967
            bne.s *               * branch if Z clear
968
            bchg.b d7,2(a0)           *
969
            beq.s *               * branch if Z set
970
            move.l #$00000100,a0      * point to memory to address 0x100
971
            cmpi.b #$00,(a0)+
972
            bne.s *               * branch if Z clear
973
            cmpi.b #$FE,(a0)+
974
            bne.s *               * branch if Z clear
975
            cmpi.b #$00,(a0)+
976
            bne.s *               * branch if Z clear
977
 
978
*             EA = n(An,R.W)  - BYTE only
979
            move.l #$00000100,a0      * point to memory to address
980
            move.l #$00000000,a1      * point to memory to address
981
            move.l #$00000001,a2      * point to memory to address
982
            moveq  #$00000000,d0      * point to memory to address
983
            moveq  #$00000001,d1      * point to memory to address
984
            bchg.b d5,0(a0,d0.w)
985
            bne.s *               * branch if Z clear
986
            bchg.b d6,0(a0,d1.w)      *
987
            beq.s *               * branch if Z set
988
            bchg.b d7,1(a0,d1.w)      *
989
            bne.s *               * branch if Z clear
990
*             EA = n(An,R.L)  - BYTE only
991
            bchg.b d5,0(a0,d0.l)
992
            beq.s *               * branch if Z set
993
            bchg.b d6,0(a0,d1.l)      *
994
            bne.s *               * branch if Z clear
995
            bchg.b d7,1(a0,d1.l)      *
996
            beq.s *               * branch if Z set
997
*             EA = n(An,A.W)  - BYTE only
998
            bchg.b d5,0(a0,a1.w)
999
            bne.s *               * branch if Z clear
1000
            bchg.b d6,0(a0,a2.w)      *
1001
            beq.s *               * branch if Z set
1002
            bchg.b d7,1(a0,a2.w)      *
1003
            bne.s *               * branch if Z clear
1004
*             EA = n(An,A.L)  - BYTE only
1005
            bchg.b d5,0(a0,a1.l)
1006
            beq.s *               * branch if Z set
1007
            bchg.b d6,0(a0,a2.l)      *
1008
            bne.s *               * branch if Z clear
1009
            bchg.b d7,1(a0,a2.l)      *
1010
            beq.s *               * branch if Z set
1011
            cmpi.b #$00,(a0)+
1012
            bne.s *               * branch if Z clear
1013
 
1014
*             EA = x.W  - BYTE only
1015
            bchg.b d5,$0100
1016
            bne.s *               * branch if Z clear
1017
            bchg.b d6,$0101           *
1018
            beq.s *               * branch if Z set
1019
            bchg.b d7,$0102           *
1020
            bne.s *               * branch if Z clear
1021
            cmpi.b #$FC,(a0)+
1022
            bne.s *               * branch if Z clear
1023
 
1024
*             EA = x.L  - BYTE only
1025
            move.l #$F100,a0      * point to memory to address 0x100
1026
            move.b #$01,(a0)+         * populate test data
1027
            move.b #$FC,(a0)+         * populate test data
1028
            move.b #$80,(a0)+         * populate test data
1029
            bchg.b d5,$F100
1030
            beq.s *               * branch if Z set
1031
            bchg.b d6,$F101       *
1032
            bne.s *               * branch if Z clear
1033
            bchg.b d7,$F102       *
1034
            beq.s *               * branch if Z set
1035
            move.l #$F101,a0      * point to memory to address 0x100
1036
            cmpi.b #$FE,(a0)
1037
            bne.s *               * branch if Z clear
1038
 
1039
 
1040
    rts
1041
 
1042
*-----------------------------------------------------------
1043
*-----------------------------------------------------------
1044
* OPCODE : BCLR
1045
*-----------------------------------------------------------
1046
*-----------------------------------------------------------
1047
op_BCLR:
1048
 
1049
 
1050
*  Bit Number.s Static
1051
 
1052
*             EA = Dn  - LONG only
1053
            move.l #$FF0000FF,d0      * populate test data
1054
            bclr.l #0,d0
1055
            beq.s *               * branch if Z set
1056
            bclr.l #1,d0              *
1057
            beq.s *               * branch if Z set
1058
            bclr.l #15,d0             *
1059
            bne.s *               * branch if Z clear
1060
            bclr.l #31,d0             *
1061
            beq.s *               * branch if Z set
1062
            cmpi.l #$7F0000FC,d0
1063
            bne.s *               * branch if Z clear
1064
 
1065
 
1066
*             EA = (An)  - BYTE only
1067
            move.l #$00000100,a0      * point to memory to address 0x100
1068
            move.b #$0F,(a0)          * populate test data
1069
            bclr.b #0,(a0)
1070
            beq.s *               * branch if Z set
1071
            bclr.b #7,(a0)            *
1072
            bne.s *               * branch if Z clear
1073
            cmpi.b #$0E,(a0)
1074
            bne.s *               * branch if Z clear
1075
 
1076
*             EA = (An)+  - BYTE only
1077
            move.l #$00000100,a0      * point to memory to address 0x100
1078
            move.b #$01,(a0)+         * populate test data
1079
            move.b #$00,(a0)+         * populate test data
1080
            move.l #$00000100,a0      * point to memory to address 0x100
1081
            bclr.b #0,(a0)+
1082
            beq.s *               * branch if Z set
1083
            bclr.b #1,(a0)+           *
1084
            bne.s *               * branch if Z clear
1085
            move.l #$00000100,a0      * point to memory to address 0x100
1086
            cmpi.b #$00,(a0)+
1087
            bne.s *               * branch if Z clear
1088
            cmpi.b #$00,(a0)+
1089
            bne.s *               * branch if Z clear
1090
 
1091
 
1092
*             EA = -(An)  - BYTE only
1093
            move.l #$00000100,a0      * point to memory to address
1094
            move.b #$01,(a0)+         * populate test data
1095
            move.b #$80,(a0)+         * populate test data
1096
            bclr.b #7,-(a0)
1097
            beq.s *               * branch if Z set
1098
            bclr.b #0,-(a0)           *
1099
            beq.s *               * branch if Z set
1100
            move.l #$00000102,a0      * point to memory to address 0x100
1101
            cmpi.b #$00,-(a0)
1102
            bne.s *               * branch if Z clear
1103
            cmpi.b #$00,-(a0)
1104
            bne.s *               * branch if Z clear
1105
 
1106
 
1107
*             EA = n(An)  - BYTE only
1108
            move.l #$00000100,a0      * point to memory to address
1109
            move.b #$FF,(a0)+         * populate test data
1110
            move.b #$FF,(a0)+         * populate test data
1111
            move.l #$00000100,a0      * point to memory to address
1112
            bclr.b #0,0(a0)
1113
            beq.s *               * branch if Z set
1114
            bclr.b #4,1(a0)           *
1115
            beq.s *               * branch if Z set
1116
            move.l #$00000100,a0      * point to memory to address 0x100
1117
            cmpi.b #$FE,(a0)+
1118
            bne.s *               * branch if Z clear
1119
            cmpi.b #$EF,(a0)+
1120
            bne.s *               * branch if Z clear
1121
 
1122
 
1123
*             EA = n(An,D.W)  - BYTE only
1124
            move.l #$00000100,a0      * point to memory to address
1125
            move.l #$00000000,a1      * point to memory to address
1126
            move.l #$00000001,a2      * point to memory to address
1127
            moveq  #$00000000,d0      * point to memory to address
1128
            moveq  #$00000001,d1      * point to memory to address
1129
            move.b #$FF,(a0)+         * populate test data
1130
            move.b #$FF,(a0)+         * populate test data
1131
            move.l #$00000100,a0      * point to memory to address
1132
            bclr.b #0,0(a0,d0.w)
1133
            beq.s *               * branch if Z set
1134
            bclr.b #1,0(a0,d1.w)      *
1135
            beq.s *               * branch if Z set
1136
            bclr.b #2,1(a0,d1.w)      *
1137
            bne.s *               * branch if Z clear
1138
*             EA = n(An,D.L)  - BYTE only
1139
            bclr.b #3,0(a0,d0.l)
1140
            beq.s *               * branch if Z set
1141
            bclr.b #4,0(a0,d1.l)      *
1142
            beq.s *               * branch if Z set
1143
            bclr.b #5,1(a0,d1.l)      *
1144
            bne.s *               * branch if Z clear
1145
*             EA = n(An,A.W)  - BYTE only
1146
            bclr.b #6,0(a0,a1.w)
1147
            beq.s *               * branch if Z set
1148
            bclr.b #1,0(a0,a2.w)      *
1149
            bne.s *               * branch if Z clear
1150
            bclr.b #7,1(a0,a2.w)      *
1151
            beq.s *               * branch if Z set
1152
*             EA = n(An,A.L)  - BYTE only
1153
            bclr.b #0,0(a0,a1.l)
1154
            bne.s *               * branch if Z clear
1155
            bclr.b #0,0(a0,a2.l)      *
1156
            beq.s *               * branch if Z set
1157
            bclr.b #1,1(a0,a2.l)      *
1158
            bne.s *               * branch if Z clear
1159
            move.l #$00000100,a0      * point to memory to address 0x100
1160
            cmpi.b #$B6,(a0)+
1161
            bne.s *               * branch if Z clear
1162
            cmpi.b #$EC,(a0)+
1163
            bne.s *               * branch if Z clear
1164
            cmpi.b #$59,(a0)+
1165
            beq.s *               * branch if Z set
1166
 
1167
 
1168
*             EA = x.W  - BYTE only
1169
            move.l #$00000100,a0      * point to memory to address
1170
            move.b #$FF,(a0)+         * populate test data
1171
            bclr.b #0,$0100
1172
            beq.s *               * branch if Z set
1173
            bclr.b #1,$0100           *
1174
            beq.s *               * branch if Z set
1175
            move.l #$00000100,a0      * point to memory to address 0x100
1176
            cmpi.b #$FC,(a0)+
1177
            bne.s *               * branch if Z clear
1178
 
1179
 
1180
*             EA = x.L  - BYTE only
1181
            move.l #$F100,a0      * point to memory to address 0x100
1182
            move.b #$FF,(a0)          * populate test data
1183
            bclr.b #0,$F100
1184
            beq.s *               * branch if Z set
1185
            bclr.b #1,$F100       *
1186
            beq.s *               * branch if Z set
1187
            bclr.b #2,$F100       *
1188
            beq.s *               * branch if Z set
1189
            move.l #$F100,a0      * point to memory to address 0x100
1190
            cmpi.b #$F8,(a0)+
1191
            bne.s *               * branch if Z clear
1192
 
1193
 
1194
* Bit Number.s Dynamic
1195
 
1196
*             EA = Dn  - LONG only
1197
            move.l #$FF00FF00,d0      * populate test data
1198
            move.l #0,d5              * populate bit.s number to test
1199
            move.l #1,d6              * populate bit.s number to test
1200
            move.l #31,d7              * populate bit.s number to test
1201
 
1202
            bclr.l d5,d0
1203
            bne.s *               * branch if Z clear
1204
            bclr.l d6,d0              *
1205
            bne.s *               * branch if Z clear
1206
            bclr.l d7,d0             *
1207
            beq.s *               * branch if Z set
1208
            cmpi.l #$7F00FF00,d0
1209
            bne.s *               * branch if Z clear
1210
 
1211
 
1212
*             EA = (An)  - BYTE only
1213
            move.l #0,d5              * populate bit.s number to test
1214
            move.l #1,d6              * populate bit.s number to test
1215
            move.l #7,d7              * populate bit.s number to test
1216
            move.l #$00000100,a0      * point to memory to address 0x100
1217
            move.b #$81,(a0)          * populate test data
1218
            bclr.b d5,(a0)
1219
            beq.s *               * branch if Z set
1220
            bclr.b d6,(a0)            *
1221
            bne.s *               * branch if Z clear
1222
            bclr.b d7,(a0)            *
1223
            beq.s *               * branch if Z set
1224
            cmpi.b #$00,(a0)
1225
            bne.s *               * branch if Z clear
1226
 
1227
 
1228
*             EA = (An)+  - BYTE only
1229
            move.l #$00000100,a0      * point to memory to address 0x100
1230
            move.b #$01,(a0)+         * populate test data
1231
            move.b #$FC,(a0)+         * populate test data
1232
            move.b #$80,(a0)+         * populate test data
1233
            move.l #$00000100,a0      * point to memory to address 0x100
1234
            bclr.b d5,(a0)+
1235
            beq.s *               * branch if Z set
1236
            bclr.b d6,(a0)+           *
1237
            bne.s *               * branch if Z clear
1238
            bclr.b d7,(a0)+           *
1239
            beq.s *               * branch if Z set
1240
            move.l #$00000100,a0      * point to memory to address 0x100
1241
            cmpi.b #$00,(a0)+
1242
            bne.s *               * branch if Z clear
1243
            cmpi.b #$FC,(a0)+
1244
            bne.s *               * branch if Z clear
1245
            cmpi.b #$00,(a0)+
1246
            bne.s *               * branch if Z clear
1247
 
1248
*             EA = -(An)  - BYTE only
1249
            move.l #$00000100,a0      * point to memory to address
1250
            move.b #$80,(a0)+         * populate test data
1251
            move.b #$FC,(a0)+         * populate test data
1252
            move.b #$01,(a0)+         * populate test data
1253
            move.l #$00000103,a0      * point to memory to address
1254
            bclr.b d5,-(a0)
1255
            beq.s *               * branch if Z set
1256
            bclr.b d6,-(a0)           *
1257
            bne.s *               * branch if Z clear
1258
            bclr.b d7,-(a0)           *
1259
            beq.s *               * branch if Z set
1260
            move.l #$00000103,a0      * point to memory to address 0x100
1261
            cmpi.b #$00,-(a0)
1262
            bne.s *               * branch if Z clear
1263
            cmpi.b #$FC,-(a0)
1264
            bne.s *               * branch if Z clear
1265
            cmpi.b #$00,-(a0)
1266
            bne.s *               * branch if Z clear
1267
 
1268
*             EA = n(An)  - BYTE only
1269
            move.l #$00000100,a0      * point to memory to address
1270
            move.b #$01,(a0)+         * populate test data
1271
            move.b #$FC,(a0)+         * populate test data
1272
            move.b #$80,(a0)+         * populate test data
1273
            move.l #$00000100,a0      * point to memory to address
1274
            bclr.b d5,0(a0)
1275
            beq.s *               * branch if Z set
1276
            bclr.b d6,1(a0)           *
1277
            bne.s *               * branch if Z clear
1278
            bclr.b d7,2(a0)           *
1279
            beq.s *               * branch if Z set
1280
            move.l #$00000100,a0      * point to memory to address 0x100
1281
            cmpi.b #$00,(a0)+
1282
            bne.s *               * branch if Z clear
1283
            cmpi.b #$FC,(a0)+
1284
            bne.s *               * branch if Z clear
1285
            cmpi.b #$00,(a0)+
1286
            bne.s *               * branch if Z clear
1287
 
1288
*             EA = n(An,R.W)  - BYTE only
1289
            move.l #$00000100,a0      * point to memory to address
1290
            move.b #$FF,(a0)+         * populate test data
1291
            move.b #$FF,(a0)+         * populate test data
1292
            move.b #$FF,(a0)+         * populate test data
1293
            move.l #$00000103,a0      * point to memory to address
1294
            move.l #$00000100,a0      * point to memory to address
1295
            move.l #$00000000,a1      * point to memory to address
1296
            move.l #$00000001,a2      * point to memory to address
1297
            moveq  #$00000000,d0      * point to memory to address
1298
            moveq  #$00000001,d1      * point to memory to address
1299
            bclr.b d5,0(a0,d0.w)
1300
            beq.s *               * branch if Z set
1301
            bclr.b d6,0(a0,d1.w)      *
1302
            beq.s *               * branch if Z set
1303
            bclr.b d7,1(a0,d1.w)      *
1304
            beq.s *               * branch if Z set
1305
*             EA = n(An,R.L)  - BYTE only
1306
            bclr.b d5,0(a0,d0.l)
1307
            bne.s *               * branch if Z clear
1308
            bclr.b d6,0(a0,d1.l)      *
1309
            bne.s *               * branch if Z clear
1310
            bclr.b d7,1(a0,d1.l)      *
1311
            bne.s *               * branch if Z clear
1312
*             EA = n(An,A.W)  - BYTE only
1313
            bclr.b d5,0(a0,a1.w)
1314
            bne.s *               * branch if Z clear
1315
            bclr.b d6,0(a0,a2.w)      *
1316
            bne.s *               * branch if Z clear
1317
            bclr.b d7,1(a0,a2.w)      *
1318
            bne.s *               * branch if Z clear
1319
*             EA = n(An,A.L)  - BYTE only
1320
            bclr.b d5,0(a0,a1.l)
1321
            bne.s *               * branch if Z clear
1322
            bclr.b d6,0(a0,a2.l)      *
1323
            bne.s *               * branch if Z clear
1324
            bclr.b d7,1(a0,a2.l)      *
1325
            bne.s *               * branch if Z clear
1326
            move.l #$00000100,a0      * point to memory to address
1327
            cmpi.b #$FE,(a0)
1328
            bne.s *               * branch if Z clear
1329
 
1330
*             EA = x.W  - BYTE only
1331
            move.l #$00000100,a0      * point to memory to address
1332
            move.b #$FF,(a0)+         * populate test data
1333
            move.b #$FF,(a0)+         * populate test data
1334
            move.b #$FF,(a0)+         * populate test data
1335
            bclr.b d5,$0100
1336
            beq.s *               * branch if Z set
1337
            bclr.b d6,$0101           *
1338
            beq.s *               * branch if Z set
1339
            bclr.b d7,$0102           *
1340
            beq.s *               * branch if Z set
1341
            move.l #$00000100,a0      * point to memory to address
1342
            cmpi.b #$FE,(a0)+
1343
            bne.s *               * branch if Z clear
1344
 
1345
*             EA = x.L  - BYTE only
1346
            move.l #$F100,a0      * point to memory to address 0x100
1347
            move.b #$01,(a0)+         * populate test data
1348
            move.b #$FC,(a0)+         * populate test data
1349
            move.b #$80,(a0)+         * populate test data
1350
            bclr.b d5,$F100
1351
            beq.s *               * branch if Z set
1352
            bclr.b d6,$F101       *
1353
            bne.s *               * branch if Z clear
1354
            bclr.b d7,$F102       *
1355
            beq.s *               * branch if Z set
1356
            move.l #$F101,a0      * point to memory to address 0x100
1357
            cmpi.b #$FC,(a0)
1358
            bne.s *               * branch if Z clear
1359
 
1360
 
1361
 
1362
    rts
1363
 
1364
*-----------------------------------------------------------
1365
*-----------------------------------------------------------
1366
* OPCODE : BSET
1367
*-----------------------------------------------------------
1368
*-----------------------------------------------------------
1369
op_BSET:
1370
 
1371
 
1372
*  Bit Number.s Static
1373
 
1374
*             EA = Dn  - LONG only
1375
            moveq  #$00000000,d0      * populate test data
1376
            bset.l #0,d0
1377
            bne.s *               * branch if Z clear
1378
            bset.l #1,d0              *
1379
            bne.s *               * branch if Z clear
1380
            bset.l #15,d0             *
1381
            bne.s *               * branch if Z clear
1382
            bset.l #31,d0             *
1383
            bne.s *               * branch if Z clear
1384
            cmpi.l #$80008003,d0
1385
            bne.s *               * branch if Z clear
1386
 
1387
 
1388
*             EA = (An)  - BYTE only
1389
            move.l #$00000100,a0      * point to memory to address 0x100
1390
            move.b #$00,(a0)          * populate test data
1391
            bset.b #0,(a0)
1392
            bne.s *               * branch if Z clear
1393
            bset.b #7,(a0)            *
1394
            bne.s *               * branch if Z clear
1395
            cmpi.b #$81,(a0)
1396
            bne.s *               * branch if Z clear
1397
 
1398
*             EA = (An)+  - BYTE only
1399
            move.l #$00000100,a0      * point to memory to address 0x100
1400
            move.b #$00,(a0)+         * populate test data
1401
            move.b #$00,(a0)+         * populate test data
1402
            move.l #$00000100,a0      * point to memory to address 0x100
1403
            bset.b #0,(a0)+
1404
            bne.s *               * branch if Z clear
1405
            bset.b #1,(a0)+           *
1406
            bne.s *               * branch if Z clear
1407
            move.l #$00000100,a0      * point to memory to address 0x100
1408
            cmpi.b #$01,(a0)+
1409
            bne.s *               * branch if Z clear
1410
            cmpi.b #$02,(a0)+
1411
            bne.s *               * branch if Z clear
1412
 
1413
 
1414
*             EA = -(An)  - BYTE only
1415
            move.l #$00000100,a0      * point to memory to address
1416
            move.b #$00,(a0)+         * populate test data
1417
            move.b #$00,(a0)+         * populate test data
1418
            bset.b #7,-(a0)
1419
            bne.s *               * branch if Z clear
1420
            bset.b #0,-(a0)           *
1421
            bne.s *               * branch if Z clear
1422
            move.l #$00000102,a0      * point to memory to address 0x100
1423
            cmpi.b #$80,-(a0)
1424
            bne.s *               * branch if Z clear
1425
            cmpi.b #$01,-(a0)
1426
            bne.s *               * branch if Z clear
1427
 
1428
 
1429
*             EA = n(An)  - BYTE only
1430
            move.l #$00000100,a0      * point to memory to address
1431
            move.b #$00,(a0)+         * populate test data
1432
            move.b #$00,(a0)+         * populate test data
1433
            move.l #$00000100,a0      * point to memory to address
1434
            bset.b #0,0(a0)
1435
            bne.s *               * branch if Z clear
1436
            bset.b #4,1(a0)           *
1437
            bne.s *               * branch if Z clear
1438
            move.l #$00000100,a0      * point to memory to address 0x100
1439
            cmpi.b #$01,(a0)+
1440
            bne.s *               * branch if Z clear
1441
            cmpi.b #$10,(a0)+
1442
            bne.s *               * branch if Z clear
1443
 
1444
 
1445
*             EA = n(An,D.W)  - BYTE only
1446
            move.l #$00000100,a0      * point to memory to address
1447
            move.l #$00000000,a1      * point to memory to address
1448
            move.l #$00000004,a2      * point to memory to address
1449
            moveq  #$00000000,d0      * point to memory to address
1450
            moveq  #$00000001,d1      * point to memory to address
1451
            move.b #$00,(a0)+         * populate test data
1452
            move.b #$00,(a0)+         * populate test data
1453
            move.b #$00,(a0)+         * populate test data
1454
            move.b #$00,(a0)+         * populate test data
1455
            move.b #$00,(a0)+         * populate test data
1456
            move.b #$00,(a0)+         * populate test data
1457
            move.b #$00,(a0)+         * populate test data
1458
            move.b #$00,(a0)+         * populate test data
1459
            move.b #$00,(a0)+         * populate test data
1460
            move.b #$00,(a0)+         * populate test data
1461
            move.l #$00000100,a0      * point to memory to address
1462
            bset.b #0,0(a0,d0.w)
1463
            bne.s *               * branch if Z clear
1464
            bset.b #1,0(a0,d1.w)      *
1465
            bne.s *               * branch if Z clear
1466
            bset.b #2,1(a0,d1.w)      *
1467
            bne.s *               * branch if Z clear
1468
*             EA = n(An,D.L)  - BYTE only
1469
            bset.b #3,2(a0,d0.l)
1470
            bne.s *               * branch if Z clear
1471
            bset.b #4,0(a0,d1.l)      *
1472
            bne.s *               * branch if Z clear
1473
            bset.b #5,1(a0,d1.l)      *
1474
            bne.s *               * branch if Z clear
1475
*             EA = n(An,A.W)  - BYTE only
1476
            bset.b #6,0(a0,a1.w)
1477
            bne.s *               * branch if Z clear
1478
            bset.b #1,0(a0,a2.w)      *
1479
            bne.s *               * branch if Z clear
1480
            bset.b #7,1(a0,a2.w)      *
1481
            bne.s *               * branch if Z clear
1482
*             EA = n(An,A.L)  - BYTE only
1483
            bset.b #0,2(a0,a2.l)
1484
            bne.s *               * branch if Z clear
1485
            bset.b #0,3(a0,a2.l)      *
1486
            bne.s *               * branch if Z clear
1487
            bset.b #1,4(a0,a2.l)      *
1488
            bne.s *               * branch if Z clear
1489
            move.l #$00000100,a0      * point to memory to address 0x100
1490
            cmpi.l #$41122C00,(a0)+
1491
            bne.s *               * branch if Z clear
1492
            cmpi.l #$02800101,(a0)+
1493
            bne.s *
1494
 
1495
 
1496
 
1497
*             EA = x.W  - BYTE only
1498
            move.l #$00000100,a0      * point to memory to address
1499
            move.b #$00,(a0)+         * populate test data
1500
            bset.b #0,$0100
1501
            bne.s *               * branch if Z clear
1502
            bset.b #1,$0100           *
1503
            bne.s *               * branch if Z clear
1504
            move.l #$00000100,a0      * point to memory to address 0x100
1505
            cmpi.b #$03,(a0)+
1506
            bne.s *
1507
 
1508
 
1509
*             EA = x.L  - BYTE only
1510
            move.l #$F100,a0      * point to memory to address 0x100
1511
            move.b #$00,(a0)          * populate test data
1512
            bset.b #0,$F100
1513
            bne.s *               * branch if Z clear
1514
            bset.b #1,$F100       *
1515
            bne.s *               * branch if Z clear
1516
            bset.b #2,$F100       *
1517
            bne.s *               * branch if Z clear
1518
            move.l #$F100,a0      * point to memory to address 0x100
1519
            cmpi.b #$07,(a0)+
1520
            bne.s *
1521
 
1522
 
1523
* Bit Number.s Dynamic
1524
 
1525
*             EA = Dn  - LONG only
1526
            moveq  #$00000000,d0      * populate test data
1527
            move.l #0,d5              * populate bit.s number to test
1528
            move.l #1,d6              * populate bit.s number to test
1529
            move.l #31,d7              * populate bit.s number to test
1530
 
1531
            bset.l d5,d0
1532
            bne.s *               * branch if Z clear
1533
            bset.l d6,d0              *
1534
            bne.s *               * branch if Z clear
1535
            bset.l d7,d0             *
1536
            bne.s *               * branch if Z clear
1537
            cmpi.l #$80000003,d0
1538
            bne.s *               * branch if Z clear
1539
 
1540
 
1541
*             EA = (An)  - BYTE only
1542
            move.l #0,d5              * populate bit.s number to test
1543
            move.l #1,d6              * populate bit.s number to test
1544
            move.l #7,d7              * populate bit.s number to test
1545
            move.l #$00000100,a0      * point to memory to address 0x100
1546
            move.b #$00,(a0)          * populate test data
1547
            bset.b d5,(a0)
1548
            bne.s *               * branch if Z clear
1549
            bset.b d6,(a0)            *
1550
            bne.s *               * branch if Z clear
1551
            bset.b d7,(a0)            *
1552
            bne.s *               * branch if Z clear
1553
            cmpi.b #$83,(a0)
1554
            bne.s *               * branch if Z clear
1555
 
1556
 
1557
*             EA = (An)+  - BYTE only
1558
            move.l #$00000100,a0      * point to memory to address 0x100
1559
            move.b #$00,(a0)+         * populate test data
1560
            move.b #$00,(a0)+         * populate test data
1561
            move.b #$00,(a0)+         * populate test data
1562
            move.l #$00000100,a0      * point to memory to address 0x100
1563
            bset.b d5,(a0)+
1564
            bne.s *               * branch if Z clear
1565
            bset.b d6,(a0)+           *
1566
            bne.s *               * branch if Z clear
1567
            bset.b d7,(a0)+           *
1568
            bne.s *               * branch if Z clear
1569
            move.l #$00000100,a0      * point to memory to address 0x100
1570
            cmpi.b #$01,(a0)+
1571
            bne.s *               * branch if Z clear
1572
            cmpi.b #$02,(a0)+
1573
            bne.s *               * branch if Z clear
1574
            cmpi.b #$80,(a0)+
1575
            bne.s *               * branch if Z clear
1576
 
1577
*             EA = -(An)  - BYTE only
1578
            move.l #$00000100,a0      * point to memory to address
1579
            move.b #$00,(a0)+         * populate test data
1580
            move.b #$00,(a0)+         * populate test data
1581
            move.b #$00,(a0)+         * populate test data
1582
            move.l #$00000103,a0      * point to memory to address
1583
            bset.b d5,-(a0)
1584
            bne.s *               * branch if Z clear
1585
            bset.b d6,-(a0)           *
1586
            bne.s *               * branch if Z clear
1587
            bset.b d7,-(a0)           *
1588
            bne.s *               * branch if Z clear
1589
            move.l #$00000103,a0      * point to memory to address 0x100
1590
            cmpi.b #$01,-(a0)
1591
            bne.s *               * branch if Z clear
1592
            cmpi.b #$02,-(a0)
1593
            bne.s *               * branch if Z clear
1594
            cmpi.b #$80,-(a0)
1595
            bne.s *               * branch if Z clear
1596
 
1597
*             EA = n(An)  - BYTE only
1598
            move.l #$00000100,a0      * point to memory to address
1599
            move.b #$00,(a0)+         * populate test data
1600
            move.b #$00,(a0)+         * populate test data
1601
            move.b #$00,(a0)+         * populate test data
1602
            move.l #$00000100,a0      * point to memory to address
1603
            bset.b d5,0(a0)
1604
            bne.s *               * branch if Z clear
1605
            bset.b d6,1(a0)           *
1606
            bne.s *               * branch if Z clear
1607
            bset.b d7,2(a0)           *
1608
            bne.s *               * branch if Z clear
1609
            move.l #$00000100,a0      * point to memory to address 0x100
1610
            cmpi.b #$01,(a0)+
1611
            bne.s *               * branch if Z clear
1612
            cmpi.b #$02,(a0)+
1613
            bne.s *               * branch if Z clear
1614
            cmpi.b #$80,(a0)+
1615
            bne.s *               * branch if Z clear
1616
 
1617
*             EA = n(An,R.W)  - BYTE only
1618
            move.l #$00000100,a0      * point to memory to address
1619
            move.b #$00,(a0)+         * populate test data
1620
            move.b #$00,(a0)+         * populate test data
1621
            move.b #$00,(a0)+         * populate test data
1622
            move.b #$00,(a0)+         * populate test data
1623
            move.b #$00,(a0)+         * populate test data
1624
            move.b #$00,(a0)+         * populate test data
1625
            move.b #$00,(a0)+         * populate test data
1626
            move.b #$00,(a0)+         * populate test data
1627
            move.b #$00,(a0)+         * populate test data
1628
            move.b #$00,(a0)+         * populate test data
1629
            move.b #$00,(a0)+         * populate test data
1630
            move.b #$00,(a0)+         * populate test data
1631
            move.l #$00000100,a0      * point to memory to address
1632
            move.l #$00000000,a1      * point to memory to address
1633
            move.l #$00000001,a2      * point to memory to address
1634
            moveq  #$00000000,d0      * point to memory to address
1635
            moveq  #$00000001,d1      * point to memory to address
1636
            bset.b d5,0(a0,d0.w)
1637
            bne.s *               * branch if Z clear
1638
            bset.b d6,0(a0,d1.w)      *
1639
            bne.s *               * branch if Z clear
1640
            bset.b d7,1(a0,d1.w)      *
1641
            bne.s *               * branch if Z clear
1642
*             EA = n(An,R.L)  - BYTE only
1643
            bset.b d5,2(a0,d0.l)
1644
            bne.s *               * branch if Z clear
1645
            bset.b d6,3(a0,d1.l)      *
1646
            bne.s *               * branch if Z clear
1647
            bset.b d7,4(a0,d1.l)      *
1648
            bne.s *               * branch if Z clear
1649
*             EA = n(An,A.W)  - BYTE only
1650
            bset.b d5,5(a0,a1.w)
1651
            bne.s *               * branch if Z clear
1652
            bset.b d6,6(a0,a2.w)      *
1653
            bne.s *               * branch if Z clear
1654
            bset.b d7,7(a0,a2.w)      *
1655
            bne.s *               * branch if Z clear
1656
*             EA = n(An,A.L)  - BYTE only
1657
            bset.b d5,8(a0,a1.l)
1658
            bne.s *               * branch if Z clear
1659
            bset.b d6,9(a0,a2.l)      *
1660
            bne.s *               * branch if Z clear
1661
            bset.b d7,10(a0,a2.l)      *
1662
            bne.s *               * branch if Z clear
1663
            move.l #$00000100,a0      * point to memory to address 0x100
1664
            cmpi.l #$01028100,(a0)+
1665
            bne.s *               * branch if Z clear
1666
            cmpi.l #$02810002,(a0)+
1667
            bne.s *
1668
 
1669
 
1670
*             EA = x.W  - BYTE only
1671
            move.l #$00000100,a0      * point to memory to address
1672
            move.b #$00,(a0)+         * populate test data
1673
            move.b #$00,(a0)+         * populate test data
1674
            move.b #$00,(a0)+         * populate test data
1675
            bset.b d5,$0100
1676
            bne.s *               * branch if Z clear
1677
            bset.b d6,$0100           *
1678
            bne.s *               * branch if Z clear
1679
            bset.b d7,$0100           *
1680
            bne.s *               * branch if Z clear
1681
            move.l #$00000100,a0      * point to memory to address
1682
            cmpi.b #$83,(a0)+
1683
            bne.s *               * branch if Z clear
1684
 
1685
*             EA = x.L  - BYTE only
1686
            move.l #$F100,a0      * point to memory to address 0x100
1687
            move.b #$00,(a0)+         * populate test data
1688
            move.b #$00,(a0)+         * populate test data
1689
            move.b #$00,(a0)+         * populate test data
1690
            bset.b d5,$F100
1691
            bne.s *               * branch if Z clear
1692
            bset.b d6,$F100       *
1693
            bne.s *               * branch if Z clear
1694
            bset.b d7,$F100       *
1695
            bne.s *               * branch if Z clear
1696
            move.l #$F100,a0      * point to memory to address 0x100
1697
            cmpi.b #$83,(a0)
1698
            bne.s *               * branch if Z clear
1699
 
1700
 
1701
    rts
1702
 
1703
*-----------------------------------------------------------
1704
*-----------------------------------------------------------
1705
* OPCODE : MOVEP
1706
*-----------------------------------------------------------
1707
*-----------------------------------------------------------
1708
op_MOVEP:
1709
 
1710
* Dn --> x(An)
1711
            move.l #$00000100,a0
1712
            move.l #$12345678,d0
1713
            move.l #$AABBCCDD,d1
1714
            move.l #0,(a0)
1715
            move.l #0,4(a0)
1716
 
1717
            movep.w d0,0(a0)      * even offset
1718
            movep.w d1,1(a0)      * odd offset
1719
 
1720
            movep.l d0,4(a0)      * even offset
1721
            movep.l d1,5(a0)      * odd offset
1722
 
1723
            cmpi.l #$56CC78DD,(a0)
1724
            bne.s *
1725
            cmpi.l #$12AA34BB,4(a0)
1726
            bne.s *
1727
            cmpi.l #$56CC78DD,8(a0)
1728
            bne.s *
1729
 
1730
 
1731
* x(An)--> Dn
1732
            move.l #$5a5a5a5a,d0
1733
            move.l #$5a5a5a5a,d1
1734
            move.l #$5a5a5a5a,d2
1735
            move.l #$5a5a5a5a,d3
1736
 
1737
            movep.w 0(a0),d0      * even offset
1738
            movep.w 1(a0),d1      * odd offset
1739
 
1740
            movep.l 4(a0),d2      * even offset
1741
            movep.l 5(a0),d3      * odd offset
1742
 
1743
            cmpi.l #$5a5a5678,d0
1744
            bne.s *
1745
            cmpi.l #$5a5aCCDD,d1
1746
            bne.s *
1747
            cmpi.l #$12345678,d2
1748
            bne.s *
1749
            cmpi.l #$AABBCCDD,d3
1750
            bne.s *
1751
 
1752
            rts
1753
 
1754
 
1755
 
1756
*-----------------------------------------------------------
1757
*-----------------------------------------------------------
1758
* OPCODE : BOOL_I
1759
*-----------------------------------------------------------
1760
*-----------------------------------------------------------
1761
op_BOOL_I:
1762
 
1763
*     Dn -- BYTE
1764
            move.l #$12345678,d0
1765
            move.w #$000F,CCR          * pre-set Flags
1766
            ori.b  #$FF,d0
1767
            eori.b #$5A,d0
1768
            andi.b #$F0,d0
1769
            bvs.s *                       * Check V,C are cleared
1770
            bcs.s *
1771
            bpl.s *                       * Verify if N flag is set
1772
            andi.b #$00,d0
1773
            bmi.s *                       * Verify if N flag is cleared
1774
            bne.s *                       * Verify if Z flag is set
1775
 
1776
*     Dn -- WORD
1777
            move.l #$12345678,d1
1778
            move.w #$000F,CCR          * pre-set Flags
1779
            ori.w  #$FFFF,d1
1780
            eori.w #$5A5A,d1
1781
            andi.w #$F0F0,d1
1782
            bvs.s *                       * Check V,C are cleared
1783
            bcs.s *
1784
            bpl.s *                       * Verify if N flag is set
1785
            andi.w #$0000,d1
1786
            bmi.s *                       * Verify if N flag is cleared
1787
            bne.s *                       * Verify if Z flag is set
1788
 
1789
*     Dn -- LONG
1790
            move.l #$12345678,d2
1791
            move.w #$000F,CCR          * pre-set Flags
1792
            ori.l  #$FFFFFFFF,d2
1793
            eori.l #$5A5A5A5A,d2
1794
            andi.l #$F0F0F0F0,d2
1795
            bvs.s *                       * Check V,C are cleared
1796
            bcs.s *
1797
            bpl.s *                       * Verify if N flag is set
1798
            andi.l #$00000000,d2
1799
            bmi.s *                       * Verify if N flag is cleared
1800
            bne.s *                       * Verify if Z flag is set
1801
 
1802
 
1803
*     (An) -- BYTE
1804
            move.l #$00000100,a0
1805
            move.l #$12345678,(a0)
1806
            move.w #$000F,CCR          * pre-set Flags
1807
            ori.b  #$FF,(a0)
1808
            eori.b #$5A,(a0)
1809
            andi.b #$F0,(a0)
1810
            bvs.s *                       * Check V,C are cleared
1811
            bcs.s *
1812
            bpl.s *                       * Verify if N flag is set
1813
            andi.b #$00,(a0)
1814
            bmi.s *                       * Verify if N flag is cleared
1815
            bne.s *                       * Verify if Z flag is set
1816
            cmpi.b #$00,(a0)
1817
            bne.s *                       * Verify if Z flag is set
1818
 
1819
*     (An) -- WORD
1820
            move.l #$12345678,(a0)
1821
            move.w #$000F,CCR          * pre-set Flags
1822
            ori.w  #$FFFF,(a0)
1823
            eori.w #$5A5A,(a0)
1824
            andi.w #$F0F0,(a0)
1825
            bvs.s *                       * Check V,C are cleared
1826
            bcs.s *
1827
            bpl.s *                       * Verify if N flag is set
1828
            andi.w #$0000,(a0)
1829
            bmi.s *                       * Verify if N flag is cleared
1830
            bne.s *                       * Verify if Z flag is set
1831
            cmpi.w #$00,(a0)
1832
            bne.s *                       * Verify if Z flag is set
1833
 
1834
*     (An) -- LONG
1835
            move.l #$12345678,(a0)
1836
            move.w #$000F,CCR          * pre-set Flags
1837
            ori.l  #$FFFFFFFF,(a0)
1838
            eori.l #$5A5A5A5A,(a0)
1839
            andi.l #$F0F0F0F0,(a0)
1840
            bvs.s *                       * Check V,C are cleared
1841
            bcs.s *
1842
            bpl.s *                       * Verify if N flag is set
1843
            andi.l #$00000000,(a0)
1844
            bmi.s *                       * Verify if N flag is cleared
1845
            bne.s *                       * Verify if Z flag is set
1846
            cmpi.l #$00,(a0)
1847
            bne.s *                       * Verify if Z flag is set
1848
 
1849
 
1850
 
1851
*     (An)+ -- BYTE
1852
            move.l #$00000100,a0
1853
            move.l #$00A5FF88,(a0)
1854
            move.w #$000F,CCR          * pre-set Flags
1855
 
1856
            ori.b  #$F5,(a0)+
1857
            bpl.s *                       * Verify if N flag is set
1858
            beq.s *                       * Verify if Z flag is cleared
1859
 
1860
            eori.b #$FF,(a0)+
1861
            bmi.s *                       * Verify if N flag is cleared
1862
            beq.s *                       * Verify if Z flag is cleared
1863
 
1864
            andi.b #$AA,(a0)+
1865
            bpl.s *                       * Verify if N flag is set
1866
            beq.s *                       * Verify if Z flag is cleared
1867
 
1868
            move.l #$00000100,a0
1869
            cmpi.l #$F55AAA88,(a0)
1870
            bne.s *                       * Verify if Z flag is set
1871
 
1872
 
1873
*     (An)+ -- WORD
1874
            move.l #$00000100,a0
1875
            move.l #$00000104,a1
1876
            move.l #$00005a5a,(a0)
1877
            move.l #$12345678,(a1)
1878
            move.w #$000F,CCR          * pre-set Flags
1879
 
1880
            ori.w  #$5678,(a0)+
1881
            bmi.s *                       * Verify if N flag is cleared
1882
            beq.s *                       * Verify if Z flag is cleared
1883
 
1884
            eori.w #$FFFF,(a0)+
1885
            bpl.s *                       * Verify if N flag is set
1886
            beq.s *                       * Verify if Z flag is cleared
1887
 
1888
            andi.w #$A55A,(a0)+
1889
            bmi.s *                       * Verify if N flag is cleared
1890
            beq.s *                       * Verify if Z flag is cleared
1891
 
1892
            move.l #$00000100,a0
1893
            cmpi.l #$5678a5a5,(a0)
1894
            move.l #$00000104,a0
1895
            cmpi.l #$00105678,(a0)
1896
            bne.s *                       * Verify if Z flag is set
1897
 
1898
*     (An)+ -- LONG
1899
            move.l #$00000100,a0
1900
            move.l #$00000000,(a0)+
1901
            move.l #$5a5a5a5a,(a0)+
1902
            move.l #$FFFFFFFF,(a0)+
1903
            move.l #$00000100,a0
1904
            move.w #$000F,CCR          * pre-set Flags
1905
 
1906
            ori.l  #$12345678,(a0)+
1907
            bmi.s *                       * Verify if N flag is cleared
1908
            beq.s *                       * Verify if Z flag is cleared
1909
 
1910
            eori.l #$FFFFFFFF,(a0)+
1911
            bpl.s *                       * Verify if N flag is set
1912
            beq.s *                       * Verify if Z flag is cleared
1913
 
1914
            andi.l #$A5A5A55A,(a0)+
1915
            bpl.s *                       * Verify if N flag is set
1916
            beq.s *                       * Verify if Z flag is cleared
1917
 
1918
            move.l #$00000100,a0
1919
            cmpi.l #$12345678,(a0)+
1920
            cmpi.l #$a5a5a5a5,(a0)+
1921
            cmpi.l #$a5a5a55a,(a0)+
1922
            bne.s *                       * Verify if Z flag is set
1923
 
1924
            rts
1925
 
1926
 
1927
*-----------------------------------------------------------
1928
*-----------------------------------------------------------
1929
* OPCODE : BSR
1930
*-----------------------------------------------------------
1931
*-----------------------------------------------------------
1932
 
1933
 
1934
BSR_CLOSE1:     move.l #$11111111,d1
1935
                rts
1936
 
1937
 
1938
 
1939
op_BSR:         bsr BSR_CLOSE1        * Negative 8-bit.s displacement
1940
                bsr BSR_CLOSE2        * Positive 8-bit.s displacement
1941
                bsr.w BSR_FAR1          * Negative 16-bit.s displacement
1942
                bsr.w BSR_FAR2          * Positive 16-bit.s displacement
1943
 
1944
                cmpi.l #$11111111,d1
1945
                bne.s *
1946
                cmpi.l #$22222222,d2
1947
                bne.s *
1948
                cmpi.l #$33333333,d3
1949
                bne.s *
1950
                cmpi.l #$44444444,d4
1951
                bne.s *
1952
 
1953
                rts
1954
 
1955
 
1956
BSR_CLOSE2:     move.l #$22222222,d2
1957
                rts
1958
 
1959
*-----------------------------------------------------------
1960
*-----------------------------------------------------------
1961
* OPCODE : op_CMP_I
1962
*-----------------------------------------------------------
1963
*-----------------------------------------------------------
1964
op_CMP_I:
1965
 
1966
            move.l #$00000100,a0
1967
            move.l #$00000100,(a0)
1968
 
1969
*     REGISTER - BYTE
1970
            move.l #$FFFFFF80,d0
1971
            cmpi.b #$80,d0
1972
            bne.s *                       * Check Z Flag  beq/bne
1973
            bmi.s *                       * Check N Flag  bmi/bpl
1974
            bcs.s *                       * Check C Flag  bcc/bcs
1975
            bvs.s *                       * Check V Flag  bvc/bvs
1976
 
1977
            move.l #$FFFFF000,d1
1978
            cmpi.b #$00,d1
1979
            bne.s *                       * Check Z Flag  beq/bne
1980
            bmi.s *                       * Check N Flag  bmi/bpl
1981
            bcs.s *                       * Check C Flag  bcc/bcs
1982
            bvs.s *                       * Check V Flag  bvc/bvs
1983
 
1984
            move.l #$FFFFFF02,d2
1985
            cmpi.b #$FF,d2
1986
            beq.s *                       * Check Z Flag  beq/bne
1987
            bmi.s *                       * Check N Flag  bmi/bpl
1988
            bcc.s *                       * Check C Flag  bcc/bcs
1989
            bvs.s *                       * Check V Flag  bvc/bvs
1990
 
1991
            move.l #$FFFFFF7F,d3
1992
            cmpi.b #$FF,d3
1993
            beq.s *                       * Check Z Flag  beq/bne
1994
            bpl.s *                       * Check N Flag  bmi/bpl
1995
            bcc.s *                       * Check C Flag  bcc/bcs
1996
            bvc.s *                       * Check V Flag  bvc/bvs
1997
 
1998
 
1999
*     REGISTER - WORD
2000
            move.l #$FFFF8000,d0
2001
            cmpi.w #$8000,d0
2002
            bne.s *                       * Check Z Flag  beq/bne
2003
            bmi.s *                       * Check N Flag  bmi/bpl
2004
            bcs.s *                       * Check C Flag  bcc/bcs
2005
            bvs.s *                       * Check V Flag  bvc/bvs
2006
 
2007
            move.l #$FFF00000,d1
2008
            cmpi.w #$0000,d1
2009
            bne.s *                       * Check Z Flag  beq/bne
2010
            bmi.s *                       * Check N Flag  bmi/bpl
2011
            bcs.s *                       * Check C Flag  bcc/bcs
2012
            bvs.s *                       * Check V Flag  bvc/bvs
2013
 
2014
            move.l #$FFFF0002,d2
2015
            cmpi.w #$FFFF,d2
2016
            beq.s *                       * Check Z Flag  beq/bne
2017
            bmi.s *                       * Check N Flag  bmi/bpl
2018
            bcc.s *                       * Check C Flag  bcc/bcs
2019
            bvs.s *                       * Check V Flag  bvc/bvs
2020
 
2021
            move.l #$FFFF7FFF,d3
2022
            cmpi.w #$FFFF,d3
2023
            beq.s *                       * Check Z Flag  beq/bne
2024
            bpl.s *                       * Check N Flag  bmi/bpl
2025
            bcc.s *                       * Check C Flag  bcc/bcs
2026
            bvc.s *                       * Check V Flag  bvc/bvs
2027
 
2028
*     REGISTER - LONG
2029
            move.l #$80000000,d0
2030
            cmpi.l #$80000000,d0
2031
            bne.s *                       * Check Z Flag  beq/bne
2032
            bmi.s *                       * Check N Flag  bmi/bpl
2033
            bcs.s *                       * Check C Flag  bcc/bcs
2034
            bvs.s *                       * Check V Flag  bvc/bvs
2035
 
2036
            moveq  #$00000000,d1
2037
            cmpi.l #$00000000,d1
2038
            bne.s *                       * Check Z Flag  beq/bne
2039
            bmi.s *                       * Check N Flag  bmi/bpl
2040
            bcs.s *                       * Check C Flag  bcc/bcs
2041
            bvs.s *                       * Check V Flag  bvc/bvs
2042
 
2043
            moveq  #$00000002,d2
2044
            cmpi.l #$FFFFFFFF,d2
2045
            beq.s *                       * Check Z Flag  beq/bne
2046
            bmi.s *                       * Check N Flag  bmi/bpl
2047
            bcc.s *                       * Check C Flag  bcc/bcs
2048
            bvs.s *                       * Check V Flag  bvc/bvs
2049
 
2050
            move.l #$7FFFFFFF,d3
2051
            cmpi.l #$FFFFFFFF,d3
2052
            beq.s *                       * Check Z Flag  beq/bne
2053
            bpl.s *                       * Check N Flag  bmi/bpl
2054
            bcc.s *                       * Check C Flag  bcc/bcs
2055
            bvc.s *                       * Check V Flag  bvc/bvs
2056
 
2057
 
2058
 
2059
 
2060
*     EA=x(An,Dn) - BYTE
2061
            move.l #$00000100,a0
2062
            moveq  #$00000004,d7
2063
 
2064
            move.l #$FFFFFF80,12(a0,d7)
2065
            move.l #$FFFFFF80,12(a0,d7)
2066
            cmpi.b #$80,15(a0,d7)
2067
            bne.s *                       * Check Z Flag  beq/bne
2068
            bmi.s *                       * Check N Flag  bmi/bpl
2069
            bcs.s *                       * Check C Flag  bcc/bcs
2070
            bvs.s *                       * Check V Flag  bvc/bvs
2071
 
2072
            move.l #$FFFFF000,12(a0,d7)
2073
            cmpi.b #$00,15(a0,d7)
2074
            bne.s *                       * Check Z Flag  beq/bne
2075
            bmi.s *                       * Check N Flag  bmi/bpl
2076
            bcs.s *                       * Check C Flag  bcc/bcs
2077
            bvs.s *                       * Check V Flag  bvc/bvs
2078
 
2079
            move.l #$FFFFFF02,12(a0,d7)
2080
            cmpi.b #$FF,15(a0,d7)
2081
            beq.s *                       * Check Z Flag  beq/bne
2082
            bmi.s *                       * Check N Flag  bmi/bpl
2083
            bcc.s *                       * Check C Flag  bcc/bcs
2084
            bvs.s *                       * Check V Flag  bvc/bvs
2085
 
2086
            move.l #$FFFFFF7F,12(a0,d7)
2087
            cmpi.b #$FF,15(a0,d7)
2088
            beq.s *                       * Check Z Flag  beq/bne
2089
            bpl.s *                       * Check N Flag  bmi/bpl
2090
            bcc.s *                       * Check C Flag  bcc/bcs
2091
            bvc.s *                       * Check V Flag  bvc/bvs
2092
 
2093
 
2094
*     EA=x(An,Dn) - WORD
2095
            move.l #$FFFF8000,12(a0,d7)
2096
            cmpi.w #$8000,14(a0,d7)
2097
            bne.s *                       * Check Z Flag  beq/bne
2098
            bmi.s *                       * Check N Flag  bmi/bpl
2099
            bcs.s *                       * Check C Flag  bcc/bcs
2100
            bvs.s *                       * Check V Flag  bvc/bvs
2101
 
2102
            move.l #$FFF00000,12(a0,d7)
2103
            cmpi.w #$0000,14(a0,d7)
2104
            bne.s *                       * Check Z Flag  beq/bne
2105
            bmi.s *                       * Check N Flag  bmi/bpl
2106
            bcs.s *                       * Check C Flag  bcc/bcs
2107
            bvs.s *                       * Check V Flag  bvc/bvs
2108
 
2109
            move.l #$FFFF0002,12(a0,d7)
2110
            cmpi.w #$FFFF,14(a0,d7)
2111
            beq.s *                       * Check Z Flag  beq/bne
2112
            bmi.s *                       * Check N Flag  bmi/bpl
2113
            bcc.s *                       * Check C Flag  bcc/bcs
2114
            bvs.s *                       * Check V Flag  bvc/bvs
2115
 
2116
            move.l #$FFFF7FFF,12(a0,d7)
2117
            cmpi.w #$FFFF,14(a0,d7)
2118
            beq.s *                       * Check Z Flag  beq/bne
2119
            bpl.s *                       * Check N Flag  bmi/bpl
2120
            bcc.s *                       * Check C Flag  bcc/bcs
2121
            bvc.s *                       * Check V Flag  bvc/bvs
2122
 
2123
*     EA=x(An,Dn) - LONG
2124
            move.l #$80000000,12(a0,d7)
2125
            cmpi.l #$80000000,12(a0,d7)
2126
            bne.s *                       * Check Z Flag  beq/bne
2127
            bmi.s *                       * Check N Flag  bmi/bpl
2128
            bcs.s *                       * Check C Flag  bcc/bcs
2129
            bvs.s *                       * Check V Flag  bvc/bvs
2130
 
2131
            move.l #$00000000,12(a0,d7)
2132
            cmpi.l #$00000000,12(a0,d7)
2133
            bne.s *                       * Check Z Flag  beq/bne
2134
            bmi.s *                       * Check N Flag  bmi/bpl
2135
            bcs.s *                       * Check C Flag  bcc/bcs
2136
            bvs.s *                       * Check V Flag  bvc/bvs
2137
 
2138
            move.l #$00000002,12(a0,d7)
2139
            cmpi.l #$FFFFFFFF,12(a0,d7)
2140
            beq.s *                       * Check Z Flag  beq/bne
2141
            bmi.s *                       * Check N Flag  bmi/bpl
2142
            bcc.s *                       * Check C Flag  bcc/bcs
2143
            bvs.s *                       * Check V Flag  bvc/bvs
2144
 
2145
            move.l #$7FFFFFFF,12(a0,d7)
2146
            cmpi.l #$FFFFFFFF,12(a0,d7)
2147
            beq.s *                       * Check Z Flag  beq/bne
2148
            bpl.s *                       * Check N Flag  bmi/bpl
2149
            bcc.s *                       * Check C Flag  bcc/bcs
2150
            bvc.s *                       * Check V Flag  bvc/bvs
2151
 
2152
 
2153
 
2154
 
2155
            rts
2156
 
2157
 
2158
 
2159
*-----------------------------------------------------------
2160
*-----------------------------------------------------------
2161
* OPCODE : ADD_I
2162
*-----------------------------------------------------------
2163
*-----------------------------------------------------------
2164
op_ADD_I:
2165
 
2166
*     EA = Dn  - Byte
2167
            move.l #$12345678,d0      * populate test data
2168
            addi.b #0,d0
2169
            beq.s *                       * Check Z Flag  beq/bne
2170
            bmi.s *                       * Check N Flag  bmi/bpl
2171
            bcs.s *                       * Check C Flag  bcc/bcs
2172
            bvs.s *                       * Check V Flag  bvc/bvs
2173
            addi.b #$10,d0
2174
            beq.s *                       * Check Z Flag  beq/bne
2175
            bpl.s *                       * Check N Flag  bmi/bpl
2176
            bcs.s *                       * Check C Flag  bcc/bcs
2177
            bvc.s *                       * Check V Flag  bvc/bvs
2178
            addi.b #$A5,d0
2179
            beq.s *                       * Check Z Flag  beq/bne
2180
            bmi.s *                       * Check N Flag  bmi/bpl
2181
            bcc.s *                       * Check C Flag  bcc/bcs
2182
            bvc.s *                       * Check V Flag  bvc/bvs
2183
            cmpi.b #$2D,d0
2184
            bne.s *                       * Check Z Flag  beq/bne
2185
 
2186
*     EA = Dn  - WORD
2187
            move.l #$12345678,d0      * populate test data
2188
            addi.w #0,d0
2189
            beq.s *                       * Check Z Flag  beq/bne
2190
            bmi.s *                       * Check N Flag  bmi/bpl
2191
            bcs.s *                       * Check C Flag  bcc/bcs
2192
            bvs.s *                       * Check V Flag  bvc/bvs
2193
            addi.w #$7000,d0
2194
            beq.s *                       * Check Z Flag  beq/bne
2195
            bpl.s *                       * Check N Flag  bmi/bpl
2196
            bcs.s *                       * Check C Flag  bcc/bcs
2197
            bvc.s *                       * Check V Flag  bvc/bvs
2198
            addi.w #$A55A,d0
2199
            beq.s *                       * Check Z Flag  beq/bne
2200
            bmi.s *                       * Check N Flag  bmi/bpl
2201
            bcc.s *                       * Check C Flag  bcc/bcs
2202
            bvc.s *                       * Check V Flag  bvc/bvs
2203
            cmpi.w #$6BD2,d0
2204
            bne.s *                       * Check Z Flag  beq/bne
2205
 
2206
*     EA = Dn  - LONG
2207
            move.l #$12345678,d0      * populate test data
2208
            addi.l #0,d0
2209
            beq.s *                       * Check Z Flag  beq/bne
2210
            bmi.s *                       * Check N Flag  bmi/bpl
2211
            bcs.s *                       * Check C Flag  bcc/bcs
2212
            bvs.s *                       * Check V Flag  bvc/bvs
2213
            addi.l #$F0000000,d0
2214
            beq.s *                       * Check Z Flag  beq/bne
2215
            bmi.s *                       * Check N Flag  bmi/bpl
2216
            bcc.s *                       * Check C Flag  bcc/bcs
2217
            bvs.s *                       * Check V Flag  bvc/bvs
2218
            addi.l #$855AA55A,d0
2219
            beq.s *                       * Check Z Flag  beq/bne
2220
            bpl.s *                       * Check N Flag  bmi/bpl
2221
            bcs.s *                       * Check C Flag  bcc/bcs
2222
            bvs.s *                       * Check V Flag  bvc/bvs
2223
            addi.l #$A0000000,d0
2224
            bvc.s *                       * Check V Flag  bvc/bvs
2225
            cmpi.l #$278EFBD2,d0
2226
            bne.s *                       * Check Z Flag  beq/bne
2227
 
2228
 
2229
 
2230
*     EA = x.L  - Byte
2231
            move.l #$F100,a0      * populate test data
2232
            move.l #$12345678,(a0)     * populate test data
2233
            addi.b #0,$F103
2234
            beq.s *                       * Check Z Flag  beq/bne
2235
            bmi.s *                       * Check N Flag  bmi/bpl
2236
            bcs.s *                       * Check C Flag  bcc/bcs
2237
            bvs.s *                       * Check V Flag  bvc/bvs
2238
            addi.b #$10,$F103
2239
            beq.s *                       * Check Z Flag  beq/bne
2240
            bpl.s *                       * Check N Flag  bmi/bpl
2241
            bcs.s *                       * Check C Flag  bcc/bcs
2242
            bvc.s *                       * Check V Flag  bvc/bvs
2243
            addi.b #$A5,$F103
2244
            beq.s *                       * Check Z Flag  beq/bne
2245
            bmi.s *                       * Check N Flag  bmi/bpl
2246
            bcc.s *                       * Check C Flag  bcc/bcs
2247
            bvc.s *                       * Check V Flag  bvc/bvs
2248
            cmpi.b #$2D,$F103
2249
            bne.s *                       * Check Z Flag  beq/bne
2250
 
2251
*     EA = x.L- WORD
2252
            move.l #$F100,a0      * populate test data
2253
            move.l #$12345678,(a0)     * populate test data
2254
            addi.w #0,$F100
2255
            beq.s *                       * Check Z Flag  beq/bne
2256
            bmi.s *                       * Check N Flag  bmi/bpl
2257
            bcs.s *                       * Check C Flag  bcc/bcs
2258
            bvs.s *                       * Check V Flag  bvc/bvs
2259
            addi.w #$7000,$F100
2260
            beq.s *                       * Check Z Flag  beq/bne
2261
            bpl.s *                       * Check N Flag  bmi/bpl
2262
            bcs.s *                       * Check C Flag  bcc/bcs
2263
            bvc.s *                       * Check V Flag  bvc/bvs
2264
            addi.w #$A55A,$F100
2265
            beq.s *                       * Check Z Flag  beq/bne
2266
            bmi.s *                       * Check N Flag  bmi/bpl
2267
            bcc.s *                       * Check C Flag  bcc/bcs
2268
            bvc.s *                       * Check V Flag  bvc/bvs
2269
            cmpi.w #$278E,$F100
2270
            bne.s *                       * Check Z Flag  beq/bne
2271
 
2272
*     EA = x.L- LONG
2273
            move.l #$12345678,$F100  * populate test data
2274
            addi.l #0,$F100
2275
            beq.s *                       * Check Z Flag  beq/bne
2276
            bmi.s *                       * Check N Flag  bmi/bpl
2277
            bcs.s *                       * Check C Flag  bcc/bcs
2278
            bvs.s *                       * Check V Flag  bvc/bvs
2279
            addi.l #$F0000000,$F100
2280
            beq.s *                       * Check Z Flag  beq/bne
2281
            bmi.s *                       * Check N Flag  bmi/bpl
2282
            bcc.s *                       * Check C Flag  bcc/bcs
2283
            bvs.s *                       * Check V Flag  bvc/bvs
2284
            addi.l #$855AA55A,$F100
2285
            beq.s *                       * Check Z Flag  beq/bne
2286
            bpl.s *                       * Check N Flag  bmi/bpl
2287
            bcs.s *                       * Check C Flag  bcc/bcs
2288
            bvs.s *                       * Check V Flag  bvc/bvs
2289
            addi.l #$A0000000,$F100
2290
            bvc.s *                       * Check V Flag  bvc/bvs
2291
            cmpi.l #$278EFBD2,$F100
2292
            bne.s *                       * Check Z Flag  beq/bne
2293
 
2294
            rts
2295
 
2296
 
2297
*-----------------------------------------------------------
2298
*-----------------------------------------------------------
2299
* OPCODE : SUB_I
2300
*-----------------------------------------------------------
2301
*-----------------------------------------------------------
2302
op_SUB_I:
2303
 
2304
*     EA = Dn  - Byte
2305
            move.l #$12345678,d0      * populate test data
2306
            subi.b #0,d0
2307
            beq.s *                       * Check Z Flag  beq/bne
2308
            bmi.s *                       * Check N Flag  bmi/bpl
2309
            bcs.s *                       * Check C Flag  bcc/bcs
2310
            bvs.s *                       * Check V Flag  bvc/bvs
2311
            subi.b #$10,d0
2312
            beq.s *                       * Check Z Flag  beq/bne
2313
            bmi.s *                       * Check N Flag  bmi/bpl
2314
            bcs.s *                       * Check C Flag  bcc/bcs
2315
            bvs.s *                       * Check V Flag  bvc/bvs
2316
            subi.b #$A5,d0
2317
            beq.s *                       * Check Z Flag  beq/bne
2318
            bpl.s *                       * Check N Flag  bmi/bpl
2319
            bcc.s *                       * Check C Flag  bcc/bcs
2320
            bvc.s *                       * Check V Flag  bvc/bvs
2321
            cmpi.b #$C3,d0
2322
            bne.s *                       * Check Z Flag  beq/bne
2323
 
2324
*     EA = Dn  - WORD
2325
            move.l #$12345678,d0      * populate test data
2326
            subi.w #0,d0
2327
            beq.s *                       * Check Z Flag  beq/bne
2328
            bmi.s *                       * Check N Flag  bmi/bpl
2329
            bcs.s *                       * Check C Flag  bcc/bcs
2330
            bvs.s *                       * Check V Flag  bvc/bvs
2331
            subi.w #$7000,d0
2332
            beq.s *                       * Check Z Flag  beq/bne
2333
            bpl.s *                       * Check N Flag  bmi/bpl
2334
            bcc.s *                       * Check C Flag  bcc/bcs
2335
            bvs.s *                       * Check V Flag  bvc/bvs
2336
            subi.w #$A55A,d0
2337
            beq.s *                       * Check Z Flag  beq/bne
2338
            bmi.s *                       * Check N Flag  bmi/bpl
2339
            bcs.s *                       * Check C Flag  bcc/bcs
2340
            bvs.s *                       * Check V Flag  bvc/bvs
2341
            cmpi.w #$411E,d0
2342
            bne.s *                       * Check Z Flag  beq/bne
2343
 
2344
*     EA = Dn  - LONG
2345
            move.l #$12345678,d0      * populate test data
2346
            subi.l #0,d0
2347
            beq.s *                       * Check Z Flag  beq/bne
2348
            bmi.s *                       * Check N Flag  bmi/bpl
2349
            bcs.s *                       * Check C Flag  bcc/bcs
2350
            bvs.s *                       * Check V Flag  bvc/bvs
2351
            subi.l #$F0000000,d0
2352
            beq.s *                       * Check Z Flag  beq/bne
2353
            bmi.s *                       * Check N Flag  bmi/bpl
2354
            bcc.s *                       * Check C Flag  bcc/bcs
2355
            bvs.s *                       * Check V Flag  bvc/bvs
2356
            subi.l #$855AA55A,d0
2357
            beq.s *                       * Check Z Flag  beq/bne
2358
            bpl.s *                       * Check N Flag  bmi/bpl
2359
            bcc.s *                       * Check C Flag  bcc/bcs
2360
            bvc.s *                       * Check V Flag  bvc/bvs
2361
            subi.l #$A0000000,d0
2362
            bvs.s *                       * Check V Flag  bvc/bvs
2363
            cmpi.l #$FCD9B11E,d0
2364
            bne.s *                       * Check Z Flag  beq/bne
2365
 
2366
 
2367
 
2368
*     EA = x.L  - Byte
2369
            move.l #$F100,a0      * populate test data
2370
            move.l #$12345678,(a0)     * populate test data
2371
            subi.b #0,$F103
2372
            beq.s *                       * Check Z Flag  beq/bne
2373
            bmi.s *                       * Check N Flag  bmi/bpl
2374
            bcs.s *                       * Check C Flag  bcc/bcs
2375
            bvs.s *                       * Check V Flag  bvc/bvs
2376
            subi.b #$10,$F103
2377
            beq.s *                       * Check Z Flag  beq/bne
2378
            bmi.s *                       * Check N Flag  bmi/bpl
2379
            bcs.s *                       * Check C Flag  bcc/bcs
2380
            bvs.s *                       * Check V Flag  bvc/bvs
2381
            subi.b #$A5,$F103
2382
            beq.s *                       * Check Z Flag  beq/bne
2383
            bpl.s *                       * Check N Flag  bmi/bpl
2384
            bcc.s *                       * Check C Flag  bcc/bcs
2385
            bvc.s *                       * Check V Flag  bvc/bvs
2386
            cmpi.b #$C3,$F103
2387
            bne.s *                       * Check Z Flag  beq/bne
2388
 
2389
*     EA = x.L- WORD
2390
            move.l #$F100,a0      * populate test data
2391
            move.l #$12345678,(a0)     * populate test data
2392
            subi.w #0,$F100
2393
            beq.s *                       * Check Z Flag  beq/bne
2394
            bmi.s *                       * Check N Flag  bmi/bpl
2395
            bcs.s *                       * Check C Flag  bcc/bcs
2396
            bvs.s *                       * Check V Flag  bvc/bvs
2397
            subi.w #$7000,$F100
2398
            beq.s *                       * Check Z Flag  beq/bne
2399
            bpl.s *                       * Check N Flag  bmi/bpl
2400
            bcc.s *                       * Check C Flag  bcc/bcs
2401
            bvs.s *                       * Check V Flag  bvc/bvs
2402
            subi.w #$A55A,$F100
2403
            beq.s *                       * Check Z Flag  beq/bne
2404
            bpl.s *                       * Check N Flag  bmi/bpl
2405
            bcc.s *                       * Check C Flag  bcc/bcs
2406
            bvs.s *                       * Check V Flag  bvc/bvs
2407
            cmpi.w #$FCDA,$F100
2408
            bne.s *                       * Check Z Flag  beq/bne
2409
 
2410
*     EA = x.L- LONG
2411
            move.l #$12345678,$F100  * populate test data
2412
            subi.l #0,$F100
2413
            beq.s *                       * Check Z Flag  beq/bne
2414
            bmi.s *                       * Check N Flag  bmi/bpl
2415
            bcs.s *                       * Check C Flag  bcc/bcs
2416
            bvs.s *                       * Check V Flag  bvc/bvs
2417
            subi.l #$F0000000,$F100
2418
            beq.s *                       * Check Z Flag  beq/bne
2419
            bmi.s *                       * Check N Flag  bmi/bpl
2420
            bcc.s *                       * Check C Flag  bcc/bcs
2421
            bvs.s *                       * Check V Flag  bvc/bvs
2422
            subi.l #$855AA55A,$F100
2423
            beq.s *                       * Check Z Flag  beq/bne
2424
            bpl.s *                       * Check N Flag  bmi/bpl
2425
            bcc.s *                       * Check C Flag  bcc/bcs
2426
            bvc.s *                       * Check V Flag  bvc/bvs
2427
            subi.l #$A0000000,$F100
2428
            bvs.s *                       * Check V Flag  bvc/bvs
2429
            cmpi.l #$FCD9B11E,$F100
2430
            bne.s *                       * Check Z Flag  beq/bne
2431
 
2432
            rts
2433
 
2434
 
2435
 
2436
*-----------------------------------------------------------
2437
*-----------------------------------------------------------
2438
* OPCODE : MOVE
2439
*-----------------------------------------------------------
2440
*-----------------------------------------------------------
2441
op_MOVE:
2442
            move.l #$11223344,d0
2443
            move.l #$55667788,d1
2444
            move.l #$8899aabb,d2
2445
            move.l #$ccddeeff,d3
2446
            moveq  #$00000000,d4
2447
            moveq  #$00000000,d5
2448
            moveq  #$00000000,d6
2449
            moveq  #$00000000,d7
2450
            move.l #$44332211,a0
2451
            move.l #$88776655,a1
2452
            move.l #$bbaa9988,a2
2453
            move.l #$ffeeddcc,a3
2454
 
2455
            move.b d0,d4              * BYTE - DATA REGISTER
2456
            beq.s *                       * Check Z Flag  beq/bne
2457
            bmi.s *                       * Check N Flag  bmi/bpl
2458
            cmpi.l #$00000044,d4
2459
            bne.s *                       * Check Z Flag  beq/bne
2460
 
2461
            move.w d1,d5              * WORD - DATA REGISTER
2462
            beq.s *                       * Check Z Flag  beq/bne
2463
            bmi.s *                       * Check N Flag  bmi/bpl
2464
            cmpi.l #$00007788,d5
2465
            bne.s *                       * Check Z Flag  beq/bne
2466
 
2467
            move.l d2,d6              * LONG - DATA REGISTER
2468
            beq.s *                       * Check Z Flag  beq/bne
2469
            bpl.s *                       * Check N Flag  bmi/bpl
2470
            cmpi.l #$8899aabb,d6
2471
            bne.s *                       * Check Z Flag  beq/bne
2472
 
2473
            move.w a1,d5              * WORD - ADDRESS REGISTER
2474
            beq.s *                       * Check Z Flag  beq/bne
2475
            bmi.s *                       * Check N Flag  bmi/bpl
2476
            cmpi.l #$00006655,d5
2477
            bne.s *                       * Check Z Flag  beq/bne
2478
 
2479
            move.l a2,d6              * LONG - ADDRESS REGISTER
2480
            beq.s *                       * Check Z Flag  beq/bne
2481
            bpl.s *                       * Check N Flag  bmi/bpl
2482
            cmpi.l #$bbaa9988,d6
2483
            bne.s *                       * Check Z Flag  beq/bne
2484
 
2485
 
2486
            movea.w d2,a4             * WORD - ADDRESS REGISTER as SOURCE ## MOVEA
2487
            cmpa.l d2,a4
2488
            beq.s *                       * Check Z Flag  beq/bne ## comopare fails because A4 was sign extended
2489
 
2490
            movea.l d1,a5             * LONG - ADDRESS REGISTER as SOURCE ## MOVEA
2491
            cmpa.l d1,a5
2492
            bne.s *                       * Check Z Flag  beq/bne
2493
 
2494
 
2495
 
2496
*   Too mamy EA combinations to test,so we focus on a few of the more complicted EA's
2497
 
2498
            move.l #$11223344,d0
2499
            move.l #$00010100,d1
2500
            move.l #$8899aabb,d2
2501
            moveq  #$00000001,d3
2502
            moveq  #$00000000,d4
2503
            moveq  #$00000000,d5
2504
            moveq  #$00000000,d6
2505
            moveq  #$00000000,d7
2506
            move.l #$00000000,a0
2507
            move.l #$00010100,a1
2508
 
2509
*     x(An,AL) --> x.L
2510
            move.b #$5A,4(a0,a1.l)    * BYTE
2511
            lea 4(a0,a1.l),a3
2512
            move.b 4(a0,a1.l),$00010105
2513
            beq.s *                       * Check Z Flag  beq/bne
2514
            bmi.s *                       * Check N Flag  bmi/bpl
2515
            cmpi.b #$5A,5(a0,a1.l)
2516
            bne.s *                       * Check Z Flag  beq/bne
2517
 
2518
*     x.L --> n(An,Dw)
2519
MOVE2:      move.b  $00010105,7(a0,d1.w)    * BYTE
2520
            beq.s *                       * Check Z Flag  beq/bne
2521
            bmi.s *                       * Check N Flag  bmi/bpl
2522
            cmpi.b #$5A,7(a0,d1.w)
2523
            bne.s *                       * Check Z Flag  beq/bne
2524
 
2525
*     x(PC,Ds) --> x.w
2526
            move.b  MOVE1(pc,d3.w),$0100 * BYTE
2527
            beq.s *                       * Check Z Flag  beq/bne
2528
            bpl.s *                       * Check N Flag  bmi/bpl
2529
            cmpi.b #$B9,1+MOVE2
2530
            bne.s *                       * Check Z Flag  beq/bne
2531
 
2532
*     #x -->    n(An,AL)
2533
            move.b  #$78,7(a0,d1.w)    * BYTE
2534
            beq.s *                       * Check Z Flag  beq/bne
2535
            bmi.s *                       * Check N Flag  bmi/bpl
2536
            cmpi.b #$78,7(a0,d1.w)
2537
            bne.s *                       * Check Z Flag  beq/bne
2538
 
2539
            move.l #$11223344,d0
2540
            move.l #$00010100,d1
2541
            move.l #$8899aabb,d2
2542
            moveq  #$00000002,d3
2543
            moveq  #$00000000,d4
2544
            moveq  #$00000000,d5
2545
            moveq  #$00000000,d6
2546
            moveq  #$00000000,d7
2547
            move.l #$00000000,a0
2548
            move.l #$00010100,a1
2549
 
2550
*     x(An,AL) --> x.L
2551
            move.w #$5A5A,4(a0,a1.l)    * WORD
2552
            lea 4(a0,a1.l),a4
2553
            move.w 4(a0,a1.l),$00010104
2554
            beq.s *                       * Check Z Flag  beq/bne
2555
            bmi.s *                       * Check N Flag  bmi/bpl
2556
            cmpi.w #$5A5A,4(a0,a1.l)
2557
            bne.s *                       * Check Z Flag  beq/bne
2558
 
2559
*     x.L --> n(An,Dw)
2560
MOVE1:      move.w  $00010104,6(a0,d1.w)    * WORD
2561
            beq.s *                       * Check Z Flag  beq/bne
2562
            bmi.s *                       * Check N Flag  bmi/bpl
2563
            cmpi.w #$5A5A,6(a0,d1.w)
2564
            bne.s *                       * Check Z Flag  beq/bne
2565
 
2566
*     x(PC,Ds) --> x.w
2567
            move.w  MOVE1(pc,d3),$0100 * WORD
2568
            beq.s *                       * Check Z Flag  beq/bne
2569
            bmi.s *                       * Check N Flag  bmi/bpl
2570
            cmpi.w #$67FE,8+MOVE1
2571
            bne.s *                       * Check Z Flag  beq/bne
2572
 
2573
*     #x -->    n(An,AL)
2574
            move.w  #$7878,6(a0,d1.w)    * WORD
2575
            beq.s *                       * Check Z Flag  beq/bne
2576
            bmi.s *                       * Check N Flag  bmi/bpl
2577
            cmpi.w #$7878,6(a0,d1.w)
2578
            bne.s *                       * Check Z Flag  beq/bne
2579
 
2580
* ---
2581
 
2582
            move.l #$11223344,d0
2583
            move.l #$00010100,d1
2584
            move.l #$8899aabb,d2
2585
            moveq  #$00000002,d3
2586
            moveq  #$00000000,d4
2587
            moveq  #$00000000,d5
2588
            moveq  #$00000000,d6
2589
            moveq  #$00000000,d7
2590
            move.l #$00000000,a0
2591
            move.l #$00010100,a1
2592
 
2593
*     x(An,AL) --> x.L
2594
            move.l #$5A5A1234,4(a0,a1.l)    * LONG
2595
            lea 4(a0,a1.l),a4
2596
            move.l 4(a0,a1.l),$00010104
2597
            beq.s *                       * Check Z Flag  beq/bne
2598
            bmi.s *                       * Check N Flag  bmi/bpl
2599
            cmpi.l #$5A5A1234,4(a0,a1.l)
2600
            bne.s *                       * Check Z Flag  beq/bne
2601
 
2602
*     x.L --> n(An,Dw)
2603
MOVE3:      move.l  $00010104,6(a0,d1.w)    * LONG
2604
            beq.s *                       * Check Z Flag  beq/bne
2605
            bmi.s *                       * Check N Flag  bmi/bpl
2606
            cmpi.l #$5A5A1234,6(a0,d1.w)
2607
            bne.s *                       * Check Z Flag  beq/bne
2608
 
2609
*     x(PC,Ds) --> x.w
2610
            move.l  MOVE3(pc,d3),$0100 * LONG
2611
            beq.s *                       * Check Z Flag  beq/bne
2612
            bmi.s *                       * Check N Flag  bmi/bpl
2613
            cmpi.l #$67FE6BFE,8+MOVE3
2614
            bne.s *                       * Check Z Flag  beq/bne
2615
 
2616
*     #x -->    n(An,AL)
2617
            move.l  #$78782323,6(a0,d1.w)    * LONG
2618
            beq.s *                       * Check Z Flag  beq/bne
2619
            bmi.s *                       * Check N Flag  bmi/bpl
2620
            cmpi.l #$78782323,6(a0,d1.w)
2621
            bne.s *                       * Check Z Flag  beq/bne
2622
 
2623
 
2624
         rts
2625
 
2626
 
2627
*-----------------------------------------------------------
2628
*-----------------------------------------------------------
2629
* OPCODE : MOVE_xxx_FLAGS
2630
*-----------------------------------------------------------
2631
*-----------------------------------------------------------
2632
op_MOVE_xxx_FLAGS:
2633
 
2634
*     Move_To_SR
2635
 
2636
*     Dn
2637
 
2638
            move.w #$2FFF,d0
2639
            move.w d0,SR
2640
            bpl.s *           * branch if Z clear
2641
            bne.s *           * branch if N clear
2642
            bvc.s *           * branch if V clear
2643
            bcc.s *           * branch if C clear
2644
            move.w #$2F00,d0
2645
            move d0,CCR
2646
            beq.s *           * branch if Z set
2647
            bmi.s *           * branch if N set
2648
            bvs.s *           * branch if V set
2649
            bcs.s *           * branch if C set
2650
 
2651
            move.w #$2000,d0
2652
            move.w d0,SR
2653
            beq.s *           * branch if Z set
2654
            bmi.s *           * branch if N set
2655
            bvs.s *           * branch if V set
2656
            bcs.s *           * branch if C set
2657
 
2658
*     (An)
2659
            move.l #$00000100,a0
2660
            move.w #$2FFF,(a0)
2661
            move.w (a0),SR
2662
            bpl.s *           * branch if Z clear
2663
            bne.s *           * branch if N clear
2664
            bvc.s *           * branch if V clear
2665
            bcc.s *           * branch if C clear
2666
 
2667
            move.w #$2000,(a0)
2668
            move.w (a0),SR
2669
            beq.s *           * branch if Z set
2670
            bmi.s *           * branch if N set
2671
            bvs.s *           * branch if V set
2672
            bcs.s *           * branch if C set
2673
 
2674
*     (An)+
2675
            move.l #$00000100,a0
2676
            move.w #$2FFF,(a0)
2677
            move.w (a0)+,SR
2678
            bpl.s *           * branch if Z clear
2679
            bne.s *           * branch if N clear
2680
            bvc.s *           * branch if V clear
2681
            bcc.s *           * branch if C clear
2682
 
2683
            move.w #$2000,(a0)
2684
            move.w (a0)+,SR
2685
            beq.s *           * branch if Z set
2686
            bmi.s *           * branch if N set
2687
            bvs.s *           * branch if V set
2688
            bcs.s *           * branch if C set
2689
 
2690
*     -(An)
2691
            move.l #$00000102,a0
2692
            move.w #$2FFF,(a0)
2693
            move.w (a0)+,SR
2694
            bpl.s *           * branch if Z clear
2695
            bne.s *           * branch if N clear
2696
            bvc.s *           * branch if V clear
2697
            bcc.s *           * branch if C clear
2698
 
2699
            move.w #$2000,(a0)
2700
            move.w (a0)+,SR
2701
            beq.s *           * branch if Z set
2702
            bmi.s *           * branch if N set
2703
            bvs.s *           * branch if V set
2704
            bcs.s *           * branch if C set
2705
 
2706
*     n(An)
2707
            move.l #$00000102,a0
2708
            move.w #$2FFF,2(a0)
2709
            move.w 2(a0),SR
2710
            bpl.s *           * branch if Z clear
2711
            bne.s *           * branch if N clear
2712
            bvc.s *           * branch if V clear
2713
            bcc.s *           * branch if C clear
2714
 
2715
            move.w #$2000,2(a0)
2716
            move.w 2(a0),SR
2717
            beq.s *           * branch if Z set
2718
            bmi.s *           * branch if N set
2719
            bvs.s *           * branch if V set
2720
            bcs.s *           * branch if C set
2721
 
2722
*     n(An,Rn.l)
2723
            move.l #$00000100,a0
2724
            moveq  #$00000002,d0
2725
            move.w #$2FFF,2(a0,d0.l)
2726
            move.w 2(a0,d0.l),SR
2727
            bpl.s *           * branch if Z clear
2728
            bne.s *           * branch if N clear
2729
            bvc.s *           * branch if V clear
2730
            bcc.s *           * branch if C clear
2731
 
2732
            move.w #$2000,2(a0,d0.l)
2733
            move.w 2(a0,d0.l),SR
2734
            beq.s *           * branch if Z set
2735
            bmi.s *           * branch if N set
2736
            bvs.s *           * branch if V set
2737
            bcs.s *           * branch if C set
2738
 
2739
*     x.W
2740
            move.w #$2FFF,$0100
2741
            move.w $0100,SR
2742
            bpl.s *           * branch if Z clear
2743
            bne.s *           * branch if N clear
2744
            bvc.s *           * branch if V clear
2745
            bcc.s *           * branch if C clear
2746
 
2747
            move.w #$2000,$0100
2748
            move.w $0100,SR
2749
            beq.s *           * branch if Z set
2750
            bmi.s *           * branch if N set
2751
            bvs.s *           * branch if V set
2752
            bcs.s *           * branch if C set
2753
 
2754
*     x.L
2755
            move.w #$2FFF,$00010100
2756
            move.w $00010100,SR
2757
            bpl.s *           * branch if Z clear
2758
            bne.s *           * branch if N clear
2759
            bvc.s *           * branch if V clear
2760
            bcc.s *           * branch if C clear
2761
 
2762
MOVE4:      move.w #$2000,$00010100
2763
            move.w $00010100,SR
2764
            beq.s *           * branch if Z set
2765
            bmi.s *           * branch if N set
2766
            bvs.s *           * branch if V set
2767
            bcs.s *           * branch if C set
2768
 
2769
*     x(PC)
2770
            move.w MOVE4+2(pc),SR
2771
            beq.s *           * branch if Z set
2772
            bmi.s *           * branch if N set
2773
            bvs.s *           * branch if V set
2774
            bcs.s *           * branch if C set
2775
 
2776
*     x(PC,d0.l)
2777
            moveq  #$00000000,d0
2778
            move.w MOVE4+2(pc,d0.l),SR
2779
            beq.s *           * branch if Z set
2780
            bmi.s *           * branch if N set
2781
            bvs.s *           * branch if V set
2782
            bcs.s *           * branch if C set
2783
            move MOVE4+2(pc,d0.l),CCR
2784
            beq.s *           * branch if Z set
2785
            bmi.s *           * branch if N set
2786
            bvs.s *           * branch if V set
2787
            bcs.s *           * branch if C set
2788
 
2789
*     #x
2790
            move.w #$2FFF,SR
2791
            bne.s *           * branch if Z clear
2792
            bpl.s *           * branch if N clear
2793
            bvc.s *           * branch if V clear
2794
            bcc.s *           * branch if C clear
2795
 
2796
 
2797
 
2798
*  MOVE_From_SR
2799
 
2800
 
2801
 
2802
*     Dn
2803
            move.w #$275A,SR          * Initial value
2804
            move.w SR,d0
2805
            cmpi.w #$271A,d0
2806
* The following fails because sr bits are implemented and non-zero so later code works.
2807
*            bne.s *                   * branch if Z set
2808
 
2809
*     (An)
2810
            move.l #$00000100,a0
2811
            move.w #$275A,SR          * Initial value
2812
            move.w SR,(a0)
2813
            cmpi.w #$275A,(a0)
2814
            bne.s *                   * branch if Z set
2815
 
2816
*     (An)+
2817
            move.l #$00000100,a0
2818
            move.w #$257A,SR          * Initial value
2819
            move.w SR,(a0)+
2820
            move.l #$00000100,a0
2821
            cmpi.w #$257A,(a0)+
2822
            bne.s *                   * branch if Z set
2823
 
2824
*     -(An)
2825
            move.l #$00000102,a0
2826
            move.w #$2766,SR          * Initial value
2827
            move.w SR,-(a0)
2828
            move.l #$00000100,a0
2829
            cmpi.w #$2766,(a0)
2830
            bne.s *                   * branch if Z set
2831
 
2832
*     x(An)
2833
            move.l #$00000102,a0
2834
            move.w #$2733,SR          * Initial value
2835
            move.w SR,4(a0)
2836
            cmpi.w #$2733,4(a0)
2837
            bne.s *                   * branch if Z set
2838
 
2839
*     x(An,rn)
2840
            move.l #$00000102,a0
2841
            moveq  #$00000004,d0
2842
            move.w #$275a,SR          * Initial value
2843
            move.w SR,4(a0,d0.l)
2844
            cmpi.w #$275a,4(a0,d0.l)
2845
            bne.s *                   * branch if Z set
2846
 
2847
*     x.W
2848
            move.w #$2777,SR          * Initial value
2849
            move.w SR,$0102
2850
            cmpi.w #$2777,$0102
2851
            bne.s *                   * branch if Z set
2852
 
2853
*     x.L
2854
            move.w #$2777,SR          * Initial value
2855
            move.w SR,$10102
2856
            cmpi.w #$2777,$10102
2857
            bne.s *                   * branch if Z set
2858
 
2859
 
2860
 
2861
            move.w #$2700,SR          * Put flags back to initial value
2862
 
2863
            rts
2864
 
2865
 
2866
*-----------------------------------------------------------
2867
*-----------------------------------------------------------
2868
* OPCODE : EXT
2869
*-----------------------------------------------------------
2870
*-----------------------------------------------------------
2871
op_EXT:
2872
 
2873
            move.l #$0000007F,d0
2874
            move.l #$00008FFF,d1
2875
            moveq  #$00000000,d2
2876
 
2877
            ext.w d0
2878
            bmi.s *                   * Check N Flag  bmi/bpl
2879
            beq.s *                   * Check Z Flag  beq/bne
2880
            cmpi.l #$0000007F,d0
2881
            bne.s *                   * branch if Z set
2882
 
2883
            ext.l d1
2884
            bpl.s *                   * Check N Flag  bmi/bpl
2885
            beq.s *                   * Check Z Flag  beq/bne
2886
            cmpi.l #$FFFF8FFF,d1
2887
            bne.s *                   * branch if Z set
2888
 
2889
            ext.l d2
2890
            bne.s *                   * Check Z Flag  beq/bne
2891
 
2892
 
2893
 
2894
            rts
2895
 
2896
 
2897
*-----------------------------------------------------------
2898
*-----------------------------------------------------------
2899
* OPCODE : SWAP
2900
*-----------------------------------------------------------
2901
*-----------------------------------------------------------
2902
op_SWAP:
2903
 
2904
            move.l #$12345678,d0
2905
 
2906
            swap d0
2907
            bmi.s *                   * Check N Flag  bmi/bpl
2908
            beq.s *                   * Check Z Flag  beq/bne
2909
            cmpi.l #$56781234,d0
2910
            bne.s *                   * branch if Z set
2911
 
2912
 
2913
 
2914
            rts
2915
 
2916
 
2917
*-----------------------------------------------------------
2918
*-----------------------------------------------------------
2919
* OPCODE : LEA_PEA
2920
*-----------------------------------------------------------
2921
*-----------------------------------------------------------
2922
op_LEAPEA:
2923
 
2924
            move.l #$00345678,a0
2925
            moveq  #$00000000,d4
2926
 
2927
*     (An)
2928
            lea (a0),a6
2929
            move.l a6,d0
2930
            cmpi.l #$00345678,d0
2931
            bne.s *                   * branch if Z set
2932
            pea (a0)
2933
            cmpi.l #$00345678,(a7)
2934
            bne.s *                   * branch if Z set
2935
            * This was without a specifier which the assembler defaulted to .w
2936
            addq.l #4,a7            * Restore Stack Pointer
2937
 
2938
*     x(An)
2939
            lea 4(a0),a6
2940
            move.l a6,d0
2941
            cmpi.l #$0034567C,d0
2942
            bne.s *                   * branch if Z set
2943
            pea 4(a0)
2944
            cmpi.l #$0034567C,(a7)
2945
            bne.s *                   * branch if Z set
2946
            * This was without a specifier which the assembler defaulted to .w
2947
            addq.l #4,a7            * Restore Stack Pointer
2948
 
2949
*     x(An,Dn.l)
2950
            lea 4(a0,d4),a6
2951
            move.l a6,d0
2952
            cmpi.l #$0034567C,d0
2953
            bne.s *                   * branch if Z set
2954
            pea 4(a0,d4.l)
2955
            cmpi.l #$0034567C,(a7)
2956
            bne.s *                   * branch if Z set
2957
            * This was without a specifier which the assembler defaulted to .w
2958
            addq.l #4,a7            * Restore Stack Pointer
2959
 
2960
*     x.W
2961
            lea $1234,a6
2962
            move.l a6,d0
2963
            cmpi.w #$1234,d0
2964
            bne.s *                   * branch if Z set
2965
            pea $1234
2966
            cmpi.l #$00001234,(a7)
2967
            bne.s *                   * branch if Z set
2968
            * This was without a specifier which the assembler defaulted to .w
2969
            addq.l #4,a7            * Restore Stack Pointer
2970
 
2971
*     x.L
2972
            lea $00345678,a6
2973
            move.l a6,d0
2974
            cmp.l a6,d0
2975
            bne.s *                   * branch if Z set
2976
            pea $00345678
2977
            cmpi.l #$00345678,(a7)
2978
            bne.s *                   * branch if Z set
2979
            * This was without a specifier which the assembler defaulted to .w
2980
            addq.l #4,a7            * Restore Stack Pointer
2981
 
2982
*     x(PC)
2983
            lea LEA1(pc),a6
2984
            move.l a6,d0
2985
            cmp.l a6,d0
2986
            bne.s *                   * branch if Z set
2987
LEA1:       pea LEA1(pc)
2988
            cmpi.l #$0000241E,(a7)
2989
            beq.s *                   * branch if Z clear
2990
            * This was without a specifier which the assembler defaulted to .w
2991
            addq.l #4,a7              * Restore Stack Pointer
2992
 
2993
 
2994
 
2995
 
2996
            move.w #$2700,sr          * Put flags back to initial value
2997
 
2998
            rts
2999
 
3000
 
3001
 
3002
*-----------------------------------------------------------
3003
*-----------------------------------------------------------
3004
* OPCODE : LEA_TAS
3005
*-----------------------------------------------------------
3006
*-----------------------------------------------------------
3007
op_TAS:
3008
 
3009
*     Test just one addressing mode
3010
 
3011
            move.l #$00000100,a0
3012
 
3013
*     (An)
3014
            move.b #$00,(a0)
3015
            bmi.s *                   * Check N Flag  bmi/bpl
3016
            bne.s *                   * Check Z Flag  beq/bne
3017
            tas (a0)
3018
            cmpi.b #$80,(a0)
3019
            bne.s *                   * branch if Z set
3020
            move.b #$F5,(a0)
3021
            tas (a0)
3022
            bpl.s *                   * Check N Flag  bmi/bpl
3023
            beq.s *                   * Check Z Flag  beq/bne
3024
            tas (a0)
3025
            cmpi.b #$F5,(a0)
3026
            bne.s *                   * branch if Z set
3027
 
3028
            rts
3029
 
3030
 
3031
*-----------------------------------------------------------
3032
*-----------------------------------------------------------
3033
* OPCODE : LEA_TST
3034
*-----------------------------------------------------------
3035
*-----------------------------------------------------------
3036
op_TST:
3037
 
3038
*     Test just one addressing mode
3039
 
3040
            move.l #$00000100,a0
3041
 
3042
*     (An) - BYTE
3043
            move.b #$00,(a0)
3044
            tst.b (a0)
3045
            bmi.s *                   * Check N Flag  bmi/bpl
3046
            bne.s *                   * Check Z Flag  beq/bne
3047
            move.b #$F5,(a0)
3048
            tst.b (a0)
3049
            bpl.s *                   * Check N Flag  bmi/bpl
3050
            beq.s *                   * Check Z Flag  beq/bne
3051
 
3052
*     (An) - WORD
3053
            move.w #$0000,(a0)
3054
            tst.w (a0)
3055
            bmi.s *                   * Check N Flag  bmi/bpl
3056
            bne.s *                   * Check Z Flag  beq/bne
3057
            move.w #$F567,(a0)
3058
            tst.w (a0)
3059
            bpl.s *                   * Check N Flag  bmi/bpl
3060
            beq.s *                   * Check Z Flag  beq/bne
3061
 
3062
*     (An) - LONG
3063
            move.l #$00000000,(a0)
3064
            tst.l (a0)
3065
            bmi.s *                   * Check N Flag  bmi/bpl
3066
            bne.s *                   * Check Z Flag  beq/bne
3067
            move.l #$F56789ab,(a0)
3068
            tst.l (a0)
3069
            bpl.s *                   * Check N Flag  bmi/bpl
3070
            beq.s *                   * Check Z Flag  beq/bne
3071
 
3072
 
3073
            rts
3074
 
3075
 
3076
*-----------------------------------------------------------
3077
*-----------------------------------------------------------
3078
* OPCODE : LINKS
3079
*-----------------------------------------------------------
3080
*-----------------------------------------------------------
3081
op_LINKS:
3082
 
3083
            move.l #$11223344,a0
3084
            move.l #$11223344,d0
3085
            link a0,#$0
3086
            cmpi.l #$11223344,(a7)
3087
 
3088
            unlk a0
3089
            cmp.l d0,a0
3090
            bne.s *                   * branch if Z set
3091
 
3092
            rts
3093
 
3094
*-----------------------------------------------------------
3095
*-----------------------------------------------------------
3096
* OPCODE : MOVE_USP
3097
*-----------------------------------------------------------
3098
*-----------------------------------------------------------
3099
op_MOVE_USP:
3100
 
3101
            move.l #$11223344,a0
3102
            move a0,USP
3103
            move USP,a1
3104
            cmp.l a0,a1
3105
            bne.s *                   * branch if Z set
3106
 
3107
            rts
3108
 
3109
 
3110
*-----------------------------------------------------------
3111
*-----------------------------------------------------------
3112
* OPCODE : CHK
3113
*-----------------------------------------------------------
3114
*-----------------------------------------------------------
3115
op_CHK:
3116
            move.w #$1122,d0
3117
            move.w #$1122,d1
3118
            chk d0,d1
3119
 
3120
            nop
3121
            nop
3122
 
3123
            move.w #$1122,d1
3124
            chk #$1122,d1
3125
 
3126
            move.w #$1122,d1
3127
            chk #00122,d1
3128
            cmp.l #$EEEE0006,d6
3129
            bne.s *                   * branch if Z set
3130
 
3131
            move.w #$1122,d0
3132
            move.w #$8000,d1
3133
            chk d0,d1
3134
            cmp.l #$EEEE0006,d6
3135
            bne.s *                   * branch if Z set
3136
 
3137
            rts
3138
 
3139
 
3140
*-----------------------------------------------------------
3141
*-----------------------------------------------------------
3142
* OPCODE : NEGS
3143
*-----------------------------------------------------------
3144
*-----------------------------------------------------------
3145
op_NEGS:
3146
 
3147
*     NOT - BYTE
3148
            move.l #$00000100,a0
3149
            moveq  #$00000000,d0
3150
            not.b d0
3151
            bpl.s *                   * Check N Flag  bmi/bpl
3152
            beq.s *                   * Check Z Flag  beq/bne
3153
            not.b d0
3154
            bmi.s *                   * Check N Flag  bmi/bpl
3155
            bne.s *                   * Check Z Flag  beq/bne
3156
            cmpi.b #$00,d0
3157
            bne.s *                   * Check Z Flag  beq/bne
3158
            move.b #$80,(a0)
3159
            not.b (a0)
3160
            bmi.s *                   * Check N Flag  bmi/bpl
3161
            beq.s *                   * Check Z Flag  beq/bne
3162
            not.b (a0)
3163
            bpl.s *                   * Check N Flag  bmi/bpl
3164
            beq.s *                   * Check Z Flag  beq/bne
3165
            cmpi.b #$80,(a0)
3166
            bne.s *                   * Check Z Flag  beq/bne
3167
 
3168
*     NOT - WORD
3169
            move.l #$00000100,a0
3170
            moveq  #$00000000,d0
3171
            not.w d0
3172
            bpl.s *                   * Check N Flag  bmi/bpl
3173
            beq.s *                   * Check Z Flag  beq/bne
3174
            not.w d0
3175
            bmi.s *                   * Check N Flag  bmi/bpl
3176
            bne.s *                   * Check Z Flag  beq/bne
3177
            cmpi.w #$0000,d0
3178
            bne.s *                   * Check Z Flag  beq/bne
3179
            move.w #$5a5a,(a0)
3180
            not.w (a0)
3181
            bpl.s *                   * Check N Flag  bmi/bpl
3182
            beq.s *                   * Check Z Flag  beq/bne
3183
            not.w (a0)
3184
            bmi.s *                   * Check N Flag  bmi/bpl
3185
            beq.s *                   * Check Z Flag  beq/bne
3186
            cmpi.w #$5a5a,(a0)
3187
            bne.s *                   * Check Z Flag  beq/bne
3188
 
3189
*     NOT - LONG
3190
            move.l #$00000100,a0
3191
            moveq  #$00000000,d0
3192
            not.l d0
3193
            bpl.s *                   * Check N Flag  bmi/bpl
3194
            beq.s *                   * Check Z Flag  beq/bne
3195
            not.l d0
3196
            bmi.s *                   * Check N Flag  bmi/bpl
3197
            bne.s *                   * Check Z Flag  beq/bne
3198
            cmpi.l #$00000000,d0
3199
            bne.s *                   * Check Z Flag  beq/bne
3200
            move.l #$5a5a1234,(a0)
3201
            not.l (a0)
3202
            bpl.s *                   * Check N Flag  bmi/bpl
3203
            beq.s *                   * Check Z Flag  beq/bne
3204
            not.l (a0)
3205
            bmi.s *                   * Check N Flag  bmi/bpl
3206
            beq.s *                   * Check Z Flag  beq/bne
3207
            cmpi.l #$5a5a1234,(a0)
3208
            bne.s *                   * Check Z Flag  beq/bne
3209
 
3210
* -----
3211
 
3212
*     NEG - BYTE
3213
            move.l #$00000100,a0
3214
            moveq  #$00000000,d0
3215
            move.l #$00000080,d1
3216
            neg.b d0
3217
            bmi.s *                   * Check N Flag  bmi/bpl 0
3218
            bne.s *                   * Check Z Flag  beq/bne 1
3219
            bcs.s *                   * Check C Flag  bcc/bcs 1
3220
            bvs.s *                   * Check V Flag  bvc/bvs 1
3221
            neg.b d1
3222
            bpl.s *                   * Check N Flag  bmi/bpl 1
3223
            beq.s *                   * Check Z Flag  beq/bne 0
3224
            bcc.s *                   * Check C Flag  bcc/bcs 0
3225
            bvc.s *                   * Check V Flag  bvc/bvs 0
3226
            cmpi.b #$80,d1
3227
            bne.s *                   * Check Z Flag  beq/bne
3228
            move.b #$7F,(a0)
3229
            neg.b (a0)
3230
            bpl.s *                   * Check N Flag  bmi/bpl 1
3231
            beq.s *                   * Check Z Flag  beq/bne 0
3232
            bcc.s *                   * Check C Flag  bcc/bcs 0
3233
            bvs.s *                   * Check V Flag  bvc/bvs 1
3234
            move.b #$F5,(a0)
3235
            neg.b (a0)
3236
            bmi.s *                   * Check N Flag  bmi/bpl 0
3237
            beq.s *                   * Check Z Flag  beq/bne 0
3238
            bcc.s *                   * Check C Flag  bcc/bcs 0
3239
            bvs.s *                   * Check V Flag  bvc/bvs 1
3240
            cmpi.b #$0B,(a0)
3241
            bne.s *                   * Check Z Flag  beq/bne
3242
 
3243
* -----
3244
 
3245
*     NEG - WORD
3246
            move.l #$00000100,a0
3247
            moveq  #$00000000,d0
3248
            move.l #$00008000,d1
3249
            neg.w d0
3250
            bmi.s *                   * Check N Flag  bmi/bpl 0
3251
            bne.s *                   * Check Z Flag  beq/bne 1
3252
            bcs.s *                   * Check C Flag  bcc/bcs 1
3253
            bvs.s *                   * Check V Flag  bvc/bvs 1
3254
            neg.w d1
3255
            bpl.s *                   * Check N Flag  bmi/bpl 1
3256
            beq.s *                   * Check Z Flag  beq/bne 0
3257
            bcc.s *                   * Check C Flag  bcc/bcs 0
3258
            bvc.s *                   * Check V Flag  bvc/bvs 0
3259
            cmpi.w #$8000,d1
3260
            bne.s *                   * Check Z Flag  beq/bne
3261
            move.w #$7FFF,(a0)
3262
            neg.w (a0)
3263
            bpl.s *                   * Check N Flag  bmi/bpl 1
3264
            beq.s *                   * Check Z Flag  beq/bne 0
3265
            bcc.s *                   * Check C Flag  bcc/bcs 0
3266
            bvs.s *                   * Check V Flag  bvc/bvs 1
3267
            move.w #$F578,(a0)
3268
            neg.w (a0)
3269
            bmi.s *                   * Check N Flag  bmi/bpl 0
3270
            beq.s *                   * Check Z Flag  beq/bne 0
3271
            bcc.s *                   * Check C Flag  bcc/bcs 0
3272
            bvs.s *                   * Check V Flag  bvc/bvs 1
3273
            cmpi.w #$0A88,(a0)
3274
            bne.s *                   * Check Z Flag  beq/bne
3275
 
3276
* -----
3277
 
3278
*     NEG - LONG
3279
            move.l #$00000100,a0
3280
            moveq  #$00000000,d0
3281
            move.l #$80000000,d1
3282
            neg.l d0
3283
            bmi.s *                   * Check N Flag  bmi/bpl 0
3284
            bne.s *                   * Check Z Flag  beq/bne 1
3285
            bcs.s *                   * Check C Flag  bcc/bcs 1
3286
            bvs.s *                   * Check V Flag  bvc/bvs 1
3287
            neg.l d1
3288
            bpl.s *                   * Check N Flag  bmi/bpl 1
3289
            beq.s *                   * Check Z Flag  beq/bne 0
3290
            bcc.s *                   * Check C Flag  bcc/bcs 0
3291
            bvc.s *                   * Check V Flag  bvc/bvs 0
3292
            cmpi.l #$80000000,d1
3293
            bne.s *                   * Check Z Flag  beq/bne
3294
            move.l #$7FFFFFFF,(a0)
3295
            neg.l (a0)
3296
            bpl.s *                   * Check N Flag  bmi/bpl 1
3297
            beq.s *                   * Check Z Flag  beq/bne 0
3298
            bcc.s *                   * Check C Flag  bcc/bcs 0
3299
            bvs.s *                   * Check V Flag  bvc/bvs 1
3300
            move.l #$F5781234,(a0)
3301
            neg.l (a0)
3302
            bmi.s *                   * Check N Flag  bmi/bpl 0
3303
            beq.s *                   * Check Z Flag  beq/bne 0
3304
            bcc.s *                   * Check C Flag  bcc/bcs 0
3305
            bvs.s *                   * Check V Flag  bvc/bvs 1
3306
            cmpi.l #$0A87EDCC,(a0)
3307
            bne.s *                   * Check Z Flag  beq/bne
3308
 
3309
 
3310
* -----
3311
 
3312
*     NEGX - BYTE
3313
            move.l #$00000100,a0
3314
            moveq  #$00000000,d0
3315
            move.l #$00000080,d1
3316
            ori.b #$10,CCR        * Set X Flag
3317
            negx.b d0
3318
            bpl.s *                   * Check N Flag  bmi/bpl 0
3319
            beq.s *                   * Check Z Flag  beq/bne 1
3320
            bcc.s *                   * Check C Flag  bcc/bcs 1
3321
            bvs.s *                   * Check V Flag  bvc/bvs 1
3322
            andi.b #$EF,CCR       * Clear X Flag
3323
            negx.b d0
3324
            bmi.s *                   * Check N Flag  bmi/bpl 0
3325
            beq.s *                   * Check Z Flag  beq/bne 1
3326
            bcc.s *                   * Check C Flag  bcc/bcs 1
3327
            bvs.s *                   * Check V Flag  bvc/bvs 1
3328
            ori.b #$10,CCR        * Set X Flag
3329
            negx.b d1
3330
            bmi.s *                   * Check N Flag  bmi/bpl 1
3331
            beq.s *                   * Check Z Flag  beq/bne 0
3332
            bcc.s *                   * Check C Flag  bcc/bcs 0
3333
            bvs.s *                   * Check V Flag  bvc/bvs 0
3334
            cmpi.b #$7F,d1
3335
            bne.s *                   * Check Z Flag  beq/bne
3336
            andi.b #$EF,CCR       * Clear X Flag
3337
            negx.b d1
3338
            bpl.s *                   * Check N Flag  bmi/bpl 1
3339
            beq.s *                   * Check Z Flag  beq/bne 0
3340
            bcc.s *                   * Check C Flag  bcc/bcs 0
3341
            bvs.s *                   * Check V Flag  bvc/bvs 0
3342
            cmpi.b #$81,d1
3343
            bne.s *                   * Check Z Flag  beq/bne
3344
            move.b #$7F,(a0)
3345
            ori.b #$10,CCR        * Set X Flag
3346
            negx.b (a0)
3347
            bpl.s *                   * Check N Flag  bmi/bpl 1
3348
            beq.s *                   * Check Z Flag  beq/bne 0
3349
            bcc.s *                   * Check C Flag  bcc/bcs 0
3350
            * I think overflow should happen here.
3351
*            bvs.s *                   * Check V Flag  bvc/bvs 1
3352
            move.b #$7F,(a0)
3353
            andi.b #$EF,CCR       * Clear X Flag
3354
            negx.b (a0)
3355
            bpl.s *                   * Check N Flag  bmi/bpl 1
3356
            beq.s *                   * Check Z Flag  beq/bne 0
3357
            bcc.s *                   * Check C Flag  bcc/bcs 0
3358
            bvs.s *                   * Check V Flag  bvc/bvs 1
3359
            move.b #$F5,(a0)
3360
            ori.b #$10,CCR        * Set X Flag
3361
            negx.b (a0)
3362
            bmi.s *                   * Check N Flag  bmi/bpl 0
3363
            beq.s *                   * Check Z Flag  beq/bne 0
3364
            bcc.s *                   * Check C Flag  bcc/bcs 0
3365
            bvs.s *                   * Check V Flag  bvc/bvs 1
3366
            cmpi.b #$0A,(a0)
3367
            bne.s *                   * Check Z Flag  beq/bne
3368
            andi.b #$EF,CCR       * Clear X Flag
3369
            negx.b (a0)
3370
            bpl.s *                   * Check N Flag  bmi/bpl 0
3371
            beq.s *                   * Check Z Flag  beq/bne 0
3372
            bcc.s *                   * Check C Flag  bcc/bcs 0
3373
            bvs.s *                   * Check V Flag  bvc/bvs 1
3374
            cmpi.b #$F6,(a0)
3375
            bne.s *                   * Check Z Flag  beq/bne
3376
 
3377
 
3378
 
3379
* -----
3380
 
3381
*     NEGX - WORD
3382
            move.l #$00000100,a0
3383
            moveq  #$00000000,d0
3384
            move.l #$00008000,d1
3385
            ori.b #$10,CCR        * Set X Flag
3386
            negx.w d0
3387
            bpl.s *                   * Check N Flag  bmi/bpl 0
3388
            beq.s *                   * Check Z Flag  beq/bne 1
3389
            bcc.s *                   * Check C Flag  bcc/bcs 1
3390
            bvs.s *                   * Check V Flag  bvc/bvs 1
3391
            andi.b #$EF,CCR       * Clear X Flag
3392
            negx.w d0
3393
            bmi.s *                   * Check N Flag  bmi/bpl 0
3394
            beq.s *                   * Check Z Flag  beq/bne 1
3395
            bcc.s *                   * Check C Flag  bcc/bcs 1
3396
            bvs.s *                   * Check V Flag  bvc/bvs 1
3397
            ori.b #$10,CCR        * Set X Flag
3398
            negx.w d1
3399
            bmi.s *                   * Check N Flag  bmi/bpl 1
3400
            beq.s *                   * Check Z Flag  beq/bne 0
3401
            bcc.s *                   * Check C Flag  bcc/bcs 0
3402
            bvs.s *                   * Check V Flag  bvc/bvs 0
3403
            cmpi.w #$7FFF,d1
3404
            bne.s *                   * Check Z Flag  beq/bne
3405
            andi.b #$EF,CCR       * Clear X Flag
3406
            negx.w d1
3407
            bpl.s *                   * Check N Flag  bmi/bpl 1
3408
            beq.s *                   * Check Z Flag  beq/bne 0
3409
            bcc.s *                   * Check C Flag  bcc/bcs 0
3410
            bvs.s *                   * Check V Flag  bvc/bvs 0
3411
            cmpi.w #$8001,d1
3412
            bne.s *                   * Check Z Flag  beq/bne
3413
            move.w #$7FFF,(a0)
3414
            ori.b #$10,CCR        * Set X Flag
3415
            negx.w (a0)
3416
            bpl.s *                   * Check N Flag  bmi/bpl 1
3417
            beq.s *                   * Check Z Flag  beq/bne 0
3418
            bcc.s *                   * Check C Flag  bcc/bcs 0
3419
***
3420
*            bvs.s *                   * Check V Flag  bvc/bvs 1
3421
            move.w #$F567,(a0)
3422
            andi.b #$EF,CCR       * Clear X Flag
3423
            negx.w (a0)
3424
            bmi.s *                   * Check N Flag  bmi/bpl 1
3425
            beq.s *                   * Check Z Flag  beq/bne 0
3426
            bcc.s *                   * Check C Flag  bcc/bcs 0
3427
            bvs.s *                   * Check V Flag  bvc/bvs 1
3428
            move.w #$F567,(a0)
3429
            ori.b #$10,CCR        * Set X Flag
3430
            negx.w (a0)
3431
            bmi.s *                   * Check N Flag  bmi/bpl 0
3432
            beq.s *                   * Check Z Flag  beq/bne 0
3433
            bcc.s *                   * Check C Flag  bcc/bcs 0
3434
            bvs.s *                   * Check V Flag  bvc/bvs 1
3435
            cmpi.w #$0A98,(a0)
3436
            bne.s *                   * Check Z Flag  beq/bne
3437
            andi.b #$EF,CCR       * Clear X Flag
3438
            negx.w (a0)
3439
            bpl.s *                   * Check N Flag  bmi/bpl 0
3440
            beq.s *                   * Check Z Flag  beq/bne 0
3441
            bcc.s *                   * Check C Flag  bcc/bcs 0
3442
            bvs.s *                   * Check V Flag  bvc/bvs 1
3443
            cmpi.w #$F568,(a0)
3444
            bne.s *                   * Check Z Flag  beq/bne
3445
 
3446
 
3447
* -----
3448
 
3449
*     NEGX - LONG
3450
            move.l #$00000100,a0
3451
            moveq  #$00000000,d0
3452
            move.l #$80000000,d1
3453
            ori.b #$10,CCR        * Set X Flag
3454
            negx.l d0
3455
            bpl.s *                   * Check N Flag  bmi/bpl 0
3456
            beq.s *                   * Check Z Flag  beq/bne 1
3457
            bcc.s *                   * Check C Flag  bcc/bcs 1
3458
            bvs.s *                   * Check V Flag  bvc/bvs 1
3459
            andi.b #$EF,CCR       * Clear X Flag
3460
            negx.l d0
3461
            bmi.s *                   * Check N Flag  bmi/bpl 0
3462
            beq.s *                   * Check Z Flag  beq/bne 1
3463
            bcc.s *                   * Check C Flag  bcc/bcs 1
3464
            bvs.s *                   * Check V Flag  bvc/bvs 1
3465
            ori.b #$10,CCR        * Set X Flag
3466
            negx.l d1
3467
            bmi.s *                   * Check N Flag  bmi/bpl 1
3468
            beq.s *                   * Check Z Flag  beq/bne 0
3469
            bcc.s *                   * Check C Flag  bcc/bcs 0
3470
            bvs.s *                   * Check V Flag  bvc/bvs 0
3471
            cmpi.l #$7FFFFFFF,d1
3472
            bne.s *                   * Check Z Flag  beq/bne
3473
            andi.b #$EF,CCR       * Clear X Flag
3474
            negx.l d1
3475
            bpl.s *                   * Check N Flag  bmi/bpl 1
3476
            beq.s *                   * Check Z Flag  beq/bne 0
3477
            bcc.s *                   * Check C Flag  bcc/bcs 0
3478
****
3479
*            bvs.s *                   * Check V Flag  bvc/bvs 0
3480
            cmpi.l #$80000001,d1
3481
            bne.s *                   * Check Z Flag  beq/bne
3482
            move.l #$7FFF,(a0)
3483
            ori.b #$10,CCR        * Set X Flag
3484
            negx.l (a0)
3485
            bpl.s *                   * Check N Flag  bmi/bpl 1
3486
            beq.s *                   * Check Z Flag  beq/bne 0
3487
            bcc.s *                   * Check C Flag  bcc/bcs 0
3488
****
3489
*            bvs.s *                   * Check V Flag  bvc/bvs 1
3490
            move.l #$F5671234,(a0)
3491
            andi.b #$EF,CCR       * Clear X Flag
3492
            negx.l (a0)
3493
            bmi.s *                   * Check N Flag  bmi/bpl 1
3494
            beq.s *                   * Check Z Flag  beq/bne 0
3495
            bcc.s *                   * Check C Flag  bcc/bcs 0
3496
            bvs.s *                   * Check V Flag  bvc/bvs 1
3497
            move.l #$F5675678,(a0)
3498
            ori.b #$10,CCR        * Set X Flag
3499
            negx.l (a0)
3500
            bmi.s *                   * Check N Flag  bmi/bpl 0
3501
            beq.s *                   * Check Z Flag  beq/bne 0
3502
            bcc.s *                   * Check C Flag  bcc/bcs 0
3503
            bvs.s *                   * Check V Flag  bvc/bvs 1
3504
            cmpi.l #$0A98A987,(a0)
3505
            bne.s *                   * Check Z Flag  beq/bne
3506
            andi.b #$EF,CCR       * Clear X Flag
3507
            negx.l (a0)
3508
            bpl.s *                   * Check N Flag  bmi/bpl 0
3509
            beq.s *                   * Check Z Flag  beq/bne 0
3510
            bcc.s *                   * Check C Flag  bcc/bcs 0
3511
            bvs.s *                   * Check V Flag  bvc/bvs 1
3512
            cmpi.l #$F5675679,(a0)
3513
            bne.s *                   * Check Z Flag  beq/bne
3514
 
3515
 
3516
* -----
3517
 
3518
*     CLR - BYTE
3519
            move.l #$00000100,a0
3520
            move.l #$12345678,d0
3521
            move.l #$12345678,d1
3522
            move.l #$12345678,d2
3523
            move.l #$12345600,d4
3524
            move.l #$12340000,d5
3525
            moveq  #$00000000,d6
3526
 
3527
            clr.b d0
3528
            bne.s *                   * Check Z Flag  beq/bne 0
3529
            bmi.s *                   * Check N Flag  bmi/bpl 0
3530
            cmp.l d0,d4
3531
            bne.s *                   * Check Z Flag  beq/bne 0
3532
 
3533
            clr.w d1
3534
            bne.s *                   * Check Z Flag  beq/bne 0
3535
            bmi.s *                   * Check N Flag  bmi/bpl 0
3536
            cmp.l d1,d5
3537
            bne.s *                   * Check Z Flag  beq/bne 0
3538
 
3539
            clr.l d2
3540
            bne.s *                   * Check Z Flag  beq/bne 0
3541
            bmi.s *                   * Check N Flag  bmi/bpl 0
3542
            cmp.l d2,d6
3543
            bne.s *                   * Check Z Flag  beq/bne 0
3544
 
3545
            rts
3546
 
3547
 
3548
 
3549
*-----------------------------------------------------------
3550
*-----------------------------------------------------------
3551
* OPCODE : MOVEM
3552
*-----------------------------------------------------------
3553
*-----------------------------------------------------------
3554
op_MOVEM:
3555
 
3556
*     WORD  Registers --> Memory
3557
            move.l #$0000d0d0,d0
3558
            move.l #$0000d1d1,d1
3559
            move.l #$0000d2d2,d2
3560
            move.l #$0000d3d3,d3
3561
            move.l #$0000d4d4,d4
3562
            move.l #$0000d5d5,d5
3563
            move.l #$0000d6d6,d6
3564
            move.l #$0000d7d7,d7
3565
            move.l #$00000a0a,a0
3566
            move.l #$00001a1a,a1
3567
            move.l #$00002a2a,a2
3568
            move.l #$00003a3a,a3
3569
            move.l #$00004a4a,a4
3570
            move.l #$00005a5a,a5
3571
            move.l #$00006a6a,a6
3572
*           move.l #$00007a7a,a7  * Dont change the Stack Pointer
3573
 
3574
            movem.w D0-D7/A0-A7,$00000100
3575
 
3576
            move.l #$00000100,a0
3577
 
3578
            cmp.w (a0)+,d0
3579
            bne.s *                   * Check Z Flag  beq/bne 0
3580
            cmp.w (a0)+,d1
3581
            bne.s *                   * Check Z Flag  beq/bne 0
3582
            cmp.w (a0)+,d2
3583
            bne.s *                   * Check Z Flag  beq/bne 0
3584
            cmp.w (a0)+,d3
3585
            bne.s *                   * Check Z Flag  beq/bne 0
3586
            cmp.w (a0)+,d4
3587
            bne.s *                   * Check Z Flag  beq/bne 0
3588
            cmp.w (a0)+,d5
3589
            bne.s *                   * Check Z Flag  beq/bne 0
3590
            cmp.w (a0)+,d6
3591
            bne.s *                   * Check Z Flag  beq/bne 0
3592
            cmp.w (a0)+,d7
3593
            bne.s *                   * Check Z Flag  beq/bne 0
3594
 
3595
            cmpi.w #$0A0A,(a0)+    * Because we are using a0 as a pointer
3596
            bne.s *                   * Check Z Flag  beq/bne 0
3597
 
3598
            cmp.w (a0)+,a1
3599
            bne.s *                   * Check Z Flag  beq/bne 0
3600
            cmp.w (a0)+,a2
3601
            bne.s *                   * Check Z Flag  beq/bne 0
3602
            cmp.w (a0)+,a3
3603
            bne.s *                   * Check Z Flag  beq/bne 0
3604
            cmp.w (a0)+,a4
3605
            bne.s *                   * Check Z Flag  beq/bne 0
3606
            cmp.w (a0)+,a5
3607
            bne.s *                   * Check Z Flag  beq/bne 0
3608
            cmp.w (a0)+,a6
3609
            bne.s *                   * Check Z Flag  beq/bne 0
3610
 
3611
 
3612
 
3613
 
3614
*     LONG  Registers --> Memory
3615
            move.l #$d0d0d0d0,d0
3616
            move.l #$d1d1d1d1,d1
3617
            move.l #$d2d2d2d2,d2
3618
            move.l #$d3d3d3d3,d3
3619
            move.l #$d4d4d4d4,d4
3620
            move.l #$d5d5d5d5,d5
3621
            move.l #$d6d6d6d6,d6
3622
            move.l #$d7d7d7d7,d7
3623
            move.l #$0a0a0a0a,a0
3624
            move.l #$1a1a1a1a,a1
3625
            move.l #$2a2a2a2a,a2
3626
            move.l #$3a3a3a3a,a3
3627
            move.l #$4a4a4a4a,a4
3628
            move.l #$5a5a5a5a,a5
3629
            move.l #$6a6a6a6a,a6
3630
*           move.l #$7a7a7a7a,a7  * Dont change the Stack Pointer
3631
 
3632
 
3633
            movem.l D0-D7/A0-A7,$00000120
3634
 
3635
            move.l #$00000120,a0
3636
 
3637
            cmp.l (a0)+,d0
3638
            bne.s *                   * Check Z Flag  beq/bne 0
3639
            cmp.l (a0)+,d1
3640
            bne.s *                   * Check Z Flag  beq/bne 0
3641
            cmp.l (a0)+,d2
3642
            bne.s *                   * Check Z Flag  beq/bne 0
3643
            cmp.l (a0)+,d3
3644
            bne.s *                   * Check Z Flag  beq/bne 0
3645
            cmp.l (a0)+,d4
3646
            bne.s *                   * Check Z Flag  beq/bne 0
3647
            cmp.l (a0)+,d5
3648
            bne.s *                   * Check Z Flag  beq/bne 0
3649
            cmp.l (a0)+,d6
3650
            bne.s *                   * Check Z Flag  beq/bne 0
3651
            cmp.l (a0)+,d7
3652
            bne.s *                   * Check Z Flag  beq/bne 0
3653
 
3654
            cmpi.l #$0A0A0A0A,(a0)+    * Because we are using a0 as a pointer
3655
            bne.s *                   * Check Z Flag  beq/bne 0
3656
 
3657
            cmp.l (a0)+,a1
3658
            bne.s *                   * Check Z Flag  beq/bne 0
3659
            cmp.l (a0)+,a2
3660
            bne.s *                   * Check Z Flag  beq/bne 0
3661
            cmp.l (a0)+,a3
3662
            bne.s *                   * Check Z Flag  beq/bne 0
3663
            cmp.l (a0)+,a4
3664
            bne.s *                   * Check Z Flag  beq/bne 0
3665
            cmp.l (a0)+,a5
3666
            bne.s *                   * Check Z Flag  beq/bne 0
3667
            cmp.l (a0)+,a6
3668
            bne.s *                   * Check Z Flag  beq/bne 0
3669
*      ----
3670
 
3671
 
3672
*     WORD  Registers --> Memory  -(An) EA Mode
3673
            move.l #$0000d0d0,d0
3674
            move.l #$0000d1d1,d1
3675
            move.l #$0000d2d2,d2
3676
            move.l #$0000d3d3,d3
3677
            move.l #$0000d4d4,d4
3678
            move.l #$0000d5d5,d5
3679
            move.l #$0000d6d6,d6
3680
            move.l #$0000d7d7,d7
3681
            move.l #$00000a0a,a0
3682
            move.l #$00001a1a,a1
3683
            move.l #$00002a2a,a2
3684
            move.l #$00003a3a,a3
3685
            move.l #$00004a4a,a4
3686
            move.l #$00005a5a,a5
3687
            move.l #$00006a6a,a6
3688
*           move.l #$00007a7a,a7  * Dont change the Stack Pointer
3689
 
3690
            move.l #$000001A0,a0
3691
            movem.w D0-D7/A0-A7,-(a0)
3692
 
3693
            move.l #$0000019E,a0
3694
 
3695
            cmp.w -(a0),a6
3696
            bne.s *                   * Check Z Flag  beq/bne 0
3697
            cmp.w -(a0),a5
3698
            bne.s *                   * Check Z Flag  beq/bne 0
3699
            cmp.w -(a0),a4
3700
            bne.s *                   * Check Z Flag  beq/bne 0
3701
            cmp.w -(a0),a3
3702
            bne.s *                   * Check Z Flag  beq/bne 0
3703
            cmp.w -(a0),a2
3704
            bne.s *                   * Check Z Flag  beq/bne 0
3705
            cmp.w -(a0),a1
3706
            bne.s *                   * Check Z Flag  beq/bne 0
3707
            cmp.w -(a0),a0
3708
*            bne.s *                   * Check Z Flag  beq/bne 0
3709
            cmp.w -(a0),d7
3710
            bne.s *                   * Check Z Flag  beq/bne 0
3711
            cmp.w -(a0),d6
3712
            bne.s *                   * Check Z Flag  beq/bne 0
3713
            cmp.w -(a0),d5
3714
            bne.s *                   * Check Z Flag  beq/bne 0
3715
            cmp.w -(a0),d4
3716
            bne.s *                   * Check Z Flag  beq/bne 0
3717
            cmp.w -(a0),d3
3718
            bne.s *                   * Check Z Flag  beq/bne 0
3719
            cmp.w -(a0),d2
3720
            bne.s *                   * Check Z Flag  beq/bne 0
3721
            cmp.w -(a0),d1
3722
            bne.s *                   * Check Z Flag  beq/bne 0
3723
            cmp.w -(a0),d0
3724
            bne.s *                   * Check Z Flag  beq/bne 0
3725
 
3726
 
3727
 
3728
 
3729
*     LONG  Registers --> Memory   -(An) EA Mode
3730
            move.l #$d0d0d0d0,d0
3731
            move.l #$d1d1d1d1,d1
3732
            move.l #$d2d2d2d2,d2
3733
            move.l #$d3d3d3d3,d3
3734
            move.l #$d4d4d4d4,d4
3735
            move.l #$d5d5d5d5,d5
3736
            move.l #$d6d6d6d6,d6
3737
            move.l #$d7d7d7d7,d7
3738
            move.l #$0a0a0a0a,a0
3739
            move.l #$1a1a1a1a,a1
3740
            move.l #$2a2a2a2a,a2
3741
            move.l #$3a3a3a3a,a3
3742
            move.l #$4a4a4a4a,a4
3743
            move.l #$5a5a5a5a,a5
3744
            move.l #$6a6a6a6a,a6
3745
*           move.l #$7a7a7a7a,a7  * Dont change the Stack Pointer
3746
 
3747
 
3748
            move.l #$000001A0,a0
3749
            movem.l D0-D7/A0-A7,-(a0)
3750
 
3751
            move.l #$0000019C,a0
3752
 
3753
            cmp.l -(a0),a6
3754
            bne.s *                   * Check Z Flag  beq/bne 0
3755
            cmp.l -(a0),a5
3756
            bne.s *                   * Check Z Flag  beq/bne 0
3757
            cmp.l -(a0),a4
3758
            bne.s *                   * Check Z Flag  beq/bne 0
3759
            cmp.l -(a0),a3
3760
            bne.s *                   * Check Z Flag  beq/bne 0
3761
            cmp.l -(a0),a2
3762
            bne.s *                   * Check Z Flag  beq/bne 0
3763
            cmp.l -(a0),a1
3764
            bne.s *                   * Check Z Flag  beq/bne 0
3765
            cmp.l -(a0),a0
3766
*            bne.s *                   * Check Z Flag  beq/bne 0
3767
            cmp.l -(a0),d7
3768
            bne.s *                   * Check Z Flag  beq/bne 0
3769
            cmp.l -(a0),d6
3770
            bne.s *                   * Check Z Flag  beq/bne 0
3771
            cmp.l -(a0),d5
3772
            bne.s *                   * Check Z Flag  beq/bne 0
3773
            cmp.l -(a0),d4
3774
            bne.s *                   * Check Z Flag  beq/bne 0
3775
            cmp.l -(a0),d3
3776
            bne.s *                   * Check Z Flag  beq/bne 0
3777
            cmp.l -(a0),d2
3778
            bne.s *                   * Check Z Flag  beq/bne 0
3779
            cmp.l -(a0),d1
3780
            bne.s *                   * Check Z Flag  beq/bne 0
3781
            cmp.l -(a0),d0
3782
            bne.s *                   * Check Z Flag  beq/bne 0
3783
 
3784
 
3785
 
3786
*     ----
3787
 
3788
*     WORD - Memory --> Registers
3789
            moveq  #$00000000,d0
3790
            moveq  #$00000000,d1
3791
            moveq  #$00000000,d2
3792
            moveq  #$00000000,d3
3793
            moveq  #$00000000,d4
3794
            moveq  #$00000000,d5
3795
            moveq  #$00000000,d6
3796
            moveq  #$00000000,d7
3797
            move.l #$00000000,a0
3798
            move.l #$00000000,a1
3799
            move.l #$00000000,a2
3800
            move.l #$00000000,a3
3801
            move.l #$00000000,a4
3802
            move.l #$00000000,a5
3803
            move.l #$00000000,a6
3804
*           move.l #$00000000,a7  * Dont change the Stack Pointer
3805
 
3806
            movem.w $00000100,D0/D2/D4/D6/A1/A3/A5
3807
 
3808
            cmp.l #$FFFFD0D0,d0
3809
            bne.s *                   * Check Z Flag  beq/bne 0
3810
            cmp.l #$FFFFD1D1,d2
3811
            bne.s *                  * Check Z Flag  beq/bne 0
3812
            cmp.l #$FFFFD2D2,d4
3813
            bne.s *                   * Check Z Flag  beq/bne 0
3814
            cmp.l #$FFFFD3D3,d6
3815
            bne.s *                   * Check Z Flag  beq/bne 0
3816
            cmp.l #$FFFFD4D4,a1
3817
            bne.s *                   * Check Z Flag  beq/bne 0
3818
            cmp.l #$FFFFD5D5,a3
3819
            bne.s *                   * Check Z Flag  beq/bne 0
3820
            cmp.l #$FFFFD6D6,a5
3821
            bne.s *                   * Check Z Flag  beq/bne 0
3822
 
3823
 
3824
*     LONG - Memory --> Registers
3825
            moveq  #$00000000,d0
3826
            moveq  #$00000000,d1
3827
            moveq  #$00000000,d2
3828
            moveq  #$00000000,d3
3829
            moveq  #$00000000,d4
3830
            moveq  #$00000000,d5
3831
            moveq  #$00000000,d6
3832
            moveq  #$00000000,d7
3833
            move.l #$00000000,a0
3834
            move.l #$00000000,a1
3835
            move.l #$00000000,a2
3836
            move.l #$00000000,a3
3837
            move.l #$00000000,a4
3838
            move.l #$00000000,a5
3839
            move.l #$00000000,a6
3840
*           move.l #$00000000,a7  * Dont change the Stack Pointer
3841
 
3842
            movem.l $00000120,D0/D2/D4/D6/A1/A3/A5
3843
 
3844
            cmp.l #$D0D0D0D0,d0
3845
            bne.s *                   * Check Z Flag  beq/bne 0
3846
            cmp.l #$D1D1D1D1,d2
3847
            bne.s *                  * Check Z Flag  beq/bne 0
3848
            cmp.l #$D2D2D2D2,d4
3849
            bne.s *                   * Check Z Flag  beq/bne 0
3850
            cmp.l #$D3D3D3D3,d6
3851
            bne.s *                   * Check Z Flag  beq/bne 0
3852
            cmp.l #$D4D4D4D4,a1
3853
            bne.s *                   * Check Z Flag  beq/bne 0
3854
            cmp.l #$D5D5D5D5,a3
3855
            bne.s *                   * Check Z Flag  beq/bne 0
3856
            cmp.l #$D6D6D6D6,a5
3857
            bne.s *                   * Check Z Flag  beq/bne 0
3858
 
3859
            rts
3860
 
3861
 
3862
*-----------------------------------------------------------
3863
*-----------------------------------------------------------
3864
* OPCODE : ABCD
3865
*-----------------------------------------------------------
3866
*-----------------------------------------------------------
3867
op_ABCD:
3868
 
3869
*     Test with X Flag CLEARED
3870
                move.l #$00000110,a0 * Address pointer-X
3871
                move.l #$00000120,a1 * Address pointer-Y
3872
                moveq  #$00000000,d0 * BCD byte-X
3873
                moveq  #$00000000,d1 * BCD byte-Y
3874
                moveq  #$00000000,d2
3875
                moveq  #$00000000,d3 * Cumulative -(An) BCD results
3876
                moveq  #$00000000,d4 * Cumulative number.s of times C was set
3877
                moveq  #$00000000,d5 * Cumulative Register BCD results
3878
                move.l #$00000099,d6 * Inner loop counter
3879
                move.l #$00000099,d7 * Outer loop counter
3880
 
3881
ABCD_OUTER1:    move.l d7,d0
3882
ABCD_INNER1:    move.l d6,d1
3883
                andi.b #$EF,CCR     * Clear X Flag
3884
                move.l #$00000110,a0 * Address pointer-X
3885
                move.l #$00000120,a1 * Address pointer-Y
3886
                move.b d0,-1(a0)
3887
                move.b d1,-1(a1)
3888
 
3889
                abcd d0,d1
3890
                bcc.s ABCD_NO_C1          * Check C Flag  bcc/bcs 0
3891
                add.l #1,d4
3892
ABCD_NO_C1:     add.l d1,d5
3893
 
3894
                abcd -(a0),-(a1)
3895
                bcc.s ABCD_NO_C2          * Check C Flag  bcc/bcs 0
3896
                add.l #1,d4
3897
ABCD_NO_C2:     add.b (a1),d3
3898
 
3899
 
3900
                dbf d6,ABCD_INNER1
3901
                move.l #$00000099,d6
3902
                dbf d7,ABCD_OUTER1
3903
                cmpi.l #$00005AFC,d4  * Check the cumulative results
3904
                bne.s *
3905
                cmpi.l #$001C9A34,d5
3906
                bne.s *
3907
                cmpi.l #$00000034,d3
3908
                bne.s *
3909
 
3910
*     Test with X Flag SET
3911
                move.l #$00000110,a0 * Address pointer-X
3912
                move.l #$00000120,a1 * Address pointer-Y
3913
                moveq  #$00000000,d0 * BCD byte-X
3914
                moveq  #$00000000,d1 * BCD byte-Y
3915
                moveq  #$00000000,d2
3916
                moveq  #$00000000,d3 * Cumulative -(An) BCD results
3917
                moveq  #$00000000,d4 * Cumulative number.s of times C was set
3918
                moveq  #$00000000,d5 * Cumulative Register BCD results
3919
                move.l #$00000099,d6 * Inner loop counter
3920
                move.l #$00000099,d7 * Outer loop counter
3921
 
3922
ABCD_OUTER2:    move.l d7,d0
3923
ABCD_INNER2:    move.l d6,d1
3924
                ori.b #$10,CCR      * Set X Flag
3925
                move.l #$00000110,a0 * Address pointer-X
3926
                move.l #$00000120,a1 * Address pointer-Y
3927
                move.b d0,-1(a0)
3928
                move.b d1,-1(a1)
3929
 
3930
                abcd d0,d1
3931
                bcc.s ABCD_NO_C3          * Check C Flag  bcc/bcs 0
3932
                add.l #1,d4
3933
ABCD_NO_C3:     add.l d1,d5
3934
 
3935
                abcd -(a0),-(a1)
3936
                bcc.s ABCD_NO_C4          * Check C Flag  bcc/bcs 0
3937
                add.l #1,d4
3938
ABCD_NO_C4:     add.b (a1),d3
3939
 
3940
 
3941
                dbf d6,ABCD_INNER2
3942
                move.l #$00000099,d6
3943
                dbf d7,ABCD_OUTER2
3944
                cmpi.l #$00005B60,d4  * Check the cumulative results
3945
                bne.s *
3946
                cmpi.l #$001CCFC8,d5
3947
                bne.s *
3948
                cmpi.l #$00000034,d3
3949
                bne.s *
3950
 
3951
*             Quick check of Z Flag
3952
                move.b #$00,d0
3953
                move.b #$00,d1
3954
                move #$00,CCR              * Set Z flag to 0
3955
                abcd d1,d0                  * Should NOT set Z Flag to 1
3956
                beq.s *                       * Check Z Flag  beq/bne
3957
 
3958
                move.b #$01,d0
3959
                move.b #$00,d1
3960
                move #$04,CCR              * Set Z flag to 0
3961
                abcd d1,d0                  * Should NOT set Z Flag to 1
3962
                beq.s *                       * Check Z Flag  beq/bne
3963
 
3964
                rts
3965
 
3966
*-----------------------------------------------------------
3967
*-----------------------------------------------------------
3968
* OPCODE : SBCD
3969
*-----------------------------------------------------------
3970
*-----------------------------------------------------------
3971
op_SBCD:
3972
 
3973
*     Test with X Flag CLEARED
3974
                move.l #$00000110,a0 * Address pointer-X
3975
                move.l #$00000120,a1 * Address pointer-Y
3976
                moveq  #$00000000,d0 * BCD byte-X
3977
                moveq  #$00000000,d1 * BCD byte-Y
3978
                moveq  #$00000000,d2
3979
                moveq  #$00000000,d3 * Cumulative -(An) BCD results
3980
                moveq  #$00000000,d4 * Cumulative number.s of times C was set
3981
                moveq  #$00000000,d5 * Cumulative Register BCD results
3982
                move.l #$00000099,d6 * Inner loop counter
3983
                move.l #$00000099,d7 * Outer loop counter
3984
 
3985
SBCD_OUTER1:    move.l d7,d0
3986
SBCD_INNER1:    move.l d6,d1
3987
                andi.b #$EF,CCR     * Clear X Flag
3988
                move.l #$00000110,a0 * Address pointer-X
3989
                move.l #$00000120,a1 * Address pointer-Y
3990
                move.b d0,-1(a0)
3991
                move.b d1,-1(a1)
3992
 
3993
                sbcd d0,d1
3994
                bcc.s SBCD_NO_C1          * Check C Flag  bcc/bcs 0
3995
                add.l #1,d4
3996
SBCD_NO_C1:     add.l d1,d5
3997
 
3998
                sbcd -(a0),-(a1)
3999
                bcc.s SBCD_NO_C2          * Check C Flag  bcc/bcs 0
4000
                add.l #1,d4
4001
SBCD_NO_C2:     add.b (a1),d3
4002
 
4003
 
4004
                dbf d6,SBCD_INNER1
4005
                move.l #$00000099,d6
4006
                dbf d7,SBCD_OUTER1
4007
                cmpi.l #$00005C0A,d4  * Check the cumulative results
4008
                bne.s *
4009
                cmpi.l #$001C459E,d5
4010
                bne.s *
4011
                cmpi.l #$0000009E,d3
4012
                bne.s *
4013
 
4014
*     Test with X Flag SET
4015
                move.l #$00000110,a0 * Address pointer-X
4016
                move.l #$00000120,a1 * Address pointer-Y
4017
                moveq  #$00000000,d0 * BCD byte-X
4018
                moveq  #$00000000,d1 * BCD byte-Y
4019
                moveq  #$00000000,d2
4020
                moveq  #$00000000,d3 * Cumulative -(An) BCD results
4021
                moveq  #$00000000,d4 * Cumulative number.s of times C was set
4022
                moveq  #$00000000,d5 * Cumulative Register BCD results
4023
                move.l #$00000099,d6 * Inner loop counter
4024
                move.l #$00000099,d7 * Outer loop counter
4025
 
4026
SBCD_OUTER2:    move.l d7,d0
4027
SBCD_INNER2:    move.l d6,d1
4028
                ori.b #$10,CCR      * Set X Flag
4029
                move.l #$00000110,a0 * Address pointer-X
4030
                move.l #$00000120,a1 * Address pointer-Y
4031
                move.b d0,-1(a0)
4032
                move.b d1,-1(a1)
4033
 
4034
                sbcd d0,d1
4035
                bcc.s SBCD_NO_C3          * Check C Flag  bcc/bcs 0
4036
                add.l #1,d4
4037
SBCD_NO_C3:     add.l d1,d5
4038
 
4039
                sbcd -(a0),-(a1)
4040
                bcc.s SBCD_NO_C4          * Check C Flag  bcc/bcs 0
4041
                add.l #1,d4
4042
SBCD_NO_C4:     add.b (a1),d3
4043
 
4044
                dbf d6,SBCD_INNER2
4045
                move.l #$00000099,d6
4046
                dbf d7,SBCD_OUTER2
4047
                cmpi.l #$00005CA4,d4  * Check the cumulative results
4048
                bne.s *
4049
                cmpi.l #$001C5C66,d5
4050
                bne.s *
4051
                cmpi.l #$0000009E,d3
4052
                bne.s *
4053
 
4054
 
4055
*             Quick check of Z Flag
4056
                move.b #$00,d0
4057
                move.b #$00,d1
4058
                move #$00,CCR              * Set Z flag to 0
4059
                sbcd d1,d0                  * Should NOT set Z Flag to 1
4060
                beq.s *                       * Check Z Flag  beq/bne
4061
 
4062
                move.b #$01,d0
4063
                move.b #$00,d1
4064
                move #$04,CCR              * Set Z flag to 0
4065
                sbcd d1,d0                  * Should NOT set Z Flag to 1
4066
                beq.s *                       * Check Z Flag  beq/bne
4067
 
4068
                rts
4069
 
4070
*-----------------------------------------------------------
4071
*-----------------------------------------------------------
4072
* OPCODE : NBCD
4073
*-----------------------------------------------------------
4074
*-----------------------------------------------------------
4075
op_NBCD:
4076
 
4077
*        NBCD to a  Register
4078
 
4079
                moveq  #$00000000,d0 * BCD byte
4080
                moveq  #$00000000,d1
4081
                moveq  #$00000000,d2
4082
                moveq  #$00000000,d3 * Cumulative number.s of times Z was set
4083
                moveq  #$00000000,d4 * Cumulative number.s of times C was set
4084
                moveq  #$00000000,d5 * Cumulative BCD results
4085
                move.l #$00000099,d6
4086
                move.l #$00000099,d7 * Loop counter
4087
 
4088
NBCD_LOOP:      move.l d7,d0
4089
                move #$04,CCR        * Set Z flag to 0
4090
 
4091
                nbcd d0
4092
 
4093
                bcc.s NBCD_NO_C         * Check C Flag
4094
                add.l #1,d4
4095
NBCD_NO_C:      bne.s NBCD_NO_Z         * Check Z Flag
4096
                add.l #1,d3
4097
NBCD_NO_Z:      add.l d0,d5         * Add results into d5
4098
 
4099
                dbf d7,NBCD_LOOP
4100
 
4101
                cmpi.l #$00000001,d3  * Check the cumulative results
4102
                bne.s *
4103
                cmpi.l #$00000099,d4
4104
                bne.s *
4105
                cmpi.l #$00002E3B,d5
4106
                bne.s *
4107
 
4108
 
4109
*        NBCD to a memory location
4110
 
4111
                moveq  #$00000000,d0 * BCD byte
4112
                moveq  #$00000000,d1
4113
                moveq  #$00000000,d2
4114
                moveq  #$00000000,d3 * Cumulative number.s of times Z was set
4115
                moveq  #$00000000,d4 * Cumulative number.s of times C was set
4116
                moveq  #$00000000,d5 * Cumulative BCD results
4117
                move.l #$00000099,d6
4118
                move.l #$00000099,d7 * Loop counter
4119
 
4120
NBCD_LOOP1:     move.b d7,$00000100
4121
                move #$04,CCR        * Set Z flag to 0
4122
 
4123
                nbcd $00000100
4124
                move.b $00000100,d0
4125
 
4126
                bcc.s NBCD_NO_C1        * Check C Flag
4127
                add.l #1,d4
4128
NBCD_NO_C1:     bne.s NBCD_NO_Z1        * Check Z Flag
4129
                add.l #1,d3
4130
NBCD_NO_Z1:     add.l d0,d5         * Add results into d5
4131
 
4132
                dbf d7,NBCD_LOOP1
4133
 
4134
                cmpi.l #$00000001,d3  * Check the cumulative results
4135
                bne.s *
4136
                cmpi.l #$00000000,d4
4137
                bne.s *
4138
                cmpi.l #$00002E3B,d5
4139
                bne.s *
4140
 
4141
 
4142
                rts
4143
 
4144
 
4145
 
4146
*-----------------------------------------------------------
4147
*-----------------------------------------------------------
4148
* OPCODE : TRAPV
4149
*-----------------------------------------------------------
4150
*-----------------------------------------------------------
4151
op_TRAPV:
4152
 
4153
*     TRAPV will set d0 to 12345678 if V flag is set
4154
 
4155
                moveq  #$00000000,d0 * Clear d0
4156
 
4157
                move #$00,CCR        * Clear V flag
4158
                trapv
4159
                cmpi.l #$00000000,d0  * Check of d0 was updated (should not be_)
4160
                bne.s *
4161
 
4162
                move #$02,CCR        * Set V flag
4163
                trapv
4164
                cmpi.l #$12345678,d0  * Check of d0 was updated (should not be_)
4165
                bne.s *
4166
 
4167
 
4168
                rts
4169
 
4170
 
4171
 
4172
*-----------------------------------------------------------
4173
*-----------------------------------------------------------
4174
* OPCODE : RTR
4175
*-----------------------------------------------------------
4176
*-----------------------------------------------------------
4177
 
4178
op_RTR:
4179
 
4180
*     Leventhal claims only 5 LSB's are popped from the stack to the CCR
4181
 
4182
                lea             RTR_DONE,a0
4183
                move.l  a0,-(a7)     * push destination PC to the stack
4184
                move.w  #$FF15,-(a7)       * push flags=0xFFFF to the stack
4185
                rtr
4186
 
4187
RTR_DONE:       move.w SR,d0
4188
                andi.w #$1F,d0
4189
                cmpi.w #$15,d0
4190
                bne.s *
4191
 
4192
                rts
4193
 
4194
 
4195
BSR_FAR2:       move.l #$44444444,d4
4196
                rts
4197
 
4198
 
4199
*-----------------------------------------------------------
4200
*-----------------------------------------------------------
4201
* OPCODE : BCC
4202
*-----------------------------------------------------------
4203
*-----------------------------------------------------------
4204
 
4205
op_BCC:         move #$00,CCR
4206
                bhi.s BCC1            * Higher Than         C=0 AND Z=0
4207
                bra.s *
4208
 
4209
BCC1:           move #$01,CCR
4210
                bls.w BCC2            * Lower or Same       C=1 OR Z=1
4211
                bra.s *
4212
 
4213
BCC2:           move #$00,CCR
4214
                bcc.s BCC3            * Carry Clear         C=0
4215
                bra.s *
4216
 
4217
BCC3:           move #$01,CCR
4218
                bcs.w BCC4            * Carry Set           C=1
4219
                bra.s *
4220
 
4221
BCC4:           move #$00,CCR
4222
                bne.s BCC5            * Not Equal           Z=0
4223
                bra.s *
4224
 
4225
BCC5:           move #$04,CCR
4226
                beq.w BCC6            * Equal               Z=1
4227
                bra.s *
4228
 
4229
BCC6:           move #$00,CCR
4230
                bvc.s BCC7            * V Clear             V=0
4231
                bra.s *
4232
 
4233
BCC7:           move #$02,CCR
4234
                bvs.w BCC8            * V Set               V=1
4235
                bra.s *
4236
 
4237
BCC8:           move #$00,CCR
4238
                bpl.s BCC9            * Plus                N=0
4239
                bra.s *
4240
 
4241
BCC9:           move #$08,CCR
4242
                bmi.w BCC10           * Minus               N=1
4243
                bra.s *
4244
 
4245
BCC10:          move #$00,CCR
4246
                bge.s BCC11           * Greater or Equal    N=V
4247
                bra.s *
4248
 
4249
BCC11:          move #$02,CCR
4250
                blt.w BCC12           * Less Than           N!=V
4251
                bra.s *
4252
 
4253
BCC12:          move #$0A,CCR
4254
                bgt.s BCC13           * Greater Than        N=V  AND Z=0
4255
                bra.s *
4256
 
4257
BCC13:          move #$06,CCR
4258
                ble.w BCC14           * Less Than or Equal  N!=V AND Z=1
4259
                bra.s *
4260
 
4261
 
4262
BCC14:          rts
4263
 
4264
 
4265
*-----------------------------------------------------------
4266
*-----------------------------------------------------------
4267
* OPCODE : DBCC
4268
*-----------------------------------------------------------
4269
*-----------------------------------------------------------
4270
 
4271
op_DBCC:        moveq  #$00000003,d0    * Loop counter
4272
                moveq  #$00000000,d1    * Accumulator
4273
                move #$00,CCR
4274
 
4275
DBCC_LOOP1:     addi.b #$1,d1
4276
                dbf d0,DBCC_LOOP1
4277
 
4278
                cmpi.l #$00000004,d1  * Check Accumulator results
4279
                bne.s *
4280
 
4281
DBCC_LOOP2:     addi.b #$1,d1
4282
                dbcc d0,DBCC_LOOP2    * Dont loop
4283
 
4284
                cmpi.l #$00000005,d1  * Check Accumulator results
4285
                bne.s *
4286
 
4287
                rts
4288
 
4289
 
4290
*-----------------------------------------------------------
4291
*-----------------------------------------------------------
4292
* OPCODE : SCC
4293
*-----------------------------------------------------------
4294
*-----------------------------------------------------------
4295
 
4296
op_SCC:         move #$01,CCR
4297
                scc $00010000                   * Clear the EA byte
4298
                cmpi.b #$00,$00010000
4299
                bne.s *
4300
 
4301
                move #$00,CCR
4302
                scc $00010000                   * Set the EA byte to 0xFF
4303
                cmpi.b #$FF,$00010000
4304
                bne.s *
4305
 
4306
                rts
4307
 
4308
 
4309
 
4310
*-----------------------------------------------------------
4311
*-----------------------------------------------------------
4312
* OPCODE : ADDQ
4313
*-----------------------------------------------------------
4314
*-----------------------------------------------------------
4315
 
4316
op_ADDQ:
4317
 
4318
*     BYTE
4319
                move.l #$000000FF,d0    * Loop counter
4320
                moveq  #$00000000,d1    * Flag results accumulator
4321
                moveq  #$00000000,d2    * Data results accumulator
4322
                moveq  #$00000000,d3
4323
                moveq  #$00000000,d4
4324
                moveq  #$00000000,d5
4325
                moveq  #$00000000,d6
4326
                moveq  #$00000000,d7
4327
 
4328
ADDQ_LOOP1:     addq.b #3,d5
4329
                move.w SR,d6
4330
                andi.l #$1F,d6        * Isolate flags
4331
                add.l d6,d1           * Copy flag results into accumulator
4332
                add.l d5,d2           * Copy data results into data accumulator
4333
                dbf d0,ADDQ_LOOP1
4334
 
4335
                cmpi.l #$0000043D,d1
4336
                bne.s *
4337
                cmpi.l #$00007F80,d2
4338
                bne.s *
4339
 
4340
 
4341
*     WORD
4342
                move.l #$000000FF,d0    * Loop counter
4343
                moveq  #$00000000,d1    * Flag results accumulator
4344
                moveq  #$00000000,d2    * Data results accumulator
4345
                moveq  #$00000000,d3
4346
                moveq  #$00000000,d4
4347
                move.l #$0000FFF0,d5
4348
                moveq  #$00000000,d6
4349
                moveq  #$00000000,d7
4350
                move.l #$00000100,a0
4351
 
4352
ADDQ_LOOP2:     addq.w #5,d5
4353
                move.w SR,d6
4354
                andi.l #$1F,d6        * Isolate flags
4355
                add.l d6,d1           * Copy flag results into accumulator
4356
                add.l d5,d2           * Copy data results into data accumulator
4357
                dbf d0,ADDQ_LOOP2
4358
 
4359
                cmpi.l #$00000029,d1
4360
                bne.s *
4361
                cmpi.l #$00057280,d2
4362
                bne.s *
4363
 
4364
 
4365
*     LONG
4366
                move.l #$000000FF,d0    * Loop counter
4367
                moveq  #$00000000,d1    * Flag results accumulator
4368
                moveq  #$00000000,d2    * Data results accumulator
4369
                moveq  #$00000000,d3
4370
                moveq  #$00000000,d4
4371
                move.l #$FFFFFFF0,d5
4372
                moveq  #$00000000,d6
4373
                moveq  #$00000000,d7
4374
 
4375
ADDQ_LOOP3:     addq.l #1,d5
4376
                move.w SR,d6
4377
                andi.l #$1F,d6        * Isolate flags
4378
                add.l d6,d1           * Copy flag results into accumulator
4379
                add.l d5,d2           * Copy data results into data accumulator
4380
                dbf d0,ADDQ_LOOP3
4381
 
4382
                cmpi.l #$0000008D,d1
4383
                bne.s *
4384
                cmpi.l #$00007080,d2
4385
                bne.s *
4386
 
4387
*     Check that Flags are not updated for Address registers
4388
                move.l #$0000FFFF,a0
4389
                move #$00,CCR         * Clear flags
4390
                addq.w #$7,a0
4391
                bcs.s *
4392
 
4393
                rts
4394
 
4395
 
4396
 
4397
*-----------------------------------------------------------
4398
*-----------------------------------------------------------
4399
* OPCODE : SUBQ
4400
*-----------------------------------------------------------
4401
*-----------------------------------------------------------
4402
 
4403
op_SUBQ:
4404
 
4405
*     BYTE
4406
                move.l #$000000FF,d0    * Loop counter
4407
                moveq  #$00000000,d1    * Flag results accumulator
4408
                move.l #$00001234,d2    * Data results accumulator
4409
                moveq  #$00000000,d3
4410
                moveq  #$00000000,d4
4411
                moveq  #$00000012,d5
4412
                moveq  #$00000000,d6
4413
                moveq  #$00000000,d7
4414
 
4415
SUBQ_LOOP1:     subq.b #1,d5
4416
                move.w SR,d6
4417
                andi.l #$1F,d6        * Isolate flags
4418
                add.l d6,d1           * Copy flag results into accumulator
4419
                add.l d5,d2           * Copy data results into data accumulator
4420
                dbf d0,SUBQ_LOOP1
4421
 
4422
                cmpi.l #$00000417,d1
4423
                bne.s *
4424
                cmpi.l #$000091B4,d2
4425
                bne.s *
4426
 
4427
 
4428
*     WORD
4429
                move.l #$000000FF,d0    * Loop counter
4430
                moveq  #$00000000,d1    * Flag results accumulator
4431
                moveq  #$00000000,d2    * Data results accumulator
4432
                moveq  #$00000000,d3
4433
                moveq  #$00000000,d4
4434
                moveq  #$00000002,d5
4435
                moveq  #$00000000,d6
4436
                moveq  #$00000000,d7
4437
                move.l #$00000100,a0
4438
 
4439
SUBQ_LOOP2:     subq.w #5,d5
4440
                move.w SR,d6
4441
                andi.l #$1F,d6        * Isolate flags
4442
                add.l d6,d1           * Copy flag results into accumulator
4443
                add.l d5,d2           * Copy data results into data accumulator
4444
                dbf d0,SUBQ_LOOP2
4445
 
4446
                cmpi.l #$00000811,d1
4447
                bne.s *
4448
                cmpi.l #$00FD7F80,d2
4449
                bne.s *
4450
 
4451
 
4452
*     LONG
4453
                move.l #$000000FF,d0    * Loop counter
4454
                moveq  #$00000000,d1    * Flag results accumulator
4455
                moveq  #$00000000,d2    * Data results accumulator
4456
                moveq  #$00000000,d3
4457
                moveq  #$00000000,d4
4458
                moveq  #$00000007,d5
4459
                moveq  #$00000000,d6
4460
                moveq  #$00000000,d7
4461
 
4462
SUBQ_LOOP3:     subq.l #1,d5
4463
                move.w SR,d6
4464
                andi.l #$1F,d6        * Isolate flags
4465
                add.l d6,d1           * Copy flag results into accumulator
4466
                add.l d5,d2           * Copy data results into data accumulator
4467
                dbf d0,SUBQ_LOOP3
4468
 
4469
                cmpi.l #$000007DD,d1
4470
                bne.s *
4471
                cmpi.l #$FFFF8680,d2
4472
                bne.s *
4473
 
4474
*     Check that Flags are not updated for Address registers
4475
                move.l #$0001FFFF,a0
4476
                move #$00,CCR         * Clear flags
4477
                subq.w #$7,a0
4478
                bcs.s *
4479
 
4480
                rts
4481
 
4482
 
4483
 
4484
 
4485
*-----------------------------------------------------------
4486
*-----------------------------------------------------------
4487
* OPCODE : MOVEQ
4488
*-----------------------------------------------------------
4489
*-----------------------------------------------------------
4490
 
4491
op_MOVEQ:
4492
                moveq  #$00000000,d0
4493
                moveq #$0,d0
4494
                bne.s *
4495
                cmpi.l #$00000000,d0
4496
                bne.s *
4497
 
4498
                moveq  #$00000000,d0
4499
                moveq #-128,d0
4500
                beq.s *
4501
                bpl.s *
4502
                cmpi.l #$FFFFFF80,d0
4503
                bne.s *
4504
 
4505
 
4506
                rts
4507
 
4508
 
4509
*-----------------------------------------------------------
4510
*-----------------------------------------------------------
4511
* OPCODE : DIVU
4512
*-----------------------------------------------------------
4513
*-----------------------------------------------------------
4514
 
4515
op_DIVU:
4516
 
4517
                move.l #$a5a5a5a5,d0        * Initial Numerator
4518
                move.l #$00005a5a,d1        * Initial Divisor
4519
                move.l #$a5a5a5a5,d2
4520
                moveq  #$00000000,d3
4521
                moveq  #$00000000,d4        * Cumulative data results
4522
                moveq  #$00000000,d5       * Cumulative flag results
4523
                move.l #$0000000E,d6       * Inner loop counter
4524
                move.l #$0000001E,d7       * Outer loop counter
4525
 
4526
 
4527
DIVU_OUTER1:    divu d1,d0               * !! Easy68K C not always cleared
4528
                move.w SR,d3
4529
                andi.l #$0C,d3            * Isolate flags
4530
                add.l d3,d5               * Copy flag results into accumulator
4531
                add.l d0,d4               * Copy data results into data accumulator
4532
                lsr.l #$1,d1
4533
 
4534
                dbf d6,DIVU_OUTER1
4535
                lsr.l #$1,d2
4536
                move.l d2,d0
4537
                move.l #$00005a5a,d1       * Initial Divisor
4538
                move.l #$0000000E,d6       * Inner loop counter
4539
                dbf d7,DIVU_OUTER1
4540
 
4541
                cmpi.l #$92FEDB89,d4      * Check the data results
4542
                bne.s *
4543
 
4544
                cmpi.l #$00000110,d5      * Check the Flag results
4545
                bne.s *
4546
 
4547
 
4548
                rts
4549
 
4550
 
4551
 
4552
*-----------------------------------------------------------
4553
*-----------------------------------------------------------
4554
* OPCODE : DIVS
4555
*-----------------------------------------------------------
4556
*-----------------------------------------------------------
4557
 
4558
op_DIVS:
4559
 
4560
                move.l #$a5a5a5a5,d0        * Initial Numerator
4561
                move.l #$00005a5a,d1        * Initial Divisor
4562
                move.l #$a5a5a5a5,d2
4563
                moveq  #$00000000,d3
4564
                moveq  #$00000000,d4        * Cumulative data results
4565
                moveq  #$00000000,d5       * Cumulative flag results
4566
                move.l #$0000000E,d6       * Inner loop counter
4567
                move.l #$0000001E,d7       * Outer loop counter
4568
 
4569
 
4570
DIVS_OUTER1:    divs d1,d0               * !! Easy68K C not always cleared
4571
                move.w SR,d3
4572
                andi.l #$0C,d3            * Isolate flags
4573
                add.l d3,d5               * Copy flag results into accumulator
4574
                add.l d0,d4               * Copy data results into data accumulator
4575
                lsr.l #$1,d1
4576
 
4577
                dbf d6,DIVS_OUTER1
4578
                lsr.l #$1,d2
4579
                move.l d2,d0
4580
                move.l #$00005a5a,d1       * Initial Divisor
4581
                move.l #$0000000E,d6       * Inner loop counter
4582
                dbf d7,DIVS_OUTER1
4583
 
4584
                cmpi.l #$4EC5D057,d4      * Check the data results
4585
                bne.s *
4586
 
4587
                cmpi.l #$00000038,d5      * Check the Flag results
4588
                bne.s *
4589
 
4590
 
4591
                rts
4592
 
4593
 
4594
 
4595
*-----------------------------------------------------------
4596
*-----------------------------------------------------------
4597
* OPCODE : OR
4598
*-----------------------------------------------------------
4599
*-----------------------------------------------------------
4600
 
4601
op_OR:
4602
 
4603
*  *  to Register
4604
 
4605
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
4606
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4607
                move.l #$a5a5a5a5,d2
4608
                moveq  #$00000000,d3
4609
                moveq  #$00000000,d4       * Cumulative data results
4610
                moveq  #$00000000,d5       * Cumulative flag results
4611
                move.l #$0000001E,d6       * Inner loop counter
4612
                move.l #$0000001E,d7       * Outer loop counter
4613
                move.l #$00000100,a0       * Address for memory EA operations
4614
 
4615
 
4616
OR_OUTER1:
4617
 
4618
*     BYTE
4619
                move.l d1,(a0)
4620
                or.b (a0),d0
4621
                move.w SR,d3
4622
                andi.l #$0C,d3            * Isolate flags
4623
                add.l d3,d5               * Copy flag results into accumulator
4624
                add.l d0,d4               * Copy data results into data accumulator
4625
 
4626
*     WORD
4627
                move.l d1,(a0)
4628
                or.w (a0),d0
4629
                move.w SR,d3
4630
                andi.l #$0C,d3            * Isolate flags
4631
                add.l d3,d5               * Copy flag results into accumulator
4632
                add.l d0,d4               * Copy data results into data accumulator
4633
 
4634
*     LONG
4635
                move.l d1,(a0)
4636
                or.l (a0),d0
4637
                move.w SR,d3
4638
                andi.l #$0F,d3            * Isolate flags
4639
                add.l d3,d5               * Copy flag results into accumulator
4640
                add.l d0,d4               * Copy data results into data accumulator
4641
 
4642
 
4643
                lsr.l #$1,d1
4644
                dbf d6,OR_OUTER1
4645
                lsr.l #$1,d2
4646
                move.l #$8167E123,d1       * Initial Data-Y
4647
                move.l #$0000001E,d6       * Inner loop counter
4648
                dbf d7,OR_OUTER1
4649
 
4650
                cmpi.l #$76EAC803,d4      * Check the data results
4651
                bne.s *
4652
                cmpi.l #$00005A18,d5      * Check the Flag results
4653
                bne.s *
4654
 
4655
 
4656
*  * Register to 
4657
 
4658
                move.l #$86738374,d0       * Initial Data-X  Inner loop
4659
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
4660
                move.l #$86738374,d2
4661
                moveq  #$00000000,d3
4662
                moveq  #$00000000,d4       * Cumulative data results
4663
                moveq  #$00000000,d5       * Cumulative flag results
4664
                move.l #$0000001E,d6       * Inner loop counter
4665
                move.l #$0000001D,d7       * Outer loop counter
4666
                move.l #$00000100,a0       * Address for memory EA operations
4667
 
4668
 
4669
OR_OUTER2:
4670
 
4671
*     BYTE
4672
                move.l d0,(a0)
4673
                or.b d1,(a0)
4674
                move.w SR,d3
4675
                andi.l #$0C,d3            * Isolate flags
4676
                add.l d3,d5               * Copy flag results into accumulator
4677
                add.l (a0),d4             * Copy data results into data accumulator
4678
 
4679
*     WORD
4680
                move.l d0,(a0)
4681
                or.w d1,(a0)
4682
                move.w SR,d3
4683
                andi.l #$0C,d3            * Isolate flags
4684
                add.l d3,d5               * Copy flag results into accumulator
4685
                add.l (a0),d4             * Copy data results into data accumulator
4686
 
4687
*     LONG
4688
                move.l d0,(a0)
4689
                or.l d1,(a0)
4690
                move.w SR,d3
4691
                andi.l #$0F,d3            * Isolate flags
4692
                add.l d3,d5               * Copy flag results into accumulator
4693
                add.l (a0),d4             * Copy data results into data accumulator
4694
 
4695
 
4696
                lsr.l #$1,d1
4697
                dbf d6,OR_OUTER2
4698
                lsr.l #$1,d2
4699
                move.l #$8167E123,d1       * Initial Data-Y
4700
                move.l #$0000001E,d6       * Inner loop counter
4701
                dbf d7,OR_OUTER2
4702
 
4703
                cmpi.l #$FA82B9E4,d4      * Check the data results
4704
                bne.s *
4705
                cmpi.l #$00005730,d5      * Check the Flag results
4706
                bne.s *
4707
 
4708
 
4709
                rts
4710
 
4711
 
4712
 
4713
*-----------------------------------------------------------
4714
*-----------------------------------------------------------
4715
* OPCODE : AND
4716
*-----------------------------------------------------------
4717
*-----------------------------------------------------------
4718
 
4719
op_AND:
4720
 
4721
*  *  to Register
4722
 
4723
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
4724
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4725
                move.l #$a5a5a5a5,d2
4726
                moveq  #$00000000,d3
4727
                moveq  #$00000000,d4       * Cumulative data results
4728
                moveq  #$00000000,d5       * Cumulative flag results
4729
                move.l #$0000001E,d6       * Inner loop counter
4730
                move.l #$0000001E,d7       * Outer loop counter
4731
                move.l #$00000100,a0       * Address for memory EA operations
4732
 
4733
 
4734
AND_OUTER1:
4735
 
4736
*     BYTE
4737
                move.l d1,(a0)
4738
                and.b (a0),d0
4739
                move.w sr,d3
4740
                andi.l #$0C,d3            * Isolate flags
4741
                add.l d3,d5               * Copy flag results into accumulator
4742
                add.l d0,d4               * Copy data results into data accumulator
4743
 
4744
*     WORD
4745
                move.l d1,(a0)
4746
                and.w (a0),d0
4747
                move.w sr,d3
4748
                andi.l #$0C,d3            * Isolate flags
4749
                add.l d3,d5               * Copy flag results into accumulator
4750
                add.l d0,d4               * Copy data results into data accumulator
4751
 
4752
*     LONG
4753
                move.l d1,(a0)
4754
                and.l (a0),d0
4755
                move.w sr,d3
4756
                andi.l #$0F,d3            * Isolate flags
4757
                add.l d3,d5               * Copy flag results into accumulator
4758
                add.l d0,d4               * Copy data results into data accumulator
4759
 
4760
 
4761
                lsr.l #$1,d1
4762
                dbf d6,AND_OUTER1
4763
                lsr.l #$1,d2
4764
                move.l #$8167E123,d1       * Initial Data-Y
4765
                move.l #$0000001E,d6       * Inner loop counter
4766
                dbf d7,AND_OUTER1
4767
 
4768
                cmpi.l #$CF212883,d4      * Check the data results
4769
                bne.s *
4770
                cmpi.l #$00002D10,d5      * Check the Flag results
4771
                bne.s *
4772
 
4773
 
4774
*  * Register to 
4775
 
4776
                move.l #$86738374,d0       * Initial Data-X  Inner loop
4777
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
4778
                move.l #$86738374,d2
4779
                moveq  #$00000000,d3
4780
                moveq  #$00000000,d4       * Cumulative data results
4781
                moveq  #$00000000,d5       * Cumulative flag results
4782
                move.l #$0000001E,d6       * Inner loop counter
4783
                move.l #$0000001D,d7       * Outer loop counter
4784
                move.l #$00000100,a0       * Address for memory EA operations
4785
 
4786
 
4787
AND_OUTER2:
4788
 
4789
*     BYTE
4790
                move.l d0,(a0)
4791
                and.b d1,(a0)
4792
                move.w sr,d3
4793
                andi.l #$0C,d3            * Isolate flags
4794
                add.l d3,d5               * Copy flag results into accumulator
4795
                add.l (a0),d4             * Copy data results into data accumulator
4796
 
4797
*     WORD
4798
                move.l d0,(a0)
4799
                and.w d1,(a0)
4800
                move.w sr,d3
4801
                andi.l #$0C,d3            * Isolate flags
4802
                add.l d3,d5               * Copy flag results into accumulator
4803
                add.l (a0),d4             * Copy data results into data accumulator
4804
 
4805
*     LONG
4806
                move.l d0,(a0)
4807
                and.l d1,(a0)
4808
                move.w sr,d3
4809
                andi.l #$0F,d3            * Isolate flags
4810
                add.l d3,d5               * Copy flag results into accumulator
4811
                add.l (a0),d4             * Copy data results into data accumulator
4812
 
4813
 
4814
                lsr.l #$1,d1
4815
                dbf d6,AND_OUTER2
4816
                lsr.l #$1,d2
4817
                move.l #$8167E123,d1       * Initial Data-Y
4818
                move.l #$0000001E,d6       * Inner loop counter
4819
                dbf d7,AND_OUTER2
4820
 
4821
                cmpi.l #$4A3DE544,d4      * Check the data results
4822
                bne.s *
4823
                cmpi.l #$000018E8,d5      * Check the Flag results
4824
                bne.s *
4825
 
4826
 
4827
                rts
4828
 
4829
 
4830
 
4831
*-----------------------------------------------------------
4832
*-----------------------------------------------------------
4833
* OPCODE : EOR
4834
*-----------------------------------------------------------
4835
*-----------------------------------------------------------
4836
 
4837
op_EOR:
4838
 
4839
*  * Register to 
4840
 
4841
                move.l #$86738374,d0       * Initial Data-X  Inner loop
4842
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
4843
                move.l #$86738374,d2
4844
                moveq  #$00000000,d3
4845
                moveq  #$00000000,d4       * Cumulative data results
4846
                moveq  #$00000000,d5       * Cumulative flag results
4847
                move.l #$0000001E,d6       * Inner loop counter
4848
                move.l #$0000001D,d7       * Outer loop counter
4849
                move.l #$00000100,a0       * Address for memory EA operations
4850
 
4851
 
4852
EOR_OUTER2:
4853
 
4854
*     BYTE
4855
                move.l d0,(a0)
4856
                eor.b d1,(a0)
4857
                move.w sr,d3
4858
                andi.l #$0C,d3            * Isolate flags
4859
                add.l d3,d5               * Copy flag results into accumulator
4860
                add.l (a0),d4             * Copy data results into data accumulator
4861
 
4862
*     WORD
4863
                move.l d0,(a0)
4864
                eor.w d1,(a0)
4865
                move.w sr,d3
4866
                andi.l #$0C,d3            * Isolate flags
4867
                add.l d3,d5               * Copy flag results into accumulator
4868
                add.l (a0),d4             * Copy data results into data accumulator
4869
 
4870
*     LONG
4871
                move.l d0,(a0)
4872
                eor.l d1,(a0)
4873
                move.w sr,d3
4874
                andi.l #$0F,d3            * Isolate flags
4875
                add.l d3,d5               * Copy flag results into accumulator
4876
                add.l (a0),d4             * Copy data results into data accumulator
4877
 
4878
 
4879
                lsr.l #$1,d1
4880
                dbf d6,EOR_OUTER2
4881
                lsr.l #$1,d2
4882
                move.l #$8167E123,d1       * Initial Data-Y
4883
                move.l #$0000001E,d6       * Inner loop counter
4884
                dbf d7,EOR_OUTER2
4885
 
4886
                cmpi.l #$55C5EB70,d4      * Check the data results
4887
                bne.s *
4888
                cmpi.l #$00004430,d5      * Check the Flag results
4889
                bne.s *
4890
 
4891
 
4892
                rts
4893
 
4894
 
4895
*-----------------------------------------------------------
4896
*-----------------------------------------------------------
4897
* OPCODE : CMP
4898
*-----------------------------------------------------------
4899
*-----------------------------------------------------------
4900
 
4901
op_CMP:
4902
 
4903
 
4904
*  *  to Register
4905
 
4906
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
4907
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4908
                move.l #$a5a5a5a5,d2
4909
                moveq  #$00000000,d3
4910
                moveq  #$00000000,d4       * Cumulative data results
4911
                moveq  #$00000000,d5       * Cumulative flag results
4912
                move.l #$0000001E,d6       * Inner loop counter
4913
                move.l #$0000001E,d7       * Outer loop counter
4914
                move.l #$00000100,a0       * Address for memory EA operations
4915
 
4916
 
4917
CMP_OUTER1:
4918
 
4919
*     BYTE
4920
                move.l d1,(a0)
4921
                cmp.b (a0),d0
4922
                move.w sr,d3
4923
                andi.l #$0F,d3            * Isolate flags
4924
                add.l d3,d5               * Copy flag results into accumulator
4925
                add.l d0,d4               * Copy data results into data accumulator
4926
 
4927
*     WORD
4928
                move.l d1,(a0)
4929
                cmp.w (a0),d0
4930
                move.w sr,d3
4931
                andi.l #$0F,d3            * Isolate flags
4932
                add.l d3,d5               * Copy flag results into accumulator
4933
                add.l d0,d4               * Copy data results into data accumulator
4934
 
4935
*     LONG
4936
                move.l d1,(a0)
4937
                cmp.l (a0),d0
4938
                move.w sr,d3
4939
                andi.l #$0F,d3            * Isolate flags
4940
                add.l d3,d5               * Copy flag results into accumulator
4941
                add.l d0,d4               * Copy data results into data accumulator
4942
 
4943
 
4944
                lsr.l #$1,d1
4945
                dbf d6,CMP_OUTER1
4946
                lsr.l #$1,d2
4947
                move.l #$8167E123,d1       * Initial Data-Y
4948
                move.l #$0000001E,d6       * Inner loop counter
4949
                dbf d7,CMP_OUTER1
4950
 
4951
                cmpi.l #$7878712F,d4      * Check the data results
4952
                bne.s *
4953
                cmpi.l #$00005502,d5      * Check the Flag results
4954
                bne.s *
4955
 
4956
 
4957
 
4958
                rts
4959
 
4960
 
4961
*-----------------------------------------------------------
4962
*-----------------------------------------------------------
4963
* OPCODE : CMPA
4964
*-----------------------------------------------------------
4965
*-----------------------------------------------------------
4966
 
4967
op_CMPA:
4968
 
4969
 
4970
*  *  to Register
4971
 
4972
                move.l #$a5a5a5a5,a0       * Initial Data-X  Inner loop
4973
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4974
                move.l #$a5a5a5a5,d2
4975
                moveq  #$00000000,d3
4976
                moveq  #$00000000,d4       * Cumulative data results
4977
                moveq  #$00000000,d5       * Cumulative flag results
4978
                move.l #$0000001E,d6       * Inner loop counter
4979
                move.l #$0000001E,d7       * Outer loop counter
4980
                move.l #$00000100,a1       * Address for memory EA operations
4981
 
4982
 
4983
CMPA_OUTER1:
4984
 
4985
 
4986
*     WORD
4987
                move.l d1,(a1)
4988
                cmpa.w (a1),a0
4989
                move.w sr,d3
4990
                andi.l #$0F,d3            * Isolate flags
4991
                add.l d3,d5               * Copy flag results into accumulator
4992
                add.l a0,d4               * Copy data results into data accumulator
4993
 
4994
*     LONG
4995
                move.l d1,(a1)
4996
                cmpa.l (a1),a0
4997
                move.w sr,d3
4998
                andi.l #$0F,d3            * Isolate flags
4999
                add.l d3,d5               * Copy flag results into accumulator
5000
                add.l a0,d4               * Copy data results into data accumulator
5001
 
5002
 
5003
                lsr.l #$1,d1
5004
                dbf d6,CMPA_OUTER1
5005
                lsr.l #$1,d2
5006
                move.l #$8167E123,d1       * Initial Data-Y
5007
                move.l #$0000001E,d6       * Inner loop counter
5008
                dbf d7,CMPA_OUTER1
5009
 
5010
                cmpi.l #$a5a5a0ca,d4      * Check the data results
5011
                bne.s *
5012
                cmpi.l #$00003A7D,d5      * Check the Flag results
5013
                bne.s *
5014
 
5015
 
5016
                rts
5017
 
5018
 
5019
 
5020
*-----------------------------------------------------------
5021
*-----------------------------------------------------------
5022
* OPCODE : CMPM
5023
*-----------------------------------------------------------
5024
*-----------------------------------------------------------
5025
 
5026
op_CMPM:
5027
 
5028
                move.l #$00000100,a0       * Address for Data-X
5029
                move.l #$00000200,a1       * Address for Data-Y
5030
                moveq  #$00000000,d0
5031
                moveq  #$00000000,d1
5032
                moveq  #$00000000,d2
5033
 
5034
                move.l #$11FF5580,(a0)+   * Populate test data
5035
                move.l #$1111FFFF,(a0)+   * Populate test data
5036
                move.l #$33333333,(a0)+   * Populate test data
5037
                move.l #$44444444,(a0)+   * Populate test data
5038
 
5039
                move.l #$80FF337F,(a1)+   * Populate test data
5040
                move.l #$FFFF1111,(a1)+   * Populate test data
5041
                move.l #$33333333,(a1)+   * Populate test data
5042
                move.l #$44444444,(a1)+   * Populate test data
5043
 
5044
                move.l #$00000100,a0       * Address for Data-X
5045
                move.l #$00000200,a1       * Address for Data-Y
5046
                move.l #$0000000F,d6       * Loop counter
5047
 
5048
CMPM_LOOP1:     cmpm.b (a0)+,(a1)+
5049
                move.w sr,d3
5050
                andi.l #$0F,d3            * Isolate flags
5051
                add.l d3,d0               * Copy flag results into accumulator
5052
                dbf d6,CMPM_LOOP1
5053
 
5054
 
5055
                move.l #$00000100,a0       * Address for Data-X
5056
                move.l #$00000200,a1       * Address for Data-Y
5057
                moveq  #$00000007,d6       * Loop counter
5058
 
5059
CMPM_LOOP2:     cmpm.w (a0)+,(a1)+
5060
                move.w sr,d3
5061
                andi.l #$0F,d3            * Isolate flags
5062
                add.l d3,d1               * Copy flag results into accumulator
5063
                dbf d6,CMPM_LOOP2
5064
 
5065
 
5066
                move.l #$00000100,a0       * Address for Data-X
5067
                move.l #$00000200,a1       * Address for Data-Y
5068
                moveq  #$00000003,d6       * Loop counter
5069
 
5070
CMPM_LOOP3:     cmpm.l (a0)+,(a1)+
5071
                move.w sr,d3
5072
                andi.l #$0F,d3            * Isolate flags
5073
                add.l d3,d2               * Copy flag results into accumulator
5074
                dbf d6,CMPM_LOOP3
5075
 
5076
 
5077
                cmpi.l #$0000004C,d0      * Check the data results
5078
                bne.s *
5079
                cmpi.l #$00000024,d1
5080
                bne.s *
5081
                cmpi.l #$00000012,d2
5082
                bne.s *
5083
 
5084
                rts
5085
 
5086
 
5087
*-----------------------------------------------------------
5088
*-----------------------------------------------------------
5089
* OPCODE : ADD
5090
*-----------------------------------------------------------
5091
*-----------------------------------------------------------
5092
 
5093
op_ADD:
5094
 
5095
 
5096
*  *  to Register
5097
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5098
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5099
                move.l #$a5a5a5a5,d2
5100
                moveq  #$00000000,d3
5101
                moveq  #$00000000,d4       * Cumulative data results
5102
                moveq  #$00000000,d5       * Cumulative flag results
5103
                move.l #$0000001E,d6       * Inner loop counter
5104
                move.l #$0000001E,d7       * Outer loop counter
5105
                move.l #$00000100,a0       * Address for memory EA operations
5106
 
5107
 
5108
ADD_OUTER1:
5109
 
5110
*     BYTE
5111
                move.l d1,(a0)
5112
                add.b (a0),d0
5113
                move.w sr,d3
5114
                andi.l #$1F,d3            * Isolate flags
5115
                add.l d3,d5               * Copy flag results into accumulator
5116
                add.l d0,d4               * Copy data results into data accumulator
5117
 
5118
*     WORD
5119
                move.l d1,(a0)
5120
                add.w (a0),d0
5121
                move.w sr,d3
5122
                andi.l #$0C,d3            * Isolate flags
5123
                add.l d3,d5               * Copy flag results into accumulator
5124
                add.l d0,d4               * Copy data results into data accumulator
5125
 
5126
*     LONG
5127
                move.l d1,(a0)
5128
                add.l (a0),d0
5129
                move.w sr,d3
5130
                andi.l #$0F,d3            * Isolate flags
5131
                add.l d3,d5               * Copy flag results into accumulator
5132
                add.l d0,d4               * Copy data results into data accumulator
5133
 
5134
 
5135
                ror.l #$1,d1
5136
                dbf d6,ADD_OUTER1
5137
                ror.l #$1,d2
5138
                move.l #$8167E123,d1       * Initial Data-Y
5139
                move.l #$0000001E,d6       * Inner loop counter
5140
                dbf d7,ADD_OUTER1
5141
 
5142
                cmpi.l #$23ED428F,d4      * Check the data results
5143
                bne.s *
5144
                cmpi.l #$00004C96,d5      * Check the Flag results
5145
                bne.s *
5146
 
5147
 
5148
*  * Register to 
5149
                move.l #$86738374,d0       * Initial Data-X  Inner loop
5150
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
5151
                move.l #$86738374,d2
5152
                moveq  #$00000000,d3
5153
                moveq  #$00000000,d4       * Cumulative data results
5154
                moveq  #$00000000,d5       * Cumulative flag results
5155
                move.l #$0000001E,d6       * Inner loop counter
5156
                move.l #$0000001D,d7       * Outer loop counter
5157
                move.l #$00000100,a0       * Address for memory EA operations
5158
 
5159
 
5160
ADD_OUTER2:
5161
 
5162
*     BYTE
5163
                move.l d0,(a0)
5164
                add.b d1,(a0)
5165
                move.w sr,d3
5166
                andi.l #$0C,d3            * Isolate flags
5167
                add.l d3,d5               * Copy flag results into accumulator
5168
                add.l (a0),d4             * Copy data results into data accumulator
5169
 
5170
*     WORD
5171
                move.l d0,(a0)
5172
                add.w d1,(a0)
5173
                move.w sr,d3
5174
                andi.l #$1F,d3            * Isolate flags
5175
                add.l d3,d5               * Copy flag results into accumulator
5176
                add.l (a0),d4             * Copy data results into data accumulator
5177
 
5178
*     LONG
5179
                move.l d0,(a0)
5180
                add.l d1,(a0)
5181
                move.w sr,d3
5182
                andi.l #$0F,d3            * Isolate flags
5183
                add.l d3,d5               * Copy flag results into accumulator
5184
                add.l (a0),d4             * Copy data results into data accumulator
5185
 
5186
 
5187
                ror.l #$1,d1
5188
                dbf d6,ADD_OUTER2
5189
                ror.l #$1,d2
5190
                move.l #$8167E123,d1       * Initial Data-Y
5191
                move.l #$0000001E,d6       * Inner loop counter
5192
                dbf d7,ADD_OUTER2
5193
 
5194
                cmpi.l #$6701B884,d4      * Check the data results
5195
                bne.s *
5196
                cmpi.l #$00005467,d5      * Check the Flag results
5197
                bne.s *
5198
 
5199
                rts
5200
 
5201
*-----------------------------------------------------------
5202
*-----------------------------------------------------------
5203
* OPCODE : SUB
5204
*-----------------------------------------------------------
5205
*-----------------------------------------------------------
5206
 
5207
op_SUB:
5208
 
5209
*  *  to Register
5210
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5211
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5212
                move.l #$a5a5a5a5,d2
5213
                moveq  #$00000000,d3
5214
                moveq  #$00000000,d4       * Cumulative data results
5215
                moveq  #$00000000,d5       * Cumulative flag results
5216
                move.l #$0000001E,d6       * Inner loop counter
5217
                move.l #$0000001E,d7       * Outer loop counter
5218
                move.l #$00000100,a0       * Address for memory EA operations
5219
 
5220
 
5221
SUB_OUTER1:
5222
 
5223
*     BYTE
5224
                move.l d1,(a0)
5225
                sub.b (a0),d0
5226
                move.w sr,d3
5227
                andi.l #$1F,d3            * Isolate flags
5228
                add.l d3,d5               * Copy flag results into accumulator
5229
                add.l d0,d4               * Copy data results into data accumulator
5230
 
5231
*     WORD
5232
                move.l d1,(a0)
5233
                sub.w (a0),d0
5234
                move.w sr,d3
5235
                andi.l #$0C,d3            * Isolate flags
5236
                add.l d3,d5               * Copy flag results into accumulator
5237
                add.l d0,d4               * Copy data results into data accumulator
5238
 
5239
*     LONG
5240
                move.l d1,(a0)
5241
                sub.l (a0),d0
5242
                move.w sr,d3
5243
                andi.l #$0F,d3            * Isolate flags
5244
                add.l d3,d5               * Copy flag results into accumulator
5245
                add.l d0,d4               * Copy data results into data accumulator
5246
 
5247
 
5248
                ror.l #$1,d1
5249
                dbf d6,SUB_OUTER1
5250
                ror.l #$1,d2
5251
                move.l #$8167E123,d1       * Initial Data-Y
5252
                move.l #$0000001E,d6       * Inner loop counter
5253
                dbf d7,SUB_OUTER1
5254
 
5255
                cmpi.l #$1A8D14CF,d4      * Check the data results
5256
                bne.s *
5257
                cmpi.l #$00004FC4,d5      * Check the Flag results
5258
                bne.s *
5259
 
5260
 
5261
*  * Register to 
5262
                move.l #$86738374,d0       * Initial Data-X  Inner loop
5263
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
5264
                move.l #$86738374,d2
5265
                moveq  #$00000000,d3
5266
                moveq  #$00000000,d4       * Cumulative data results
5267
                moveq  #$00000000,d5       * Cumulative flag results
5268
                move.l #$0000001E,d6       * Inner loop counter
5269
                move.l #$0000001D,d7       * Outer loop counter
5270
                move.l #$00000100,a0       * Address for memory EA operations
5271
 
5272
 
5273
SUB_OUTER2:
5274
 
5275
*     BYTE
5276
                move.l d0,(a0)
5277
                sub.b d1,(a0)
5278
                move.w sr,d3
5279
                andi.l #$0C,d3            * Isolate flags
5280
                add.l d3,d5               * Copy flag results into accumulator
5281
                add.l (a0),d4             * Copy data results into data accumulator
5282
 
5283
*     WORD
5284
                move.l d0,(a0)
5285
                sub.w d1,(a0)
5286
                move.w sr,d3
5287
                andi.l #$1F,d3            * Isolate flags
5288
                add.l d3,d5               * Copy flag results into accumulator
5289
                add.l (a0),d4             * Copy data results into data accumulator
5290
 
5291
*     LONG
5292
                move.l d0,(a0)
5293
                sub.l d1,(a0)
5294
                move.w sr,d3
5295
                andi.l #$0F,d3            * Isolate flags
5296
                add.l d3,d5               * Copy flag results into accumulator
5297
                add.l (a0),d4             * Copy data results into data accumulator
5298
 
5299
 
5300
                ror.l #$1,d1
5301
                dbf d6,SUB_OUTER2
5302
                ror.l #$1,d2
5303
                move.l #$8167E123,d1       * Initial Data-Y
5304
                move.l #$0000001E,d6       * Inner loop counter
5305
                dbf d7,SUB_OUTER2
5306
 
5307
                cmpi.l #$36D38BEC,d4      * Check the data results
5308
                bne.s *
5309
                cmpi.l #$000045A5,d5      * Check the Flag results
5310
                bne.s *
5311
 
5312
 
5313
 
5314
 
5315
                rts
5316
 
5317
 
5318
 
5319
*-----------------------------------------------------------
5320
*-----------------------------------------------------------
5321
* OPCODE : ADDA
5322
*-----------------------------------------------------------
5323
*-----------------------------------------------------------
5324
 
5325
op_ADDA:
5326
 
5327
*  *  to Register
5328
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5329
                move.l #$8167E123,d1
5330
                move.l #$a5a5a5a5,d2
5331
                moveq  #$00000000,d3
5332
                moveq  #$00000000,d4       * Cumulative data results
5333
                moveq  #$00000000,d5       * Cumulative flag results
5334
                move.l #$0000001E,d6       * Inner loop counter
5335
                move.l #$0000001E,d7       * Outer loop counter
5336
                move.l #$00000100,a0       * Address for memory EA operations
5337
                move.l #$8167E123,a1       * Initial Data-Y  Outer loop
5338
 
5339
ADDA_OUTER1:
5340
 
5341
*     WORD
5342
*                move.l d1,(a0)       * !!! Easy68K is not altering the whole 32-bits of the address register
5343
*                adda.w (a0),a1
5344
*                add.l a1,d4               * Copy data results into data accumulator
5345
 
5346
*     LONG
5347
                move.l d1,(a0)
5348
                adda.l (a0),a1
5349
                add.l a1,d4               * Copy data results into data accumulator
5350
 
5351
                ror.l #$1,d1
5352
                dbf d6,ADDA_OUTER1
5353
                ror.l #$1,d1
5354
                move.l d1,a1
5355
                move.l #$8167E123,d1       * Initial Data-Y
5356
                move.l #$0000001E,d6       * Inner loop counter
5357
                dbf d7,ADDA_OUTER1
5358
 
5359
                cmpi.l #$AC04DB4C,d4      * Check the data results
5360
                bne.s *
5361
 
5362
 
5363
                rts
5364
 
5365
 
5366
*-----------------------------------------------------------
5367
*-----------------------------------------------------------
5368
* OPCODE : SUBA
5369
*-----------------------------------------------------------
5370
*-----------------------------------------------------------
5371
 
5372
op_SUBA:
5373
 
5374
*  *  to Register
5375
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5376
                move.l #$8167E123,d1
5377
                move.l #$a5a5a5a5,d2
5378
                moveq  #$00000000,d3
5379
                moveq  #$00000000,d4       * Cumulative data results
5380
                moveq  #$00000000,d5       * Cumulative flag results
5381
                move.l #$0000001E,d6       * Inner loop counter
5382
                move.l #$0000001E,d7       * Outer loop counter
5383
                move.l #$00000100,a0       * Address for memory EA operations
5384
                move.l #$8167E123,a1       * Initial Data-Y  Outer loop
5385
 
5386
SUBA_OUTER1:
5387
 
5388
*     WORD
5389
*                move.l d1,(a0) * !!! Easy68K is not altering the whole 32-bits of the address register
5390
*                suba.w (a0),a1
5391
*                add.l a1,d4               * Copy data results into data accumulator
5392
 
5393
*     LONG
5394
                move.l d1,(a0)
5395
                suba.l (a0),a1
5396
                add.l a1,d4               * Copy data results into data accumulator
5397
 
5398
                ror.l #$1,d1
5399
                dbf d6,SUBA_OUTER1
5400
                ror.l #$1,d1
5401
                move.l d1,a1
5402
                move.l #$8167E123,d1       * Initial Data-Y
5403
                move.l #$0000001E,d6       * Inner loop counter
5404
                dbf d7,SUBA_OUTER1
5405
 
5406
                cmpi.l #$E1E36D7A,d4      * Check the data results
5407
                bne.s *
5408
 
5409
 
5410
                rts
5411
 
5412
 
5413
 
5414
*-----------------------------------------------------------
5415
*-----------------------------------------------------------
5416
* OPCODE : ADDX
5417
*-----------------------------------------------------------
5418
*-----------------------------------------------------------
5419
 
5420
op_ADDX:
5421
 
5422
 
5423
*  * Register to Register
5424
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5425
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5426
                move.l #$a5a5a5a5,d2
5427
                moveq  #$00000000,d3
5428
                moveq  #$00000000,d4       * Cumulative data results
5429
                moveq  #$00000000,d5       * Cumulative flag results
5430
                move.l #$0000001E,d6       * Inner loop counter
5431
                move.l #$0000001E,d7       * Outer loop counter
5432
                move.l #$00000100,a0       * Address for memory EA operations
5433
 
5434
 
5435
ADDX_OUTER1:
5436
 
5437
*     BYTE
5438
                move.l d2,d0
5439
                addx.b d1,d0
5440
                move.w sr,d3
5441
                andi.l #$1F,d3            * Isolate flags
5442
                add.l d3,d5               * Copy flag results into accumulator
5443
                add.l d0,d4               * Copy data results into data accumulator
5444
 
5445
*     WORD
5446
                move.l d2,d0
5447
                addx.w d1,d0
5448
                move.w sr,d3
5449
                andi.l #$1F,d3            * Isolate flags
5450
                add.l d3,d5               * Copy flag results into accumulator
5451
                add.l d0,d4               * Copy data results into data accumulator
5452
 
5453
*     LONG
5454
                move.l d2,d0
5455
                addx.l d1,d0
5456
                move.w sr,d3
5457
                andi.l #$1F,d3            * Isolate flags
5458
                add.l d3,d5               * Copy flag results into accumulator
5459
                add.l d0,d4               * Copy data results into data accumulator
5460
 
5461
                ror.l #$1,d1
5462
                dbf d6,ADDX_OUTER1
5463
                ror.l #$1,d2
5464
                move.l #$8167E123,d1       * Initial Data-Y
5465
                move.l #$0000001E,d6       * Inner loop counter
5466
                dbf d7,ADDX_OUTER1
5467
 
5468
                cmpi.l #$4E96A4D9,d4      * Check the data results
5469
                bne.s *
5470
                cmpi.l #$000085CD,d5      * Check the Flag results
5471
                bne.s *
5472
 
5473
 
5474
 
5475
*     -(An),-(An)
5476
 
5477
                moveq  #$00000000,d0       * BYTE Flag Results Accumulator
5478
                moveq  #$00000000,d1
5479
                moveq  #$00000000,d2
5480
                move.l #$00000100,a0       * Address for Data-X
5481
                move.l #$00000200,a1       * Address for Data-Y
5482
                move.l #$11FF5580,(a0)+   * Populate test data
5483
                move.l #$1111FFFF,(a0)+   * Populate test data
5484
                move.l #$33333333,(a0)+   * Populate test data
5485
                move.l #$44444444,(a0)+   * Populate test data
5486
                move.l #$80FF337F,(a1)+   * Populate test data
5487
                move.l #$FFFF1111,(a1)+   * Populate test data
5488
                move.l #$33333333,(a1)+   * Populate test data
5489
                move.l #$44444444,(a1)+   * Populate test data
5490
 
5491
 
5492
                move.l #$0000000F,d6       * Loop counter
5493
 
5494
ADDX_LOOP3:     addx.b -(a0),-(a1)
5495
                move.w sr,d3
5496
                andi.l #$0F,d3            * Isolate flags
5497
                add.l d3,d0               * Copy flag results into accumulator
5498
                add.b (a1),d1
5499
                dbf d6,ADDX_LOOP3
5500
 
5501
 
5502
                move.l #$00000110,a0       * Address for Data-X
5503
                move.l #$00000210,a1       * Address for Data-Y
5504
                moveq  #$00000007,d6       * Loop counter
5505
 
5506
ADDX_LOOP4:     addx.w -(a0),-(a1)
5507
                move.w sr,d3
5508
                andi.l #$0F,d3            * Isolate flags
5509
                add.l d3,d0               * Copy flag results into accumulator
5510
                add.w (a1),d1
5511
                dbf d6,ADDX_LOOP4
5512
 
5513
 
5514
                move.l #$00000110,a0       * Address for Data-X
5515
                move.l #$00000210,a1       * Address for Data-Y
5516
                moveq  #$00000003,d6       * Loop counter
5517
 
5518
ADDX_LOOP5:     addx.l -(a0),-(a1)
5519
                move.w sr,d3
5520
                andi.l #$0F,d3            * Isolate flags
5521
                add.l d3,d0               * Copy flag results into accumulator
5522
                add.l (a1),d1
5523
                dbf d6,ADDX_LOOP5
5524
 
5525
 
5526
                cmpi.l #$00000095,d0      * Check the flag results
5527
                bne.s *
5528
                cmpi.l #$C812A682,d1      * Check the data results
5529
                bne.s *
5530
 
5531
                rts
5532
 
5533
 
5534
 
5535
 
5536
*-----------------------------------------------------------
5537
*-----------------------------------------------------------
5538
* OPCODE : SUBX
5539
*-----------------------------------------------------------
5540
*-----------------------------------------------------------
5541
 
5542
op_SUBX:
5543
 
5544
 
5545
*  * Register to Register
5546
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5547
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5548
                move.l #$a5a5a5a5,d2
5549
                moveq  #$00000000,d3
5550
                moveq  #$00000000,d4       * Cumulative data results
5551
                moveq  #$00000000,d5       * Cumulative flag results
5552
                move.l #$0000001E,d6       * Inner loop counter
5553
                move.l #$0000001E,d7       * Outer loop counter
5554
                move.l #$00000100,a0       * Address for memory EA operations
5555
 
5556
 
5557
SUBX_OUTER1:
5558
 
5559
*     BYTE
5560
                move.l d2,d0
5561
                subx.b d1,d0
5562
                move.w sr,d3
5563
                andi.l #$1F,d3            * Isolate flags
5564
                add.l d3,d5               * Copy flag results into accumulator
5565
                add.l d0,d4               * Copy data results into data accumulator
5566
 
5567
*     WORD
5568
                move.l d2,d0
5569
                subx.w d1,d0
5570
                move.w sr,d3
5571
                andi.l #$1F,d3            * Isolate flags
5572
                add.l d3,d5               * Copy flag results into accumulator
5573
                add.l d0,d4               * Copy data results into data accumulator
5574
 
5575
*     LONG
5576
                move.l d2,d0
5577
                subx.l d1,d0
5578
                move.w sr,d3
5579
                andi.l #$1F,d3            * Isolate flags
5580
                add.l d3,d5               * Copy flag results into accumulator
5581
                add.l d0,d4               * Copy data results into data accumulator
5582
 
5583
                ror.l #$1,d1
5584
                dbf d6,SUBX_OUTER1
5585
                ror.l #$1,d2
5586
                move.l #$8167E123,d1       * Initial Data-Y
5587
                move.l #$0000001E,d6       * Inner loop counter
5588
                dbf d7,SUBX_OUTER1
5589
 
5590
                cmpi.l #$FCAA913E,d4      * Check the data results
5591
                bne.s *
5592
                cmpi.l #$00007E89,d5      * Check the Flag results
5593
                bne.s *
5594
 
5595
 
5596
 
5597
*     -(An),-(An)
5598
 
5599
                moveq  #$00000000,d0       * BYTE Flag Results Accumulator
5600
                moveq  #$00000000,d1
5601
                moveq  #$00000000,d2
5602
                move.l #$00000100,a0       * Address for Data-X
5603
                move.l #$00000200,a1       * Address for Data-Y
5604
                move.l #$11FF5580,(a0)+   * Populate test data
5605
                move.l #$1111FFFF,(a0)+   * Populate test data
5606
                move.l #$80FF337F,(a0)+   * Populate test data
5607
                move.l #$44444444,(a0)+   * Populate test data
5608
                move.l #$80FF337F,(a1)+   * Populate test data
5609
                move.l #$1111FFFF,(a1)+   * Populate test data
5610
                move.l #$33333333,(a1)+   * Populate test data
5611
                move.l #$5580EECC,(a1)+   * Populate test data
5612
 
5613
 
5614
                move.l #$0000000F,d6       * Loop counter
5615
 
5616
SUBX_LOOP3:     subx.b -(a0),-(a1)
5617
                move.w sr,d3
5618
                andi.l #$0F,d3            * Isolate flags
5619
                add.l d3,d0               * Copy flag results into accumulator
5620
                add.b (a1),d1
5621
                dbf d6,SUBX_LOOP3
5622
 
5623
 
5624
                move.l #$00000110,a0       * Address for Data-X
5625
                move.l #$00000210,a1       * Address for Data-Y
5626
                moveq  #$00000007,d6       * Loop counter
5627
 
5628
SUBX_LOOP4:     subx.w -(a0),-(a1)
5629
                move.w sr,d3
5630
                andi.l #$0F,d3            * Isolate flags
5631
                add.l d3,d0               * Copy flag results into accumulator
5632
                add.w (a1),d1
5633
                dbf d6,SUBX_LOOP4
5634
 
5635
 
5636
                move.l #$00000110,a0       * Address for Data-X
5637
                move.l #$00000210,a1       * Address for Data-Y
5638
                moveq  #$00000003,d6       * Loop counter
5639
 
5640
SUBX_LOOP5:     subx.l -(a0),-(a1)
5641
                move.w sr,d3
5642
                andi.l #$0F,d3            * Isolate flags
5643
                add.l d3,d0               * Copy flag results into accumulator
5644
                add.l (a1),d1
5645
                dbf d6,SUBX_LOOP5
5646
 
5647
 
5648
                cmpi.l #$000000B1,d0      * Check the flag results
5649
                bne.s *
5650
                cmpi.l #$62C6F417,d1      * Check the data results
5651
                bne.s *
5652
 
5653
                rts
5654
 
5655
 
5656
*-----------------------------------------------------------
5657
*-----------------------------------------------------------
5658
* OPCODE : MULU
5659
*-----------------------------------------------------------
5660
*-----------------------------------------------------------
5661
 
5662
op_MULU:
5663
 
5664
                move.l #$FE805501,d0        * Initial
5665
                move.l #$5697EDB6,d1        * Initial Y
5666
                move.l #$FE805501,d2
5667
                moveq  #$00000000,d3
5668
                moveq  #$00000000,d4        * Cumulative data results
5669
                moveq  #$00000000,d5       * Cumulative flag results
5670
                move.l #$0000000E,d6       * Inner loop counter
5671
                move.l #$0000000E,d7       * Outer loop counter
5672
 
5673
 
5674
MULU_OUTER1:    mulu d1,d0
5675
                move.w sr,d3
5676
                andi.l #$0C,d3            * Isolate flags
5677
                add.l d3,d5               * Copy flag results into accumulator
5678
                add.l d0,d4               * Copy data results into data accumulator
5679
                ror.l #$1,d1
5680
 
5681
                dbf d6,MULU_OUTER1
5682
                ror.l #$1,d2
5683
                move.l d2,d0
5684
                move.l #$0000000E,d6       * Inner loop counter
5685
                dbf d7,MULU_OUTER1
5686
 
5687
                cmpi.l #$76FB988C,d4      * Check the data results
5688
                bne.s *
5689
 
5690
                cmpi.l #$00000170,d5      * Check the Flag results
5691
                bne.s *
5692
 
5693
 
5694
                rts
5695
 
5696
 
5697
*-----------------------------------------------------------
5698
*-----------------------------------------------------------
5699
* OPCODE : MULS
5700
*-----------------------------------------------------------
5701
*-----------------------------------------------------------
5702
 
5703
op_MULS:
5704
 
5705
                move.l #$FE805501,d0        * Initial
5706
                move.l #$5697EDB6,d1        * Initial Y
5707
                move.l #$FE805501,d2
5708
                moveq  #$00000000,d3
5709
                moveq  #$00000000,d4        * Cumulative data results
5710
                moveq  #$00000000,d5       * Cumulative flag results
5711
                move.l #$0000000E,d6       * Inner loop counter
5712
                move.l #$0000000E,d7       * Outer loop counter
5713
 
5714
 
5715
MULS_OUTER1:    muls d1,d0
5716
                move.w sr,d3
5717
                andi.l #$0C,d3            * Isolate flags
5718
                add.l d3,d5               * Copy flag results into accumulator
5719
                add.l d0,d4               * Copy data results into data accumulator
5720
                ror.l #$1,d1
5721
 
5722
                dbf d6,MULS_OUTER1
5723
                ror.l #$1,d2
5724
                move.l d2,d0
5725
                move.l #$0000000E,d6       * Inner loop counter
5726
                dbf d7,MULS_OUTER1
5727
 
5728
                cmpi.l #$D4E2988C,d4      * Check the data results
5729
                bne.s *
5730
 
5731
                cmpi.l #$000003E0,d5      * Check the Flag results
5732
                bne.s *
5733
 
5734
 
5735
                rts
5736
 
5737
 
5738
 
5739
*-----------------------------------------------------------
5740
*-----------------------------------------------------------
5741
* OPCODE : EXG
5742
*-----------------------------------------------------------
5743
*-----------------------------------------------------------
5744
 
5745
op_EXG:
5746
                move.l #$d1d1d1d1,d1
5747
                move.l #$d2d2d2d2,d2
5748
                move.l #$d3d3d3d3,d3
5749
                move.l #$a1a1a1a1,a1
5750
                move.l #$a2a2a2a2,a2
5751
                move.l #$a3a3a3a3,a3
5752
 
5753
                exg d1,d2
5754
                exg a1,a2
5755
                exg d3,a3
5756
 
5757
                cmpi.l #$d2d2d2d2,d1      * Check the results
5758
                bne.s *
5759
                cmpi.l #$d1d1d1d1,d2
5760
                bne.s *
5761
                cmpi.l #$a3a3a3a3,d3
5762
                bne.s *
5763
 
5764
                move.l a1,d1
5765
                move.l a2,d2
5766
                move.l a3,d3
5767
 
5768
                cmpi.l #$a2a2a2a2,d1
5769
                bne.s *
5770
                cmpi.l #$a1a1a1a1,d2
5771
                bne.s *
5772
                cmpi.l #$d3d3d3d3,d3
5773
                bne.s *
5774
 
5775
                rts
5776
 
5777
 
5778
*-----------------------------------------------------------
5779
*-----------------------------------------------------------
5780
* OPCODE : ROx
5781
*-----------------------------------------------------------
5782
*-----------------------------------------------------------
5783
 
5784
*     Subroutine to check and accumulate the flags
5785
ROx_FLAGS:      move.w sr,d3
5786
                andi.l #$0F,d3            * Isolate flags
5787
                add.l d3,d5               * Copy flag results into accumulator
5788
                rts
5789
 
5790
op_ROx:
5791
 
5792
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
5793
 
5794
*        BYTE LEFT
5795
                move.l #$80018FF1,d0
5796
                moveq  #$00000000,d5
5797
                moveq  #$00000011,d6
5798
ROx_LOOP1:
5799
                rol.b d6,d0
5800
                bsr ROx_FLAGS
5801
                dbf d6,ROx_LOOP1
5802
                cmpi.l #$80018FE3,d0
5803
                bne.s *
5804
                cmpi.l #$0000006B,d5
5805
                bne.s *
5806
 
5807
*        BYTE RIGHT
5808
                move.l #$80018FF1,d0
5809
                moveq  #$00000012,d6
5810
ROx_LOOP2:
5811
                ror.b d6,d0
5812
                bsr ROx_FLAGS
5813
                dbf d6,ROx_LOOP2
5814
                cmpi.l #$80018F3E,d0
5815
                bne.s *
5816
                cmpi.l #$000000C5,d5
5817
                bne.s *
5818
 
5819
 
5820
*        WORD LEFT
5821
                move.l #$80018FF1,d0
5822
                moveq  #$00000013,d6
5823
ROx_LOOP3:
5824
                rol.w d6,d0
5825
                bsr ROx_FLAGS
5826
                dbf d6,ROx_LOOP3
5827
                cmpi.l #$800163FC,d0
5828
                bne.s *
5829
                cmpi.l #$00000131,d5
5830
                bne.s *
5831
 
5832
*        WORD RIGHT
5833
                move.l #$80018FF1,d0
5834
                move.l #$0000001E,d6
5835
ROx_LOOP4:
5836
                ror.w d6,d0
5837
                bsr ROx_FLAGS
5838
                dbf d6,ROx_LOOP4
5839
                cmpi.l #$8001C7F8,d0
5840
                bne.s *
5841
                cmpi.l #$000001DB,d5
5842
                bne.s *
5843
 
5844
 
5845
*        LONG LEFT
5846
                move.l #$80018FF1,d0
5847
                moveq  #$00000015,d6
5848
ROx_LOOP5:
5849
                rol.l d6,d0
5850
                bsr ROx_FLAGS
5851
                dbf d6,ROx_LOOP5
5852
                cmpi.l #$00C7F8C0,d0
5853
                bne.s *
5854
                cmpi.l #$0000021A,d5
5855
                bne.s *
5856
 
5857
*        LONG RIGHT
5858
                move.l #$80018FF1,d0
5859
                moveq  #$00000016,d6
5860
ROx_LOOP6:
5861
                ror.l d6,d0
5862
                bsr ROx_FLAGS
5863
                dbf d6,ROx_LOOP6
5864
                cmpi.l #$000C7F8C,d0
5865
                bne.s *
5866
                cmpi.l #$00000250,d5
5867
                bne.s *
5868
 
5869
 
5870
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
5871
 
5872
                move.l #$80018FF1,d0
5873
                moveq  #$00000000,d5
5874
 
5875
*        BYTE LEFT
5876
                rol.b #1,d0
5877
                bsr ROx_FLAGS
5878
                rol.b #5,d0
5879
                bsr ROx_FLAGS
5880
                rol.b #7,d0
5881
                bsr ROx_FLAGS
5882
                rol.b #8,d0
5883
                bsr ROx_FLAGS
5884
                cmpi.l #$80018F3E,d0
5885
                bne.s *
5886
                cmpi.l #$00000009,d5
5887
                bne.s *
5888
 
5889
*        BYTE RIGHT
5890
                ror.b #1,d0
5891
                bsr ROx_FLAGS
5892
                ror.b #5,d0
5893
                bsr ROx_FLAGS
5894
                ror.b #7,d0
5895
                bsr ROx_FLAGS
5896
                ror.b #8,d0
5897
                bsr ROx_FLAGS
5898
                cmpi.l #$80018FF1,d0
5899
                bne.s *
5900
                cmpi.l #$00000024,d5
5901
                bne.s *
5902
 
5903
*        WORD LEFT
5904
                rol.w #1,d0
5905
                bsr ROx_FLAGS
5906
                rol.w #5,d0
5907
                bsr ROx_FLAGS
5908
                rol.w #7,d0
5909
                bsr ROx_FLAGS
5910
                rol.w #8,d0
5911
                bsr ROx_FLAGS
5912
                cmpi.l #$8001FE31,d0
5913
                bne.s *
5914
                cmpi.l #$00000037,d5
5915
                bne.s *
5916
 
5917
*        WORD RIGHT
5918
                ror.w #1,d0
5919
                bsr ROx_FLAGS
5920
                ror.w #5,d0
5921
                bsr ROx_FLAGS
5922
                ror.w #7,d0
5923
                bsr ROx_FLAGS
5924
                ror.w #8,d0
5925
                bsr ROx_FLAGS
5926
                cmpi.l #$80018FF1,d0
5927
                bne.s *
5928
                cmpi.l #$0000005B,d5
5929
                bne.s *
5930
 
5931
*        LONG LEFT
5932
                rol.l #1,d0
5933
                bsr ROx_FLAGS
5934
                rol.l #5,d0
5935
                bsr ROx_FLAGS
5936
                rol.l #7,d0
5937
                bsr ROx_FLAGS
5938
                rol.l #8,d0
5939
                bsr ROx_FLAGS
5940
                cmpi.l #$FE300031,d0
5941
                bne.s *
5942
                cmpi.l #$00000065,d5
5943
                bne.s *
5944
 
5945
*        LONG RIGHT
5946
                ror.l #1,d0
5947
                bsr ROx_FLAGS
5948
                ror.l #5,d0
5949
                bsr ROx_FLAGS
5950
                ror.l #7,d0
5951
                bsr ROx_FLAGS
5952
                ror.l #8,d0
5953
                bsr ROx_FLAGS
5954
                cmpi.l #$80018FF1,d0
5955
                bne.s *
5956
                cmpi.l #$00000080,d5
5957
                bne.s *
5958
 
5959
 
5960
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
5961
 
5962
                moveq  #$00000000,d5
5963
                move.l #$00000100,a0
5964
                move.w #$8FF1,(a0)
5965
 
5966
*        WORD LEFT
5967
                rol (a0)
5968
                bsr ROx_FLAGS
5969
                rol (a0)
5970
                bsr ROx_FLAGS
5971
                rol (a0)
5972
                bsr ROx_FLAGS
5973
                rol (a0)
5974
                bsr ROx_FLAGS
5975
                move.w (a0),d0
5976
                cmpi.l #$8001FF18,d0
5977
                bne.s *
5978
                cmpi.l #$00000009,d5
5979
                bne.s *
5980
 
5981
*        WORD RIGHT
5982
                ror (a0)
5983
                bsr ROx_FLAGS
5984
                ror (a0)
5985
                bsr ROx_FLAGS
5986
                ror (a0)
5987
                bsr ROx_FLAGS
5988
                ror (a0)
5989
                bsr ROx_FLAGS
5990
                ror (a0)
5991
                bsr ROx_FLAGS
5992
                ror (a0)
5993
                bsr ROx_FLAGS
5994
                move.w (a0),d0
5995
                cmpi.l #$800163FC,d0
5996
                bne.s *
5997
                cmpi.l #$0000001B,d5
5998
                bne.s *
5999
 
6000
                rts
6001
 
6002
 
6003
 
6004
*-----------------------------------------------------------
6005
*-----------------------------------------------------------
6006
* OPCODE : ROXx
6007
*-----------------------------------------------------------
6008
*-----------------------------------------------------------
6009
 
6010
*     Subroutine to check and accumulate the flags
6011
ROXx_FLAGS:     move.w sr,d3
6012
                andi.l #$0F,d3            * Isolate flags
6013
                add.l d3,d5               * Copy flag results into accumulator
6014
                rts
6015
 
6016
op_ROXx:
6017
 
6018
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
6019
 
6020
*        BYTE LEFT
6021
                move.l #$80018FF1,d0
6022
                moveq  #$00000000,d5
6023
                moveq  #$00000011,d6
6024
ROXx_LOOP1:
6025
                roxl.b d6,d0
6026
                bsr ROXx_FLAGS
6027
                dbf d6,ROXx_LOOP1
6028
                cmpi.l #$80018FD0,d0
6029
                bne.s *
6030
                cmpi.l #$00000042,d5
6031
                bne.s *
6032
 
6033
*        BYTE RIGHT
6034
                move.l #$80018FF1,d0
6035
                moveq  #$00000012,d6
6036
ROXx_LOOP2:
6037
                roxr.b d6,d0
6038
                bsr ROXx_FLAGS
6039
                dbf d6,ROXx_LOOP2
6040
                cmpi.l #$80018F51,d0
6041
                bne.s *
6042
                cmpi.l #$0000009C,d5
6043
                bne.s *
6044
 
6045
 
6046
*        WORD LEFT
6047
                move.l #$80018FF1,d0
6048
                moveq  #$00000013,d6
6049
ROXx_LOOP3:
6050
                roxl.w d6,d0
6051
                bsr ROXx_FLAGS
6052
                dbf d6,ROXx_LOOP3
6053
                cmpi.l #$80013980,d0
6054
                bne.s *
6055
                cmpi.l #$000000C9,d5
6056
                bne.s *
6057
 
6058
*        WORD RIGHT
6059
                move.l #$80018FF1,d0
6060
                move.l #$0000001E,d6
6061
ROXx_LOOP4:
6062
                roxr.w d6,d0
6063
                bsr ROXx_FLAGS
6064
                dbf d6,ROXx_LOOP4
6065
                cmpi.l #$80010A1D,d0
6066
                bne.s *
6067
                cmpi.l #$0000014D,d5
6068
                bne.s *
6069
 
6070
 
6071
*        LONG LEFT
6072
                move.l #$80018FF1,d0
6073
                moveq  #$00000015,d6
6074
ROXx_LOOP5:
6075
                roxl.l d6,d0
6076
                bsr ROXx_FLAGS
6077
                dbf d6,ROXx_LOOP5
6078
                cmpi.l #$800185D0,d0
6079
                bne.s *
6080
                cmpi.l #$000001A1,d5
6081
                bne.s *
6082
 
6083
*        LONG RIGHT
6084
                move.l #$80018FF1,d0
6085
                moveq  #$00000016,d6
6086
ROXx_LOOP6:
6087
                roxr.l d6,d0
6088
                bsr ROXx_FLAGS
6089
                dbf d6,ROXx_LOOP6
6090
                cmpi.l #$082D8200,d0
6091
                bne.s *
6092
                cmpi.l #$000001DE,d5
6093
                bne.s *
6094
 
6095
 
6096
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
6097
 
6098
                move.l #$80018FF1,d0
6099
                moveq  #$00000000,d5
6100
 
6101
*        BYTE LEFT
6102
                roxl.b #1,d0
6103
                bsr ROXx_FLAGS
6104
                roxl.b #5,d0
6105
                bsr ROXx_FLAGS
6106
                roxl.b #7,d0
6107
                bsr ROXx_FLAGS
6108
                roxl.b #8,d0
6109
                bsr ROXx_FLAGS
6110
                cmpi.l #$80018F09,d0
6111
                bne.s *
6112
                cmpi.l #$0000000B,d5
6113
                bne.s *
6114
 
6115
*        BYTE RIGHT
6116
                roxr.b #1,d0
6117
                bsr ROXx_FLAGS
6118
                roxr.b #5,d0
6119
                bsr ROXx_FLAGS
6120
                roxr.b #7,d0
6121
                bsr ROXx_FLAGS
6122
                roxr.b #8,d0
6123
                bsr ROXx_FLAGS
6124
                cmpi.l #$80018F00,d0
6125
                bne.s *
6126
                cmpi.l #$00000015,d5
6127
                bne.s *
6128
 
6129
*        WORD LEFT
6130
                roxl.w #1,d0
6131
                bsr ROXx_FLAGS
6132
                roxl.w #5,d0
6133
                bsr ROXx_FLAGS
6134
                roxl.w #7,d0
6135
                bsr ROXx_FLAGS
6136
                roxl.w #8,d0
6137
                bsr ROXx_FLAGS
6138
                cmpi.l #$8001B000,d0
6139
                bne.s *
6140
                cmpi.l #$00000027,d5
6141
                bne.s *
6142
 
6143
*        WORD RIGHT
6144
                roxr.w #1,d0
6145
                bsr ROXx_FLAGS
6146
                roxr.w #5,d0
6147
                bsr ROXx_FLAGS
6148
                roxr.w #7,d0
6149
                bsr ROXx_FLAGS
6150
                roxr.w #8,d0
6151
                bsr ROXx_FLAGS
6152
                cmpi.l #$80010A00,d0
6153
                bne.s *
6154
                cmpi.l #$00000028,d5
6155
                bne.s *
6156
 
6157
*        LONG LEFT
6158
                roxl.l #1,d0
6159
                bsr ROXx_FLAGS
6160
                roxl.l #5,d0
6161
                bsr ROXx_FLAGS
6162
                roxl.l #7,d0
6163
                bsr ROXx_FLAGS
6164
                roxl.l #8,d0
6165
                bsr ROXx_FLAGS
6166
                cmpi.l #$40000010,d0
6167
                bne.s *
6168
                cmpi.l #$0000002A,d5
6169
                bne.s *
6170
 
6171
*        LONG RIGHT
6172
                roxr.l #1,d0
6173
                bsr ROXx_FLAGS
6174
                roxr.l #5,d0
6175
                bsr ROXx_FLAGS
6176
                roxr.l #7,d0
6177
                bsr ROXx_FLAGS
6178
                roxr.l #8,d0
6179
                bsr ROXx_FLAGS
6180
                cmpi.l #$00010200,d0
6181
                bne.s *
6182
                cmpi.l #$00000032,d5
6183
                bne.s *
6184
 
6185
 
6186
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
6187
 
6188
                moveq  #$00000000,d5
6189
                move.l #$00000100,a0
6190
                move.w #$8FF1,(a0)
6191
 
6192
*        WORD LEFT
6193
                roxl (a0)
6194
                bsr ROXx_FLAGS
6195
                roxl (a0)
6196
                bsr ROXx_FLAGS
6197
                roxl (a0)
6198
                bsr ROXx_FLAGS
6199
                roxl (a0)
6200
                bsr ROXx_FLAGS
6201
                move.w (a0),d0
6202
                cmpi.l #$0001FF10,d0
6203
                bne.s *
6204
                cmpi.l #$00000009,d5
6205
                bne.s *
6206
 
6207
*        WORD RIGHT
6208
                roxr (a0)
6209
                bsr ROXx_FLAGS
6210
                roxr (a0)
6211
                bsr ROXx_FLAGS
6212
                roxr (a0)
6213
                bsr ROXx_FLAGS
6214
                roxr (a0)
6215
                bsr ROXx_FLAGS
6216
                roxr (a0)
6217
                bsr ROXx_FLAGS
6218
                roxr (a0)
6219
                bsr ROXx_FLAGS
6220
                move.w (a0),d0
6221
                cmpi.l #$000103FC,d0
6222
                bne.s *
6223
                cmpi.l #$0000000A,d5
6224
                bne.s *
6225
 
6226
                rts
6227
 
6228
 
6229
 
6230
 
6231
*-----------------------------------------------------------
6232
*-----------------------------------------------------------
6233
* OPCODE : SHIFTS
6234
*-----------------------------------------------------------
6235
*-----------------------------------------------------------
6236
 
6237
*     Subroutine to check and accumulate the flags
6238
SHIFTS_FLAGS:   move.w sr,d3
6239
                andi.l #$0F,d3            * Isolate flags
6240
                add.l d3,d5               * Copy flag results into accumulator
6241
                rts
6242
 
6243
op_SHIFTS:
6244
 
6245
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
6246
 
6247
*        BYTE LEFT
6248
                move.l #$80018F81,d0
6249
                moveq  #$00000000,d5
6250
                moveq  #$00000002,d6
6251
SHIFTS_LOOP1:
6252
                asl.b d6,d0
6253
                bsr SHIFTS_FLAGS
6254
                dbf d6,SHIFTS_LOOP1
6255
                cmpi.l #$80018F08,d0
6256
                bne.s *
6257
                cmpi.l #$00000002,d5
6258
                bne.s *
6259
 
6260
*        BYTE RIGHT
6261
                move.l #$80018F81,d0
6262
                moveq  #$00000002,d6
6263
SHIFTS_LOOP2:
6264
                asr.b d6,d0
6265
                bsr SHIFTS_FLAGS
6266
                dbf d6,SHIFTS_LOOP2
6267
                cmpi.l #$80018FF0,d0
6268
                bne.s *
6269
                cmpi.l #$0000001A,d5
6270
                bne.s *
6271
 
6272
 
6273
*        WORD LEFT
6274
                move.l #$80018FF1,d0
6275
                moveq  #$00000002,d6
6276
SHIFTS_LOOP3:
6277
                asl.w d6,d0
6278
                bsr SHIFTS_FLAGS
6279
                dbf d6,SHIFTS_LOOP3
6280
                cmpi.l #$80017F88,d0
6281
                bne.s *
6282
                cmpi.l #$0000001C,d5
6283
                bne.s *
6284
 
6285
*        WORD RIGHT
6286
                move.l #$80018FF1,d0
6287
                moveq  #$00000002,d6
6288
SHIFTS_LOOP4:
6289
                asr.w d6,d0
6290
                bsr SHIFTS_FLAGS
6291
                dbf d6,SHIFTS_LOOP4
6292
                cmpi.l #$8001F1FE,d0
6293
                bne.s *
6294
                cmpi.l #$00000034,d5
6295
                bne.s *
6296
 
6297
 
6298
*        LONG LEFT
6299
                move.l #$80018FF1,d0
6300
                moveq  #$00000002,d6
6301
SHIFTS_LOOP5:
6302
                asl.l d6,d0
6303
                bsr SHIFTS_FLAGS
6304
                dbf d6,SHIFTS_LOOP5
6305
                cmpi.l #$000C7F88,d0
6306
                bne.s *
6307
                cmpi.l #$00000036,d5
6308
                bne.s *
6309
 
6310
*        LONG RIGHT
6311
                move.l #$80018FF1,d0
6312
                moveq  #$00000002,d6
6313
SHIFTS_LOOP6:
6314
                asr.l d6,d0
6315
                bsr SHIFTS_FLAGS
6316
                dbf d6,SHIFTS_LOOP6
6317
                cmpi.l #$F00031FE,d0
6318
                bne.s *
6319
                cmpi.l #$0000004E,d5
6320
                bne.s *
6321
 
6322
 
6323
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
6324
 
6325
                move.l #$80018FF1,d0
6326
                moveq  #$00000000,d5
6327
 
6328
*        BYTE LEFT
6329
                asl.b #1,d0
6330
                bsr SHIFTS_FLAGS
6331
                asl.b #2,d0
6332
                bsr SHIFTS_FLAGS
6333
                asl.b #1,d0
6334
                bsr SHIFTS_FLAGS
6335
                asl.b #3,d0
6336
                bsr SHIFTS_FLAGS
6337
                cmpi.l #$80018F80,d0
6338
                bne.s *
6339
                cmpi.l #$0000001F,d5
6340
                bne.s *
6341
 
6342
*        BYTE RIGHT
6343
                asr.b #1,d0
6344
                bsr SHIFTS_FLAGS
6345
                asr.b #2,d0
6346
                bsr SHIFTS_FLAGS
6347
                asr.b #3,d0
6348
                bsr SHIFTS_FLAGS
6349
                asr.b #1,d0
6350
                bsr SHIFTS_FLAGS
6351
                cmpi.l #$80018FFF,d0
6352
                bne.s *
6353
                cmpi.l #$0000003F,d5
6354
                bne.s *
6355
 
6356
*        WORD LEFT
6357
                asl.w #1,d0
6358
                bsr SHIFTS_FLAGS
6359
                asl.w #2,d0
6360
                bsr SHIFTS_FLAGS
6361
                asl.w #3,d0
6362
                bsr SHIFTS_FLAGS
6363
                asl.w #5,d0
6364
                bsr SHIFTS_FLAGS
6365
                cmpi.l #$8001F800,d0
6366
                bne.s *
6367
                cmpi.l #$00000056,d5
6368
                bne.s *
6369
 
6370
*        WORD RIGHT
6371
                asr.w #5,d0
6372
                bsr SHIFTS_FLAGS
6373
                asr.w #1,d0
6374
                bsr SHIFTS_FLAGS
6375
                asr.w #2,d0
6376
                bsr SHIFTS_FLAGS
6377
                asr.w #4,d0
6378
                bsr SHIFTS_FLAGS
6379
                cmpi.l #$8001FFFF,d0
6380
                bne.s *
6381
                cmpi.l #$00000077,d5
6382
                bne.s *
6383
 
6384
*        LONG LEFT
6385
                move.l #$80018FF1,d0
6386
                asl.l #1,d0
6387
                bsr SHIFTS_FLAGS
6388
                asl.l #2,d0
6389
                bsr SHIFTS_FLAGS
6390
                asl.l #7,d0
6391
                bsr SHIFTS_FLAGS
6392
                asl.l #4,d0
6393
                bsr SHIFTS_FLAGS
6394
                cmpi.l #$63FC4000,d0
6395
                bne.s *
6396
                cmpi.l #$0000007A,d5
6397
                bne.s *
6398
 
6399
*        LONG RIGHT
6400
                move.l #$80018FF1,d0
6401
                asr.l #1,d0
6402
                bsr SHIFTS_FLAGS
6403
                asr.l #5,d0
6404
                bsr SHIFTS_FLAGS
6405
                asr.l #7,d0
6406
                bsr SHIFTS_FLAGS
6407
                asr.l #8,d0
6408
                bsr SHIFTS_FLAGS
6409
                cmpi.l #$FFFFFC00,d0
6410
                bne.s *
6411
                cmpi.l #$0000009C,d5
6412
                bne.s *
6413
 
6414
 
6415
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
6416
 
6417
                moveq  #$00000000,d5
6418
                move.l #$00000100,a0
6419
                move.w #$8FF1,(a0)
6420
 
6421
*        WORD LEFT
6422
                asl  (a0)
6423
                bsr SHIFTS_FLAGS
6424
                asl  (a0)
6425
                bsr SHIFTS_FLAGS
6426
                asl  (a0)
6427
                bsr SHIFTS_FLAGS
6428
                asl  (a0)
6429
                bsr SHIFTS_FLAGS
6430
                move.w (a0),d0
6431
                cmpi.l #$FFFFFF10,d0
6432
                bne.s *
6433
                cmpi.l #$0000000D,d5
6434
                bne.s *
6435
 
6436
*        WORD RIGHT
6437
                asr (a0)
6438
                bsr SHIFTS_FLAGS
6439
                asr (a0)
6440
                bsr SHIFTS_FLAGS
6441
                asr (a0)
6442
                bsr SHIFTS_FLAGS
6443
                asr (a0)
6444
                bsr SHIFTS_FLAGS
6445
                asr (a0)
6446
                bsr SHIFTS_FLAGS
6447
                asr (a0)
6448
                bsr SHIFTS_FLAGS
6449
                move.w (a0),d0
6450
                cmpi.l #$FFFFFFFC,d0
6451
                bne.s *
6452
                cmpi.l #$0000003E,d5
6453
                bne.s *
6454
 
6455
                rts
6456
 
6457
 
6458
 
6459
*-----------------------------------------------------------
6460
*-----------------------------------------------------------
6461
* OPCODE : SHIFTS2
6462
*-----------------------------------------------------------
6463
*-----------------------------------------------------------
6464
 
6465
*     Subroutine to check and accumulate the flags
6466
SHIFTS2_FLAGS:  move.w sr,d3
6467
                andi.l #$0F,d3            * Isolate flags
6468
                add.l d3,d5               * Copy flag results into accumulator
6469
                rts
6470
 
6471
op_SHIFTS2:
6472
 
6473
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
6474
 
6475
*        BYTE LEFT
6476
                move.l #$80018F81,d0
6477
                moveq  #$00000000,d5
6478
                moveq  #$00000002,d6
6479
SHIFTS2_LOOP1:
6480
                lsl.b d6,d0
6481
                bsr SHIFTS2_FLAGS
6482
                dbf d6,SHIFTS2_LOOP1
6483
                cmpi.l #$80018F08,d0
6484
                bne.s *
6485
                cmpi.l #$00000000,d5
6486
                bne.s *
6487
 
6488
*        BYTE RIGHT
6489
                move.l #$80018F81,d0
6490
                moveq  #$00000002,d6
6491
SHIFTS2_LOOP2:
6492
                lsr.b d6,d0
6493
                bsr SHIFTS2_FLAGS
6494
                dbf d6,SHIFTS2_LOOP2
6495
                cmpi.l #$80018F10,d0
6496
                bne.s *
6497
                cmpi.l #$00000000,d5
6498
                bne.s *
6499
 
6500
 
6501
*        WORD LEFT
6502
                move.l #$80018FF1,d0
6503
                moveq  #$00000002,d6
6504
SHIFTS2_LOOP3:
6505
                lsl.w d6,d0
6506
                bsr SHIFTS2_FLAGS
6507
                dbf d6,SHIFTS2_LOOP3
6508
                cmpi.l #$80017F88,d0
6509
                bne.s *
6510
                cmpi.l #$00000000,d5
6511
                bne.s *
6512
 
6513
*        WORD RIGHT
6514
                move.l #$80018FF1,d0
6515
                moveq  #$00000002,d6
6516
SHIFTS2_LOOP4:
6517
                lsr.w d6,d0
6518
                bsr SHIFTS2_FLAGS
6519
                dbf d6,SHIFTS2_LOOP4
6520
                cmpi.l #$800111FE,d0
6521
                bne.s *
6522
                cmpi.l #$00000000,d5
6523
                bne.s *
6524
 
6525
 
6526
*        LONG LEFT
6527
                move.l #$80018FF1,d0
6528
                moveq  #$00000002,d6
6529
SHIFTS2_LOOP5:
6530
                lsl.l d6,d0
6531
                bsr SHIFTS2_FLAGS
6532
                dbf d6,SHIFTS2_LOOP5
6533
                cmpi.l #$000C7F88,d0
6534
                bne.s *
6535
                cmpi.l #$00000000,d5
6536
                bne.s *
6537
 
6538
*        LONG RIGHT
6539
                move.l #$80018FF1,d0
6540
                moveq  #$00000002,d6
6541
SHIFTS2_LOOP6:
6542
                lsr.l d6,d0
6543
                bsr SHIFTS2_FLAGS
6544
                dbf d6,SHIFTS2_LOOP6
6545
                cmpi.l #$100031FE,d0
6546
                bne.s *
6547
                cmpi.l #$00000000,d5
6548
                bne.s *
6549
 
6550
 
6551
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
6552
 
6553
                move.l #$80018FF1,d0
6554
                moveq  #$00000000,d5
6555
 
6556
*        BYTE LEFT
6557
                lsl.b #1,d0
6558
                bsr SHIFTS2_FLAGS
6559
                lsl.b #2,d0
6560
                bsr SHIFTS2_FLAGS
6561
                lsl.b #1,d0
6562
                bsr SHIFTS2_FLAGS
6563
                lsl.b #3,d0
6564
                bsr SHIFTS2_FLAGS
6565
                cmpi.l #$80018F80,d0
6566
                bne.s *
6567
                cmpi.l #$0000001B,d5
6568
                bne.s *
6569
 
6570
*        BYTE RIGHT
6571
                lsr.b #1,d0
6572
                bsr SHIFTS2_FLAGS
6573
                lsr.b #2,d0
6574
                bsr SHIFTS2_FLAGS
6575
                lsr.b #3,d0
6576
                bsr SHIFTS2_FLAGS
6577
                lsr.b #1,d0
6578
                bsr SHIFTS2_FLAGS
6579
                cmpi.l #$80018F01,d0
6580
                bne.s *
6581
                cmpi.l #$0000001B,d5
6582
                bne.s *
6583
 
6584
*        WORD LEFT
6585
                lsl.w #1,d0
6586
                bsr SHIFTS2_FLAGS
6587
                lsl.w #2,d0
6588
                bsr SHIFTS2_FLAGS
6589
                lsl.w #3,d0
6590
                bsr SHIFTS2_FLAGS
6591
                lsl.w #5,d0
6592
                bsr SHIFTS2_FLAGS
6593
                cmpi.l #$80010800,d0
6594
                bne.s *
6595
                cmpi.l #$00000025,d5
6596
                bne.s *
6597
 
6598
*        WORD RIGHT
6599
                lsr.w #5,d0
6600
                bsr SHIFTS2_FLAGS
6601
                lsr.w #1,d0
6602
                bsr SHIFTS2_FLAGS
6603
                lsr.w #2,d0
6604
                bsr SHIFTS2_FLAGS
6605
                lsr.w #4,d0
6606
                bsr SHIFTS2_FLAGS
6607
                cmpi.l #$80010000,d0
6608
                bne.s *
6609
                cmpi.l #$0000002A,d5
6610
                bne.s *
6611
 
6612
*        LONG LEFT
6613
                move.l #$80018FF1,d0
6614
                lsl.l #1,d0
6615
                bsr SHIFTS2_FLAGS
6616
                lsl.l #2,d0
6617
                bsr SHIFTS2_FLAGS
6618
                lsl.l #7,d0
6619
                bsr SHIFTS2_FLAGS
6620
                lsl.l #4,d0
6621
                bsr SHIFTS2_FLAGS
6622
                cmpi.l #$63FC4000,d0
6623
                bne.s *
6624
                cmpi.l #$0000002B,d5
6625
                bne.s *
6626
 
6627
*        LONG RIGHT
6628
                move.l #$80018FF1,d0
6629
                lsr.l #1,d0
6630
                bsr SHIFTS2_FLAGS
6631
                lsr.l #5,d0
6632
                bsr SHIFTS2_FLAGS
6633
                lsr.l #7,d0
6634
                bsr SHIFTS2_FLAGS
6635
                lsr.l #8,d0
6636
                bsr SHIFTS2_FLAGS
6637
                cmpi.l #$00000400,d0
6638
                bne.s *
6639
                cmpi.l #$0000002D,d5
6640
                bne.s *
6641
 
6642
 
6643
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
6644
 
6645
                moveq  #$00000000,d5
6646
                move.l #$00000100,a0
6647
                move.w #$8FF1,(a0)
6648
 
6649
*        WORD LEFT
6650
                lsl  (a0)
6651
                bsr SHIFTS2_FLAGS
6652
                lsl  (a0)
6653
                bsr SHIFTS2_FLAGS
6654
                lsl  (a0)
6655
                bsr SHIFTS2_FLAGS
6656
                lsl  (a0)
6657
                bsr SHIFTS2_FLAGS
6658
                move.w (a0),d0
6659
                cmpi.l #$0000FF10,d0
6660
                bne.s *
6661
                cmpi.l #$00000009,d5
6662
                bne.s *
6663
 
6664
*        WORD RIGHT
6665
                lsr (a0)
6666
                bsr SHIFTS2_FLAGS
6667
                lsr (a0)
6668
                bsr SHIFTS2_FLAGS
6669
                lsr (a0)
6670
                bsr SHIFTS2_FLAGS
6671
                lsr (a0)
6672
                bsr SHIFTS2_FLAGS
6673
                lsr (a0)
6674
                bsr SHIFTS2_FLAGS
6675
                lsr (a0)
6676
                bsr SHIFTS2_FLAGS
6677
                move.w (a0),d0
6678
                cmpi.l #$000003FC,d0
6679
                bne.s *
6680
                cmpi.l #$0000000A,d5
6681
                bne.s *
6682
 
6683
                rts
6684
 
6685
;-----------------------------------------------------------
6686
;-----------------------------------------------------------
6687
; OPCODE : BSR / RTS
6688
;-----------------------------------------------------------
6689
;-----------------------------------------------------------
6690
 
6691
;t3_bsr:
6692
;       moveq   #3,d3
6693
;       rts
6694
 
6695
;t1_bsr:
6696
;       moveq   #1,d1
6697
;       rts
6698
 
6699
;op_bsr:
6700
;       bsr                     t1_bsr
6701
;       bsr                     t2_bsr
6702
;       bsr.w           t3_bsr
6703
;       bsr.w           t4_bsr
6704
;       cmpi.l  #1,d1
6705
;       bne                     *
6706
;       cmpi.l  #2,d2
6707
;       bne                     *
6708
;       cmpi.l  #3,d3
6709
;       bne                     *
6710
;       cmpi.l  #4,d4
6711
;       bne                     *
6712
;       rts
6713
 
6714
;t2_bsr:
6715
;       moveq   #2,d2
6716
;       rts
6717
 
6718
;t4_bsr:
6719
;       moveq   #4,d4
6720
;       rts
6721
*    END
6722
 

powered by: WebSVN 2.1.0

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