-
Notifications
You must be signed in to change notification settings - Fork 1
/
CPUDEBUG.C
1387 lines (1257 loc) · 53.3 KB
/
CPUDEBUG.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
** Starscream 680x0 emulation library
** Copyright 1997, 1998, 1999 Neill Corlett
**
** Refer to STARDOC.TXT for terms of use, API reference, and directions on
** how to compile.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include "starcpu.h"
#include "cpudebug.h"
void (*cpudebug_get)(char*, int);
void (*cpudebug_put)(const char*);
static void cpudebug_gets(char *s, int n) {
if(cpudebug_get) cpudebug_get(s, n);
else fgets(s, n, stdin);
}
static void cpudebug_putc(char c) {
static char buffer[100];
static unsigned l = 0;
buffer[l++] = c;
if((c == '\n') || (l == (sizeof(buffer) - 1))) {
buffer[l] = 0;
if(cpudebug_put) cpudebug_put(buffer);
else fputs(buffer, stdout);
l = 0;
}
}
static void cpudebug_printf(const char *fmt, ...) {
static char buffer[400];
char *s = buffer;
va_list ap;
va_start(ap, fmt);
vsprintf(s, fmt, ap);
va_end(ap);
while(*s) cpudebug_putc(*s++);
}
#define byte unsigned char
#define word unsigned short int
#define dword unsigned int
#define int08 signed char
#define int16 signed short int
#define int32 signed int
int cpudebug_disabled(void){return 0;}
#define ea eacalc[inst&0x3F]()
/******************************
** SNAGS / EA CONSIDERATIONS **
*******************************
- ADDX is encoded the same way as ADD->ea
- SUBX is encoded the same way as SUB->ea
- ABCD is encoded the same way as AND->ea
- EXG is encoded the same way as AND->ea
- SBCD is encoded the same way as OR->ea
- EOR is encoded the same way as CMPM
- ASR is encoded the same way as LSR
(so are LSL and ASL, but they do the same thing)
- Bcc does NOT support 32-bit offsets on the 68000.
(this is a reminder, don't bother implementing 32-bit offsets!)
- Look on p. 3-19 for how to calculate branch conditions (GE, LT, GT, etc.)
- Bit operations are 32-bit for registers, 8-bit for memory locations.
- MOVEM->memory is encoded the same way as EXT
If the EA is just a register, then it's EXT, otherwise it's MOVEM.
- MOVEP done the same way as the bit operations
- Scc done the same way as DBcc.
Assume it's Scc, unless the EA is a direct An mode (then it's a DBcc).
- SWAP done the same way as PEA
- TAS done the same way as ILLEGAL
- LINK, NOP, RTR, RTS, TRAP, TRAPV, UNLK are encoded the same way.
******************************/
#define hex08 "%02X"
#define hex16 "%04X"
#define hex32 "%08X"
#define hexlong "%06X"
#define isregister ((inst&0x0030)==0x0000)
#define isaddressr ((inst&0x0038)==0x0008)
static char eabuffer[20],sdebug[80];
static dword debugpc,hexaddr;
static int isize;
static word inst;
static word fetch(void){
debugpc+=2;
isize+=2;
return(s68000fetch(debugpc-2)&0xFFFF);
}
static dword fetchl(void){
dword t;
t=(s68000fetch(debugpc)&0xFFFF);
t<<=16;
t|=(s68000fetch(debugpc+2)&0xFFFF);
debugpc+=4;
isize+=4;
return t;
}
static int08 opsize[1024]={
1,2,4,0,0,0,0,0,1,2,4,0,0,0,0,0,1,2,4,0,0,0,0,0,1,2,4,0,0,0,0,0,
0,0,0,0,0,0,0,0,1,2,4,0,0,0,0,0,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1,2,4,2,0,0,2,4,1,2,4,1,0,0,2,4,1,2,4,1,0,0,2,4,1,2,4,2,0,0,2,4,
1,4,2,4,0,0,2,4,1,2,4,1,0,0,2,4,0,0,2,4,0,0,2,4,0,2,0,0,0,0,2,4,
1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,
1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4,4,4,4,0,0,0,0,4,4,4,4,0,0,0,0,4,4,4,4,0,0,0,0,4,4,4,4,0,0,0,0,
4,4,4,4,0,0,0,0,4,4,4,4,0,0,0,0,4,4,4,4,0,0,0,0,4,4,4,4,0,0,0,0,
1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,
1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,
1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,
1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,
1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,
1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,
1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,
1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,
1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,1,2,4,2,1,2,4,4,
1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,1,2,4,2,
1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,1,2,4,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
/******************** EA GENERATION ********************/
/* These are the functions to generate effective addresses.
Here is the syntax:
eacalc[mode]();
mode is the EA mode << 3 + register number
The function sets addr so you can use m68read and m68write.
These routines screw around with the PC, and might call fetch() a couple
times to get extension words. Place the eacalc() calls strategically to
get the extension words in the right order.
*/
/* These are the jump tables for EA calculation.
drd = data reg direct Dn
ard = address reg direct An
ari = address reg indirect (An)
ari_inc = address reg indirect, postincrement (An)+
ari_dec = address reg indirect, predecrement -(An)
ari_dis = address reg indirect, displacement (d16,An)
ari_ind = address reg indirect, index (d8,An,Xn)
pci_dis = prog. counter indirect, displacement (d16,PC)
pci_ind = prog. counter indirect, index (d8,PC,Xn)
*/
#define eacalc_drd(n,r) static void n(void){sprintf(eabuffer,"d%d",r);}
#define eacalc_ard(n,r) static void n(void){sprintf(eabuffer,"a%d",r);}
#define eacalc_ari(n,r) static void n(void){sprintf(eabuffer,"(a%d)",r);}
#define eacalc_ari_inc(n,r) static void n(void){sprintf(eabuffer,"(a%d)+",r);}
#define eacalc_ari_dec(n,r) static void n(void){sprintf(eabuffer,"-(a%d)",r);}
#define eacalc_ari_dis(n,r) static void n(void){\
int16 briefext=fetch();\
sprintf(eabuffer,"%c$" hex16 "(a%d)",(briefext<0)?'-':'+',(briefext<0)?-briefext:briefext,r);\
}
#define eacalc_ari_ind(n,r) static void n(void){\
int16 briefext=fetch();\
if(briefext<0)sprintf(eabuffer,"-$" hex08 "(a%d,%c%d.%c)",\
(int08)-briefext,r,\
briefext&0x8000?'a':'d',(briefext>>12)&7,\
briefext&0x800?'l':'w');\
else sprintf(eabuffer,"+$" hex08 "(a%d,%c%d.%c)",\
(int08)briefext,r,\
briefext&0x8000?'a':'d',(briefext>>12)&7,\
briefext&0x800?'l':'w');\
}
eacalc_drd(ea_0_0,0)
eacalc_drd(ea_0_1,1)
eacalc_drd(ea_0_2,2)
eacalc_drd(ea_0_3,3)
eacalc_drd(ea_0_4,4)
eacalc_drd(ea_0_5,5)
eacalc_drd(ea_0_6,6)
eacalc_drd(ea_0_7,7)
eacalc_ard(ea_1_0,0)
eacalc_ard(ea_1_1,1)
eacalc_ard(ea_1_2,2)
eacalc_ard(ea_1_3,3)
eacalc_ard(ea_1_4,4)
eacalc_ard(ea_1_5,5)
eacalc_ard(ea_1_6,6)
eacalc_ard(ea_1_7,7)
eacalc_ari(ea_2_0,0)
eacalc_ari(ea_2_1,1)
eacalc_ari(ea_2_2,2)
eacalc_ari(ea_2_3,3)
eacalc_ari(ea_2_4,4)
eacalc_ari(ea_2_5,5)
eacalc_ari(ea_2_6,6)
eacalc_ari(ea_2_7,7)
eacalc_ari_inc(ea_3_0,0)
eacalc_ari_inc(ea_3_1,1)
eacalc_ari_inc(ea_3_2,2)
eacalc_ari_inc(ea_3_3,3)
eacalc_ari_inc(ea_3_4,4)
eacalc_ari_inc(ea_3_5,5)
eacalc_ari_inc(ea_3_6,6)
eacalc_ari_inc(ea_3_7,7)
eacalc_ari_dec(ea_4_0,0)
eacalc_ari_dec(ea_4_1,1)
eacalc_ari_dec(ea_4_2,2)
eacalc_ari_dec(ea_4_3,3)
eacalc_ari_dec(ea_4_4,4)
eacalc_ari_dec(ea_4_5,5)
eacalc_ari_dec(ea_4_6,6)
eacalc_ari_dec(ea_4_7,7)
eacalc_ari_dis(ea_5_0,0)
eacalc_ari_dis(ea_5_1,1)
eacalc_ari_dis(ea_5_2,2)
eacalc_ari_dis(ea_5_3,3)
eacalc_ari_dis(ea_5_4,4)
eacalc_ari_dis(ea_5_5,5)
eacalc_ari_dis(ea_5_6,6)
eacalc_ari_dis(ea_5_7,7)
eacalc_ari_ind(ea_6_0,0)
eacalc_ari_ind(ea_6_1,1)
eacalc_ari_ind(ea_6_2,2)
eacalc_ari_ind(ea_6_3,3)
eacalc_ari_ind(ea_6_4,4)
eacalc_ari_ind(ea_6_5,5)
eacalc_ari_ind(ea_6_6,6)
eacalc_ari_ind(ea_6_7,7)
/* These are the "special" addressing modes:
abshort absolute short address
abslong absolute long address
immdata immediate data
*/
static void eacalcspecial_abshort(void){
word briefext;
briefext=fetch();
sprintf(eabuffer,"($" hex16 ")",briefext);
}
static void eacalcspecial_abslong(void){
dword briefext;
briefext=fetch();
briefext<<=16;
briefext|=fetch();
sprintf(eabuffer,"($"hexlong")",briefext);
}
static void eacalcspecial_immdata(void){
dword briefext;
switch(opsize[inst>>6]){
case 1:
briefext=fetch()&0xFF;
sprintf(eabuffer,"#$" hex08,briefext);
break;
case 2:
briefext=fetch();
sprintf(eabuffer,"#$" hex16,briefext);
break;
default:
briefext=fetch();
briefext<<=16;
briefext|=fetch();
sprintf(eabuffer,"#$" hex32,briefext);
break;
}
}
static void eacalcspecial_pci_dis(void){
dword dpc = debugpc;
word briefext = fetch();
sprintf(eabuffer,"$" hexlong "(pc)",((int16)(briefext))+dpc);
}
static void eacalcspecial_pci_ind(void){
dword dpc = debugpc;
word briefext = fetch();
sprintf(eabuffer,"$" hexlong "(pc,%c%d)",
((int08)(briefext))+dpc,
briefext&0x8000?'a':'d',(briefext>>12)&7);
}
static void eacalcspecial_unknown(void){
sprintf(eabuffer,"*** UNKNOWN EA MODE ***");
}
static void (*(eacalc[64]))(void)={
ea_0_0,ea_0_1,ea_0_2,ea_0_3,ea_0_4,ea_0_5,ea_0_6,ea_0_7,
ea_1_0,ea_1_1,ea_1_2,ea_1_3,ea_1_4,ea_1_5,ea_1_6,ea_1_7,
ea_2_0,ea_2_1,ea_2_2,ea_2_3,ea_2_4,ea_2_5,ea_2_6,ea_2_7,
ea_3_0,ea_3_1,ea_3_2,ea_3_3,ea_3_4,ea_3_5,ea_3_6,ea_3_7,
ea_4_0,ea_4_1,ea_4_2,ea_4_3,ea_4_4,ea_4_5,ea_4_6,ea_4_7,
ea_5_0,ea_5_1,ea_5_2,ea_5_3,ea_5_4,ea_5_5,ea_5_6,ea_5_7,
ea_6_0,ea_6_1,ea_6_2,ea_6_3,ea_6_4,ea_6_5,ea_6_6,ea_6_7,
eacalcspecial_abshort,eacalcspecial_abslong,eacalcspecial_pci_dis,eacalcspecial_pci_ind,
eacalcspecial_immdata,eacalcspecial_unknown,eacalcspecial_unknown,eacalcspecial_unknown};
static void m68unsupported(void){
sprintf(sdebug,"*** NOT RECOGNIZED ***");
}
static void m68_unrecog_x(void){
sprintf(sdebug,"unrecognized");
}
/******************** BIT TEST-AND-____ ********************/
static void m68_bitopdn_x(void){
int16 d16;
if((inst&0x38)==0x08){
d16=fetch();
sprintf(eabuffer,"%c$" hex16 "(a%d)",(d16<0)?'-':'+',(d16<0)?-d16:d16,inst&7);
if(!(inst&0x80)){
sprintf(sdebug,"movep%s %s,d%d",
((inst&0x40)==0x40)?".l":" ",
eabuffer,inst>>9
);
}else{
sprintf(sdebug,"movep%s d%d,%s",
((inst&0x40)==0x40)?".l":" ",
inst>>9,eabuffer
);
}
}else{
ea;
switch((inst>>6)&3){
case 0:sprintf(sdebug,"btst d%d,%s",inst>>9,eabuffer);break;
case 1:sprintf(sdebug,"bchg d%d,%s",inst>>9,eabuffer);break;
case 2:sprintf(sdebug,"bclr d%d,%s",inst>>9,eabuffer);break;
case 3:sprintf(sdebug,"bset d%d,%s",inst>>9,eabuffer);break;
default:break;
}
}
}
#define bittest_st(name,dump) static void name(void){\
byte shiftby=(fetch()&0xFF);\
ea;sprintf(sdebug,"%s #$"hex08",%s",dump,shiftby,eabuffer);\
}
bittest_st(m68_btst_st_x,"btst")
bittest_st(m68_bclr_st_x,"bclr")
bittest_st(m68_bset_st_x,"bset")
bittest_st(m68_bchg_st_x,"bchg")
/******************** Bcc ********************/
#define conditional_branch(name,dump) static void name(void){\
int16 disp;\
int32 currentpc=debugpc;\
disp=(int08)(inst&0xFF);\
if(!disp)disp=fetch();\
sprintf(sdebug,"%s ($"hexlong")",dump,currentpc+disp);\
}
conditional_branch(m68_bra_____x,"bra")
conditional_branch(m68_bhi_____x,"bhi")
conditional_branch(m68_bls_____x,"bls")
conditional_branch(m68_bcc_____x,"bcc")
conditional_branch(m68_bcs_____x,"bcs")
conditional_branch(m68_bne_____x,"bne")
conditional_branch(m68_beq_____x,"beq")
conditional_branch(m68_bvc_____x,"bvc")
conditional_branch(m68_bvs_____x,"bvs")
conditional_branch(m68_bpl_____x,"bpl")
conditional_branch(m68_bmi_____x,"bmi")
conditional_branch(m68_bge_____x,"bge")
conditional_branch(m68_blt_____x,"blt")
conditional_branch(m68_bgt_____x,"bgt")
conditional_branch(m68_ble_____x,"ble")
/******************** Scc, DBcc ********************/
#define scc_dbcc(name,dump1,dump2)\
static void name(void){\
ea;if(isaddressr){\
int16 disp;\
disp=fetch();\
sprintf(sdebug,"%s d%d,($"hexlong")",dump2,inst&7,debugpc+disp-2);\
}else sprintf(sdebug,"%s %s",dump1,eabuffer);\
}
scc_dbcc(m68_st______x,"st ","dbt ")
scc_dbcc(m68_sf______x,"sf ","dbra")
scc_dbcc(m68_shi_____x,"shi","dbhi")
scc_dbcc(m68_sls_____x,"sls","dbls")
scc_dbcc(m68_scc_____x,"scc","dbcc")
scc_dbcc(m68_scs_____x,"scs","dbcs")
scc_dbcc(m68_sne_____x,"sne","dbne")
scc_dbcc(m68_seq_____x,"seq","dbeq")
scc_dbcc(m68_svc_____x,"svc","dbvc")
scc_dbcc(m68_svs_____x,"svs","dbvs")
scc_dbcc(m68_spl_____x,"spl","dbpl")
scc_dbcc(m68_smi_____x,"smi","dbmi")
scc_dbcc(m68_sge_____x,"sge","dbge")
scc_dbcc(m68_slt_____x,"slt","dblt")
scc_dbcc(m68_sgt_____x,"sgt","dbgt")
scc_dbcc(m68_sle_____x,"sle","dble")
/******************** JMP ********************/
static void m68_jmp_____x(void){ea;sprintf(sdebug,"jmp %s",eabuffer);}
/******************** JSR/BSR ********************/
static void m68_jsr_____x(void){ea;sprintf(sdebug,"jsr %s",eabuffer);}
static void m68_bsr_____x(void){
int16 disp;
int32 currentpc=debugpc;
disp=(int08)(inst&0xFF);
if(!disp)disp=fetch();
sprintf(sdebug,"%s ($"hexlong")","bsr",disp+currentpc);
}
/******************** TAS ********************/
/* Test-and-set / illegal */
static void m68_tas_____b(void){
if(inst==0x4AFC){
sprintf(sdebug,"illegal");
}else{
ea;
sprintf(sdebug,"tas %s",eabuffer);
}
}
/******************** LEA ********************/
static void m68_lea___n_l(void){
ea;sprintf(sdebug,"lea %s,a%d",eabuffer,(inst>>9)&7);
}
/******************** PEA ********************/
static void m68_pea_____l(void){
ea;if(isregister){/* SWAP Dn */
sprintf(sdebug,"swap d%d",inst&7);
}else{
sprintf(sdebug,"pea %s",eabuffer);
}
}
/******************** CLR, NEG, NEGX, NOT, TST ********************/
#define negate_ea(name,dump) static void name(void){\
ea;sprintf(sdebug,"%s %s",dump,eabuffer);\
}
negate_ea(m68_neg_____b,"neg.b ")
negate_ea(m68_neg_____w,"neg ")
negate_ea(m68_neg_____l,"neg.l ")
negate_ea(m68_negx____b,"negx.b")
negate_ea(m68_negx____w,"negx ")
negate_ea(m68_negx____l,"negx.l")
negate_ea(m68_not_____b,"not.b ")
negate_ea(m68_not_____w,"not ")
negate_ea(m68_not_____l,"not.l ")
negate_ea(m68_clr_____b,"clr.b ")
negate_ea(m68_clr_____w,"clr ")
negate_ea(m68_clr_____l,"clr.l ")
negate_ea(m68_tst_____b,"tst.b ")
negate_ea(m68_tst_____w,"tst ")
negate_ea(m68_tst_____l,"tst.l ")
/******************** SOURCE: IMMEDIATE DATA
********************* DESTINATION: EFFECTIVE ADDRESS
********************/
#define im_to_ea(name,type,hextype,fetchtype,dump,r) static void name(void){\
type src=(type)fetchtype();\
if((inst&0x3F)==0x3C){\
sprintf(sdebug,"%s #$"hextype",%s",dump,src,r);\
}else{\
ea;sprintf(sdebug,"%s #$"hextype",%s",dump,src,eabuffer);\
}\
}
im_to_ea(m68_ori_____b,byte ,hex08,fetch ,"or.b ","ccr")
im_to_ea(m68_ori_____w,word ,hex16,fetch ,"or ","sr" )
im_to_ea(m68_ori_____l,dword,hex32,fetchl,"or.l ","" )
im_to_ea(m68_andi____b,byte ,hex08,fetch ,"and.b","ccr")
im_to_ea(m68_andi____w,word ,hex16,fetch ,"and ","sr" )
im_to_ea(m68_andi____l,dword,hex32,fetchl,"and.l","" )
im_to_ea(m68_eori____b,byte ,hex08,fetch ,"eor.b","ccr")
im_to_ea(m68_eori____w,word ,hex16,fetch ,"eor ","sr" )
im_to_ea(m68_eori____l,dword,hex32,fetchl,"eor.l","" )
im_to_ea(m68_addi____b,byte ,hex08,fetch ,"add.b","" )
im_to_ea(m68_addi____w,word ,hex16,fetch ,"add ","" )
im_to_ea(m68_addi____l,dword,hex32,fetchl,"add.l","" )
im_to_ea(m68_subi____b,byte ,hex08,fetch ,"sub.b","" )
im_to_ea(m68_subi____w,word ,hex16,fetch ,"sub ","" )
im_to_ea(m68_subi____l,dword,hex32,fetchl,"sub.l","" )
im_to_ea(m68_cmpi____b,byte ,hex08,fetch ,"cmp.b","" )
im_to_ea(m68_cmpi____w,word ,hex16,fetch ,"cmp ","" )
im_to_ea(m68_cmpi____l,dword,hex32,fetchl,"cmp.l","" )
/******************** SOURCE: EFFECTIVE ADDRESS
********************* DESTINATION: DATA REGISTER
********************/
#define ea_to_dn(name,dump) static void name(void){\
ea;sprintf(sdebug,"%s %s,d%d",dump,eabuffer,(inst>>9)&7);\
}
ea_to_dn(m68_or__d_n_b,"or.b ")
ea_to_dn(m68_or__d_n_w,"or ")
ea_to_dn(m68_or__d_n_l,"or.l ")
ea_to_dn(m68_and_d_n_b,"and.b")
ea_to_dn(m68_and_d_n_w,"and ")
ea_to_dn(m68_and_d_n_l,"and.l")
ea_to_dn(m68_add_d_n_b,"add.b")
ea_to_dn(m68_add_d_n_w,"add ")
ea_to_dn(m68_add_d_n_l,"add.l")
ea_to_dn(m68_sub_d_n_b,"sub.b")
ea_to_dn(m68_sub_d_n_w,"sub ")
ea_to_dn(m68_sub_d_n_l,"sub.l")
ea_to_dn(m68_cmp_d_n_b,"cmp.b")
ea_to_dn(m68_cmp_d_n_w,"cmp ")
ea_to_dn(m68_cmp_d_n_l,"cmp.l")
/******************** SOURCE: EFFECTIVE ADDRESS
********************* DESTINATION: ADDRESS REGISTER
********************/
#define ea_to_an(name,dump) static void name(void){\
ea;sprintf(sdebug,"%s %s,a%d",dump,eabuffer,((inst>>9)&7));\
}
ea_to_an(m68_adda__n_w,"add ")
ea_to_an(m68_adda__n_l,"add.l")
ea_to_an(m68_suba__n_w,"sub ")
ea_to_an(m68_suba__n_l,"sub.l")
ea_to_an(m68_cmpa__n_w,"cmp ")
ea_to_an(m68_cmpa__n_l,"cmp.l")
/******************** SUPPORT ROUTINE: ADDX AND SUBX
********************/
#define support_addsubx(name,dump)\
static void name(void){\
word nregx=(inst>>9)&7,nregy=inst&7;\
if(inst&0x0008)sprintf(sdebug,"%s -(a%d),-(a%d)",dump,nregy,nregx);\
else sprintf(sdebug,"%s d%d,d%d",dump,nregy,nregx);\
}
support_addsubx(m68support_addx_b,"addx.b")
support_addsubx(m68support_addx_w,"addx ")
support_addsubx(m68support_addx_l,"addx.l")
support_addsubx(m68support_subx_b,"subx.b")
support_addsubx(m68support_subx_w,"subx ")
support_addsubx(m68support_subx_l,"subx.l")
#define support_bcd(name,dump)\
static void name(void){\
word nregx=(inst>>9)&7,nregy=inst&7;\
if(inst&0x0008)sprintf(sdebug,"%s -(a%d),-(a%d)",dump,nregy,nregx);\
else sprintf(sdebug,"%s d%d,d%d",dump,nregy,nregx);\
}
support_bcd(m68support_abcd,"abcd")
support_bcd(m68support_sbcd,"sbcd")
/******************** SUPPORT ROUTINE: CMPM
********************/
#define support_cmpm(name,dump) static void name(void){\
sprintf(sdebug,"%s (a%d)+,(a%d)+",dump,inst&7,(inst>>9)&7);\
}
support_cmpm(m68support_cmpm_b,"cmp.b")
support_cmpm(m68support_cmpm_w,"cmp ")
support_cmpm(m68support_cmpm_l,"cmp.l")
/******************** SUPPORT ROUTINE: EXG
********************/
static void m68support_exg_same(void){
dword rx;
rx=(inst&8)|((inst>>9)&7);
sprintf(sdebug,"exg %c%d,%c%d",
rx&8?'a':'d',rx&7,inst&8?'a':'d',inst&7);
}
static void m68support_exg_diff(void){
sprintf(sdebug,"exg d%d,a%d",(inst>>9)&7,inst&7);
}
/******************** SOURCE: DATA REGISTER
********************* DESTINATION: EFFECTIVE ADDRESS
*********************
********************* calls a support routine if EA is a register
********************/
#define dn_to_ea(name,dump,s_cond,s_routine)\
static void name(void){\
ea;if(s_cond)s_routine();\
else sprintf(sdebug,"%s d%d,%s",dump,(inst>>9)&7,eabuffer);\
}
dn_to_ea(m68_add_e_n_b,"add.b",isregister,m68support_addx_b)
dn_to_ea(m68_add_e_n_w,"add ",isregister,m68support_addx_w)
dn_to_ea(m68_add_e_n_l,"add.l",isregister,m68support_addx_l)
dn_to_ea(m68_sub_e_n_b,"sub.b",isregister,m68support_subx_b)
dn_to_ea(m68_sub_e_n_w,"sub ",isregister,m68support_subx_w)
dn_to_ea(m68_sub_e_n_l,"sub.l",isregister,m68support_subx_l)
dn_to_ea(m68_eor_e_n_b,"eor.b",isaddressr,m68support_cmpm_b)
dn_to_ea(m68_eor_e_n_w,"eor ",isaddressr,m68support_cmpm_w)
dn_to_ea(m68_eor_e_n_l,"eor.l",isaddressr,m68support_cmpm_l)
dn_to_ea(m68_or__e_n_b,"or.b ",isregister,m68support_sbcd)
dn_to_ea(m68_or__e_n_w,"or ",isregister,m68unsupported)
dn_to_ea(m68_or__e_n_l,"or.l ",isregister,m68unsupported)
dn_to_ea(m68_and_e_n_b,"and.b",isregister,m68support_abcd)
dn_to_ea(m68_and_e_n_w,"and ",isregister,m68support_exg_same)
dn_to_ea(m68_and_e_n_l,"and.l",isaddressr,m68support_exg_diff)
/******************** SOURCE: QUICK DATA
********************* DESTINATION: EFFECTIVE ADDRESS
********************/
#define qn_to_ea(name,dump1) static void name(void){\
ea;sprintf(sdebug,"%s #%d,%s",dump1,(((inst>>9)&7)==0)?8:(inst>>9)&7,eabuffer);\
}
qn_to_ea(m68_addq__n_b,"add.b")
qn_to_ea(m68_addq__n_w,"add ")
qn_to_ea(m68_addq__n_l,"add.l")
qn_to_ea(m68_subq__n_b,"sub.b")
qn_to_ea(m68_subq__n_w,"sub ")
qn_to_ea(m68_subq__n_l,"sub.l")
/******************** SOURCE: QUICK DATA
********************* DESTINATION: DATA REGISTER
********************/
/* MOVEQ is the only instruction that uses this form */
static void m68_moveq_n_l(void){
sprintf(sdebug,"moveq #$"hex08",d%d",inst&0xFF,(inst>>9)&7);
}
/******************** SOURCE: EFFECTIVE ADDRESS
********************* DESTINATION: EFFECTIVE ADDRESS
********************/
/* MOVE is the only instruction that uses this form */
#define ea_to_ea(name,dump) static void name(void){\
char tmpbuf[40];\
ea;strcpy(tmpbuf,eabuffer);\
eacalc[((((inst>>3)&(7<<3)))|((inst>>9)&7))]();\
sprintf(sdebug,"%s %s,%s",dump,tmpbuf,eabuffer);\
}
ea_to_ea(m68_move____b,"move.b")
ea_to_ea(m68_move____w,"move ")
ea_to_ea(m68_move____l,"move.l")
/******************** MOVEM, EXT
********************/
static void getreglistf(word mask,char*rl){
if(mask&0x0001){*(rl++)='d';*(rl++)='0';*(rl++)='/';}
if(mask&0x0002){*(rl++)='d';*(rl++)='1';*(rl++)='/';}
if(mask&0x0004){*(rl++)='d';*(rl++)='2';*(rl++)='/';}
if(mask&0x0008){*(rl++)='d';*(rl++)='3';*(rl++)='/';}
if(mask&0x0010){*(rl++)='d';*(rl++)='4';*(rl++)='/';}
if(mask&0x0020){*(rl++)='d';*(rl++)='5';*(rl++)='/';}
if(mask&0x0040){*(rl++)='d';*(rl++)='6';*(rl++)='/';}
if(mask&0x0080){*(rl++)='d';*(rl++)='7';*(rl++)='/';}
if(mask&0x0100){*(rl++)='a';*(rl++)='0';*(rl++)='/';}
if(mask&0x0200){*(rl++)='a';*(rl++)='1';*(rl++)='/';}
if(mask&0x0400){*(rl++)='a';*(rl++)='2';*(rl++)='/';}
if(mask&0x0800){*(rl++)='a';*(rl++)='3';*(rl++)='/';}
if(mask&0x1000){*(rl++)='a';*(rl++)='4';*(rl++)='/';}
if(mask&0x2000){*(rl++)='a';*(rl++)='5';*(rl++)='/';}
if(mask&0x4000){*(rl++)='a';*(rl++)='6';*(rl++)='/';}
if(mask&0x8000){*(rl++)='a';*(rl++)='7';*(rl++)='/';}
*(--rl)=0;
}
static void getreglistb(word mask,char*rl){
if(mask&0x0001){*(rl++)='a';*(rl++)='7';*(rl++)='/';}
if(mask&0x0002){*(rl++)='a';*(rl++)='6';*(rl++)='/';}
if(mask&0x0004){*(rl++)='a';*(rl++)='5';*(rl++)='/';}
if(mask&0x0008){*(rl++)='a';*(rl++)='4';*(rl++)='/';}
if(mask&0x0010){*(rl++)='a';*(rl++)='3';*(rl++)='/';}
if(mask&0x0020){*(rl++)='a';*(rl++)='2';*(rl++)='/';}
if(mask&0x0040){*(rl++)='a';*(rl++)='1';*(rl++)='/';}
if(mask&0x0080){*(rl++)='a';*(rl++)='0';*(rl++)='/';}
if(mask&0x0100){*(rl++)='d';*(rl++)='7';*(rl++)='/';}
if(mask&0x0200){*(rl++)='d';*(rl++)='6';*(rl++)='/';}
if(mask&0x0400){*(rl++)='d';*(rl++)='5';*(rl++)='/';}
if(mask&0x0800){*(rl++)='d';*(rl++)='4';*(rl++)='/';}
if(mask&0x1000){*(rl++)='d';*(rl++)='3';*(rl++)='/';}
if(mask&0x2000){*(rl++)='d';*(rl++)='2';*(rl++)='/';}
if(mask&0x4000){*(rl++)='d';*(rl++)='1';*(rl++)='/';}
if(mask&0x8000){*(rl++)='d';*(rl++)='0';*(rl++)='/';}
*(--rl)=0;
}
#define movem_mem(name,dumpm,dumpx)\
static void name(void){\
word regmask;\
char reglist[50];\
if((inst&0x38)==0x0000){ /* ext */\
sprintf(sdebug,dumpx"d%d",inst&7);\
}else if((inst&0x38)==0x0020){ /* predecrement addressing mode */\
regmask=fetch();\
getreglistb(regmask,reglist);\
sprintf(sdebug,dumpm"%s,-(a%d)",reglist,inst&7);\
}else{\
regmask=fetch();\
ea;getreglistf(regmask,reglist);\
sprintf(sdebug,dumpm "%s,%s",reglist,eabuffer);\
}\
}
movem_mem(m68_movem___w,"movem ","ext ")
movem_mem(m68_movem___l,"movem.l ","ext.l ")
#define movem_reg(name,dump) static void name(void){\
word regmask;\
char reglist[50];\
regmask=fetch();\
ea;getreglistf(regmask,reglist);\
sprintf(sdebug,dump "%s,%s",eabuffer,reglist);\
}
movem_reg(m68_movem_r_w,"movem ")
movem_reg(m68_movem_r_l,"movem.l ")
/******************** INSTRUCTIONS THAT INVOLVE SR/CCR ********************/
static void m68_move2sr_w(void){ea;sprintf(sdebug,"move %s,sr",eabuffer);}
static void m68_movefsr_w(void){ea;sprintf(sdebug,"move sr,%s",eabuffer);}
static void m68_move2cc_w(void){ea;sprintf(sdebug,"move.b %s,ccr",eabuffer);}
static void m68_movefcc_w(void){ea;sprintf(sdebug,"move.b ccr,%s",eabuffer);}
static void m68_rts_____x(void){sprintf(sdebug,"rts");}
/******************** SHIFTS AND ROTATES ********************/
#define regshift(name,sizedump) \
static void name(void){\
char tmpbuf[10];\
if((inst&0x20)==0)sprintf(tmpbuf,"#$"hex08",d%d",(((inst>>9)&7)==0)?8:(inst>>9)&7,inst&7);\
else sprintf(tmpbuf,"d%d,d%d",(inst>>9)&7,inst&7);\
switch(inst&0x18){\
case 0x00:sprintf(sdebug,"as%s %s",sizedump,tmpbuf);break;\
case 0x08:sprintf(sdebug,"ls%s %s",sizedump,tmpbuf);break;\
case 0x10:sprintf(sdebug,"rox%s %s",sizedump,tmpbuf);break;\
case 0x18:sprintf(sdebug,"ro%s %s",sizedump,tmpbuf);break;\
}\
}
regshift(m68_shl_r_n_b,"l.b")
regshift(m68_shl_r_n_w,"l ")
regshift(m68_shl_r_n_l,"l.l")
regshift(m68_shr_r_n_b,"r.b")
regshift(m68_shr_r_n_w,"r ")
regshift(m68_shr_r_n_l,"r.l")
/******************** NOP ********************/
static void m68_nop_____x(void){sprintf(sdebug,"nop");}
/******************** LINK / UNLINK ********************/
static void m68_link_an_w(void){
int16 briefext=fetch();
sprintf(sdebug,"link a%d,%c#$"hex16,inst&7,briefext<0?'-':'+',
briefext<0?-briefext:briefext
);
}
static void m68_unlk_an_x(void){
sprintf(sdebug,"unlk a%d",inst&7);
}
static void m68_stop____x(void){sprintf(sdebug,"stop #$%04X",fetch());}
static void m68_rte_____x(void){sprintf(sdebug,"rte");}
static void m68_rtr_____x(void){sprintf(sdebug,"rtr");}
static void m68_reset___x(void){sprintf(sdebug,"reset");}
static void m68_rtd_____x(void){
int16 briefext=fetch();
sprintf(sdebug,"rtd %c#$"hex16,briefext<0?'-':'+',
briefext<0?-briefext:briefext);
}
static void m68_divu__n_w(void){ea;sprintf(sdebug,"divu %s,d%d",eabuffer,(inst>>9)&7);}
static void m68_divs__n_w(void){ea;sprintf(sdebug,"divs %s,d%d",eabuffer,(inst>>9)&7);}
static void m68_mulu__n_w(void){ea;sprintf(sdebug,"mulu %s,d%d",eabuffer,(inst>>9)&7);}
static void m68_muls__n_w(void){ea;sprintf(sdebug,"muls %s,d%d",eabuffer,(inst>>9)&7);}
static void m68_asr_m___w(void){ea;sprintf(sdebug,"asr %s",eabuffer);}
static void m68_asl_m___w(void){ea;sprintf(sdebug,"asl %s",eabuffer);}
static void m68_lsr_m___w(void){ea;sprintf(sdebug,"lsr %s",eabuffer);}
static void m68_lsl_m___w(void){ea;sprintf(sdebug,"lsl %s",eabuffer);}
static void m68_roxr_m__w(void){ea;sprintf(sdebug,"roxr %s",eabuffer);}
static void m68_roxl_m__w(void){ea;sprintf(sdebug,"roxl %s",eabuffer);}
static void m68_ror_m___w(void){ea;sprintf(sdebug,"ror %s",eabuffer);}
static void m68_rol_m___w(void){ea;sprintf(sdebug,"rol %s",eabuffer);}
static void m68_nbcd____b(void){ea;sprintf(sdebug,"nbcd.b %s",eabuffer);}
static void m68_chk___n_w(void){ea;sprintf(sdebug,"chk %s,d%d",eabuffer,(inst>>9)&7);}
static void m68_trap_nn_x(void){sprintf(sdebug,"trap #%d",inst&0xF);}
static void m68_move_2u_l(void){sprintf(sdebug,"move.l a%d,usp",inst&7);}
static void m68_move_fu_l(void){sprintf(sdebug,"move.l usp,a%d",inst&7);}
static void m68_trapv___x(void){sprintf(sdebug,"trapv");}
static char*specialregister(unsigned short int code){
switch(code&0xFFF){
case 0x000:return("sfc");
case 0x001:return("dfc");
case 0x800:return("usp");
case 0x801:return("vbr");
}
return("???");
}
static void m68_movec_r_x(void){
unsigned short int f=fetch();
sprintf(sdebug,"movec %s,%c%d",
specialregister(f),
(f&0x8000)?'a':'d',(f>>12)&7
);
}
static void m68_movec_c_x(void){
unsigned short int f=fetch();
sprintf(sdebug,"movec %c%d,%s",
(f&0x8000)?'a':'d',(f>>12)&7,
specialregister(f)
);
}
/******************** SPECIAL INSTRUCTION TABLE ********************/
/* This table is used for 0100111001xxxxxx instructions (4E4x-4E7x) */
static void(*(debugspecialmap[64]))(void)={
/* 0000xx */ m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,
/* 0001xx */ m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,
/* 0010xx */ m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,
/* 0011xx */ m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,m68_trap_nn_x,
/* 0100xx */ m68_link_an_w,m68_link_an_w,m68_link_an_w,m68_link_an_w,
/* 0101xx */ m68_link_an_w,m68_link_an_w,m68_link_an_w,m68_link_an_w,
/* 0110xx */ m68_unlk_an_x,m68_unlk_an_x,m68_unlk_an_x,m68_unlk_an_x,
/* 0111xx */ m68_unlk_an_x,m68_unlk_an_x,m68_unlk_an_x,m68_unlk_an_x,
/* 1000xx */ m68_move_2u_l,m68_move_2u_l,m68_move_2u_l,m68_move_2u_l,
/* 1001xx */ m68_move_2u_l,m68_move_2u_l,m68_move_2u_l,m68_move_2u_l,
/* 1010xx */ m68_move_fu_l,m68_move_fu_l,m68_move_fu_l,m68_move_fu_l,
/* 1011xx */ m68_move_fu_l,m68_move_fu_l,m68_move_fu_l,m68_move_fu_l,
/* 1100xx */ m68_reset___x,m68_nop_____x,m68_stop____x,m68_rte_____x,
/* 1101xx */ m68_rtd_____x,m68_rts_____x,m68_trapv___x,m68_rtr_____x,
/* 1110xx */ m68_unrecog_x,m68_unrecog_x,m68_movec_r_x,m68_movec_c_x,
/* 1111xx */ m68_unrecog_x,m68_unrecog_x,m68_unrecog_x,m68_unrecog_x};
static void m68_special_x(void){
debugspecialmap[inst&0x3F]();
}
/******************** INSTRUCTION TABLE ********************/
/* The big 1024-element jump table that handles all possible opcodes
is in the following header file.
Use this syntax to execute an instruction:
cpumap[i>>6]();
("i" is the instruction word)
*/
static void(*(debugmap[1024]))(void)={
/* 00000000ss */ m68_ori_____b,m68_ori_____w,m68_ori_____l,m68_unrecog_x,
/* 00000001ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00000010ss */ m68_andi____b,m68_andi____w,m68_andi____l,m68_unrecog_x,
/* 00000011ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00000100ss */ m68_subi____b,m68_subi____w,m68_subi____l,m68_unrecog_x,
/* 00000101ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00000110ss */ m68_addi____b,m68_addi____w,m68_addi____l,m68_unrecog_x,
/* 00000111ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00001000ss */ m68_btst_st_x,m68_bchg_st_x,m68_bclr_st_x,m68_bset_st_x,
/* 00001001ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00001010ss */ m68_eori____b,m68_eori____w,m68_eori____l,m68_unrecog_x,
/* 00001011ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00001100ss */ m68_cmpi____b,m68_cmpi____w,m68_cmpi____l,m68_unrecog_x,
/* 00001101ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00001110ss */ m68_unrecog_x,m68_unrecog_x,m68_unrecog_x,m68_unrecog_x,
/* 00001111ss */ m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,m68_bitopdn_x,
/* 00010000ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00010001ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00010010ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00010011ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00010100ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00010101ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00010110ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00010111ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011000ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011001ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011010ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011011ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011100ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011101ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011110ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00011111ss */ m68_move____b,m68_move____b,m68_move____b,m68_move____b,
/* 00100000ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00100001ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00100010ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00100011ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00100100ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00100101ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00100110ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00100111ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101000ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101001ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101010ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101011ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101100ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101101ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101110ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00101111ss */ m68_move____l,m68_move____l,m68_move____l,m68_move____l,
/* 00110000ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00110001ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00110010ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00110011ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00110100ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00110101ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00110110ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00110111ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111000ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111001ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111010ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111011ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111100ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111101ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111110ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 00111111ss */ m68_move____w,m68_move____w,m68_move____w,m68_move____w,
/* 01000000ss */ m68_negx____b,m68_negx____w,m68_negx____l,m68_movefsr_w,
/* 01000001ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01000010ss */ m68_clr_____b,m68_clr_____w,m68_clr_____l,m68_movefcc_w,
/* 01000011ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01000100ss */ m68_neg_____b,m68_neg_____w,m68_neg_____l,m68_move2cc_w,
/* 01000101ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01000110ss */ m68_not_____b,m68_not_____w,m68_not_____l,m68_move2sr_w,
/* 01000111ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01001000ss */ m68_nbcd____b,m68_pea_____l,m68_movem___w,m68_movem___l,
/* 01001001ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01001010ss */ m68_tst_____b,m68_tst_____w,m68_tst_____l,m68_tas_____b,
/* 01001011ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01001100ss */ m68_unrecog_x,m68_unrecog_x,m68_movem_r_w,m68_movem_r_l,
/* 01001101ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01001110ss */ m68_unrecog_x,m68_special_x,m68_jsr_____x,m68_jmp_____x,
/* 01001111ss */ m68_unrecog_x,m68_unrecog_x,m68_chk___n_w,m68_lea___n_l,
/* 01010000ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_st______x,
/* 01010001ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_sf______x,
/* 01010010ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_shi_____x,
/* 01010011ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_sls_____x,
/* 01010100ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_scc_____x,
/* 01010101ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_scs_____x,
/* 01010110ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_sne_____x,
/* 01010111ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_seq_____x,
/* 01011000ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_svc_____x,
/* 01011001ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_svs_____x,
/* 01011010ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_spl_____x,
/* 01011011ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_smi_____x,
/* 01011100ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_sge_____x,
/* 01011101ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_slt_____x,
/* 01011110ss */ m68_addq__n_b,m68_addq__n_w,m68_addq__n_l,m68_sgt_____x,
/* 01011111ss */ m68_subq__n_b,m68_subq__n_w,m68_subq__n_l,m68_sle_____x,
/* 01100000ss */ m68_bra_____x,m68_bra_____x,m68_bra_____x,m68_bra_____x,
/* 01100001ss */ m68_bsr_____x,m68_bsr_____x,m68_bsr_____x,m68_bsr_____x,
/* 01100010ss */ m68_bhi_____x,m68_bhi_____x,m68_bhi_____x,m68_bhi_____x,
/* 01100011ss */ m68_bls_____x,m68_bls_____x,m68_bls_____x,m68_bls_____x,
/* 01100100ss */ m68_bcc_____x,m68_bcc_____x,m68_bcc_____x,m68_bcc_____x,