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

Subversion Repositories rf68000

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

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 3 robfinch
                                                                scc d0                                                                                                  * Test setting a data register
4307
                                                                cmpi.b #$FF,d0
4308
                                                                bne.s *
4309 2 robfinch
                rts
4310
 
4311
 
4312
 
4313
*-----------------------------------------------------------
4314
*-----------------------------------------------------------
4315
* OPCODE : ADDQ
4316
*-----------------------------------------------------------
4317
*-----------------------------------------------------------
4318
 
4319
op_ADDQ:
4320
 
4321
*     BYTE
4322
                move.l #$000000FF,d0    * Loop counter
4323
                moveq  #$00000000,d1    * Flag results accumulator
4324
                moveq  #$00000000,d2    * Data results accumulator
4325
                moveq  #$00000000,d3
4326
                moveq  #$00000000,d4
4327
                moveq  #$00000000,d5
4328
                moveq  #$00000000,d6
4329
                moveq  #$00000000,d7
4330
 
4331
ADDQ_LOOP1:     addq.b #3,d5
4332
                move.w SR,d6
4333
                andi.l #$1F,d6        * Isolate flags
4334
                add.l d6,d1           * Copy flag results into accumulator
4335
                add.l d5,d2           * Copy data results into data accumulator
4336
                dbf d0,ADDQ_LOOP1
4337
 
4338
                cmpi.l #$0000043D,d1
4339
                bne.s *
4340
                cmpi.l #$00007F80,d2
4341
                bne.s *
4342
 
4343
 
4344
*     WORD
4345
                move.l #$000000FF,d0    * Loop counter
4346
                moveq  #$00000000,d1    * Flag results accumulator
4347
                moveq  #$00000000,d2    * Data results accumulator
4348
                moveq  #$00000000,d3
4349
                moveq  #$00000000,d4
4350
                move.l #$0000FFF0,d5
4351
                moveq  #$00000000,d6
4352
                moveq  #$00000000,d7
4353
                move.l #$00000100,a0
4354
 
4355
ADDQ_LOOP2:     addq.w #5,d5
4356
                move.w SR,d6
4357
                andi.l #$1F,d6        * Isolate flags
4358
                add.l d6,d1           * Copy flag results into accumulator
4359
                add.l d5,d2           * Copy data results into data accumulator
4360
                dbf d0,ADDQ_LOOP2
4361
 
4362
                cmpi.l #$00000029,d1
4363
                bne.s *
4364
                cmpi.l #$00057280,d2
4365
                bne.s *
4366
 
4367
 
4368
*     LONG
4369
                move.l #$000000FF,d0    * Loop counter
4370
                moveq  #$00000000,d1    * Flag results accumulator
4371
                moveq  #$00000000,d2    * Data results accumulator
4372
                moveq  #$00000000,d3
4373
                moveq  #$00000000,d4
4374
                move.l #$FFFFFFF0,d5
4375
                moveq  #$00000000,d6
4376
                moveq  #$00000000,d7
4377
 
4378
ADDQ_LOOP3:     addq.l #1,d5
4379
                move.w SR,d6
4380
                andi.l #$1F,d6        * Isolate flags
4381
                add.l d6,d1           * Copy flag results into accumulator
4382
                add.l d5,d2           * Copy data results into data accumulator
4383
                dbf d0,ADDQ_LOOP3
4384
 
4385
                cmpi.l #$0000008D,d1
4386
                bne.s *
4387
                cmpi.l #$00007080,d2
4388
                bne.s *
4389
 
4390
*     Check that Flags are not updated for Address registers
4391
                move.l #$0000FFFF,a0
4392
                move #$00,CCR         * Clear flags
4393
                addq.w #$7,a0
4394
                bcs.s *
4395
 
4396
                rts
4397
 
4398
 
4399
 
4400
*-----------------------------------------------------------
4401
*-----------------------------------------------------------
4402
* OPCODE : SUBQ
4403
*-----------------------------------------------------------
4404
*-----------------------------------------------------------
4405
 
4406
op_SUBQ:
4407
 
4408
*     BYTE
4409
                move.l #$000000FF,d0    * Loop counter
4410
                moveq  #$00000000,d1    * Flag results accumulator
4411
                move.l #$00001234,d2    * Data results accumulator
4412
                moveq  #$00000000,d3
4413
                moveq  #$00000000,d4
4414
                moveq  #$00000012,d5
4415
                moveq  #$00000000,d6
4416
                moveq  #$00000000,d7
4417
 
4418
SUBQ_LOOP1:     subq.b #1,d5
4419
                move.w SR,d6
4420
                andi.l #$1F,d6        * Isolate flags
4421
                add.l d6,d1           * Copy flag results into accumulator
4422
                add.l d5,d2           * Copy data results into data accumulator
4423
                dbf d0,SUBQ_LOOP1
4424
 
4425
                cmpi.l #$00000417,d1
4426
                bne.s *
4427
                cmpi.l #$000091B4,d2
4428
                bne.s *
4429
 
4430
 
4431
*     WORD
4432
                move.l #$000000FF,d0    * Loop counter
4433
                moveq  #$00000000,d1    * Flag results accumulator
4434
                moveq  #$00000000,d2    * Data results accumulator
4435
                moveq  #$00000000,d3
4436
                moveq  #$00000000,d4
4437
                moveq  #$00000002,d5
4438
                moveq  #$00000000,d6
4439
                moveq  #$00000000,d7
4440
                move.l #$00000100,a0
4441
 
4442
SUBQ_LOOP2:     subq.w #5,d5
4443
                move.w SR,d6
4444
                andi.l #$1F,d6        * Isolate flags
4445
                add.l d6,d1           * Copy flag results into accumulator
4446
                add.l d5,d2           * Copy data results into data accumulator
4447
                dbf d0,SUBQ_LOOP2
4448
 
4449
                cmpi.l #$00000811,d1
4450
                bne.s *
4451
                cmpi.l #$00FD7F80,d2
4452
                bne.s *
4453
 
4454
 
4455
*     LONG
4456
                move.l #$000000FF,d0    * Loop counter
4457
                moveq  #$00000000,d1    * Flag results accumulator
4458
                moveq  #$00000000,d2    * Data results accumulator
4459
                moveq  #$00000000,d3
4460
                moveq  #$00000000,d4
4461
                moveq  #$00000007,d5
4462
                moveq  #$00000000,d6
4463
                moveq  #$00000000,d7
4464
 
4465
SUBQ_LOOP3:     subq.l #1,d5
4466
                move.w SR,d6
4467
                andi.l #$1F,d6        * Isolate flags
4468
                add.l d6,d1           * Copy flag results into accumulator
4469
                add.l d5,d2           * Copy data results into data accumulator
4470
                dbf d0,SUBQ_LOOP3
4471
 
4472
                cmpi.l #$000007DD,d1
4473
                bne.s *
4474
                cmpi.l #$FFFF8680,d2
4475
                bne.s *
4476
 
4477
*     Check that Flags are not updated for Address registers
4478
                move.l #$0001FFFF,a0
4479
                move #$00,CCR         * Clear flags
4480
                subq.w #$7,a0
4481
                bcs.s *
4482
 
4483
                rts
4484
 
4485
 
4486
 
4487
 
4488
*-----------------------------------------------------------
4489
*-----------------------------------------------------------
4490
* OPCODE : MOVEQ
4491
*-----------------------------------------------------------
4492
*-----------------------------------------------------------
4493
 
4494
op_MOVEQ:
4495
                moveq  #$00000000,d0
4496
                moveq #$0,d0
4497
                bne.s *
4498
                cmpi.l #$00000000,d0
4499
                bne.s *
4500
 
4501
                moveq  #$00000000,d0
4502
                moveq #-128,d0
4503
                beq.s *
4504
                bpl.s *
4505
                cmpi.l #$FFFFFF80,d0
4506
                bne.s *
4507
 
4508
 
4509
                rts
4510
 
4511
 
4512
*-----------------------------------------------------------
4513
*-----------------------------------------------------------
4514
* OPCODE : DIVU
4515
*-----------------------------------------------------------
4516
*-----------------------------------------------------------
4517
 
4518
op_DIVU:
4519
 
4520
                move.l #$a5a5a5a5,d0        * Initial Numerator
4521
                move.l #$00005a5a,d1        * Initial Divisor
4522
                move.l #$a5a5a5a5,d2
4523
                moveq  #$00000000,d3
4524
                moveq  #$00000000,d4        * Cumulative data results
4525
                moveq  #$00000000,d5       * Cumulative flag results
4526
                move.l #$0000000E,d6       * Inner loop counter
4527
                move.l #$0000001E,d7       * Outer loop counter
4528
 
4529
 
4530
DIVU_OUTER1:    divu d1,d0               * !! Easy68K C not always cleared
4531
                move.w SR,d3
4532
                andi.l #$0C,d3            * Isolate flags
4533
                add.l d3,d5               * Copy flag results into accumulator
4534
                add.l d0,d4               * Copy data results into data accumulator
4535
                lsr.l #$1,d1
4536
 
4537
                dbf d6,DIVU_OUTER1
4538
                lsr.l #$1,d2
4539
                move.l d2,d0
4540
                move.l #$00005a5a,d1       * Initial Divisor
4541
                move.l #$0000000E,d6       * Inner loop counter
4542
                dbf d7,DIVU_OUTER1
4543
 
4544
                cmpi.l #$92FEDB89,d4      * Check the data results
4545
                bne.s *
4546
 
4547
                cmpi.l #$00000110,d5      * Check the Flag results
4548
                bne.s *
4549
 
4550
 
4551
                rts
4552
 
4553
 
4554
 
4555
*-----------------------------------------------------------
4556
*-----------------------------------------------------------
4557
* OPCODE : DIVS
4558
*-----------------------------------------------------------
4559
*-----------------------------------------------------------
4560
 
4561
op_DIVS:
4562
 
4563
                move.l #$a5a5a5a5,d0        * Initial Numerator
4564
                move.l #$00005a5a,d1        * Initial Divisor
4565
                move.l #$a5a5a5a5,d2
4566
                moveq  #$00000000,d3
4567
                moveq  #$00000000,d4        * Cumulative data results
4568
                moveq  #$00000000,d5       * Cumulative flag results
4569
                move.l #$0000000E,d6       * Inner loop counter
4570
                move.l #$0000001E,d7       * Outer loop counter
4571
 
4572
 
4573
DIVS_OUTER1:    divs d1,d0               * !! Easy68K C not always cleared
4574
                move.w SR,d3
4575
                andi.l #$0C,d3            * Isolate flags
4576
                add.l d3,d5               * Copy flag results into accumulator
4577
                add.l d0,d4               * Copy data results into data accumulator
4578
                lsr.l #$1,d1
4579
 
4580
                dbf d6,DIVS_OUTER1
4581
                lsr.l #$1,d2
4582
                move.l d2,d0
4583
                move.l #$00005a5a,d1       * Initial Divisor
4584
                move.l #$0000000E,d6       * Inner loop counter
4585
                dbf d7,DIVS_OUTER1
4586
 
4587
                cmpi.l #$4EC5D057,d4      * Check the data results
4588
                bne.s *
4589
 
4590
                cmpi.l #$00000038,d5      * Check the Flag results
4591
                bne.s *
4592
 
4593
 
4594
                rts
4595
 
4596
 
4597
 
4598
*-----------------------------------------------------------
4599
*-----------------------------------------------------------
4600
* OPCODE : OR
4601
*-----------------------------------------------------------
4602
*-----------------------------------------------------------
4603
 
4604
op_OR:
4605
 
4606
*  *  to Register
4607
 
4608
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
4609
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4610
                move.l #$a5a5a5a5,d2
4611
                moveq  #$00000000,d3
4612
                moveq  #$00000000,d4       * Cumulative data results
4613
                moveq  #$00000000,d5       * Cumulative flag results
4614
                move.l #$0000001E,d6       * Inner loop counter
4615
                move.l #$0000001E,d7       * Outer loop counter
4616
                move.l #$00000100,a0       * Address for memory EA operations
4617
 
4618
 
4619
OR_OUTER1:
4620
 
4621
*     BYTE
4622
                move.l d1,(a0)
4623
                or.b (a0),d0
4624
                move.w SR,d3
4625
                andi.l #$0C,d3            * Isolate flags
4626
                add.l d3,d5               * Copy flag results into accumulator
4627
                add.l d0,d4               * Copy data results into data accumulator
4628
 
4629
*     WORD
4630
                move.l d1,(a0)
4631
                or.w (a0),d0
4632
                move.w SR,d3
4633
                andi.l #$0C,d3            * Isolate flags
4634
                add.l d3,d5               * Copy flag results into accumulator
4635
                add.l d0,d4               * Copy data results into data accumulator
4636
 
4637
*     LONG
4638
                move.l d1,(a0)
4639
                or.l (a0),d0
4640
                move.w SR,d3
4641
                andi.l #$0F,d3            * Isolate flags
4642
                add.l d3,d5               * Copy flag results into accumulator
4643
                add.l d0,d4               * Copy data results into data accumulator
4644
 
4645
 
4646
                lsr.l #$1,d1
4647
                dbf d6,OR_OUTER1
4648
                lsr.l #$1,d2
4649
                move.l #$8167E123,d1       * Initial Data-Y
4650
                move.l #$0000001E,d6       * Inner loop counter
4651
                dbf d7,OR_OUTER1
4652
 
4653
                cmpi.l #$76EAC803,d4      * Check the data results
4654
                bne.s *
4655
                cmpi.l #$00005A18,d5      * Check the Flag results
4656
                bne.s *
4657
 
4658
 
4659
*  * Register to 
4660
 
4661
                move.l #$86738374,d0       * Initial Data-X  Inner loop
4662
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
4663
                move.l #$86738374,d2
4664
                moveq  #$00000000,d3
4665
                moveq  #$00000000,d4       * Cumulative data results
4666
                moveq  #$00000000,d5       * Cumulative flag results
4667
                move.l #$0000001E,d6       * Inner loop counter
4668
                move.l #$0000001D,d7       * Outer loop counter
4669
                move.l #$00000100,a0       * Address for memory EA operations
4670
 
4671
 
4672
OR_OUTER2:
4673
 
4674
*     BYTE
4675
                move.l d0,(a0)
4676
                or.b d1,(a0)
4677
                move.w SR,d3
4678
                andi.l #$0C,d3            * Isolate flags
4679
                add.l d3,d5               * Copy flag results into accumulator
4680
                add.l (a0),d4             * Copy data results into data accumulator
4681
 
4682
*     WORD
4683
                move.l d0,(a0)
4684
                or.w d1,(a0)
4685
                move.w SR,d3
4686
                andi.l #$0C,d3            * Isolate flags
4687
                add.l d3,d5               * Copy flag results into accumulator
4688
                add.l (a0),d4             * Copy data results into data accumulator
4689
 
4690
*     LONG
4691
                move.l d0,(a0)
4692
                or.l d1,(a0)
4693
                move.w SR,d3
4694
                andi.l #$0F,d3            * Isolate flags
4695
                add.l d3,d5               * Copy flag results into accumulator
4696
                add.l (a0),d4             * Copy data results into data accumulator
4697
 
4698
 
4699
                lsr.l #$1,d1
4700
                dbf d6,OR_OUTER2
4701
                lsr.l #$1,d2
4702
                move.l #$8167E123,d1       * Initial Data-Y
4703
                move.l #$0000001E,d6       * Inner loop counter
4704
                dbf d7,OR_OUTER2
4705
 
4706
                cmpi.l #$FA82B9E4,d4      * Check the data results
4707
                bne.s *
4708
                cmpi.l #$00005730,d5      * Check the Flag results
4709
                bne.s *
4710
 
4711
 
4712
                rts
4713
 
4714
 
4715
 
4716
*-----------------------------------------------------------
4717
*-----------------------------------------------------------
4718
* OPCODE : AND
4719
*-----------------------------------------------------------
4720
*-----------------------------------------------------------
4721
 
4722
op_AND:
4723
 
4724
*  *  to Register
4725
 
4726
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
4727
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4728
                move.l #$a5a5a5a5,d2
4729
                moveq  #$00000000,d3
4730
                moveq  #$00000000,d4       * Cumulative data results
4731
                moveq  #$00000000,d5       * Cumulative flag results
4732
                move.l #$0000001E,d6       * Inner loop counter
4733
                move.l #$0000001E,d7       * Outer loop counter
4734
                move.l #$00000100,a0       * Address for memory EA operations
4735
 
4736
 
4737
AND_OUTER1:
4738
 
4739
*     BYTE
4740
                move.l d1,(a0)
4741
                and.b (a0),d0
4742
                move.w sr,d3
4743
                andi.l #$0C,d3            * Isolate flags
4744
                add.l d3,d5               * Copy flag results into accumulator
4745
                add.l d0,d4               * Copy data results into data accumulator
4746
 
4747
*     WORD
4748
                move.l d1,(a0)
4749
                and.w (a0),d0
4750
                move.w sr,d3
4751
                andi.l #$0C,d3            * Isolate flags
4752
                add.l d3,d5               * Copy flag results into accumulator
4753
                add.l d0,d4               * Copy data results into data accumulator
4754
 
4755
*     LONG
4756
                move.l d1,(a0)
4757
                and.l (a0),d0
4758
                move.w sr,d3
4759
                andi.l #$0F,d3            * Isolate flags
4760
                add.l d3,d5               * Copy flag results into accumulator
4761
                add.l d0,d4               * Copy data results into data accumulator
4762
 
4763
 
4764
                lsr.l #$1,d1
4765
                dbf d6,AND_OUTER1
4766
                lsr.l #$1,d2
4767
                move.l #$8167E123,d1       * Initial Data-Y
4768
                move.l #$0000001E,d6       * Inner loop counter
4769
                dbf d7,AND_OUTER1
4770
 
4771
                cmpi.l #$CF212883,d4      * Check the data results
4772
                bne.s *
4773
                cmpi.l #$00002D10,d5      * Check the Flag results
4774
                bne.s *
4775
 
4776
 
4777
*  * Register to 
4778
 
4779
                move.l #$86738374,d0       * Initial Data-X  Inner loop
4780
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
4781
                move.l #$86738374,d2
4782
                moveq  #$00000000,d3
4783
                moveq  #$00000000,d4       * Cumulative data results
4784
                moveq  #$00000000,d5       * Cumulative flag results
4785
                move.l #$0000001E,d6       * Inner loop counter
4786
                move.l #$0000001D,d7       * Outer loop counter
4787
                move.l #$00000100,a0       * Address for memory EA operations
4788
 
4789
 
4790
AND_OUTER2:
4791
 
4792
*     BYTE
4793
                move.l d0,(a0)
4794
                and.b d1,(a0)
4795
                move.w sr,d3
4796
                andi.l #$0C,d3            * Isolate flags
4797
                add.l d3,d5               * Copy flag results into accumulator
4798
                add.l (a0),d4             * Copy data results into data accumulator
4799
 
4800
*     WORD
4801
                move.l d0,(a0)
4802
                and.w d1,(a0)
4803
                move.w sr,d3
4804
                andi.l #$0C,d3            * Isolate flags
4805
                add.l d3,d5               * Copy flag results into accumulator
4806
                add.l (a0),d4             * Copy data results into data accumulator
4807
 
4808
*     LONG
4809
                move.l d0,(a0)
4810
                and.l d1,(a0)
4811
                move.w sr,d3
4812
                andi.l #$0F,d3            * Isolate flags
4813
                add.l d3,d5               * Copy flag results into accumulator
4814
                add.l (a0),d4             * Copy data results into data accumulator
4815
 
4816
 
4817
                lsr.l #$1,d1
4818
                dbf d6,AND_OUTER2
4819
                lsr.l #$1,d2
4820
                move.l #$8167E123,d1       * Initial Data-Y
4821
                move.l #$0000001E,d6       * Inner loop counter
4822
                dbf d7,AND_OUTER2
4823
 
4824
                cmpi.l #$4A3DE544,d4      * Check the data results
4825
                bne.s *
4826
                cmpi.l #$000018E8,d5      * Check the Flag results
4827
                bne.s *
4828
 
4829
 
4830
                rts
4831
 
4832
 
4833
 
4834
*-----------------------------------------------------------
4835
*-----------------------------------------------------------
4836
* OPCODE : EOR
4837
*-----------------------------------------------------------
4838
*-----------------------------------------------------------
4839
 
4840
op_EOR:
4841
 
4842
*  * Register to 
4843
 
4844
                move.l #$86738374,d0       * Initial Data-X  Inner loop
4845
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
4846
                move.l #$86738374,d2
4847
                moveq  #$00000000,d3
4848
                moveq  #$00000000,d4       * Cumulative data results
4849
                moveq  #$00000000,d5       * Cumulative flag results
4850
                move.l #$0000001E,d6       * Inner loop counter
4851
                move.l #$0000001D,d7       * Outer loop counter
4852
                move.l #$00000100,a0       * Address for memory EA operations
4853
 
4854
 
4855
EOR_OUTER2:
4856
 
4857
*     BYTE
4858
                move.l d0,(a0)
4859
                eor.b d1,(a0)
4860
                move.w sr,d3
4861
                andi.l #$0C,d3            * Isolate flags
4862
                add.l d3,d5               * Copy flag results into accumulator
4863
                add.l (a0),d4             * Copy data results into data accumulator
4864
 
4865
*     WORD
4866
                move.l d0,(a0)
4867
                eor.w d1,(a0)
4868
                move.w sr,d3
4869
                andi.l #$0C,d3            * Isolate flags
4870
                add.l d3,d5               * Copy flag results into accumulator
4871
                add.l (a0),d4             * Copy data results into data accumulator
4872
 
4873
*     LONG
4874
                move.l d0,(a0)
4875
                eor.l d1,(a0)
4876
                move.w sr,d3
4877
                andi.l #$0F,d3            * Isolate flags
4878
                add.l d3,d5               * Copy flag results into accumulator
4879
                add.l (a0),d4             * Copy data results into data accumulator
4880
 
4881
 
4882
                lsr.l #$1,d1
4883
                dbf d6,EOR_OUTER2
4884
                lsr.l #$1,d2
4885
                move.l #$8167E123,d1       * Initial Data-Y
4886
                move.l #$0000001E,d6       * Inner loop counter
4887
                dbf d7,EOR_OUTER2
4888
 
4889
                cmpi.l #$55C5EB70,d4      * Check the data results
4890
                bne.s *
4891
                cmpi.l #$00004430,d5      * Check the Flag results
4892
                bne.s *
4893
 
4894
 
4895
                rts
4896
 
4897
 
4898
*-----------------------------------------------------------
4899
*-----------------------------------------------------------
4900
* OPCODE : CMP
4901
*-----------------------------------------------------------
4902
*-----------------------------------------------------------
4903
 
4904
op_CMP:
4905
 
4906
 
4907
*  *  to Register
4908
 
4909
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
4910
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4911
                move.l #$a5a5a5a5,d2
4912
                moveq  #$00000000,d3
4913
                moveq  #$00000000,d4       * Cumulative data results
4914
                moveq  #$00000000,d5       * Cumulative flag results
4915
                move.l #$0000001E,d6       * Inner loop counter
4916
                move.l #$0000001E,d7       * Outer loop counter
4917
                move.l #$00000100,a0       * Address for memory EA operations
4918
 
4919
 
4920
CMP_OUTER1:
4921
 
4922
*     BYTE
4923
                move.l d1,(a0)
4924
                cmp.b (a0),d0
4925
                move.w sr,d3
4926
                andi.l #$0F,d3            * Isolate flags
4927
                add.l d3,d5               * Copy flag results into accumulator
4928
                add.l d0,d4               * Copy data results into data accumulator
4929
 
4930
*     WORD
4931
                move.l d1,(a0)
4932
                cmp.w (a0),d0
4933
                move.w sr,d3
4934
                andi.l #$0F,d3            * Isolate flags
4935
                add.l d3,d5               * Copy flag results into accumulator
4936
                add.l d0,d4               * Copy data results into data accumulator
4937
 
4938
*     LONG
4939
                move.l d1,(a0)
4940
                cmp.l (a0),d0
4941
                move.w sr,d3
4942
                andi.l #$0F,d3            * Isolate flags
4943
                add.l d3,d5               * Copy flag results into accumulator
4944
                add.l d0,d4               * Copy data results into data accumulator
4945
 
4946
 
4947
                lsr.l #$1,d1
4948
                dbf d6,CMP_OUTER1
4949
                lsr.l #$1,d2
4950
                move.l #$8167E123,d1       * Initial Data-Y
4951
                move.l #$0000001E,d6       * Inner loop counter
4952
                dbf d7,CMP_OUTER1
4953
 
4954
                cmpi.l #$7878712F,d4      * Check the data results
4955
                bne.s *
4956
                cmpi.l #$00005502,d5      * Check the Flag results
4957
                bne.s *
4958
 
4959
 
4960
 
4961
                rts
4962
 
4963
 
4964
*-----------------------------------------------------------
4965
*-----------------------------------------------------------
4966
* OPCODE : CMPA
4967
*-----------------------------------------------------------
4968
*-----------------------------------------------------------
4969
 
4970
op_CMPA:
4971
 
4972
 
4973
*  *  to Register
4974
 
4975
                move.l #$a5a5a5a5,a0       * Initial Data-X  Inner loop
4976
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
4977
                move.l #$a5a5a5a5,d2
4978
                moveq  #$00000000,d3
4979
                moveq  #$00000000,d4       * Cumulative data results
4980
                moveq  #$00000000,d5       * Cumulative flag results
4981
                move.l #$0000001E,d6       * Inner loop counter
4982
                move.l #$0000001E,d7       * Outer loop counter
4983
                move.l #$00000100,a1       * Address for memory EA operations
4984
 
4985
 
4986
CMPA_OUTER1:
4987
 
4988
 
4989
*     WORD
4990
                move.l d1,(a1)
4991
                cmpa.w (a1),a0
4992
                move.w sr,d3
4993
                andi.l #$0F,d3            * Isolate flags
4994
                add.l d3,d5               * Copy flag results into accumulator
4995
                add.l a0,d4               * Copy data results into data accumulator
4996
 
4997
*     LONG
4998
                move.l d1,(a1)
4999
                cmpa.l (a1),a0
5000
                move.w sr,d3
5001
                andi.l #$0F,d3            * Isolate flags
5002
                add.l d3,d5               * Copy flag results into accumulator
5003
                add.l a0,d4               * Copy data results into data accumulator
5004
 
5005
 
5006
                lsr.l #$1,d1
5007
                dbf d6,CMPA_OUTER1
5008
                lsr.l #$1,d2
5009
                move.l #$8167E123,d1       * Initial Data-Y
5010
                move.l #$0000001E,d6       * Inner loop counter
5011
                dbf d7,CMPA_OUTER1
5012
 
5013
                cmpi.l #$a5a5a0ca,d4      * Check the data results
5014
                bne.s *
5015
                cmpi.l #$00003A7D,d5      * Check the Flag results
5016
                bne.s *
5017
 
5018
 
5019
                rts
5020
 
5021
 
5022
 
5023
*-----------------------------------------------------------
5024
*-----------------------------------------------------------
5025
* OPCODE : CMPM
5026
*-----------------------------------------------------------
5027
*-----------------------------------------------------------
5028
 
5029
op_CMPM:
5030
 
5031
                move.l #$00000100,a0       * Address for Data-X
5032
                move.l #$00000200,a1       * Address for Data-Y
5033
                moveq  #$00000000,d0
5034
                moveq  #$00000000,d1
5035
                moveq  #$00000000,d2
5036
 
5037
                move.l #$11FF5580,(a0)+   * Populate test data
5038
                move.l #$1111FFFF,(a0)+   * Populate test data
5039
                move.l #$33333333,(a0)+   * Populate test data
5040
                move.l #$44444444,(a0)+   * Populate test data
5041
 
5042
                move.l #$80FF337F,(a1)+   * Populate test data
5043
                move.l #$FFFF1111,(a1)+   * Populate test data
5044
                move.l #$33333333,(a1)+   * Populate test data
5045
                move.l #$44444444,(a1)+   * Populate test data
5046
 
5047
                move.l #$00000100,a0       * Address for Data-X
5048
                move.l #$00000200,a1       * Address for Data-Y
5049
                move.l #$0000000F,d6       * Loop counter
5050
 
5051
CMPM_LOOP1:     cmpm.b (a0)+,(a1)+
5052
                move.w sr,d3
5053
                andi.l #$0F,d3            * Isolate flags
5054
                add.l d3,d0               * Copy flag results into accumulator
5055
                dbf d6,CMPM_LOOP1
5056
 
5057
 
5058
                move.l #$00000100,a0       * Address for Data-X
5059
                move.l #$00000200,a1       * Address for Data-Y
5060
                moveq  #$00000007,d6       * Loop counter
5061
 
5062
CMPM_LOOP2:     cmpm.w (a0)+,(a1)+
5063
                move.w sr,d3
5064
                andi.l #$0F,d3            * Isolate flags
5065
                add.l d3,d1               * Copy flag results into accumulator
5066
                dbf d6,CMPM_LOOP2
5067
 
5068
 
5069
                move.l #$00000100,a0       * Address for Data-X
5070
                move.l #$00000200,a1       * Address for Data-Y
5071
                moveq  #$00000003,d6       * Loop counter
5072
 
5073
CMPM_LOOP3:     cmpm.l (a0)+,(a1)+
5074
                move.w sr,d3
5075
                andi.l #$0F,d3            * Isolate flags
5076
                add.l d3,d2               * Copy flag results into accumulator
5077
                dbf d6,CMPM_LOOP3
5078
 
5079
 
5080
                cmpi.l #$0000004C,d0      * Check the data results
5081
                bne.s *
5082
                cmpi.l #$00000024,d1
5083
                bne.s *
5084
                cmpi.l #$00000012,d2
5085
                bne.s *
5086
 
5087
                rts
5088
 
5089
 
5090
*-----------------------------------------------------------
5091
*-----------------------------------------------------------
5092
* OPCODE : ADD
5093
*-----------------------------------------------------------
5094
*-----------------------------------------------------------
5095
 
5096
op_ADD:
5097
 
5098
 
5099
*  *  to Register
5100
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5101
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5102
                move.l #$a5a5a5a5,d2
5103
                moveq  #$00000000,d3
5104
                moveq  #$00000000,d4       * Cumulative data results
5105
                moveq  #$00000000,d5       * Cumulative flag results
5106
                move.l #$0000001E,d6       * Inner loop counter
5107
                move.l #$0000001E,d7       * Outer loop counter
5108
                move.l #$00000100,a0       * Address for memory EA operations
5109
 
5110
 
5111
ADD_OUTER1:
5112
 
5113
*     BYTE
5114
                move.l d1,(a0)
5115
                add.b (a0),d0
5116
                move.w sr,d3
5117
                andi.l #$1F,d3            * Isolate flags
5118
                add.l d3,d5               * Copy flag results into accumulator
5119
                add.l d0,d4               * Copy data results into data accumulator
5120
 
5121
*     WORD
5122
                move.l d1,(a0)
5123
                add.w (a0),d0
5124
                move.w sr,d3
5125
                andi.l #$0C,d3            * Isolate flags
5126
                add.l d3,d5               * Copy flag results into accumulator
5127
                add.l d0,d4               * Copy data results into data accumulator
5128
 
5129
*     LONG
5130
                move.l d1,(a0)
5131
                add.l (a0),d0
5132
                move.w sr,d3
5133
                andi.l #$0F,d3            * Isolate flags
5134
                add.l d3,d5               * Copy flag results into accumulator
5135
                add.l d0,d4               * Copy data results into data accumulator
5136
 
5137
 
5138
                ror.l #$1,d1
5139
                dbf d6,ADD_OUTER1
5140
                ror.l #$1,d2
5141
                move.l #$8167E123,d1       * Initial Data-Y
5142
                move.l #$0000001E,d6       * Inner loop counter
5143
                dbf d7,ADD_OUTER1
5144
 
5145
                cmpi.l #$23ED428F,d4      * Check the data results
5146
                bne.s *
5147
                cmpi.l #$00004C96,d5      * Check the Flag results
5148
                bne.s *
5149
 
5150
 
5151
*  * Register to 
5152
                move.l #$86738374,d0       * Initial Data-X  Inner loop
5153
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
5154
                move.l #$86738374,d2
5155
                moveq  #$00000000,d3
5156
                moveq  #$00000000,d4       * Cumulative data results
5157
                moveq  #$00000000,d5       * Cumulative flag results
5158
                move.l #$0000001E,d6       * Inner loop counter
5159
                move.l #$0000001D,d7       * Outer loop counter
5160
                move.l #$00000100,a0       * Address for memory EA operations
5161
 
5162
 
5163
ADD_OUTER2:
5164
 
5165
*     BYTE
5166
                move.l d0,(a0)
5167
                add.b d1,(a0)
5168
                move.w sr,d3
5169
                andi.l #$0C,d3            * Isolate flags
5170
                add.l d3,d5               * Copy flag results into accumulator
5171
                add.l (a0),d4             * Copy data results into data accumulator
5172
 
5173
*     WORD
5174
                move.l d0,(a0)
5175
                add.w d1,(a0)
5176
                move.w sr,d3
5177
                andi.l #$1F,d3            * Isolate flags
5178
                add.l d3,d5               * Copy flag results into accumulator
5179
                add.l (a0),d4             * Copy data results into data accumulator
5180
 
5181
*     LONG
5182
                move.l d0,(a0)
5183
                add.l d1,(a0)
5184
                move.w sr,d3
5185
                andi.l #$0F,d3            * Isolate flags
5186
                add.l d3,d5               * Copy flag results into accumulator
5187
                add.l (a0),d4             * Copy data results into data accumulator
5188
 
5189
 
5190
                ror.l #$1,d1
5191
                dbf d6,ADD_OUTER2
5192
                ror.l #$1,d2
5193
                move.l #$8167E123,d1       * Initial Data-Y
5194
                move.l #$0000001E,d6       * Inner loop counter
5195
                dbf d7,ADD_OUTER2
5196
 
5197
                cmpi.l #$6701B884,d4      * Check the data results
5198
                bne.s *
5199
                cmpi.l #$00005467,d5      * Check the Flag results
5200
                bne.s *
5201
 
5202
                rts
5203
 
5204
*-----------------------------------------------------------
5205
*-----------------------------------------------------------
5206
* OPCODE : SUB
5207
*-----------------------------------------------------------
5208
*-----------------------------------------------------------
5209
 
5210
op_SUB:
5211
 
5212
*  *  to Register
5213
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5214
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5215
                move.l #$a5a5a5a5,d2
5216
                moveq  #$00000000,d3
5217
                moveq  #$00000000,d4       * Cumulative data results
5218
                moveq  #$00000000,d5       * Cumulative flag results
5219
                move.l #$0000001E,d6       * Inner loop counter
5220
                move.l #$0000001E,d7       * Outer loop counter
5221
                move.l #$00000100,a0       * Address for memory EA operations
5222
 
5223
 
5224
SUB_OUTER1:
5225
 
5226
*     BYTE
5227
                move.l d1,(a0)
5228
                sub.b (a0),d0
5229
                move.w sr,d3
5230
                andi.l #$1F,d3            * Isolate flags
5231
                add.l d3,d5               * Copy flag results into accumulator
5232
                add.l d0,d4               * Copy data results into data accumulator
5233
 
5234
*     WORD
5235
                move.l d1,(a0)
5236
                sub.w (a0),d0
5237
                move.w sr,d3
5238
                andi.l #$0C,d3            * Isolate flags
5239
                add.l d3,d5               * Copy flag results into accumulator
5240
                add.l d0,d4               * Copy data results into data accumulator
5241
 
5242
*     LONG
5243
                move.l d1,(a0)
5244
                sub.l (a0),d0
5245
                move.w sr,d3
5246
                andi.l #$0F,d3            * Isolate flags
5247
                add.l d3,d5               * Copy flag results into accumulator
5248
                add.l d0,d4               * Copy data results into data accumulator
5249
 
5250
 
5251
                ror.l #$1,d1
5252
                dbf d6,SUB_OUTER1
5253
                ror.l #$1,d2
5254
                move.l #$8167E123,d1       * Initial Data-Y
5255
                move.l #$0000001E,d6       * Inner loop counter
5256
                dbf d7,SUB_OUTER1
5257
 
5258
                cmpi.l #$1A8D14CF,d4      * Check the data results
5259
                bne.s *
5260
                cmpi.l #$00004FC4,d5      * Check the Flag results
5261
                bne.s *
5262
 
5263
 
5264
*  * Register to 
5265
                move.l #$86738374,d0       * Initial Data-X  Inner loop
5266
                move.l #$FC55F2FE,d1       * Initial Data-Y  Outer loop
5267
                move.l #$86738374,d2
5268
                moveq  #$00000000,d3
5269
                moveq  #$00000000,d4       * Cumulative data results
5270
                moveq  #$00000000,d5       * Cumulative flag results
5271
                move.l #$0000001E,d6       * Inner loop counter
5272
                move.l #$0000001D,d7       * Outer loop counter
5273
                move.l #$00000100,a0       * Address for memory EA operations
5274
 
5275
 
5276
SUB_OUTER2:
5277
 
5278
*     BYTE
5279
                move.l d0,(a0)
5280
                sub.b d1,(a0)
5281
                move.w sr,d3
5282
                andi.l #$0C,d3            * Isolate flags
5283
                add.l d3,d5               * Copy flag results into accumulator
5284
                add.l (a0),d4             * Copy data results into data accumulator
5285
 
5286
*     WORD
5287
                move.l d0,(a0)
5288
                sub.w d1,(a0)
5289
                move.w sr,d3
5290
                andi.l #$1F,d3            * Isolate flags
5291
                add.l d3,d5               * Copy flag results into accumulator
5292
                add.l (a0),d4             * Copy data results into data accumulator
5293
 
5294
*     LONG
5295
                move.l d0,(a0)
5296
                sub.l d1,(a0)
5297
                move.w sr,d3
5298
                andi.l #$0F,d3            * Isolate flags
5299
                add.l d3,d5               * Copy flag results into accumulator
5300
                add.l (a0),d4             * Copy data results into data accumulator
5301
 
5302
 
5303
                ror.l #$1,d1
5304
                dbf d6,SUB_OUTER2
5305
                ror.l #$1,d2
5306
                move.l #$8167E123,d1       * Initial Data-Y
5307
                move.l #$0000001E,d6       * Inner loop counter
5308
                dbf d7,SUB_OUTER2
5309
 
5310
                cmpi.l #$36D38BEC,d4      * Check the data results
5311
                bne.s *
5312
                cmpi.l #$000045A5,d5      * Check the Flag results
5313
                bne.s *
5314
 
5315
 
5316
 
5317
 
5318
                rts
5319
 
5320
 
5321
 
5322
*-----------------------------------------------------------
5323
*-----------------------------------------------------------
5324
* OPCODE : ADDA
5325
*-----------------------------------------------------------
5326
*-----------------------------------------------------------
5327
 
5328
op_ADDA:
5329
 
5330
*  *  to Register
5331
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5332
                move.l #$8167E123,d1
5333
                move.l #$a5a5a5a5,d2
5334
                moveq  #$00000000,d3
5335
                moveq  #$00000000,d4       * Cumulative data results
5336
                moveq  #$00000000,d5       * Cumulative flag results
5337
                move.l #$0000001E,d6       * Inner loop counter
5338
                move.l #$0000001E,d7       * Outer loop counter
5339
                move.l #$00000100,a0       * Address for memory EA operations
5340
                move.l #$8167E123,a1       * Initial Data-Y  Outer loop
5341
 
5342
ADDA_OUTER1:
5343
 
5344
*     WORD
5345
*                move.l d1,(a0)       * !!! Easy68K is not altering the whole 32-bits of the address register
5346
*                adda.w (a0),a1
5347
*                add.l a1,d4               * Copy data results into data accumulator
5348
 
5349
*     LONG
5350
                move.l d1,(a0)
5351
                adda.l (a0),a1
5352
                add.l a1,d4               * Copy data results into data accumulator
5353
 
5354
                ror.l #$1,d1
5355
                dbf d6,ADDA_OUTER1
5356
                ror.l #$1,d1
5357
                move.l d1,a1
5358
                move.l #$8167E123,d1       * Initial Data-Y
5359
                move.l #$0000001E,d6       * Inner loop counter
5360
                dbf d7,ADDA_OUTER1
5361
 
5362
                cmpi.l #$AC04DB4C,d4      * Check the data results
5363
                bne.s *
5364
 
5365
 
5366
                rts
5367
 
5368
 
5369
*-----------------------------------------------------------
5370
*-----------------------------------------------------------
5371
* OPCODE : SUBA
5372
*-----------------------------------------------------------
5373
*-----------------------------------------------------------
5374
 
5375
op_SUBA:
5376
 
5377
*  *  to Register
5378
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5379
                move.l #$8167E123,d1
5380
                move.l #$a5a5a5a5,d2
5381
                moveq  #$00000000,d3
5382
                moveq  #$00000000,d4       * Cumulative data results
5383
                moveq  #$00000000,d5       * Cumulative flag results
5384
                move.l #$0000001E,d6       * Inner loop counter
5385
                move.l #$0000001E,d7       * Outer loop counter
5386
                move.l #$00000100,a0       * Address for memory EA operations
5387
                move.l #$8167E123,a1       * Initial Data-Y  Outer loop
5388
 
5389
SUBA_OUTER1:
5390
 
5391
*     WORD
5392
*                move.l d1,(a0) * !!! Easy68K is not altering the whole 32-bits of the address register
5393
*                suba.w (a0),a1
5394
*                add.l a1,d4               * Copy data results into data accumulator
5395
 
5396
*     LONG
5397
                move.l d1,(a0)
5398
                suba.l (a0),a1
5399
                add.l a1,d4               * Copy data results into data accumulator
5400
 
5401
                ror.l #$1,d1
5402
                dbf d6,SUBA_OUTER1
5403
                ror.l #$1,d1
5404
                move.l d1,a1
5405
                move.l #$8167E123,d1       * Initial Data-Y
5406
                move.l #$0000001E,d6       * Inner loop counter
5407
                dbf d7,SUBA_OUTER1
5408
 
5409
                cmpi.l #$E1E36D7A,d4      * Check the data results
5410
                bne.s *
5411
 
5412
 
5413
                rts
5414
 
5415
 
5416
 
5417
*-----------------------------------------------------------
5418
*-----------------------------------------------------------
5419
* OPCODE : ADDX
5420
*-----------------------------------------------------------
5421
*-----------------------------------------------------------
5422
 
5423
op_ADDX:
5424
 
5425
 
5426
*  * Register to Register
5427
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5428
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5429
                move.l #$a5a5a5a5,d2
5430
                moveq  #$00000000,d3
5431
                moveq  #$00000000,d4       * Cumulative data results
5432
                moveq  #$00000000,d5       * Cumulative flag results
5433
                move.l #$0000001E,d6       * Inner loop counter
5434
                move.l #$0000001E,d7       * Outer loop counter
5435
                move.l #$00000100,a0       * Address for memory EA operations
5436
 
5437
 
5438
ADDX_OUTER1:
5439
 
5440
*     BYTE
5441
                move.l d2,d0
5442
                addx.b d1,d0
5443
                move.w sr,d3
5444
                andi.l #$1F,d3            * Isolate flags
5445
                add.l d3,d5               * Copy flag results into accumulator
5446
                add.l d0,d4               * Copy data results into data accumulator
5447
 
5448
*     WORD
5449
                move.l d2,d0
5450
                addx.w d1,d0
5451
                move.w sr,d3
5452
                andi.l #$1F,d3            * Isolate flags
5453
                add.l d3,d5               * Copy flag results into accumulator
5454
                add.l d0,d4               * Copy data results into data accumulator
5455
 
5456
*     LONG
5457
                move.l d2,d0
5458
                addx.l d1,d0
5459
                move.w sr,d3
5460
                andi.l #$1F,d3            * Isolate flags
5461
                add.l d3,d5               * Copy flag results into accumulator
5462
                add.l d0,d4               * Copy data results into data accumulator
5463
 
5464
                ror.l #$1,d1
5465
                dbf d6,ADDX_OUTER1
5466
                ror.l #$1,d2
5467
                move.l #$8167E123,d1       * Initial Data-Y
5468
                move.l #$0000001E,d6       * Inner loop counter
5469
                dbf d7,ADDX_OUTER1
5470
 
5471
                cmpi.l #$4E96A4D9,d4      * Check the data results
5472
                bne.s *
5473
                cmpi.l #$000085CD,d5      * Check the Flag results
5474
                bne.s *
5475
 
5476
 
5477
 
5478
*     -(An),-(An)
5479
 
5480
                moveq  #$00000000,d0       * BYTE Flag Results Accumulator
5481
                moveq  #$00000000,d1
5482
                moveq  #$00000000,d2
5483
                move.l #$00000100,a0       * Address for Data-X
5484
                move.l #$00000200,a1       * Address for Data-Y
5485
                move.l #$11FF5580,(a0)+   * Populate test data
5486
                move.l #$1111FFFF,(a0)+   * Populate test data
5487
                move.l #$33333333,(a0)+   * Populate test data
5488
                move.l #$44444444,(a0)+   * Populate test data
5489
                move.l #$80FF337F,(a1)+   * Populate test data
5490
                move.l #$FFFF1111,(a1)+   * Populate test data
5491
                move.l #$33333333,(a1)+   * Populate test data
5492
                move.l #$44444444,(a1)+   * Populate test data
5493
 
5494
 
5495
                move.l #$0000000F,d6       * Loop counter
5496
 
5497
ADDX_LOOP3:     addx.b -(a0),-(a1)
5498
                move.w sr,d3
5499
                andi.l #$0F,d3            * Isolate flags
5500
                add.l d3,d0               * Copy flag results into accumulator
5501
                add.b (a1),d1
5502
                dbf d6,ADDX_LOOP3
5503
 
5504
 
5505
                move.l #$00000110,a0       * Address for Data-X
5506
                move.l #$00000210,a1       * Address for Data-Y
5507
                moveq  #$00000007,d6       * Loop counter
5508
 
5509
ADDX_LOOP4:     addx.w -(a0),-(a1)
5510
                move.w sr,d3
5511
                andi.l #$0F,d3            * Isolate flags
5512
                add.l d3,d0               * Copy flag results into accumulator
5513
                add.w (a1),d1
5514
                dbf d6,ADDX_LOOP4
5515
 
5516
 
5517
                move.l #$00000110,a0       * Address for Data-X
5518
                move.l #$00000210,a1       * Address for Data-Y
5519
                moveq  #$00000003,d6       * Loop counter
5520
 
5521
ADDX_LOOP5:     addx.l -(a0),-(a1)
5522
                move.w sr,d3
5523
                andi.l #$0F,d3            * Isolate flags
5524
                add.l d3,d0               * Copy flag results into accumulator
5525
                add.l (a1),d1
5526
                dbf d6,ADDX_LOOP5
5527
 
5528
 
5529
                cmpi.l #$00000095,d0      * Check the flag results
5530
                bne.s *
5531
                cmpi.l #$C812A682,d1      * Check the data results
5532
                bne.s *
5533
 
5534
                rts
5535
 
5536
 
5537
 
5538
 
5539
*-----------------------------------------------------------
5540
*-----------------------------------------------------------
5541
* OPCODE : SUBX
5542
*-----------------------------------------------------------
5543
*-----------------------------------------------------------
5544
 
5545
op_SUBX:
5546
 
5547
 
5548
*  * Register to Register
5549
                move.l #$a5a5a5a5,d0       * Initial Data-X  Inner loop
5550
                move.l #$8167E123,d1       * Initial Data-Y  Outer loop
5551
                move.l #$a5a5a5a5,d2
5552
                moveq  #$00000000,d3
5553
                moveq  #$00000000,d4       * Cumulative data results
5554
                moveq  #$00000000,d5       * Cumulative flag results
5555
                move.l #$0000001E,d6       * Inner loop counter
5556
                move.l #$0000001E,d7       * Outer loop counter
5557
                move.l #$00000100,a0       * Address for memory EA operations
5558
 
5559
 
5560
SUBX_OUTER1:
5561
 
5562
*     BYTE
5563
                move.l d2,d0
5564
                subx.b d1,d0
5565
                move.w sr,d3
5566
                andi.l #$1F,d3            * Isolate flags
5567
                add.l d3,d5               * Copy flag results into accumulator
5568
                add.l d0,d4               * Copy data results into data accumulator
5569
 
5570
*     WORD
5571
                move.l d2,d0
5572
                subx.w d1,d0
5573
                move.w sr,d3
5574
                andi.l #$1F,d3            * Isolate flags
5575
                add.l d3,d5               * Copy flag results into accumulator
5576
                add.l d0,d4               * Copy data results into data accumulator
5577
 
5578
*     LONG
5579
                move.l d2,d0
5580
                subx.l d1,d0
5581
                move.w sr,d3
5582
                andi.l #$1F,d3            * Isolate flags
5583
                add.l d3,d5               * Copy flag results into accumulator
5584
                add.l d0,d4               * Copy data results into data accumulator
5585
 
5586
                ror.l #$1,d1
5587
                dbf d6,SUBX_OUTER1
5588
                ror.l #$1,d2
5589
                move.l #$8167E123,d1       * Initial Data-Y
5590
                move.l #$0000001E,d6       * Inner loop counter
5591
                dbf d7,SUBX_OUTER1
5592
 
5593
                cmpi.l #$FCAA913E,d4      * Check the data results
5594
                bne.s *
5595
                cmpi.l #$00007E89,d5      * Check the Flag results
5596
                bne.s *
5597
 
5598
 
5599
 
5600
*     -(An),-(An)
5601
 
5602
                moveq  #$00000000,d0       * BYTE Flag Results Accumulator
5603
                moveq  #$00000000,d1
5604
                moveq  #$00000000,d2
5605
                move.l #$00000100,a0       * Address for Data-X
5606
                move.l #$00000200,a1       * Address for Data-Y
5607
                move.l #$11FF5580,(a0)+   * Populate test data
5608
                move.l #$1111FFFF,(a0)+   * Populate test data
5609
                move.l #$80FF337F,(a0)+   * Populate test data
5610
                move.l #$44444444,(a0)+   * Populate test data
5611
                move.l #$80FF337F,(a1)+   * Populate test data
5612
                move.l #$1111FFFF,(a1)+   * Populate test data
5613
                move.l #$33333333,(a1)+   * Populate test data
5614
                move.l #$5580EECC,(a1)+   * Populate test data
5615
 
5616
 
5617
                move.l #$0000000F,d6       * Loop counter
5618
 
5619
SUBX_LOOP3:     subx.b -(a0),-(a1)
5620
                move.w sr,d3
5621
                andi.l #$0F,d3            * Isolate flags
5622
                add.l d3,d0               * Copy flag results into accumulator
5623
                add.b (a1),d1
5624
                dbf d6,SUBX_LOOP3
5625
 
5626
 
5627
                move.l #$00000110,a0       * Address for Data-X
5628
                move.l #$00000210,a1       * Address for Data-Y
5629
                moveq  #$00000007,d6       * Loop counter
5630
 
5631
SUBX_LOOP4:     subx.w -(a0),-(a1)
5632
                move.w sr,d3
5633
                andi.l #$0F,d3            * Isolate flags
5634
                add.l d3,d0               * Copy flag results into accumulator
5635
                add.w (a1),d1
5636
                dbf d6,SUBX_LOOP4
5637
 
5638
 
5639
                move.l #$00000110,a0       * Address for Data-X
5640
                move.l #$00000210,a1       * Address for Data-Y
5641
                moveq  #$00000003,d6       * Loop counter
5642
 
5643
SUBX_LOOP5:     subx.l -(a0),-(a1)
5644
                move.w sr,d3
5645
                andi.l #$0F,d3            * Isolate flags
5646
                add.l d3,d0               * Copy flag results into accumulator
5647
                add.l (a1),d1
5648
                dbf d6,SUBX_LOOP5
5649
 
5650
 
5651
                cmpi.l #$000000B1,d0      * Check the flag results
5652
                bne.s *
5653
                cmpi.l #$62C6F417,d1      * Check the data results
5654
                bne.s *
5655
 
5656
                rts
5657
 
5658
 
5659
*-----------------------------------------------------------
5660
*-----------------------------------------------------------
5661
* OPCODE : MULU
5662
*-----------------------------------------------------------
5663
*-----------------------------------------------------------
5664
 
5665
op_MULU:
5666
 
5667
                move.l #$FE805501,d0        * Initial
5668
                move.l #$5697EDB6,d1        * Initial Y
5669
                move.l #$FE805501,d2
5670
                moveq  #$00000000,d3
5671
                moveq  #$00000000,d4        * Cumulative data results
5672
                moveq  #$00000000,d5       * Cumulative flag results
5673
                move.l #$0000000E,d6       * Inner loop counter
5674
                move.l #$0000000E,d7       * Outer loop counter
5675
 
5676
 
5677
MULU_OUTER1:    mulu d1,d0
5678
                move.w sr,d3
5679
                andi.l #$0C,d3            * Isolate flags
5680
                add.l d3,d5               * Copy flag results into accumulator
5681
                add.l d0,d4               * Copy data results into data accumulator
5682
                ror.l #$1,d1
5683
 
5684
                dbf d6,MULU_OUTER1
5685
                ror.l #$1,d2
5686
                move.l d2,d0
5687
                move.l #$0000000E,d6       * Inner loop counter
5688
                dbf d7,MULU_OUTER1
5689
 
5690
                cmpi.l #$76FB988C,d4      * Check the data results
5691
                bne.s *
5692
 
5693
                cmpi.l #$00000170,d5      * Check the Flag results
5694
                bne.s *
5695
 
5696
 
5697
                rts
5698
 
5699
 
5700
*-----------------------------------------------------------
5701
*-----------------------------------------------------------
5702
* OPCODE : MULS
5703
*-----------------------------------------------------------
5704
*-----------------------------------------------------------
5705
 
5706
op_MULS:
5707
 
5708
                move.l #$FE805501,d0        * Initial
5709
                move.l #$5697EDB6,d1        * Initial Y
5710
                move.l #$FE805501,d2
5711
                moveq  #$00000000,d3
5712
                moveq  #$00000000,d4        * Cumulative data results
5713
                moveq  #$00000000,d5       * Cumulative flag results
5714
                move.l #$0000000E,d6       * Inner loop counter
5715
                move.l #$0000000E,d7       * Outer loop counter
5716
 
5717
 
5718
MULS_OUTER1:    muls d1,d0
5719
                move.w sr,d3
5720
                andi.l #$0C,d3            * Isolate flags
5721
                add.l d3,d5               * Copy flag results into accumulator
5722
                add.l d0,d4               * Copy data results into data accumulator
5723
                ror.l #$1,d1
5724
 
5725
                dbf d6,MULS_OUTER1
5726
                ror.l #$1,d2
5727
                move.l d2,d0
5728
                move.l #$0000000E,d6       * Inner loop counter
5729
                dbf d7,MULS_OUTER1
5730
 
5731
                cmpi.l #$D4E2988C,d4      * Check the data results
5732
                bne.s *
5733
 
5734
                cmpi.l #$000003E0,d5      * Check the Flag results
5735
                bne.s *
5736
 
5737
 
5738
                rts
5739
 
5740
 
5741
 
5742
*-----------------------------------------------------------
5743
*-----------------------------------------------------------
5744
* OPCODE : EXG
5745
*-----------------------------------------------------------
5746
*-----------------------------------------------------------
5747
 
5748
op_EXG:
5749
                move.l #$d1d1d1d1,d1
5750
                move.l #$d2d2d2d2,d2
5751
                move.l #$d3d3d3d3,d3
5752
                move.l #$a1a1a1a1,a1
5753
                move.l #$a2a2a2a2,a2
5754
                move.l #$a3a3a3a3,a3
5755
 
5756
                exg d1,d2
5757
                exg a1,a2
5758
                exg d3,a3
5759
 
5760
                cmpi.l #$d2d2d2d2,d1      * Check the results
5761
                bne.s *
5762
                cmpi.l #$d1d1d1d1,d2
5763
                bne.s *
5764
                cmpi.l #$a3a3a3a3,d3
5765
                bne.s *
5766
 
5767
                move.l a1,d1
5768
                move.l a2,d2
5769
                move.l a3,d3
5770
 
5771
                cmpi.l #$a2a2a2a2,d1
5772
                bne.s *
5773
                cmpi.l #$a1a1a1a1,d2
5774
                bne.s *
5775
                cmpi.l #$d3d3d3d3,d3
5776
                bne.s *
5777
 
5778
                rts
5779
 
5780
 
5781
*-----------------------------------------------------------
5782
*-----------------------------------------------------------
5783
* OPCODE : ROx
5784
*-----------------------------------------------------------
5785
*-----------------------------------------------------------
5786
 
5787
*     Subroutine to check and accumulate the flags
5788
ROx_FLAGS:      move.w sr,d3
5789
                andi.l #$0F,d3            * Isolate flags
5790
                add.l d3,d5               * Copy flag results into accumulator
5791
                rts
5792
 
5793
op_ROx:
5794
 
5795
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
5796
 
5797
*        BYTE LEFT
5798
                move.l #$80018FF1,d0
5799
                moveq  #$00000000,d5
5800
                moveq  #$00000011,d6
5801
ROx_LOOP1:
5802
                rol.b d6,d0
5803
                bsr ROx_FLAGS
5804
                dbf d6,ROx_LOOP1
5805
                cmpi.l #$80018FE3,d0
5806
                bne.s *
5807
                cmpi.l #$0000006B,d5
5808
                bne.s *
5809
 
5810
*        BYTE RIGHT
5811
                move.l #$80018FF1,d0
5812
                moveq  #$00000012,d6
5813
ROx_LOOP2:
5814
                ror.b d6,d0
5815
                bsr ROx_FLAGS
5816
                dbf d6,ROx_LOOP2
5817
                cmpi.l #$80018F3E,d0
5818
                bne.s *
5819
                cmpi.l #$000000C5,d5
5820
                bne.s *
5821
 
5822
 
5823
*        WORD LEFT
5824
                move.l #$80018FF1,d0
5825
                moveq  #$00000013,d6
5826
ROx_LOOP3:
5827
                rol.w d6,d0
5828
                bsr ROx_FLAGS
5829
                dbf d6,ROx_LOOP3
5830
                cmpi.l #$800163FC,d0
5831
                bne.s *
5832
                cmpi.l #$00000131,d5
5833
                bne.s *
5834
 
5835
*        WORD RIGHT
5836
                move.l #$80018FF1,d0
5837
                move.l #$0000001E,d6
5838
ROx_LOOP4:
5839
                ror.w d6,d0
5840
                bsr ROx_FLAGS
5841
                dbf d6,ROx_LOOP4
5842
                cmpi.l #$8001C7F8,d0
5843
                bne.s *
5844
                cmpi.l #$000001DB,d5
5845
                bne.s *
5846
 
5847
 
5848
*        LONG LEFT
5849
                move.l #$80018FF1,d0
5850
                moveq  #$00000015,d6
5851
ROx_LOOP5:
5852
                rol.l d6,d0
5853
                bsr ROx_FLAGS
5854
                dbf d6,ROx_LOOP5
5855
                cmpi.l #$00C7F8C0,d0
5856
                bne.s *
5857
                cmpi.l #$0000021A,d5
5858
                bne.s *
5859
 
5860
*        LONG RIGHT
5861
                move.l #$80018FF1,d0
5862
                moveq  #$00000016,d6
5863
ROx_LOOP6:
5864
                ror.l d6,d0
5865
                bsr ROx_FLAGS
5866
                dbf d6,ROx_LOOP6
5867
                cmpi.l #$000C7F8C,d0
5868
                bne.s *
5869
                cmpi.l #$00000250,d5
5870
                bne.s *
5871
 
5872
 
5873
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
5874
 
5875
                move.l #$80018FF1,d0
5876
                moveq  #$00000000,d5
5877
 
5878
*        BYTE LEFT
5879
                rol.b #1,d0
5880
                bsr ROx_FLAGS
5881
                rol.b #5,d0
5882
                bsr ROx_FLAGS
5883
                rol.b #7,d0
5884
                bsr ROx_FLAGS
5885
                rol.b #8,d0
5886
                bsr ROx_FLAGS
5887
                cmpi.l #$80018F3E,d0
5888
                bne.s *
5889
                cmpi.l #$00000009,d5
5890
                bne.s *
5891
 
5892
*        BYTE RIGHT
5893
                ror.b #1,d0
5894
                bsr ROx_FLAGS
5895
                ror.b #5,d0
5896
                bsr ROx_FLAGS
5897
                ror.b #7,d0
5898
                bsr ROx_FLAGS
5899
                ror.b #8,d0
5900
                bsr ROx_FLAGS
5901
                cmpi.l #$80018FF1,d0
5902
                bne.s *
5903
                cmpi.l #$00000024,d5
5904
                bne.s *
5905
 
5906
*        WORD LEFT
5907
                rol.w #1,d0
5908
                bsr ROx_FLAGS
5909
                rol.w #5,d0
5910
                bsr ROx_FLAGS
5911
                rol.w #7,d0
5912
                bsr ROx_FLAGS
5913
                rol.w #8,d0
5914
                bsr ROx_FLAGS
5915
                cmpi.l #$8001FE31,d0
5916
                bne.s *
5917
                cmpi.l #$00000037,d5
5918
                bne.s *
5919
 
5920
*        WORD RIGHT
5921
                ror.w #1,d0
5922
                bsr ROx_FLAGS
5923
                ror.w #5,d0
5924
                bsr ROx_FLAGS
5925
                ror.w #7,d0
5926
                bsr ROx_FLAGS
5927
                ror.w #8,d0
5928
                bsr ROx_FLAGS
5929
                cmpi.l #$80018FF1,d0
5930
                bne.s *
5931
                cmpi.l #$0000005B,d5
5932
                bne.s *
5933
 
5934
*        LONG LEFT
5935
                rol.l #1,d0
5936
                bsr ROx_FLAGS
5937
                rol.l #5,d0
5938
                bsr ROx_FLAGS
5939
                rol.l #7,d0
5940
                bsr ROx_FLAGS
5941
                rol.l #8,d0
5942
                bsr ROx_FLAGS
5943
                cmpi.l #$FE300031,d0
5944
                bne.s *
5945
                cmpi.l #$00000065,d5
5946
                bne.s *
5947
 
5948
*        LONG RIGHT
5949
                ror.l #1,d0
5950
                bsr ROx_FLAGS
5951
                ror.l #5,d0
5952
                bsr ROx_FLAGS
5953
                ror.l #7,d0
5954
                bsr ROx_FLAGS
5955
                ror.l #8,d0
5956
                bsr ROx_FLAGS
5957
                cmpi.l #$80018FF1,d0
5958
                bne.s *
5959
                cmpi.l #$00000080,d5
5960
                bne.s *
5961
 
5962
 
5963
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
5964
 
5965
                moveq  #$00000000,d5
5966
                move.l #$00000100,a0
5967
                move.w #$8FF1,(a0)
5968
 
5969
*        WORD LEFT
5970
                rol (a0)
5971
                bsr ROx_FLAGS
5972
                rol (a0)
5973
                bsr ROx_FLAGS
5974
                rol (a0)
5975
                bsr ROx_FLAGS
5976
                rol (a0)
5977
                bsr ROx_FLAGS
5978
                move.w (a0),d0
5979
                cmpi.l #$8001FF18,d0
5980
                bne.s *
5981
                cmpi.l #$00000009,d5
5982
                bne.s *
5983
 
5984
*        WORD RIGHT
5985
                ror (a0)
5986
                bsr ROx_FLAGS
5987
                ror (a0)
5988
                bsr ROx_FLAGS
5989
                ror (a0)
5990
                bsr ROx_FLAGS
5991
                ror (a0)
5992
                bsr ROx_FLAGS
5993
                ror (a0)
5994
                bsr ROx_FLAGS
5995
                ror (a0)
5996
                bsr ROx_FLAGS
5997
                move.w (a0),d0
5998
                cmpi.l #$800163FC,d0
5999
                bne.s *
6000
                cmpi.l #$0000001B,d5
6001
                bne.s *
6002
 
6003
                rts
6004
 
6005
 
6006
 
6007
*-----------------------------------------------------------
6008
*-----------------------------------------------------------
6009
* OPCODE : ROXx
6010
*-----------------------------------------------------------
6011
*-----------------------------------------------------------
6012
 
6013
*     Subroutine to check and accumulate the flags
6014
ROXx_FLAGS:     move.w sr,d3
6015
                andi.l #$0F,d3            * Isolate flags
6016
                add.l d3,d5               * Copy flag results into accumulator
6017
                rts
6018
 
6019
op_ROXx:
6020
 
6021
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
6022
 
6023
*        BYTE LEFT
6024
                move.l #$80018FF1,d0
6025
                moveq  #$00000000,d5
6026
                moveq  #$00000011,d6
6027
ROXx_LOOP1:
6028
                roxl.b d6,d0
6029
                bsr ROXx_FLAGS
6030
                dbf d6,ROXx_LOOP1
6031
                cmpi.l #$80018FD0,d0
6032
                bne.s *
6033
                cmpi.l #$00000042,d5
6034
                bne.s *
6035
 
6036
*        BYTE RIGHT
6037
                move.l #$80018FF1,d0
6038
                moveq  #$00000012,d6
6039
ROXx_LOOP2:
6040
                roxr.b d6,d0
6041
                bsr ROXx_FLAGS
6042
                dbf d6,ROXx_LOOP2
6043
                cmpi.l #$80018F51,d0
6044
                bne.s *
6045
                cmpi.l #$0000009C,d5
6046
                bne.s *
6047
 
6048
 
6049
*        WORD LEFT
6050
                move.l #$80018FF1,d0
6051
                moveq  #$00000013,d6
6052
ROXx_LOOP3:
6053
                roxl.w d6,d0
6054
                bsr ROXx_FLAGS
6055
                dbf d6,ROXx_LOOP3
6056
                cmpi.l #$80013980,d0
6057
                bne.s *
6058
                cmpi.l #$000000C9,d5
6059
                bne.s *
6060
 
6061
*        WORD RIGHT
6062
                move.l #$80018FF1,d0
6063
                move.l #$0000001E,d6
6064
ROXx_LOOP4:
6065
                roxr.w d6,d0
6066
                bsr ROXx_FLAGS
6067
                dbf d6,ROXx_LOOP4
6068
                cmpi.l #$80010A1D,d0
6069
                bne.s *
6070
                cmpi.l #$0000014D,d5
6071
                bne.s *
6072
 
6073
 
6074
*        LONG LEFT
6075
                move.l #$80018FF1,d0
6076
                moveq  #$00000015,d6
6077
ROXx_LOOP5:
6078
                roxl.l d6,d0
6079
                bsr ROXx_FLAGS
6080
                dbf d6,ROXx_LOOP5
6081
                cmpi.l #$800185D0,d0
6082
                bne.s *
6083
                cmpi.l #$000001A1,d5
6084
                bne.s *
6085
 
6086
*        LONG RIGHT
6087
                move.l #$80018FF1,d0
6088
                moveq  #$00000016,d6
6089
ROXx_LOOP6:
6090
                roxr.l d6,d0
6091
                bsr ROXx_FLAGS
6092
                dbf d6,ROXx_LOOP6
6093
                cmpi.l #$082D8200,d0
6094
                bne.s *
6095
                cmpi.l #$000001DE,d5
6096
                bne.s *
6097
 
6098
 
6099
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
6100
 
6101
                move.l #$80018FF1,d0
6102
                moveq  #$00000000,d5
6103
 
6104
*        BYTE LEFT
6105
                roxl.b #1,d0
6106
                bsr ROXx_FLAGS
6107
                roxl.b #5,d0
6108
                bsr ROXx_FLAGS
6109
                roxl.b #7,d0
6110
                bsr ROXx_FLAGS
6111
                roxl.b #8,d0
6112
                bsr ROXx_FLAGS
6113
                cmpi.l #$80018F09,d0
6114
                bne.s *
6115
                cmpi.l #$0000000B,d5
6116
                bne.s *
6117
 
6118
*        BYTE RIGHT
6119
                roxr.b #1,d0
6120
                bsr ROXx_FLAGS
6121
                roxr.b #5,d0
6122
                bsr ROXx_FLAGS
6123
                roxr.b #7,d0
6124
                bsr ROXx_FLAGS
6125
                roxr.b #8,d0
6126
                bsr ROXx_FLAGS
6127
                cmpi.l #$80018F00,d0
6128
                bne.s *
6129
                cmpi.l #$00000015,d5
6130
                bne.s *
6131
 
6132
*        WORD LEFT
6133
                roxl.w #1,d0
6134
                bsr ROXx_FLAGS
6135
                roxl.w #5,d0
6136
                bsr ROXx_FLAGS
6137
                roxl.w #7,d0
6138
                bsr ROXx_FLAGS
6139
                roxl.w #8,d0
6140
                bsr ROXx_FLAGS
6141
                cmpi.l #$8001B000,d0
6142
                bne.s *
6143
                cmpi.l #$00000027,d5
6144
                bne.s *
6145
 
6146
*        WORD RIGHT
6147
                roxr.w #1,d0
6148
                bsr ROXx_FLAGS
6149
                roxr.w #5,d0
6150
                bsr ROXx_FLAGS
6151
                roxr.w #7,d0
6152
                bsr ROXx_FLAGS
6153
                roxr.w #8,d0
6154
                bsr ROXx_FLAGS
6155
                cmpi.l #$80010A00,d0
6156
                bne.s *
6157
                cmpi.l #$00000028,d5
6158
                bne.s *
6159
 
6160
*        LONG LEFT
6161
                roxl.l #1,d0
6162
                bsr ROXx_FLAGS
6163
                roxl.l #5,d0
6164
                bsr ROXx_FLAGS
6165
                roxl.l #7,d0
6166
                bsr ROXx_FLAGS
6167
                roxl.l #8,d0
6168
                bsr ROXx_FLAGS
6169
                cmpi.l #$40000010,d0
6170
                bne.s *
6171
                cmpi.l #$0000002A,d5
6172
                bne.s *
6173
 
6174
*        LONG RIGHT
6175
                roxr.l #1,d0
6176
                bsr ROXx_FLAGS
6177
                roxr.l #5,d0
6178
                bsr ROXx_FLAGS
6179
                roxr.l #7,d0
6180
                bsr ROXx_FLAGS
6181
                roxr.l #8,d0
6182
                bsr ROXx_FLAGS
6183
                cmpi.l #$00010200,d0
6184
                bne.s *
6185
                cmpi.l #$00000032,d5
6186
                bne.s *
6187
 
6188
 
6189
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
6190
 
6191
                moveq  #$00000000,d5
6192
                move.l #$00000100,a0
6193
                move.w #$8FF1,(a0)
6194
 
6195
*        WORD LEFT
6196
                roxl (a0)
6197
                bsr ROXx_FLAGS
6198
                roxl (a0)
6199
                bsr ROXx_FLAGS
6200
                roxl (a0)
6201
                bsr ROXx_FLAGS
6202
                roxl (a0)
6203
                bsr ROXx_FLAGS
6204
                move.w (a0),d0
6205
                cmpi.l #$0001FF10,d0
6206
                bne.s *
6207
                cmpi.l #$00000009,d5
6208
                bne.s *
6209
 
6210
*        WORD RIGHT
6211
                roxr (a0)
6212
                bsr ROXx_FLAGS
6213
                roxr (a0)
6214
                bsr ROXx_FLAGS
6215
                roxr (a0)
6216
                bsr ROXx_FLAGS
6217
                roxr (a0)
6218
                bsr ROXx_FLAGS
6219
                roxr (a0)
6220
                bsr ROXx_FLAGS
6221
                roxr (a0)
6222
                bsr ROXx_FLAGS
6223
                move.w (a0),d0
6224
                cmpi.l #$000103FC,d0
6225
                bne.s *
6226
                cmpi.l #$0000000A,d5
6227
                bne.s *
6228
 
6229
                rts
6230
 
6231
 
6232
 
6233
 
6234
*-----------------------------------------------------------
6235
*-----------------------------------------------------------
6236
* OPCODE : SHIFTS
6237
*-----------------------------------------------------------
6238
*-----------------------------------------------------------
6239
 
6240
*     Subroutine to check and accumulate the flags
6241
SHIFTS_FLAGS:   move.w sr,d3
6242
                andi.l #$0F,d3            * Isolate flags
6243
                add.l d3,d5               * Copy flag results into accumulator
6244
                rts
6245
 
6246
op_SHIFTS:
6247
 
6248
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
6249
 
6250
*        BYTE LEFT
6251
                move.l #$80018F81,d0
6252
                moveq  #$00000000,d5
6253
                moveq  #$00000002,d6
6254
SHIFTS_LOOP1:
6255
                asl.b d6,d0
6256
                bsr SHIFTS_FLAGS
6257
                dbf d6,SHIFTS_LOOP1
6258
                cmpi.l #$80018F08,d0
6259
                bne.s *
6260
                cmpi.l #$00000002,d5
6261
                bne.s *
6262
 
6263
*        BYTE RIGHT
6264
                move.l #$80018F81,d0
6265
                moveq  #$00000002,d6
6266
SHIFTS_LOOP2:
6267
                asr.b d6,d0
6268
                bsr SHIFTS_FLAGS
6269
                dbf d6,SHIFTS_LOOP2
6270
                cmpi.l #$80018FF0,d0
6271
                bne.s *
6272
                cmpi.l #$0000001A,d5
6273
                bne.s *
6274
 
6275
 
6276
*        WORD LEFT
6277
                move.l #$80018FF1,d0
6278
                moveq  #$00000002,d6
6279
SHIFTS_LOOP3:
6280
                asl.w d6,d0
6281
                bsr SHIFTS_FLAGS
6282
                dbf d6,SHIFTS_LOOP3
6283
                cmpi.l #$80017F88,d0
6284
                bne.s *
6285
                cmpi.l #$0000001C,d5
6286
                bne.s *
6287
 
6288
*        WORD RIGHT
6289
                move.l #$80018FF1,d0
6290
                moveq  #$00000002,d6
6291
SHIFTS_LOOP4:
6292
                asr.w d6,d0
6293
                bsr SHIFTS_FLAGS
6294
                dbf d6,SHIFTS_LOOP4
6295
                cmpi.l #$8001F1FE,d0
6296
                bne.s *
6297
                cmpi.l #$00000034,d5
6298
                bne.s *
6299
 
6300
 
6301
*        LONG LEFT
6302
                move.l #$80018FF1,d0
6303
                moveq  #$00000002,d6
6304
SHIFTS_LOOP5:
6305
                asl.l d6,d0
6306
                bsr SHIFTS_FLAGS
6307
                dbf d6,SHIFTS_LOOP5
6308
                cmpi.l #$000C7F88,d0
6309
                bne.s *
6310
                cmpi.l #$00000036,d5
6311
                bne.s *
6312
 
6313
*        LONG RIGHT
6314
                move.l #$80018FF1,d0
6315
                moveq  #$00000002,d6
6316
SHIFTS_LOOP6:
6317
                asr.l d6,d0
6318
                bsr SHIFTS_FLAGS
6319
                dbf d6,SHIFTS_LOOP6
6320
                cmpi.l #$F00031FE,d0
6321
                bne.s *
6322
                cmpi.l #$0000004E,d5
6323
                bne.s *
6324
 
6325
 
6326
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
6327
 
6328
                move.l #$80018FF1,d0
6329
                moveq  #$00000000,d5
6330
 
6331
*        BYTE LEFT
6332
                asl.b #1,d0
6333
                bsr SHIFTS_FLAGS
6334
                asl.b #2,d0
6335
                bsr SHIFTS_FLAGS
6336
                asl.b #1,d0
6337
                bsr SHIFTS_FLAGS
6338
                asl.b #3,d0
6339
                bsr SHIFTS_FLAGS
6340
                cmpi.l #$80018F80,d0
6341
                bne.s *
6342
                cmpi.l #$0000001F,d5
6343
                bne.s *
6344
 
6345
*        BYTE RIGHT
6346
                asr.b #1,d0
6347
                bsr SHIFTS_FLAGS
6348
                asr.b #2,d0
6349
                bsr SHIFTS_FLAGS
6350
                asr.b #3,d0
6351
                bsr SHIFTS_FLAGS
6352
                asr.b #1,d0
6353
                bsr SHIFTS_FLAGS
6354
                cmpi.l #$80018FFF,d0
6355
                bne.s *
6356
                cmpi.l #$0000003F,d5
6357
                bne.s *
6358
 
6359
*        WORD LEFT
6360
                asl.w #1,d0
6361
                bsr SHIFTS_FLAGS
6362
                asl.w #2,d0
6363
                bsr SHIFTS_FLAGS
6364
                asl.w #3,d0
6365
                bsr SHIFTS_FLAGS
6366
                asl.w #5,d0
6367
                bsr SHIFTS_FLAGS
6368
                cmpi.l #$8001F800,d0
6369
                bne.s *
6370
                cmpi.l #$00000056,d5
6371
                bne.s *
6372
 
6373
*        WORD RIGHT
6374
                asr.w #5,d0
6375
                bsr SHIFTS_FLAGS
6376
                asr.w #1,d0
6377
                bsr SHIFTS_FLAGS
6378
                asr.w #2,d0
6379
                bsr SHIFTS_FLAGS
6380
                asr.w #4,d0
6381
                bsr SHIFTS_FLAGS
6382
                cmpi.l #$8001FFFF,d0
6383
                bne.s *
6384
                cmpi.l #$00000077,d5
6385
                bne.s *
6386
 
6387
*        LONG LEFT
6388
                move.l #$80018FF1,d0
6389
                asl.l #1,d0
6390
                bsr SHIFTS_FLAGS
6391
                asl.l #2,d0
6392
                bsr SHIFTS_FLAGS
6393
                asl.l #7,d0
6394
                bsr SHIFTS_FLAGS
6395
                asl.l #4,d0
6396
                bsr SHIFTS_FLAGS
6397
                cmpi.l #$63FC4000,d0
6398
                bne.s *
6399
                cmpi.l #$0000007A,d5
6400
                bne.s *
6401
 
6402
*        LONG RIGHT
6403
                move.l #$80018FF1,d0
6404
                asr.l #1,d0
6405
                bsr SHIFTS_FLAGS
6406
                asr.l #5,d0
6407
                bsr SHIFTS_FLAGS
6408
                asr.l #7,d0
6409
                bsr SHIFTS_FLAGS
6410
                asr.l #8,d0
6411
                bsr SHIFTS_FLAGS
6412
                cmpi.l #$FFFFFC00,d0
6413
                bne.s *
6414
                cmpi.l #$0000009C,d5
6415
                bne.s *
6416
 
6417
 
6418
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
6419
 
6420
                moveq  #$00000000,d5
6421
                move.l #$00000100,a0
6422
                move.w #$8FF1,(a0)
6423
 
6424
*        WORD LEFT
6425
                asl  (a0)
6426
                bsr SHIFTS_FLAGS
6427
                asl  (a0)
6428
                bsr SHIFTS_FLAGS
6429
                asl  (a0)
6430
                bsr SHIFTS_FLAGS
6431
                asl  (a0)
6432
                bsr SHIFTS_FLAGS
6433
                move.w (a0),d0
6434
                cmpi.l #$FFFFFF10,d0
6435
                bne.s *
6436
                cmpi.l #$0000000D,d5
6437
                bne.s *
6438
 
6439
*        WORD RIGHT
6440
                asr (a0)
6441
                bsr SHIFTS_FLAGS
6442
                asr (a0)
6443
                bsr SHIFTS_FLAGS
6444
                asr (a0)
6445
                bsr SHIFTS_FLAGS
6446
                asr (a0)
6447
                bsr SHIFTS_FLAGS
6448
                asr (a0)
6449
                bsr SHIFTS_FLAGS
6450
                asr (a0)
6451
                bsr SHIFTS_FLAGS
6452
                move.w (a0),d0
6453
                cmpi.l #$FFFFFFFC,d0
6454
                bne.s *
6455
                cmpi.l #$0000003E,d5
6456
                bne.s *
6457
 
6458
                rts
6459
 
6460
 
6461
 
6462
*-----------------------------------------------------------
6463
*-----------------------------------------------------------
6464
* OPCODE : SHIFTS2
6465
*-----------------------------------------------------------
6466
*-----------------------------------------------------------
6467
 
6468
*     Subroutine to check and accumulate the flags
6469
SHIFTS2_FLAGS:  move.w sr,d3
6470
                andi.l #$0F,d3            * Isolate flags
6471
                add.l d3,d5               * Copy flag results into accumulator
6472
                rts
6473
 
6474
op_SHIFTS2:
6475
 
6476
*     Shift a Register LEFT and RIGHT with shift_count ## IN A REGISTER ##
6477
 
6478
*        BYTE LEFT
6479
                move.l #$80018F81,d0
6480
                moveq  #$00000000,d5
6481
                moveq  #$00000002,d6
6482
SHIFTS2_LOOP1:
6483
                lsl.b d6,d0
6484
                bsr SHIFTS2_FLAGS
6485
                dbf d6,SHIFTS2_LOOP1
6486
                cmpi.l #$80018F08,d0
6487
                bne.s *
6488
                cmpi.l #$00000000,d5
6489
                bne.s *
6490
 
6491
*        BYTE RIGHT
6492
                move.l #$80018F81,d0
6493
                moveq  #$00000002,d6
6494
SHIFTS2_LOOP2:
6495
                lsr.b d6,d0
6496
                bsr SHIFTS2_FLAGS
6497
                dbf d6,SHIFTS2_LOOP2
6498
                cmpi.l #$80018F10,d0
6499
                bne.s *
6500
                cmpi.l #$00000000,d5
6501
                bne.s *
6502
 
6503
 
6504
*        WORD LEFT
6505
                move.l #$80018FF1,d0
6506
                moveq  #$00000002,d6
6507
SHIFTS2_LOOP3:
6508
                lsl.w d6,d0
6509
                bsr SHIFTS2_FLAGS
6510
                dbf d6,SHIFTS2_LOOP3
6511
                cmpi.l #$80017F88,d0
6512
                bne.s *
6513
                cmpi.l #$00000000,d5
6514
                bne.s *
6515
 
6516
*        WORD RIGHT
6517
                move.l #$80018FF1,d0
6518
                moveq  #$00000002,d6
6519
SHIFTS2_LOOP4:
6520
                lsr.w d6,d0
6521
                bsr SHIFTS2_FLAGS
6522
                dbf d6,SHIFTS2_LOOP4
6523
                cmpi.l #$800111FE,d0
6524
                bne.s *
6525
                cmpi.l #$00000000,d5
6526
                bne.s *
6527
 
6528
 
6529
*        LONG LEFT
6530
                move.l #$80018FF1,d0
6531
                moveq  #$00000002,d6
6532
SHIFTS2_LOOP5:
6533
                lsl.l d6,d0
6534
                bsr SHIFTS2_FLAGS
6535
                dbf d6,SHIFTS2_LOOP5
6536
                cmpi.l #$000C7F88,d0
6537
                bne.s *
6538
                cmpi.l #$00000000,d5
6539
                bne.s *
6540
 
6541
*        LONG RIGHT
6542
                move.l #$80018FF1,d0
6543
                moveq  #$00000002,d6
6544
SHIFTS2_LOOP6:
6545
                lsr.l d6,d0
6546
                bsr SHIFTS2_FLAGS
6547
                dbf d6,SHIFTS2_LOOP6
6548
                cmpi.l #$100031FE,d0
6549
                bne.s *
6550
                cmpi.l #$00000000,d5
6551
                bne.s *
6552
 
6553
 
6554
*     Shift a Register LEFT and RIGHT with shift_count ## IN THE OPCODE ##
6555
 
6556
                move.l #$80018FF1,d0
6557
                moveq  #$00000000,d5
6558
 
6559
*        BYTE LEFT
6560
                lsl.b #1,d0
6561
                bsr SHIFTS2_FLAGS
6562
                lsl.b #2,d0
6563
                bsr SHIFTS2_FLAGS
6564
                lsl.b #1,d0
6565
                bsr SHIFTS2_FLAGS
6566
                lsl.b #3,d0
6567
                bsr SHIFTS2_FLAGS
6568
                cmpi.l #$80018F80,d0
6569
                bne.s *
6570
                cmpi.l #$0000001B,d5
6571
                bne.s *
6572
 
6573
*        BYTE RIGHT
6574
                lsr.b #1,d0
6575
                bsr SHIFTS2_FLAGS
6576
                lsr.b #2,d0
6577
                bsr SHIFTS2_FLAGS
6578
                lsr.b #3,d0
6579
                bsr SHIFTS2_FLAGS
6580
                lsr.b #1,d0
6581
                bsr SHIFTS2_FLAGS
6582
                cmpi.l #$80018F01,d0
6583
                bne.s *
6584
                cmpi.l #$0000001B,d5
6585
                bne.s *
6586
 
6587
*        WORD LEFT
6588
                lsl.w #1,d0
6589
                bsr SHIFTS2_FLAGS
6590
                lsl.w #2,d0
6591
                bsr SHIFTS2_FLAGS
6592
                lsl.w #3,d0
6593
                bsr SHIFTS2_FLAGS
6594
                lsl.w #5,d0
6595
                bsr SHIFTS2_FLAGS
6596
                cmpi.l #$80010800,d0
6597
                bne.s *
6598
                cmpi.l #$00000025,d5
6599
                bne.s *
6600
 
6601
*        WORD RIGHT
6602
                lsr.w #5,d0
6603
                bsr SHIFTS2_FLAGS
6604
                lsr.w #1,d0
6605
                bsr SHIFTS2_FLAGS
6606
                lsr.w #2,d0
6607
                bsr SHIFTS2_FLAGS
6608
                lsr.w #4,d0
6609
                bsr SHIFTS2_FLAGS
6610
                cmpi.l #$80010000,d0
6611
                bne.s *
6612
                cmpi.l #$0000002A,d5
6613
                bne.s *
6614
 
6615
*        LONG LEFT
6616
                move.l #$80018FF1,d0
6617
                lsl.l #1,d0
6618
                bsr SHIFTS2_FLAGS
6619
                lsl.l #2,d0
6620
                bsr SHIFTS2_FLAGS
6621
                lsl.l #7,d0
6622
                bsr SHIFTS2_FLAGS
6623
                lsl.l #4,d0
6624
                bsr SHIFTS2_FLAGS
6625
                cmpi.l #$63FC4000,d0
6626
                bne.s *
6627
                cmpi.l #$0000002B,d5
6628
                bne.s *
6629
 
6630
*        LONG RIGHT
6631
                move.l #$80018FF1,d0
6632
                lsr.l #1,d0
6633
                bsr SHIFTS2_FLAGS
6634
                lsr.l #5,d0
6635
                bsr SHIFTS2_FLAGS
6636
                lsr.l #7,d0
6637
                bsr SHIFTS2_FLAGS
6638
                lsr.l #8,d0
6639
                bsr SHIFTS2_FLAGS
6640
                cmpi.l #$00000400,d0
6641
                bne.s *
6642
                cmpi.l #$0000002D,d5
6643
                bne.s *
6644
 
6645
 
6646
*     Shift a Memory location LEFT and RIGHT with shift_count of 1 - WORD only
6647
 
6648
                moveq  #$00000000,d5
6649
                move.l #$00000100,a0
6650
                move.w #$8FF1,(a0)
6651
 
6652
*        WORD LEFT
6653
                lsl  (a0)
6654
                bsr SHIFTS2_FLAGS
6655
                lsl  (a0)
6656
                bsr SHIFTS2_FLAGS
6657
                lsl  (a0)
6658
                bsr SHIFTS2_FLAGS
6659
                lsl  (a0)
6660
                bsr SHIFTS2_FLAGS
6661
                move.w (a0),d0
6662
                cmpi.l #$0000FF10,d0
6663
                bne.s *
6664
                cmpi.l #$00000009,d5
6665
                bne.s *
6666
 
6667
*        WORD RIGHT
6668
                lsr (a0)
6669
                bsr SHIFTS2_FLAGS
6670
                lsr (a0)
6671
                bsr SHIFTS2_FLAGS
6672
                lsr (a0)
6673
                bsr SHIFTS2_FLAGS
6674
                lsr (a0)
6675
                bsr SHIFTS2_FLAGS
6676
                lsr (a0)
6677
                bsr SHIFTS2_FLAGS
6678
                lsr (a0)
6679
                bsr SHIFTS2_FLAGS
6680
                move.w (a0),d0
6681
                cmpi.l #$000003FC,d0
6682
                bne.s *
6683
                cmpi.l #$0000000A,d5
6684
                bne.s *
6685
 
6686
                rts
6687
 
6688
;-----------------------------------------------------------
6689
;-----------------------------------------------------------
6690
; OPCODE : BSR / RTS
6691
;-----------------------------------------------------------
6692
;-----------------------------------------------------------
6693
 
6694
;t3_bsr:
6695
;       moveq   #3,d3
6696
;       rts
6697
 
6698
;t1_bsr:
6699
;       moveq   #1,d1
6700
;       rts
6701
 
6702
;op_bsr:
6703
;       bsr                     t1_bsr
6704
;       bsr                     t2_bsr
6705
;       bsr.w           t3_bsr
6706
;       bsr.w           t4_bsr
6707
;       cmpi.l  #1,d1
6708
;       bne                     *
6709
;       cmpi.l  #2,d2
6710
;       bne                     *
6711
;       cmpi.l  #3,d3
6712
;       bne                     *
6713
;       cmpi.l  #4,d4
6714
;       bne                     *
6715
;       rts
6716
 
6717
;t2_bsr:
6718
;       moveq   #2,d2
6719
;       rts
6720
 
6721
;t4_bsr:
6722
;       moveq   #4,d4
6723
;       rts
6724
*    END
6725
 

powered by: WebSVN 2.1.0

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