summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/arcompact/arcompactdasm.c
blob: 003bc8551d4a90e93f9733e2b6858de59efb68d9 (plain) (blame)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
/*********************************\

 ARCompact disassembler

\*********************************/

#include "emu.h"
#include <stdarg.h>

static char *output;

static void ATTR_PRINTF(1,2) print(const char *fmt, ...)
{
	va_list vl;

	va_start(vl, fmt);
	vsprintf(output, fmt, vl);
	va_end(vl);
}

/*****************************************************************************/



/*****************************************************************************/

#define DASM_OPS_16 char *output, offs_t pc, UINT16 op, const UINT8* oprom
#define DASM_OPS_32 char *output, offs_t pc, UINT32 op, const UINT8* oprom
#define DASM_PARAMS output, pc, op, oprom

#define LIMM_REG 62

int arcompact_handle04_00_dasm(DASM_OPS_32);
int arcompact_handle04_01_dasm(DASM_OPS_32);
int arcompact_handle04_02_dasm(DASM_OPS_32);
int arcompact_handle04_03_dasm(DASM_OPS_32);
int arcompact_handle04_04_dasm(DASM_OPS_32);
int arcompact_handle04_05_dasm(DASM_OPS_32);
int arcompact_handle04_06_dasm(DASM_OPS_32);
int arcompact_handle04_07_dasm(DASM_OPS_32);
int arcompact_handle04_08_dasm(DASM_OPS_32);
int arcompact_handle04_09_dasm(DASM_OPS_32);
int arcompact_handle04_0a_dasm(DASM_OPS_32);
int arcompact_handle04_0b_dasm(DASM_OPS_32);
int arcompact_handle04_0c_dasm(DASM_OPS_32);
int arcompact_handle04_0d_dasm(DASM_OPS_32);
int arcompact_handle04_0e_dasm(DASM_OPS_32);
int arcompact_handle04_0f_dasm(DASM_OPS_32);
int arcompact_handle04_10_dasm(DASM_OPS_32);
int arcompact_handle04_11_dasm(DASM_OPS_32);
int arcompact_handle04_12_dasm(DASM_OPS_32);
int arcompact_handle04_13_dasm(DASM_OPS_32);
int arcompact_handle04_14_dasm(DASM_OPS_32);
int arcompact_handle04_15_dasm(DASM_OPS_32);
int arcompact_handle04_16_dasm(DASM_OPS_32);
int arcompact_handle04_17_dasm(DASM_OPS_32);
int arcompact_handle04_18_dasm(DASM_OPS_32);
int arcompact_handle04_19_dasm(DASM_OPS_32);
int arcompact_handle04_1a_dasm(DASM_OPS_32);
int arcompact_handle04_1b_dasm(DASM_OPS_32);
int arcompact_handle04_1c_dasm(DASM_OPS_32);
int arcompact_handle04_1d_dasm(DASM_OPS_32);
int arcompact_handle04_1e_dasm(DASM_OPS_32);
int arcompact_handle04_1f_dasm(DASM_OPS_32);
int arcompact_handle04_20_dasm(DASM_OPS_32);
int arcompact_handle04_21_dasm(DASM_OPS_32);
int arcompact_handle04_22_dasm(DASM_OPS_32);
int arcompact_handle04_23_dasm(DASM_OPS_32);
int arcompact_handle04_24_dasm(DASM_OPS_32);
int arcompact_handle04_25_dasm(DASM_OPS_32);
int arcompact_handle04_26_dasm(DASM_OPS_32);
int arcompact_handle04_27_dasm(DASM_OPS_32);
int arcompact_handle04_28_dasm(DASM_OPS_32);
int arcompact_handle04_29_dasm(DASM_OPS_32);
int arcompact_handle04_2a_dasm(DASM_OPS_32);
int arcompact_handle04_2b_dasm(DASM_OPS_32);
int arcompact_handle04_2c_dasm(DASM_OPS_32);
int arcompact_handle04_2d_dasm(DASM_OPS_32);
int arcompact_handle04_2e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_dasm(DASM_OPS_32);
int arcompact_handle04_30_dasm(DASM_OPS_32);
int arcompact_handle04_31_dasm(DASM_OPS_32);
int arcompact_handle04_32_dasm(DASM_OPS_32);
int arcompact_handle04_33_dasm(DASM_OPS_32);
int arcompact_handle04_34_dasm(DASM_OPS_32);
int arcompact_handle04_35_dasm(DASM_OPS_32);
int arcompact_handle04_36_dasm(DASM_OPS_32);
int arcompact_handle04_37_dasm(DASM_OPS_32);
int arcompact_handle04_38_dasm(DASM_OPS_32);
int arcompact_handle04_39_dasm(DASM_OPS_32);
int arcompact_handle04_3a_dasm(DASM_OPS_32);
int arcompact_handle04_3b_dasm(DASM_OPS_32);
int arcompact_handle04_3c_dasm(DASM_OPS_32);
int arcompact_handle04_3d_dasm(DASM_OPS_32);
int arcompact_handle04_3e_dasm(DASM_OPS_32);
int arcompact_handle04_3f_dasm(DASM_OPS_32);

int arcompact_handle04_2f_00_dasm(DASM_OPS_32);
int arcompact_handle04_2f_01_dasm(DASM_OPS_32);
int arcompact_handle04_2f_02_dasm(DASM_OPS_32);
int arcompact_handle04_2f_03_dasm(DASM_OPS_32);
int arcompact_handle04_2f_04_dasm(DASM_OPS_32);
int arcompact_handle04_2f_05_dasm(DASM_OPS_32);
int arcompact_handle04_2f_06_dasm(DASM_OPS_32);
int arcompact_handle04_2f_07_dasm(DASM_OPS_32);
int arcompact_handle04_2f_08_dasm(DASM_OPS_32);
int arcompact_handle04_2f_09_dasm(DASM_OPS_32);
int arcompact_handle04_2f_0a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_0b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_0c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_0d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_0e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_0f_dasm(DASM_OPS_32);
int arcompact_handle04_2f_10_dasm(DASM_OPS_32);
int arcompact_handle04_2f_11_dasm(DASM_OPS_32);
int arcompact_handle04_2f_12_dasm(DASM_OPS_32);
int arcompact_handle04_2f_13_dasm(DASM_OPS_32);
int arcompact_handle04_2f_14_dasm(DASM_OPS_32);
int arcompact_handle04_2f_15_dasm(DASM_OPS_32);
int arcompact_handle04_2f_16_dasm(DASM_OPS_32);
int arcompact_handle04_2f_17_dasm(DASM_OPS_32);
int arcompact_handle04_2f_18_dasm(DASM_OPS_32);
int arcompact_handle04_2f_19_dasm(DASM_OPS_32);
int arcompact_handle04_2f_1a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_1b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_1c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_1d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_1e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_1f_dasm(DASM_OPS_32);
int arcompact_handle04_2f_20_dasm(DASM_OPS_32);
int arcompact_handle04_2f_21_dasm(DASM_OPS_32);
int arcompact_handle04_2f_22_dasm(DASM_OPS_32);
int arcompact_handle04_2f_23_dasm(DASM_OPS_32);
int arcompact_handle04_2f_24_dasm(DASM_OPS_32);
int arcompact_handle04_2f_25_dasm(DASM_OPS_32);
int arcompact_handle04_2f_26_dasm(DASM_OPS_32);
int arcompact_handle04_2f_27_dasm(DASM_OPS_32);
int arcompact_handle04_2f_28_dasm(DASM_OPS_32);
int arcompact_handle04_2f_29_dasm(DASM_OPS_32);
int arcompact_handle04_2f_2a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_2b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_2c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_2d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_2e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_2f_dasm(DASM_OPS_32);
int arcompact_handle04_2f_30_dasm(DASM_OPS_32);
int arcompact_handle04_2f_31_dasm(DASM_OPS_32);
int arcompact_handle04_2f_32_dasm(DASM_OPS_32);
int arcompact_handle04_2f_33_dasm(DASM_OPS_32);
int arcompact_handle04_2f_34_dasm(DASM_OPS_32);
int arcompact_handle04_2f_35_dasm(DASM_OPS_32);
int arcompact_handle04_2f_36_dasm(DASM_OPS_32);
int arcompact_handle04_2f_37_dasm(DASM_OPS_32);
int arcompact_handle04_2f_38_dasm(DASM_OPS_32);
int arcompact_handle04_2f_39_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_dasm(DASM_OPS_32);

int arcompact_handle04_2f_3f_00_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_01_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_02_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_03_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_04_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_05_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_06_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_07_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_08_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_09_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_0a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_0b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_0c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_0d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_0e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_0f_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_10_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_11_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_12_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_13_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_14_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_15_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_16_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_17_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_18_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_19_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_1a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_1b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_1c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_1d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_1e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_1f_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_20_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_21_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_22_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_23_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_24_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_25_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_26_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_27_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_28_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_29_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_2a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_2b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_2c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_2d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_2e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_2f_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_30_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_31_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_32_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_33_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_34_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_35_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_36_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_37_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_38_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_39_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_3a_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_3b_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_3c_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_3d_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32);
int arcompact_handle04_2f_3f_3f_dasm(DASM_OPS_32);

int arcompact_handle0e_00_dasm(DASM_OPS_16);
int arcompact_handle0e_01_dasm(DASM_OPS_16);
int arcompact_handle0e_02_dasm(DASM_OPS_16);
int arcompact_handle0e_03_dasm(DASM_OPS_16);

int arcompact_handle18_00_dasm(DASM_OPS_16);
int arcompact_handle18_01_dasm(DASM_OPS_16);
int arcompact_handle18_02_dasm(DASM_OPS_16);
int arcompact_handle18_03_dasm(DASM_OPS_16);
int arcompact_handle18_04_dasm(DASM_OPS_16);

int arcompact_handle18_05_dasm(DASM_OPS_16);
int arcompact_handle18_05_00_dasm(DASM_OPS_16);
int arcompact_handle18_05_01_dasm(DASM_OPS_16);
int arcompact_handle18_05_02_dasm(DASM_OPS_16);
int arcompact_handle18_05_03_dasm(DASM_OPS_16);
int arcompact_handle18_05_04_dasm(DASM_OPS_16);
int arcompact_handle18_05_05_dasm(DASM_OPS_16);
int arcompact_handle18_05_06_dasm(DASM_OPS_16);
int arcompact_handle18_05_07_dasm(DASM_OPS_16);

int arcompact_handle18_06_dasm(DASM_OPS_16);
int arcompact_handle18_06_00_dasm(DASM_OPS_16);
int arcompact_handle18_06_01_dasm(DASM_OPS_16);
int arcompact_handle18_06_02_dasm(DASM_OPS_16);
int arcompact_handle18_06_03_dasm(DASM_OPS_16);
int arcompact_handle18_06_04_dasm(DASM_OPS_16);
int arcompact_handle18_06_05_dasm(DASM_OPS_16);
int arcompact_handle18_06_06_dasm(DASM_OPS_16);
int arcompact_handle18_06_07_dasm(DASM_OPS_16);
int arcompact_handle18_06_08_dasm(DASM_OPS_16);
int arcompact_handle18_06_09_dasm(DASM_OPS_16);
int arcompact_handle18_06_0a_dasm(DASM_OPS_16);
int arcompact_handle18_06_0b_dasm(DASM_OPS_16);
int arcompact_handle18_06_0c_dasm(DASM_OPS_16);
int arcompact_handle18_06_0d_dasm(DASM_OPS_16);
int arcompact_handle18_06_0e_dasm(DASM_OPS_16);
int arcompact_handle18_06_0f_dasm(DASM_OPS_16);
int arcompact_handle18_06_10_dasm(DASM_OPS_16);
int arcompact_handle18_06_11_dasm(DASM_OPS_16);
int arcompact_handle18_06_12_dasm(DASM_OPS_16);
int arcompact_handle18_06_13_dasm(DASM_OPS_16);
int arcompact_handle18_06_14_dasm(DASM_OPS_16);
int arcompact_handle18_06_15_dasm(DASM_OPS_16);
int arcompact_handle18_06_16_dasm(DASM_OPS_16);
int arcompact_handle18_06_17_dasm(DASM_OPS_16);
int arcompact_handle18_06_18_dasm(DASM_OPS_16);
int arcompact_handle18_06_19_dasm(DASM_OPS_16);
int arcompact_handle18_06_1a_dasm(DASM_OPS_16);
int arcompact_handle18_06_1b_dasm(DASM_OPS_16);
int arcompact_handle18_06_1c_dasm(DASM_OPS_16);
int arcompact_handle18_06_1d_dasm(DASM_OPS_16);
int arcompact_handle18_06_1e_dasm(DASM_OPS_16);
int arcompact_handle18_06_1f_dasm(DASM_OPS_16);

int arcompact_handle18_07_dasm(DASM_OPS_16);
int arcompact_handle18_07_00_dasm(DASM_OPS_16);
int arcompact_handle18_07_01_dasm(DASM_OPS_16);
int arcompact_handle18_07_02_dasm(DASM_OPS_16);
int arcompact_handle18_07_03_dasm(DASM_OPS_16);
int arcompact_handle18_07_04_dasm(DASM_OPS_16);
int arcompact_handle18_07_05_dasm(DASM_OPS_16);
int arcompact_handle18_07_06_dasm(DASM_OPS_16);
int arcompact_handle18_07_07_dasm(DASM_OPS_16);
int arcompact_handle18_07_08_dasm(DASM_OPS_16);
int arcompact_handle18_07_09_dasm(DASM_OPS_16);
int arcompact_handle18_07_0a_dasm(DASM_OPS_16);
int arcompact_handle18_07_0b_dasm(DASM_OPS_16);
int arcompact_handle18_07_0c_dasm(DASM_OPS_16);
int arcompact_handle18_07_0d_dasm(DASM_OPS_16);
int arcompact_handle18_07_0e_dasm(DASM_OPS_16);
int arcompact_handle18_07_0f_dasm(DASM_OPS_16);
int arcompact_handle18_07_10_dasm(DASM_OPS_16);
int arcompact_handle18_07_11_dasm(DASM_OPS_16);
int arcompact_handle18_07_12_dasm(DASM_OPS_16);
int arcompact_handle18_07_13_dasm(DASM_OPS_16);
int arcompact_handle18_07_14_dasm(DASM_OPS_16);
int arcompact_handle18_07_15_dasm(DASM_OPS_16);
int arcompact_handle18_07_16_dasm(DASM_OPS_16);
int arcompact_handle18_07_17_dasm(DASM_OPS_16);
int arcompact_handle18_07_18_dasm(DASM_OPS_16);
int arcompact_handle18_07_19_dasm(DASM_OPS_16);
int arcompact_handle18_07_1a_dasm(DASM_OPS_16);
int arcompact_handle18_07_1b_dasm(DASM_OPS_16);
int arcompact_handle18_07_1c_dasm(DASM_OPS_16);
int arcompact_handle18_07_1d_dasm(DASM_OPS_16);
int arcompact_handle18_07_1e_dasm(DASM_OPS_16);
int arcompact_handle18_07_1f_dasm(DASM_OPS_16);



// condition codes (basic ones are the same as arc 
static const char *conditions[0x20] =
{
	/* 00 */ "AL", // (aka RA         - Always)
	/* 01 */ "EQ", // (aka Z          - Zero
	/* 02 */ "NE", // (aka NZ         - Non-Zero)
	/* 03 */ "PL", // (aka P          - Positive)
	/* 04 */ "MI", // (aka N          - Negative)
	/* 05 */ "CS", // (aka C,  LO     - Carry set / Lower than) (unsigned)
	/* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned) 
	/* 07 */ "VS", // (aka V          - Overflow set)
	/* 08 */ "VC", // (aka NV         - Overflow clear)
	/* 09 */ "GT", // (               - Greater than) (signed)
	/* 0a */ "GE", // (               - Greater than or Equal) (signed)
	/* 0b */ "LT", // (               - Less than) (signed)
	/* 0c */ "LE", // (               - Less than or Equal) (signed)
	/* 0d */ "HI", // (               - Higher than) (unsigned)
	/* 0e */ "LS", // (               - Lower or Same) (unsigned)
	/* 0f */ "PNZ",// (               - Positive non-0 value)
	/* 10 */ "0x10 Reserved", // possible CPU implementation specifics
	/* 11 */ "0x11 Reserved",
	/* 12 */ "0x12 Reserved",
	/* 13 */ "0x13 Reserved",
	/* 14 */ "0x14 Reserved",
	/* 15 */ "0x15 Reserved",
	/* 16 */ "0x16 Reserved",
	/* 17 */ "0x17 Reserved",
	/* 18 */ "0x18 Reserved",
	/* 19 */ "0x19 Reserved",
	/* 1a */ "0x1a Reserved",
	/* 1b */ "0x1b Reserved",
	/* 1c */ "0x1c Reserved",
	/* 1d */ "0x1d Reserved",
	/* 1e */ "0x1e Reserved",
	/* 1f */ "0x1f Reserved"
};

static const char *table01_01_0x[0x10] =
{
	/* 00 */ "BREQ",
	/* 01 */ "BRNE",
	/* 02 */ "BRLT",
	/* 03 */ "BRGE",
	/* 04 */ "BRLO",
	/* 05 */ "BRHS",
	/* 06 */ "<reserved>",
	/* 07 */ "<reserved>",
	/* 08 */ "<reserved>",
	/* 09 */ "<reserved>",
	/* 0a */ "<reserved>",
	/* 0b */ "<reserved>",
	/* 0c */ "<reserved>",
	/* 0d */ "<reserved>",
	/* 0e */ "<BBIT0>",
	/* 0f */ "<BBIT1>"
};





static const char *table0f[0x20] =
{
	/* 00 */ "SOPs", // Sub Operation (another table..) ( table0f_00 )
	/* 01 */ "0x01 <illegal>",
	/* 02 */ "SUB_S",
	/* 03 */ "0x03 <illegal>",
	/* 04 */ "AND_S",
	/* 05 */ "OR_S",
	/* 06 */ "BIC_S",
	/* 07 */ "XOR_S",
	/* 08 */ "0x08 <illegal>",
	/* 09 */ "0x09 <illegal>",
	/* 0a */ "0x0a <illegal>",
	/* 0b */ "TST_S",
	/* 0c */ "MUL64_S",
	/* 0d */ "SEXB_S",
	/* 0e */ "SEXW_S",
	/* 0f */ "EXTB_S",
	/* 10 */ "EXTW_S",
	/* 11 */ "ABS_S",
	/* 12 */ "NOT_S",
	/* 13 */ "NEG_S",
	/* 14 */ "ADD1_S",
	/* 15 */ "ADD2_S>",
	/* 16 */ "ADD3_S",
	/* 17 */ "0x17 <illegal>",
	/* 18 */ "ASL_S (multiple)",
	/* 19 */ "LSR_S (multiple)",
	/* 1a */ "ASR_S (multiple)",
	/* 1b */ "ASL_S (single)",
	/* 1c */ "LSR_S (single)",
	/* 1d */ "ASR_S (single)",
	/* 1e */ "TRAP (not a5?)",
	/* 1f */ "BRK_S" // 0x7fff only?
};

static const char *table0f_00[0x8] =
{
	/* 00 */ "J_S",
	/* 01 */ "J_S.D",
	/* 02 */ "JL_S",
	/* 03 */ "JL_S.D",
	/* 04 */ "0x04 <illegal>",
	/* 05 */ "0x05 <illegal>",
	/* 06 */ "SUB_S.NE",
	/* 07 */ "ZOPs", // Sub Operations (yet another table..) ( table0f_00_07 )
};

static const char *table0f_00_07[0x8] =
{
	/* 00 */ "NOP_S",
	/* 01 */ "UNIMP_S", // unimplemented (not a5?)
	/* 02 */ "0x02 <illegal>",
	/* 03 */ "0x03 <illegal>",
	/* 04 */ "JEQ_S [BLINK]",
	/* 05 */ "JNE_S [BLINK]",
	/* 06 */ "J_S [BLINK]",
	/* 07 */ "J_S.D [BLINK]",
};

#define ARCOMPACT_OPERATION ((op & 0xf800) >> 11)


int arcompact_handle00_dasm(DASM_OPS_32)
{
	if (op & 0x00010000)
	{ // Branch Unconditionally Far
		// 00000 ssssssssss 1  SSSSSSSSSS N R TTTT
		INT32 address =   (op & 0x07fe0000) >> 17;
		address |=        ((op & 0x0000ffc0) >> 6) << 10;
		address |=        ((op & 0x0000000f) >> 0) << 20;
		if (address & 0x800000) address = -(address&0x7fffff);	

		print("B %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
	}
	else
	{ // Branch Conditionally
		// 00000 ssssssssss 0 SSSSSSSSSS N QQQQQ
		INT32 address =   (op & 0x07fe0000) >> 17;
		address |=        ((op & 0x0000ffc0) >> 6) << 10;
		if (address & 0x800000) address = -(address&0x7fffff);	

		UINT8 condition = op & 0x0000001f;

		print("B(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );
	}
	return 4;
}

int arcompact_handle01_dasm(DASM_OPS_32)
{
	if (op & 0x00010000)
	{
		if (op & 0x00000010)
		{ // Branch on Compare / Bit Test - Register-Immediate
			// 00001 bbb sssssss 1 S BBB UUUUUU N 1 iiii
			UINT8 subinstr = op & 0x0000000f;
			INT32 address =    (op & 0x00fe0000) >> 17;
			address |=        ((op & 0x00008000) >> 15) << 7;
			if (address & 0x80) address = -(address&0x7f);	

						
			print("%s (reg-imm) %08x (%08x)", table01_01_0x[subinstr], pc + (address *2) + 4, op & ~0xf8fe800f);


		}
		else
		{
			// Branch on Compare / Bit Test - Register-Register
			// 00001 bbb sssssss 1 S BBB CCCCCC N 0 iiii
			UINT8 subinstr = op & 0x0000000f;
			INT32 address =    (op & 0x00fe0000) >> 17;
			address |=        ((op & 0x00008000) >> 15) << 7;
			if (address & 0x80) address = -(address&0x7f);	

			print("%s (reg-reg) %08x (%08x)", table01_01_0x[subinstr], pc + (address *2) + 4, op & ~0xf8fe800f);

		}

	}
	else
	{
		if (op & 0x00020000)
		{ // Branch and Link Unconditionally Far
			// 00001 sssssssss 10  SSSSSSSSSS N R TTTT
			INT32 address =   (op & 0x07fc0000) >> 17;
			address |=        ((op & 0x0000ffc0) >> 6) << 10;
			address |=        ((op & 0x0000000f) >> 0) << 20;
			if (address & 0x800000) address = -(address&0x7fffff);	

			print("BL %08x (%08x)",  pc + (address *2) + 2, op & ~0xffffffcf );
		}
		else
		{ // Branch and Link Conditionally
			// 00001 sssssssss 00 SSSSSSSSSS N QQQQQ
			INT32 address =   (op & 0x07fc0000) >> 17;
			address |=        ((op & 0x0000ffc0) >> 6) << 10;
			if (address & 0x800000) address = -(address&0x7fffff);	

			UINT8 condition = op & 0x0000001f;

			print("BL(%s) %08x (%08x)", conditions[condition], pc + (address *2) + 2, op & ~0xffffffdf );

		}

	}
	return 4;
}

int arcompact_handle02_dasm(DASM_OPS_32)
{
	// bitpos
	// 11111 111 11111111 0 000 0 00 00 0 000000
	// fedcb a98 76543210 f edc b a9 87 6 543210
	// fields
	// 00010 bbb ssssssss S BBB D aa ZZ X AAAAAA
#if 0	
	int A = (op & 0x0000003f >> 0);  op &= ~0x0000003f;
	int X = (op & 0x00000040 >> 6);  op &= ~0x00000040;
	int Z = (op & 0x00000180 >> 7);  op &= ~0x00000180;
	int a = (op & 0x00000600 >> 9);  op &= ~0x00000600;
	int D = (op & 0x00000800 >> 11); op &= ~0x00000800;
	int B = (op & 0x00007000 >> 12); op &= ~0x00007000;
	int S = (op & 0x00008000 >> 15); op &= ~0x00008000;
	int s = (op & 0x00ff0000 >> 16); op &= ~0x00ff0000;
	int b = (op & 0x07000000 >> 24); op &= ~0x07000000;
#endif

	print("LD r+o (%08x)", op );
	return 4;
}

int arcompact_handle03_dasm(DASM_OPS_32)
{
	// bitpos
	// 11111 111 11111111 0 000 000000 0 00 00 0
	// fedcb a98 76543210 f edc ba9876 5 43 21 0
	// fields
	// 00011 bbb ssssssss S BBB CCCCCC D aa ZZ R

	print("ST r+o (%08x)", op );
	return 4;
}

int arcompact_handle04_dasm(DASM_OPS_32)
{
	int size = 4;
	// General Operations

	// bitpos
	// 11111 111 11 111111 0 000 000000 0 00000
	// fedcb a98 76 543210 f edc ba9876 5 43210
	//
	// 00100 bbb 00 iiiiii F BBB CCCCCC A AAAAA   General Operations *UN*Conditional Register to Register
	// 00100 bbb 01 iiiiii F BBB UUUUUU A AAAAA   General Operations *UN*Conditional Register (Unsigned 6-bit IMM)
	// 00100 bbb 10 iiiiii F BBB ssssss S SSSSS   General Operations *UN*Conditional Register (Signed 12-bit IMM)
	
	// 00100 bbb 11 iiiiii F BBB CCCCCC 0 QQQQQ   General Operations Conditional Register 
	// 00100 bbb 11 iiiiii F BBB UUUUUU 1 QQQQQ   General Operations Conditional Register (Unsigned 6-bit IMM) 
	UINT8 subinstr = (op & 0x003f0000) >> 16;
	op &= ~0x003f0000;

	switch (subinstr)
	{
		case 0x00: size = arcompact_handle04_00_dasm(DASM_PARAMS); break; // ADD
		case 0x01: size = arcompact_handle04_01_dasm(DASM_PARAMS); break; // ADC
		case 0x02: size = arcompact_handle04_02_dasm(DASM_PARAMS); break; // SUB
		case 0x03: size = arcompact_handle04_03_dasm(DASM_PARAMS); break; // SBC
		case 0x04: size = arcompact_handle04_04_dasm(DASM_PARAMS); break; // AND
		case 0x05: size = arcompact_handle04_05_dasm(DASM_PARAMS); break; // OR
		case 0x06: size = arcompact_handle04_06_dasm(DASM_PARAMS); break; // BIC
		case 0x07: size = arcompact_handle04_07_dasm(DASM_PARAMS); break; // XOR
		case 0x08: size = arcompact_handle04_08_dasm(DASM_PARAMS); break; // MAX
		case 0x09: size = arcompact_handle04_09_dasm(DASM_PARAMS); break; // MIN
		case 0x0a: size = arcompact_handle04_0a_dasm(DASM_PARAMS); break; // MOV
		case 0x0b: size = arcompact_handle04_0b_dasm(DASM_PARAMS); break; // TST
		case 0x0c: size = arcompact_handle04_0c_dasm(DASM_PARAMS); break; // CMP
		case 0x0d: size = arcompact_handle04_0d_dasm(DASM_PARAMS); break; // RCMP
		case 0x0e: size = arcompact_handle04_0e_dasm(DASM_PARAMS); break; // RSUB
		case 0x0f: size = arcompact_handle04_0f_dasm(DASM_PARAMS); break; // BSET
		case 0x10: size = arcompact_handle04_10_dasm(DASM_PARAMS); break; // BCLR
		case 0x11: size = arcompact_handle04_11_dasm(DASM_PARAMS); break; // BTST
		case 0x12: size = arcompact_handle04_12_dasm(DASM_PARAMS); break; // BXOR
		case 0x13: size = arcompact_handle04_13_dasm(DASM_PARAMS); break; // BMSK
		case 0x14: size = arcompact_handle04_14_dasm(DASM_PARAMS); break; // ADD1
		case 0x15: size = arcompact_handle04_15_dasm(DASM_PARAMS); break; // ADD2
		case 0x16: size = arcompact_handle04_16_dasm(DASM_PARAMS); break; // ADD3
		case 0x17: size = arcompact_handle04_17_dasm(DASM_PARAMS); break; // SUB1
		case 0x18: size = arcompact_handle04_18_dasm(DASM_PARAMS); break; // SUB2
		case 0x19: size = arcompact_handle04_19_dasm(DASM_PARAMS); break; // SUB3
		case 0x1a: size = arcompact_handle04_1a_dasm(DASM_PARAMS); break; // MPY *
		case 0x1b: size = arcompact_handle04_1b_dasm(DASM_PARAMS); break; // MPYH *
		case 0x1c: size = arcompact_handle04_1c_dasm(DASM_PARAMS); break; // MPYHU *
		case 0x1d: size = arcompact_handle04_1d_dasm(DASM_PARAMS); break; // MPYU *
		case 0x1e: size = arcompact_handle04_1e_dasm(DASM_PARAMS); break; // illegal
		case 0x1f: size = arcompact_handle04_1f_dasm(DASM_PARAMS); break; // illegal
		case 0x20: size = arcompact_handle04_20_dasm(DASM_PARAMS); break; // Jcc
		case 0x21: size = arcompact_handle04_21_dasm(DASM_PARAMS); break; // Jcc.D
		case 0x22: size = arcompact_handle04_22_dasm(DASM_PARAMS); break; // JLcc
		case 0x23: size = arcompact_handle04_23_dasm(DASM_PARAMS); break; // JLcc.D
		case 0x24: size = arcompact_handle04_24_dasm(DASM_PARAMS); break; // illegal
		case 0x25: size = arcompact_handle04_25_dasm(DASM_PARAMS); break; // illegal
		case 0x26: size = arcompact_handle04_26_dasm(DASM_PARAMS); break; // illegal
		case 0x27: size = arcompact_handle04_27_dasm(DASM_PARAMS); break; // illegal
		case 0x28: size = arcompact_handle04_28_dasm(DASM_PARAMS); break; // LPcc
		case 0x29: size = arcompact_handle04_29_dasm(DASM_PARAMS); break; // FLAG
		case 0x2a: size = arcompact_handle04_2a_dasm(DASM_PARAMS); break; // LR
		case 0x2b: size = arcompact_handle04_2b_dasm(DASM_PARAMS); break; // SR
		case 0x2c: size = arcompact_handle04_2c_dasm(DASM_PARAMS); break; // illegal
		case 0x2d: size = arcompact_handle04_2d_dasm(DASM_PARAMS); break; // illegal
		case 0x2e: size = arcompact_handle04_2e_dasm(DASM_PARAMS); break; // illegal
		case 0x2f: size = arcompact_handle04_2f_dasm(DASM_PARAMS); break; // Sub Opcode
		case 0x30: size = arcompact_handle04_30_dasm(DASM_PARAMS); break; // LD r-r
		case 0x31: size = arcompact_handle04_31_dasm(DASM_PARAMS); break; // LD r-r
		case 0x32: size = arcompact_handle04_32_dasm(DASM_PARAMS); break; // LD r-r
		case 0x33: size = arcompact_handle04_33_dasm(DASM_PARAMS); break; // LD r-r
		case 0x34: size = arcompact_handle04_34_dasm(DASM_PARAMS); break; // LD r-r
		case 0x35: size = arcompact_handle04_35_dasm(DASM_PARAMS); break; // LD r-r
		case 0x36: size = arcompact_handle04_36_dasm(DASM_PARAMS); break; // LD r-r
		case 0x37: size = arcompact_handle04_37_dasm(DASM_PARAMS); break; // LD r-r
		case 0x38: size = arcompact_handle04_38_dasm(DASM_PARAMS); break; // illegal
		case 0x39: size = arcompact_handle04_39_dasm(DASM_PARAMS); break; // illegal
		case 0x3a: size = arcompact_handle04_3a_dasm(DASM_PARAMS); break; // illegal
		case 0x3b: size = arcompact_handle04_3b_dasm(DASM_PARAMS); break; // illegal
		case 0x3c: size = arcompact_handle04_3c_dasm(DASM_PARAMS); break; // illegal
		case 0x3d: size = arcompact_handle04_3d_dasm(DASM_PARAMS); break; // illegal
		case 0x3e: size = arcompact_handle04_3e_dasm(DASM_PARAMS); break; // illegal
		case 0x3f: size = arcompact_handle04_3f_dasm(DASM_PARAMS); break; // illegal
	}

	return size;
}

int arcompact_handle04_00_dasm(DASM_OPS_32)  { print("ADD (%08x)", op); return 4;}
int arcompact_handle04_01_dasm(DASM_OPS_32)  { print("ADC (%08x)", op); return 4;}
int arcompact_handle04_02_dasm(DASM_OPS_32)  { print("SUB (%08x)", op); return 4;}
int arcompact_handle04_03_dasm(DASM_OPS_32)  { print("SBC (%08x)", op); return 4;}
int arcompact_handle04_04_dasm(DASM_OPS_32)  { print("AND (%08x)", op); return 4;}
int arcompact_handle04_05_dasm(DASM_OPS_32)  { print("OR (%08x)", op); return 4;}
int arcompact_handle04_06_dasm(DASM_OPS_32)  { print("BIC (%08x)", op); return 4;}
int arcompact_handle04_07_dasm(DASM_OPS_32)  { print("XOR (%08x)", op); return 4;}
int arcompact_handle04_08_dasm(DASM_OPS_32)  { print("MAX (%08x)", op); return 4;}
int arcompact_handle04_09_dasm(DASM_OPS_32)  { print("MIN (%08x)", op); return 4;}
int arcompact_handle04_0a_dasm(DASM_OPS_32)  { print("MOV (%08x)", op); return 4;}
int arcompact_handle04_0b_dasm(DASM_OPS_32)  { print("TST (%08x)", op); return 4;}
int arcompact_handle04_0c_dasm(DASM_OPS_32)  { print("CMP (%08x)", op); return 4;}
int arcompact_handle04_0d_dasm(DASM_OPS_32)  { print("RCMP (%08x)", op); return 4;}
int arcompact_handle04_0e_dasm(DASM_OPS_32)  { print("RSUB (%08x)", op); return 4;}
int arcompact_handle04_0f_dasm(DASM_OPS_32)  { print("BSET (%08x)", op); return 4;}
int arcompact_handle04_10_dasm(DASM_OPS_32)  { print("BCLR (%08x)", op); return 4;}
int arcompact_handle04_11_dasm(DASM_OPS_32)  { print("BTST (%08x)", op); return 4;}
int arcompact_handle04_12_dasm(DASM_OPS_32)  { print("BXOR (%08x)", op); return 4;}
int arcompact_handle04_13_dasm(DASM_OPS_32)  { print("BMSK (%08x)", op); return 4;}
int arcompact_handle04_14_dasm(DASM_OPS_32)  { print("ADD1 (%08x)", op); return 4;}
int arcompact_handle04_15_dasm(DASM_OPS_32)  { print("ADD2 (%08x)", op); return 4;}
int arcompact_handle04_16_dasm(DASM_OPS_32)  { print("ADD3 (%08x)", op); return 4;}
int arcompact_handle04_17_dasm(DASM_OPS_32)  { print("SUB1 (%08x)", op); return 4;}
int arcompact_handle04_18_dasm(DASM_OPS_32)  { print("SUB2 (%08x)", op); return 4;}
int arcompact_handle04_19_dasm(DASM_OPS_32)  { print("SUB3 (%08x)", op); return 4;}
int arcompact_handle04_1a_dasm(DASM_OPS_32)  { print("MPY (%08x)", op); return 4;} // *
int arcompact_handle04_1b_dasm(DASM_OPS_32)  { print("MPYH (%08x)", op); return 4;} // *
int arcompact_handle04_1c_dasm(DASM_OPS_32)  { print("MPYHU (%08x)", op); return 4;} // *
int arcompact_handle04_1d_dasm(DASM_OPS_32)  { print("MPYU (%08x)", op); return 4;} // *
int arcompact_handle04_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_1e> (%08x)", op); return 4;}
int arcompact_handle04_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_1f> (%08x)", op); return 4;}

#define GET_LIMM_32 \
	limm = oprom[6] | (oprom[7] << 8); \
	limm |= (oprom[4] << 16) | (oprom[5] << 24); \

int arcompact_handle04_20_dasm(DASM_OPS_32)
{
	// todo, other bits (in none long immediate mode at least)

	int size = 4;
	int C = (op & 0x00000fc0) >> 6;
	UINT8 condition = op & 0x0000001f;

	op &= ~0x00000fc0;
	
	if (C == LIMM_REG)
	{
		UINT32 limm;
		GET_LIMM_32;
		size = 8;
		
		print("J(%s) %08x (%08x)", conditions[condition], limm, op);
	}
	else
	{
		print("J(%s) (r%d) (%08x)", conditions[condition], C, op);
	}

	return size;
}



int arcompact_handle04_21_dasm(DASM_OPS_32)  { print("Jcc.D (%08x)", op); return 4;}
int arcompact_handle04_22_dasm(DASM_OPS_32)  { print("JLcc (%08x)", op); return 4;}
int arcompact_handle04_23_dasm(DASM_OPS_32)  { print("JLcc.D (%08x)", op); return 4;}
int arcompact_handle04_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_24> (%08x)", op); return 4;}
int arcompact_handle04_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_25> (%08x)", op); return 4;}
int arcompact_handle04_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_26> (%08x)", op); return 4;}
int arcompact_handle04_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_27> (%08x)", op); return 4;}
int arcompact_handle04_28_dasm(DASM_OPS_32)  { print("LPcc (%08x)", op); return 4;}
int arcompact_handle04_29_dasm(DASM_OPS_32)  { print("FLAG (%08x)", op); return 4;}
int arcompact_handle04_2a_dasm(DASM_OPS_32)  { print("LR (%08x)", op); return 4;}
int arcompact_handle04_2b_dasm(DASM_OPS_32)  { print("SR (%08x)", op); return 4;}
int arcompact_handle04_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2c> (%08x)", op); return 4;}
int arcompact_handle04_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2d> (%08x)", op); return 4;}
int arcompact_handle04_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2e> (%08x)", op); return 4;}

int arcompact_handle04_2f_dasm(DASM_OPS_32)
{
	int size = 4;
	UINT8 subinstr2 = (op & 0x0000003f) >> 0;
	op &= ~0x0000003f;

	switch (subinstr2)
	{
		case 0x00: size = arcompact_handle04_2f_00_dasm(DASM_PARAMS); break; // ASL
		case 0x01: size = arcompact_handle04_2f_01_dasm(DASM_PARAMS); break; // ASR
		case 0x02: size = arcompact_handle04_2f_02_dasm(DASM_PARAMS); break; // LSR
		case 0x03: size = arcompact_handle04_2f_03_dasm(DASM_PARAMS); break; // ROR
		case 0x04: size = arcompact_handle04_2f_04_dasm(DASM_PARAMS); break; // RCC
		case 0x05: size = arcompact_handle04_2f_05_dasm(DASM_PARAMS); break; // SEXB
		case 0x06: size = arcompact_handle04_2f_06_dasm(DASM_PARAMS); break; // SEXW
		case 0x07: size = arcompact_handle04_2f_07_dasm(DASM_PARAMS); break; // EXTB
		case 0x08: size = arcompact_handle04_2f_08_dasm(DASM_PARAMS); break; // EXTW
		case 0x09: size = arcompact_handle04_2f_09_dasm(DASM_PARAMS); break; // ABS
		case 0x0a: size = arcompact_handle04_2f_0a_dasm(DASM_PARAMS); break; // NOT
		case 0x0b: size = arcompact_handle04_2f_0b_dasm(DASM_PARAMS); break; // RLC
		case 0x0c: size = arcompact_handle04_2f_0c_dasm(DASM_PARAMS); break; // EX
		case 0x0d: size = arcompact_handle04_2f_0d_dasm(DASM_PARAMS); break; // illegal
		case 0x0e: size = arcompact_handle04_2f_0e_dasm(DASM_PARAMS); break; // illegal
		case 0x0f: size = arcompact_handle04_2f_0f_dasm(DASM_PARAMS); break; // illegal
		case 0x10: size = arcompact_handle04_2f_10_dasm(DASM_PARAMS); break; // illegal
		case 0x11: size = arcompact_handle04_2f_11_dasm(DASM_PARAMS); break; // illegal
		case 0x12: size = arcompact_handle04_2f_12_dasm(DASM_PARAMS); break; // illegal
		case 0x13: size = arcompact_handle04_2f_13_dasm(DASM_PARAMS); break; // illegal
		case 0x14: size = arcompact_handle04_2f_14_dasm(DASM_PARAMS); break; // illegal
		case 0x15: size = arcompact_handle04_2f_15_dasm(DASM_PARAMS); break; // illegal
		case 0x16: size = arcompact_handle04_2f_16_dasm(DASM_PARAMS); break; // illegal
		case 0x17: size = arcompact_handle04_2f_17_dasm(DASM_PARAMS); break; // illegal
		case 0x18: size = arcompact_handle04_2f_18_dasm(DASM_PARAMS); break; // illegal
		case 0x19: size = arcompact_handle04_2f_19_dasm(DASM_PARAMS); break; // illegal
		case 0x1a: size = arcompact_handle04_2f_1a_dasm(DASM_PARAMS); break; // illegal
		case 0x1b: size = arcompact_handle04_2f_1b_dasm(DASM_PARAMS); break; // illegal
		case 0x1c: size = arcompact_handle04_2f_1c_dasm(DASM_PARAMS); break; // illegal
		case 0x1d: size = arcompact_handle04_2f_1d_dasm(DASM_PARAMS); break; // illegal
		case 0x1e: size = arcompact_handle04_2f_1e_dasm(DASM_PARAMS); break; // illegal
		case 0x1f: size = arcompact_handle04_2f_1f_dasm(DASM_PARAMS); break; // illegal
		case 0x20: size = arcompact_handle04_2f_20_dasm(DASM_PARAMS); break; // illegal
		case 0x21: size = arcompact_handle04_2f_21_dasm(DASM_PARAMS); break; // illegal
		case 0x22: size = arcompact_handle04_2f_22_dasm(DASM_PARAMS); break; // illegal
		case 0x23: size = arcompact_handle04_2f_23_dasm(DASM_PARAMS); break; // illegal
		case 0x24: size = arcompact_handle04_2f_24_dasm(DASM_PARAMS); break; // illegal
		case 0x25: size = arcompact_handle04_2f_25_dasm(DASM_PARAMS); break; // illegal
		case 0x26: size = arcompact_handle04_2f_26_dasm(DASM_PARAMS); break; // illegal
		case 0x27: size = arcompact_handle04_2f_27_dasm(DASM_PARAMS); break; // illegal
		case 0x28: size = arcompact_handle04_2f_28_dasm(DASM_PARAMS); break; // illegal
		case 0x29: size = arcompact_handle04_2f_29_dasm(DASM_PARAMS); break; // illegal
		case 0x2a: size = arcompact_handle04_2f_2a_dasm(DASM_PARAMS); break; // illegal
		case 0x2b: size = arcompact_handle04_2f_2b_dasm(DASM_PARAMS); break; // illegal
		case 0x2c: size = arcompact_handle04_2f_2c_dasm(DASM_PARAMS); break; // illegal
		case 0x2d: size = arcompact_handle04_2f_2d_dasm(DASM_PARAMS); break; // illegal
		case 0x2e: size = arcompact_handle04_2f_2e_dasm(DASM_PARAMS); break; // illegal
		case 0x2f: size = arcompact_handle04_2f_2f_dasm(DASM_PARAMS); break; // illegal
		case 0x30: size = arcompact_handle04_2f_30_dasm(DASM_PARAMS); break; // illegal
		case 0x31: size = arcompact_handle04_2f_31_dasm(DASM_PARAMS); break; // illegal
		case 0x32: size = arcompact_handle04_2f_32_dasm(DASM_PARAMS); break; // illegal
		case 0x33: size = arcompact_handle04_2f_33_dasm(DASM_PARAMS); break; // illegal
		case 0x34: size = arcompact_handle04_2f_34_dasm(DASM_PARAMS); break; // illegal
		case 0x35: size = arcompact_handle04_2f_35_dasm(DASM_PARAMS); break; // illegal
		case 0x36: size = arcompact_handle04_2f_36_dasm(DASM_PARAMS); break; // illegal
		case 0x37: size = arcompact_handle04_2f_37_dasm(DASM_PARAMS); break; // illegal
		case 0x38: size = arcompact_handle04_2f_38_dasm(DASM_PARAMS); break; // illegal
		case 0x39: size = arcompact_handle04_2f_39_dasm(DASM_PARAMS); break; // illegal
		case 0x3a: size = arcompact_handle04_2f_3a_dasm(DASM_PARAMS); break; // illegal
		case 0x3b: size = arcompact_handle04_2f_3b_dasm(DASM_PARAMS); break; // illegal
		case 0x3c: size = arcompact_handle04_2f_3c_dasm(DASM_PARAMS); break; // illegal
		case 0x3d: size = arcompact_handle04_2f_3d_dasm(DASM_PARAMS); break; // illegal
		case 0x3e: size = arcompact_handle04_2f_3e_dasm(DASM_PARAMS); break; // illegal
		case 0x3f: size = arcompact_handle04_2f_3f_dasm(DASM_PARAMS); break; // ZOPs (Zero Operand Opcodes)
	}

	return size;
}


int arcompact_handle04_2f_00_dasm(DASM_OPS_32)  { print("ASL (%08x)", op); return 4;} // ASL
int arcompact_handle04_2f_01_dasm(DASM_OPS_32)  { print("ASR (%08x)", op); return 4;} // ASR
int arcompact_handle04_2f_02_dasm(DASM_OPS_32)  { print("LSR (%08x)", op); return 4;} // LSR
int arcompact_handle04_2f_03_dasm(DASM_OPS_32)  { print("ROR (%08x)", op); return 4;} // ROR
int arcompact_handle04_2f_04_dasm(DASM_OPS_32)  { print("RCC (%08x)", op); return 4;} // RCC
int arcompact_handle04_2f_05_dasm(DASM_OPS_32)  { print("SEXB (%08x)", op); return 4;} // SEXB
int arcompact_handle04_2f_06_dasm(DASM_OPS_32)  { print("SEXW (%08x)", op); return 4;} // SEXW
int arcompact_handle04_2f_07_dasm(DASM_OPS_32)  { print("EXTB (%08x)", op); return 4;} // EXTB
int arcompact_handle04_2f_08_dasm(DASM_OPS_32)  { print("EXTW (%08x)", op); return 4;} // EXTW
int arcompact_handle04_2f_09_dasm(DASM_OPS_32)  { print("ABS (%08x)", op); return 4;} // ABS
int arcompact_handle04_2f_0a_dasm(DASM_OPS_32)  { print("NOT (%08x)", op); return 4;} // NOT
int arcompact_handle04_2f_0b_dasm(DASM_OPS_32)  { print("RLC (%08x)", op); return 4;} // RLC
int arcompact_handle04_2f_0c_dasm(DASM_OPS_32)  { print("EX (%08x)", op); return 4;} // EX
int arcompact_handle04_2f_0d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0d> (%08x)", op); return 4;}
int arcompact_handle04_2f_0e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0e> (%08x)", op); return 4;}
int arcompact_handle04_2f_0f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_0f> (%08x)", op); return 4;}
int arcompact_handle04_2f_10_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_10> (%08x)", op); return 4;}
int arcompact_handle04_2f_11_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_11> (%08x)", op); return 4;}
int arcompact_handle04_2f_12_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_12> (%08x)", op); return 4;}
int arcompact_handle04_2f_13_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_13> (%08x)", op); return 4;}
int arcompact_handle04_2f_14_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_14> (%08x)", op); return 4;}
int arcompact_handle04_2f_15_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_15> (%08x)", op); return 4;}
int arcompact_handle04_2f_16_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_16> (%08x)", op); return 4;}
int arcompact_handle04_2f_17_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_17> (%08x)", op); return 4;}
int arcompact_handle04_2f_18_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_18> (%08x)", op); return 4;}
int arcompact_handle04_2f_19_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_19> (%08x)", op); return 4;}
int arcompact_handle04_2f_1a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1a> (%08x)", op); return 4;}
int arcompact_handle04_2f_1b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1b> (%08x)", op); return 4;}
int arcompact_handle04_2f_1c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1c> (%08x)", op); return 4;}
int arcompact_handle04_2f_1d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1d> (%08x)", op); return 4;}
int arcompact_handle04_2f_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1e> (%08x)", op); return 4;}
int arcompact_handle04_2f_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_1f> (%08x)", op); return 4;}
int arcompact_handle04_2f_20_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_20> (%08x)", op); return 4;}
int arcompact_handle04_2f_21_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_21> (%08x)", op); return 4;}
int arcompact_handle04_2f_22_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_22> (%08x)", op); return 4;}
int arcompact_handle04_2f_23_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_23> (%08x)", op); return 4;}
int arcompact_handle04_2f_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_24> (%08x)", op); return 4;}
int arcompact_handle04_2f_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_25> (%08x)", op); return 4;}
int arcompact_handle04_2f_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_26> (%08x)", op); return 4;}
int arcompact_handle04_2f_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_27> (%08x)", op); return 4;}
int arcompact_handle04_2f_28_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_28> (%08x)", op); return 4;}
int arcompact_handle04_2f_29_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_29> (%08x)", op); return 4;}
int arcompact_handle04_2f_2a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2a> (%08x)", op); return 4;}
int arcompact_handle04_2f_2b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2b> (%08x)", op); return 4;}
int arcompact_handle04_2f_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2c> (%08x)", op); return 4;}
int arcompact_handle04_2f_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2d> (%08x)", op); return 4;}
int arcompact_handle04_2f_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2e> (%08x)", op); return 4;}
int arcompact_handle04_2f_2f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_2f> (%08x)", op); return 4;}
int arcompact_handle04_2f_30_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_30> (%08x)", op); return 4;}
int arcompact_handle04_2f_31_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_31> (%08x)", op); return 4;}
int arcompact_handle04_2f_32_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_32> (%08x)", op); return 4;}
int arcompact_handle04_2f_33_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_33> (%08x)", op); return 4;}
int arcompact_handle04_2f_34_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_34> (%08x)", op); return 4;}
int arcompact_handle04_2f_35_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_35> (%08x)", op); return 4;}
int arcompact_handle04_2f_36_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_36> (%08x)", op); return 4;}
int arcompact_handle04_2f_37_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_37> (%08x)", op); return 4;}
int arcompact_handle04_2f_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_38> (%08x)", op); return 4;}
int arcompact_handle04_2f_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_39> (%08x)", op); return 4;}
int arcompact_handle04_2f_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3a> (%08x)", op); return 4;}
int arcompact_handle04_2f_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3b> (%08x)", op); return 4;}
int arcompact_handle04_2f_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3c> (%08x)", op); return 4;}
int arcompact_handle04_2f_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3d> (%08x)", op); return 4;}
int arcompact_handle04_2f_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3e> (%08x)", op); return 4;}

int arcompact_handle04_2f_3f_dasm(DASM_OPS_32)
{
	int size = 4;
	UINT8 subinstr3 = (op & 0x07000000) >> 24;
	subinstr3 |= ((op & 0x00007000) >> 12) << 3;

	op &= ~0x07007000;

	switch (subinstr3)
	{
		case 0x00: size = arcompact_handle04_2f_3f_00_dasm(DASM_PARAMS); break; // illegal
		case 0x01: size = arcompact_handle04_2f_3f_01_dasm(DASM_PARAMS); break; // SLEEP
		case 0x02: size = arcompact_handle04_2f_3f_02_dasm(DASM_PARAMS); break; // SWI / TRAP9
		case 0x03: size = arcompact_handle04_2f_3f_03_dasm(DASM_PARAMS); break; // SYNC
		case 0x04: size = arcompact_handle04_2f_3f_04_dasm(DASM_PARAMS); break; // RTIE
		case 0x05: size = arcompact_handle04_2f_3f_05_dasm(DASM_PARAMS); break; // BRK
		case 0x06: size = arcompact_handle04_2f_3f_06_dasm(DASM_PARAMS); break; // illegal
		case 0x07: size = arcompact_handle04_2f_3f_07_dasm(DASM_PARAMS); break; // illegal
		case 0x08: size = arcompact_handle04_2f_3f_08_dasm(DASM_PARAMS); break; // illegal
		case 0x09: size = arcompact_handle04_2f_3f_09_dasm(DASM_PARAMS); break; // illegal
		case 0x0a: size = arcompact_handle04_2f_3f_0a_dasm(DASM_PARAMS); break; // illegal
		case 0x0b: size = arcompact_handle04_2f_3f_0b_dasm(DASM_PARAMS); break; // illegal
		case 0x0c: size = arcompact_handle04_2f_3f_0c_dasm(DASM_PARAMS); break; // illegal
		case 0x0d: size = arcompact_handle04_2f_3f_0d_dasm(DASM_PARAMS); break; // illegal
		case 0x0e: size = arcompact_handle04_2f_3f_0e_dasm(DASM_PARAMS); break; // illegal
		case 0x0f: size = arcompact_handle04_2f_3f_0f_dasm(DASM_PARAMS); break; // illegal
		case 0x10: size = arcompact_handle04_2f_3f_10_dasm(DASM_PARAMS); break; // illegal
		case 0x11: size = arcompact_handle04_2f_3f_11_dasm(DASM_PARAMS); break; // illegal
		case 0x12: size = arcompact_handle04_2f_3f_12_dasm(DASM_PARAMS); break; // illegal
		case 0x13: size = arcompact_handle04_2f_3f_13_dasm(DASM_PARAMS); break; // illegal
		case 0x14: size = arcompact_handle04_2f_3f_14_dasm(DASM_PARAMS); break; // illegal
		case 0x15: size = arcompact_handle04_2f_3f_15_dasm(DASM_PARAMS); break; // illegal
		case 0x16: size = arcompact_handle04_2f_3f_16_dasm(DASM_PARAMS); break; // illegal
		case 0x17: size = arcompact_handle04_2f_3f_17_dasm(DASM_PARAMS); break; // illegal
		case 0x18: size = arcompact_handle04_2f_3f_18_dasm(DASM_PARAMS); break; // illegal
		case 0x19: size = arcompact_handle04_2f_3f_19_dasm(DASM_PARAMS); break; // illegal
		case 0x1a: size = arcompact_handle04_2f_3f_1a_dasm(DASM_PARAMS); break; // illegal
		case 0x1b: size = arcompact_handle04_2f_3f_1b_dasm(DASM_PARAMS); break; // illegal
		case 0x1c: size = arcompact_handle04_2f_3f_1c_dasm(DASM_PARAMS); break; // illegal
		case 0x1d: size = arcompact_handle04_2f_3f_1d_dasm(DASM_PARAMS); break; // illegal
		case 0x1e: size = arcompact_handle04_2f_3f_1e_dasm(DASM_PARAMS); break; // illegal
		case 0x1f: size = arcompact_handle04_2f_3f_1f_dasm(DASM_PARAMS); break; // illegal
		case 0x20: size = arcompact_handle04_2f_3f_20_dasm(DASM_PARAMS); break; // illegal
		case 0x21: size = arcompact_handle04_2f_3f_21_dasm(DASM_PARAMS); break; // illegal
		case 0x22: size = arcompact_handle04_2f_3f_22_dasm(DASM_PARAMS); break; // illegal
		case 0x23: size = arcompact_handle04_2f_3f_23_dasm(DASM_PARAMS); break; // illegal
		case 0x24: size = arcompact_handle04_2f_3f_24_dasm(DASM_PARAMS); break; // illegal
		case 0x25: size = arcompact_handle04_2f_3f_25_dasm(DASM_PARAMS); break; // illegal
		case 0x26: size = arcompact_handle04_2f_3f_26_dasm(DASM_PARAMS); break; // illegal
		case 0x27: size = arcompact_handle04_2f_3f_27_dasm(DASM_PARAMS); break; // illegal
		case 0x28: size = arcompact_handle04_2f_3f_28_dasm(DASM_PARAMS); break; // illegal
		case 0x29: size = arcompact_handle04_2f_3f_29_dasm(DASM_PARAMS); break; // illegal
		case 0x2a: size = arcompact_handle04_2f_3f_2a_dasm(DASM_PARAMS); break; // illegal
		case 0x2b: size = arcompact_handle04_2f_3f_2b_dasm(DASM_PARAMS); break; // illegal
		case 0x2c: size = arcompact_handle04_2f_3f_2c_dasm(DASM_PARAMS); break; // illegal
		case 0x2d: size = arcompact_handle04_2f_3f_2d_dasm(DASM_PARAMS); break; // illegal
		case 0x2e: size = arcompact_handle04_2f_3f_2e_dasm(DASM_PARAMS); break; // illegal
		case 0x2f: size = arcompact_handle04_2f_3f_2f_dasm(DASM_PARAMS); break; // illegal
		case 0x30: size = arcompact_handle04_2f_3f_30_dasm(DASM_PARAMS); break; // illegal
		case 0x31: size = arcompact_handle04_2f_3f_31_dasm(DASM_PARAMS); break; // illegal
		case 0x32: size = arcompact_handle04_2f_3f_32_dasm(DASM_PARAMS); break; // illegal
		case 0x33: size = arcompact_handle04_2f_3f_33_dasm(DASM_PARAMS); break; // illegal
		case 0x34: size = arcompact_handle04_2f_3f_34_dasm(DASM_PARAMS); break; // illegal
		case 0x35: size = arcompact_handle04_2f_3f_35_dasm(DASM_PARAMS); break; // illegal
		case 0x36: size = arcompact_handle04_2f_3f_36_dasm(DASM_PARAMS); break; // illegal
		case 0x37: size = arcompact_handle04_2f_3f_37_dasm(DASM_PARAMS); break; // illegal
		case 0x38: size = arcompact_handle04_2f_3f_38_dasm(DASM_PARAMS); break; // illegal
		case 0x39: size = arcompact_handle04_2f_3f_39_dasm(DASM_PARAMS); break; // illegal
		case 0x3a: size = arcompact_handle04_2f_3f_3a_dasm(DASM_PARAMS); break; // illegal
		case 0x3b: size = arcompact_handle04_2f_3f_3b_dasm(DASM_PARAMS); break; // illegal
		case 0x3c: size = arcompact_handle04_2f_3f_3c_dasm(DASM_PARAMS); break; // illegal
		case 0x3d: size = arcompact_handle04_2f_3f_3d_dasm(DASM_PARAMS); break; // illegal
		case 0x3e: size = arcompact_handle04_2f_3f_3e_dasm(DASM_PARAMS); break; // illegal
		case 0x3f: size = arcompact_handle04_2f_3f_3f_dasm(DASM_PARAMS); break; // illegal
	}

	return size;
}

int arcompact_handle04_2f_3f_00_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_00> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_01_dasm(DASM_OPS_32)  { print("SLEEP (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_02_dasm(DASM_OPS_32)  { print("SWI / TRAP0 (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_03_dasm(DASM_OPS_32)  { print("SYNC (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_04_dasm(DASM_OPS_32)  { print("RTIE (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_05_dasm(DASM_OPS_32)  { print("BRK (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_06_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_06> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_07_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_07> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_08_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_08> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_09_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_09> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_0a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0a> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_0b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0b> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_0c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0c> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_0d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0d> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_0e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0e> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_0f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_0f> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_10_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_10> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_11_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_11> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_12_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_12> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_13_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_13> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_14_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_14> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_15_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_15> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_16_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_16> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_17_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_17> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_18_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_18> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_19_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_19> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_1a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1a> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_1b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1b> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_1c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1c> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_1d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1d> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_1e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1e> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_1f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_1f> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_20_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_20> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_21_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_21> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_22_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_22> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_23_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_23> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_24_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_24> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_25_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_25> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_26_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_26> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_27_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_27> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_28_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_28> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_29_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_29> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_2a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2a> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_2b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2b> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_2c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2c> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_2d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2d> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_2e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2e> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_2f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_2f> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_30_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_30> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_31_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_31> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_32_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_32> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_33_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_33> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_34_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_34> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_35_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_35> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_36_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_36> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_37_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_37> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_38> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_39> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3a> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3b> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3c> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3d> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3e> (%08x)", op); return 4;}
int arcompact_handle04_2f_3f_3f_dasm(DASM_OPS_32)  { print("<illegal 0x04_2f_3f_3f> (%08x)", op); return 4;}








int arcompact_handle04_30_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x30) (%08x)", op); return 4;}
int arcompact_handle04_31_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x31) (%08x)", op); return 4;}
int arcompact_handle04_32_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x32) (%08x)", op); return 4;}
int arcompact_handle04_33_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x33) (%08x)", op); return 4;}
int arcompact_handle04_34_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x34) (%08x)", op); return 4;}
int arcompact_handle04_35_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x35) (%08x)", op); return 4;}
int arcompact_handle04_36_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x36) (%08x)", op); return 4;}
int arcompact_handle04_37_dasm(DASM_OPS_32)  { print("LD r-r (basecase 0x37) (%08x)", op); return 4;}
int arcompact_handle04_38_dasm(DASM_OPS_32)  { print("<illegal 0x04_38> (%08x)", op); return 4;}
int arcompact_handle04_39_dasm(DASM_OPS_32)  { print("<illegal 0x04_39> (%08x)", op); return 4;}
int arcompact_handle04_3a_dasm(DASM_OPS_32)  { print("<illegal 0x04_3a> (%08x)", op); return 4;}
int arcompact_handle04_3b_dasm(DASM_OPS_32)  { print("<illegal 0x04_3b> (%08x)", op); return 4;}
int arcompact_handle04_3c_dasm(DASM_OPS_32)  { print("<illegal 0x04_3c> (%08x)", op); return 4;}
int arcompact_handle04_3d_dasm(DASM_OPS_32)  { print("<illegal 0x04_3d> (%08x)", op); return 4;}
int arcompact_handle04_3e_dasm(DASM_OPS_32)  { print("<illegal 0x04_3e> (%08x)", op); return 4;}
int arcompact_handle04_3f_dasm(DASM_OPS_32)  { print("<illegal 0x04_3f> (%08x)", op); return 4;}






int arcompact_handle05_dasm(DASM_OPS_32)
{
	print("op a,b,c (05 ARC ext) (%08x)", op );
	return 4;
}

int arcompact_handle06_dasm(DASM_OPS_32)
{
	print("op a,b,c (06 ARC ext) (%08x)", op );
	return 4;
}

int arcompact_handle07_dasm(DASM_OPS_32)
{
	print("op a,b,c (07 User ext) (%08x)", op );
	return 4;
}

int arcompact_handle08_dasm(DASM_OPS_32)
{
	print("op a,b,c (08 User ext) (%08x)", op );
	return 4;
}

int arcompact_handle09_dasm(DASM_OPS_32)
{
	print("op a,b,c (09 Market ext) (%08x)", op );
	return 4;
}

int arcompact_handle0a_dasm(DASM_OPS_32)
{
	print("op a,b,c (0a Market ext) (%08x)",  op );
	return 4;
}

int arcompact_handle0b_dasm(DASM_OPS_32)
{
	print("op a,b,c (0b Market ext) (%08x)",  op );
	return 4;
}




int arcompact_handle0c_dasm(DASM_OPS_16)
{
	print("Load/Add reg-reg (%04x)", op);
	return 2;
}

int arcompact_handle0d_dasm(DASM_OPS_16)
{
	print("Add/Sub/Shft imm (%04x)", op);
	return 2;
}

int arcompact_handle0e_dasm(DASM_OPS_16)
{
	int size = 2;
	UINT8 subinstr = (op & 0x0018) >> 3;
	op &= ~0x0018;

	switch (subinstr)
	{
		case 0x00: size = arcompact_handle0e_00_dasm(DASM_PARAMS); break; // ADD_S
		case 0x01: size = arcompact_handle0e_01_dasm(DASM_PARAMS); break; // MOV_S
		case 0x02: size = arcompact_handle0e_02_dasm(DASM_PARAMS); break; // CMP_S
		case 0x03: size = arcompact_handle0e_03_dasm(DASM_PARAMS); break; // MOV_S
	}
	return size;
}


#define GROUP_0e_GET_h \
	h =  ((op & 0x0007) << 3); \
    h |= ((op & 0x00e0) >> 5); \

// this is as messed up as the rest of the 16-bit alignment in LE mode...

#define GET_LIMM \
	limm = oprom[4] | (oprom[5] << 8); \
	limm |= (oprom[2] << 16) | (oprom[3] << 24); \


int arcompact_handle0e_00_dasm(DASM_OPS_16)
{
	int h;
	int size = 2;

	GROUP_0e_GET_h;

	if (h == LIMM_REG)
	{
		UINT32 limm;
		GET_LIMM;
		size = 6;
		print("ADD_S b <- b + (%08x) (%04x)", limm, op);
	}
	else
	{

		print("ADD_S b <- b + (r%d) (%04x)", h, op);
	}

	return size;
}

int arcompact_handle0e_01_dasm(DASM_OPS_16)
{
	int h;
	int size = 2;
	GROUP_0e_GET_h;

	if (h == LIMM_REG)
	{
		UINT32 limm;
		GET_LIMM;
		size = 6;
		print("MOV_S b <- (%08x)  (%04x)", limm, op);
	}
	else
	{
		print("MOV_S b <- (r%d)  (%04x)", h, op);
	}
	return size;
}

int arcompact_handle0e_02_dasm(DASM_OPS_16)
{
	int h;
	int size = 2;
	GROUP_0e_GET_h;

	if (h == LIMM_REG)
	{
		UINT32 limm;
		GET_LIMM;
		size = 6;
		print("CMP_S b - (%08x) (%04x)", limm, op);
	}
	else
	{
		print("CMP_S b - (r%d) (%04x)", h, op);
	}
	return size;
}

int arcompact_handle0e_03_dasm(DASM_OPS_16)
{
	int h;
	int size = 2;
	GROUP_0e_GET_h;

	if (h == LIMM_REG)
	{
		UINT32 limm;
		GET_LIMM;
		size = 6;
		print("MOV_S (%08x) <- b (%04x)", limm, op);
	}
	else
	{
		print("MOV_S (r%d) <- b (%04x)", h, op);
	}

	return size;
}



int arcompact_handle0f_dasm(DASM_OPS_16)
{
	// General Register Instructions (16-bit)
	// 01111 bbb ccc iiiii
	UINT8 subinstr = (op & 0x01f) >> 0;
	//print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
		
	switch (subinstr)
	{
	
		default:
			print("%s (%04x)", table0f[subinstr], op & ~0xf81f);
			break;

		case 0x00:
		{
			// General Operations w/ Register
			// 01111 bbb iii 00000
			UINT8 subinstr2 = (op & 0x00e0) >> 5;

			switch (subinstr2)
			{
				default:
					print("%s (%04x)", table0f_00[subinstr2], op & ~0xf8ff);
					return 2;

				case 0x7:
				{
					// General Operations w/o Register
					// 01111 iii 111 00000
					UINT8 subinstr3 = (op & 0x0700) >> 8;

					print("%s (%04x)", table0f_00_07[subinstr3], op & ~0xffff);

					return 2;
				}
			}
		}
	}
	
	return 2;
}

int arcompact_handle10_dasm(DASM_OPS_16)
{
	print("LD_S (%04x)",  op);
	return 2;
}

int arcompact_handle11_dasm(DASM_OPS_16)
{
	print("LDB_S (%04x)", op);
	return 2;
}

int arcompact_handle12_dasm(DASM_OPS_16)
{
	print("LDW_S (%04x)", op);
	return 2;
}

int arcompact_handle13_dasm(DASM_OPS_16)
{
	print("LSW_S.X (%04x)", op);
	return 2;
}

int arcompact_handle14_dasm(DASM_OPS_16)
{
	print("ST_S (%04x)", op);
	return 2;
}

int arcompact_handle15_dasm(DASM_OPS_16)
{
	print("STB_S (%04x)", op);
	return 2;
}

int arcompact_handle16_dasm(DASM_OPS_16)
{
	print("STW_S (%04x)",  op);
	return 2;
}

int arcompact_handle17_dasm(DASM_OPS_16)
{
	print("Shift/Sub/Bit (%04x)",  op);
	return 2;
}

int arcompact_handle18_dasm(DASM_OPS_16)
{
	int size = 2;
	// Stack Pointer Based Instructions (16-bit)
	// 11000 bbb iii uuuuu
	UINT8 subinstr = (op & 0x00e0) >> 5;
	op &= ~0x00e0;

	switch (subinstr)
	{
		case 0x00: size = arcompact_handle18_00_dasm(DASM_PARAMS); break; // LD_S (SP)
		case 0x01: size = arcompact_handle18_01_dasm(DASM_PARAMS); break; // LDB_S (SP)
		case 0x02: size = arcompact_handle18_02_dasm(DASM_PARAMS); break; // ST_S (SP)
		case 0x03: size = arcompact_handle18_03_dasm(DASM_PARAMS); break; // STB_S (SP)
		case 0x04: size = arcompact_handle18_04_dasm(DASM_PARAMS); break; // ADD_S (SP)
		case 0x05: size = arcompact_handle18_05_dasm(DASM_PARAMS); break; // subtable 18_05
		case 0x06: size = arcompact_handle18_06_dasm(DASM_PARAMS); break; // subtable 18_06
		case 0x07: size = arcompact_handle18_07_dasm(DASM_PARAMS); break; // subtable 18_07
	}

	return size;
}

// op bits remaining for 0x18_xx subgroups 0x071f 

int arcompact_handle18_00_dasm(DASM_OPS_16) 
{
	print("LD_S (SP) (%04x)",  op);
	return 2;
}

int arcompact_handle18_01_dasm(DASM_OPS_16) 
{
	print("LDB_S (SP) (%04x)",  op);
	return 2;
}

int arcompact_handle18_02_dasm(DASM_OPS_16) 
{
	print("ST_S (SP) (%04x)",  op);
	return 2;
}

int arcompact_handle18_03_dasm(DASM_OPS_16) 
{
	print("STB_S (SP) (%04x)",  op);
	return 2;
}

int arcompact_handle18_04_dasm(DASM_OPS_16) 
{
	print("ADD_S (SP) (%04x)",  op);
	return 2;
}





int arcompact_handle18_05_dasm(DASM_OPS_16) 
{
	int size = 2;
	UINT8 subinstr2 = (op & 0x0700) >> 8;
	op &= ~0x001f;

	switch (subinstr2)
	{
		case 0x00: size = arcompact_handle18_05_00_dasm(DASM_PARAMS); break; // ADD_S (SP)
		case 0x01: size = arcompact_handle18_05_01_dasm(DASM_PARAMS); break; // SUB_S (SP)
		case 0x02: size = arcompact_handle18_05_02_dasm(DASM_PARAMS); break; // <illegal 0x18_05_02> 
		case 0x03: size = arcompact_handle18_05_03_dasm(DASM_PARAMS); break; // <illegal 0x18_05_03>
		case 0x04: size = arcompact_handle18_05_04_dasm(DASM_PARAMS); break; // <illegal 0x18_05_04>
		case 0x05: size = arcompact_handle18_05_05_dasm(DASM_PARAMS); break; // <illegal 0x18_05_05>
		case 0x06: size = arcompact_handle18_05_06_dasm(DASM_PARAMS); break; // <illegal 0x18_05_06>
		case 0x07: size = arcompact_handle18_05_07_dasm(DASM_PARAMS); break; // <illegal 0x18_05_07>
	}

	return size;
}
// op bits remaining for 0x18_05_xx subgroups 0x001f
int arcompact_handle18_05_00_dasm(DASM_OPS_16)
{
	int u = op & 0x001f;
	op &= ~0x001f; // all bits now used

	print("ADD_S %02x (SP)", u);
	return 2;

}

int arcompact_handle18_05_01_dasm(DASM_OPS_16)
{
	int u = op & 0x001f;
	op &= ~0x001f; // all bits now used

	print("SUB_S %02x (SP)", u);
	return 2;
}


int arcompact_handle18_05_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_02> (%04x)", op); return 2;}
int arcompact_handle18_05_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_03> (%04x)", op); return 2;}
int arcompact_handle18_05_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_04> (%04x)", op); return 2;}
int arcompact_handle18_05_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_05> (%04x)", op); return 2;}
int arcompact_handle18_05_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_06> (%04x)", op); return 2;}
int arcompact_handle18_05_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_05_07> (%04x)", op); return 2;}


int arcompact_handle18_06_dasm(DASM_OPS_16) 
{
	int size = 2;
	UINT8 subinstr2 = (op & 0x001f) >> 0;
	op &= ~0x001f;

	switch (subinstr2)
	{
		case 0x00: size = arcompact_handle18_06_00_dasm(DASM_PARAMS); break; // <illegal 0x18_06_00>
		case 0x01: size = arcompact_handle18_06_01_dasm(DASM_PARAMS); break; // POP_S b
		case 0x02: size = arcompact_handle18_06_02_dasm(DASM_PARAMS); break; // <illegal 0x18_06_02>
		case 0x03: size = arcompact_handle18_06_03_dasm(DASM_PARAMS); break; // <illegal 0x18_06_03>
		case 0x04: size = arcompact_handle18_06_04_dasm(DASM_PARAMS); break; // <illegal 0x18_06_04>
		case 0x05: size = arcompact_handle18_06_05_dasm(DASM_PARAMS); break; // <illegal 0x18_06_05>
		case 0x06: size = arcompact_handle18_06_06_dasm(DASM_PARAMS); break; // <illegal 0x18_06_06>
		case 0x07: size = arcompact_handle18_06_07_dasm(DASM_PARAMS); break; // <illegal 0x18_06_07>
		case 0x08: size = arcompact_handle18_06_08_dasm(DASM_PARAMS); break; // <illegal 0x18_06_08>
		case 0x09: size = arcompact_handle18_06_09_dasm(DASM_PARAMS); break; // <illegal 0x18_06_09>
		case 0x0a: size = arcompact_handle18_06_0a_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0a>
		case 0x0b: size = arcompact_handle18_06_0b_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0b>
		case 0x0c: size = arcompact_handle18_06_0c_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0c>
		case 0x0d: size = arcompact_handle18_06_0d_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0d>
		case 0x0e: size = arcompact_handle18_06_0e_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0e>
		case 0x0f: size = arcompact_handle18_06_0f_dasm(DASM_PARAMS); break; // <illegal 0x18_06_0f>
		case 0x10: size = arcompact_handle18_06_10_dasm(DASM_PARAMS); break; // <illegal 0x18_06_10>
		case 0x11: size = arcompact_handle18_06_11_dasm(DASM_PARAMS); break; // POP_S blink
		case 0x12: size = arcompact_handle18_06_12_dasm(DASM_PARAMS); break; // <illegal 0x18_06_12>
		case 0x13: size = arcompact_handle18_06_13_dasm(DASM_PARAMS); break; // <illegal 0x18_06_13>
		case 0x14: size = arcompact_handle18_06_14_dasm(DASM_PARAMS); break; // <illegal 0x18_06_14>
		case 0x15: size = arcompact_handle18_06_15_dasm(DASM_PARAMS); break; // <illegal 0x18_06_15>
		case 0x16: size = arcompact_handle18_06_16_dasm(DASM_PARAMS); break; // <illegal 0x18_06_16>
		case 0x17: size = arcompact_handle18_06_17_dasm(DASM_PARAMS); break; // <illegal 0x18_06_17>
		case 0x18: size = arcompact_handle18_06_18_dasm(DASM_PARAMS); break; // <illegal 0x18_06_18>
		case 0x19: size = arcompact_handle18_06_19_dasm(DASM_PARAMS); break; // <illegal 0x18_06_19>
		case 0x1a: size = arcompact_handle18_06_1a_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1a>
		case 0x1b: size = arcompact_handle18_06_1b_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1b>
		case 0x1c: size = arcompact_handle18_06_1c_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1c>
		case 0x1d: size = arcompact_handle18_06_1d_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1d>
		case 0x1e: size = arcompact_handle18_06_1e_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1e>
		case 0x1f: size = arcompact_handle18_06_1f_dasm(DASM_PARAMS); break; // <illegal 0x18_06_1f>
	}

	return size;
}


// op bits remaining for 0x18_06_xx subgroups 0x0700 
int arcompact_handle18_06_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_00> (%04x)",  op); return 2;}

int arcompact_handle18_06_01_dasm(DASM_OPS_16) 
{
	int b = (op & 0x0700) >> 8;
	op &= ~0x0700; // all bits now used

	print("POP_S [%02x]", b);

	return 2;
}

int arcompact_handle18_06_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_02> (%04x)", op); return 2;}
int arcompact_handle18_06_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_03> (%04x)", op); return 2;}
int arcompact_handle18_06_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_04> (%04x)", op); return 2;}
int arcompact_handle18_06_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_05> (%04x)", op); return 2;}
int arcompact_handle18_06_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_06> (%04x)", op); return 2;}
int arcompact_handle18_06_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_07> (%04x)", op); return 2;}
int arcompact_handle18_06_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_08> (%04x)", op); return 2;}
int arcompact_handle18_06_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_09> (%04x)", op); return 2;}
int arcompact_handle18_06_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0a> (%04x)", op); return 2;}
int arcompact_handle18_06_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0b> (%04x)", op); return 2;}
int arcompact_handle18_06_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0c> (%04x)", op); return 2;}
int arcompact_handle18_06_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0d> (%04x)", op); return 2;}
int arcompact_handle18_06_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0e> (%04x)", op); return 2;}
int arcompact_handle18_06_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_0f> (%04x)", op); return 2;}
int arcompact_handle18_06_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_10> (%04x)", op); return 2;}

int arcompact_handle18_06_11_dasm(DASM_OPS_16) 
{
	int res = (op & 0x0700) >> 8;
	op &= ~0x0700; // all bits now used

	if (res)
		print("POP_S [BLINK] (Reserved Bits set %04x)", op);
	else
		print("POP_S [BLINK]");

	return 2;
}

int arcompact_handle18_06_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_12> (%04x)",  op); return 2;}
int arcompact_handle18_06_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_13> (%04x)",  op); return 2;}
int arcompact_handle18_06_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_14> (%04x)",  op); return 2;}
int arcompact_handle18_06_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_15> (%04x)",  op); return 2;}
int arcompact_handle18_06_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_16> (%04x)",  op); return 2;}
int arcompact_handle18_06_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_17> (%04x)",  op); return 2;}
int arcompact_handle18_06_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_18> (%04x)",  op); return 2;}
int arcompact_handle18_06_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_19> (%04x)",  op); return 2;}
int arcompact_handle18_06_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1a> (%04x)",  op); return 2;}
int arcompact_handle18_06_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1b> (%04x)",  op); return 2;}
int arcompact_handle18_06_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1c> (%04x)",  op); return 2;}
int arcompact_handle18_06_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1d> (%04x)",  op); return 2;}
int arcompact_handle18_06_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1e> (%04x)",  op); return 2;}
int arcompact_handle18_06_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_06_1f> (%04x)",  op); return 2;}




int arcompact_handle18_07_dasm(DASM_OPS_16) 
{
	int size = 2;
	UINT8 subinstr2 = (op & 0x001f) >> 0;
	op &= ~0x001f;

	switch (subinstr2)
	{
		case 0x00: size = arcompact_handle18_07_00_dasm(DASM_PARAMS); break; // <illegal 0x18_07_00>
		case 0x01: size = arcompact_handle18_07_01_dasm(DASM_PARAMS); break; // PUSH_S b
		case 0x02: size = arcompact_handle18_07_02_dasm(DASM_PARAMS); break; // <illegal 0x18_07_02>
		case 0x03: size = arcompact_handle18_07_03_dasm(DASM_PARAMS); break; // <illegal 0x18_07_03>
		case 0x04: size = arcompact_handle18_07_04_dasm(DASM_PARAMS); break; // <illegal 0x18_07_04>
		case 0x05: size = arcompact_handle18_07_05_dasm(DASM_PARAMS); break; // <illegal 0x18_07_05>
		case 0x06: size = arcompact_handle18_07_06_dasm(DASM_PARAMS); break; // <illegal 0x18_07_06>
		case 0x07: size = arcompact_handle18_07_07_dasm(DASM_PARAMS); break; // <illegal 0x18_07_07>
		case 0x08: size = arcompact_handle18_07_08_dasm(DASM_PARAMS); break; // <illegal 0x18_07_08>
		case 0x09: size = arcompact_handle18_07_09_dasm(DASM_PARAMS); break; // <illegal 0x18_07_09>
		case 0x0a: size = arcompact_handle18_07_0a_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0a>
		case 0x0b: size = arcompact_handle18_07_0b_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0b>
		case 0x0c: size = arcompact_handle18_07_0c_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0c>
		case 0x0d: size = arcompact_handle18_07_0d_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0d>
		case 0x0e: size = arcompact_handle18_07_0e_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0e>
		case 0x0f: size = arcompact_handle18_07_0f_dasm(DASM_PARAMS); break; // <illegal 0x18_07_0f>
		case 0x10: size = arcompact_handle18_07_10_dasm(DASM_PARAMS); break; // <illegal 0x18_07_10>
		case 0x11: size = arcompact_handle18_07_11_dasm(DASM_PARAMS); break; // PUSH_S blink
		case 0x12: size = arcompact_handle18_07_12_dasm(DASM_PARAMS); break; // <illegal 0x18_07_12>
		case 0x13: size = arcompact_handle18_07_13_dasm(DASM_PARAMS); break; // <illegal 0x18_07_13>
		case 0x14: size = arcompact_handle18_07_14_dasm(DASM_PARAMS); break; // <illegal 0x18_07_14>
		case 0x15: size = arcompact_handle18_07_15_dasm(DASM_PARAMS); break; // <illegal 0x18_07_15>
		case 0x16: size = arcompact_handle18_07_16_dasm(DASM_PARAMS); break; // <illegal 0x18_07_16>
		case 0x17: size = arcompact_handle18_07_17_dasm(DASM_PARAMS); break; // <illegal 0x18_07_17>
		case 0x18: size = arcompact_handle18_07_18_dasm(DASM_PARAMS); break; // <illegal 0x18_07_18>
		case 0x19: size = arcompact_handle18_07_19_dasm(DASM_PARAMS); break; // <illegal 0x18_07_19>
		case 0x1a: size = arcompact_handle18_07_1a_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1a>
		case 0x1b: size = arcompact_handle18_07_1b_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1b>
		case 0x1c: size = arcompact_handle18_07_1c_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1c>
		case 0x1d: size = arcompact_handle18_07_1d_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1d>
		case 0x1e: size = arcompact_handle18_07_1e_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1e>
		case 0x1f: size = arcompact_handle18_07_1f_dasm(DASM_PARAMS); break; // <illegal 0x18_07_1f>
	}

	return size;
}


// op bits remaining for 0x18_07_xx subgroups 0x0700 
int arcompact_handle18_07_00_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_00> (%04x)",  op); return 2;}

int arcompact_handle18_07_01_dasm(DASM_OPS_16) 
{
	int b = (op & 0x0700) >> 8;
	op &= ~0x0700; // all bits now used

	print("PUSH_S [%02x]", b);

	return 2;
}

int arcompact_handle18_07_02_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_02> (%04x)", op); return 2;}
int arcompact_handle18_07_03_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_03> (%04x)", op); return 2;}
int arcompact_handle18_07_04_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_04> (%04x)", op); return 2;}
int arcompact_handle18_07_05_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_05> (%04x)", op); return 2;}
int arcompact_handle18_07_06_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_06> (%04x)", op); return 2;}
int arcompact_handle18_07_07_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_07> (%04x)", op); return 2;}
int arcompact_handle18_07_08_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_08> (%04x)", op); return 2;}
int arcompact_handle18_07_09_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_09> (%04x)", op); return 2;}
int arcompact_handle18_07_0a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0a> (%04x)", op); return 2;}
int arcompact_handle18_07_0b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0b> (%04x)", op); return 2;}
int arcompact_handle18_07_0c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0c> (%04x)", op); return 2;}
int arcompact_handle18_07_0d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0d> (%04x)", op); return 2;}
int arcompact_handle18_07_0e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0e> (%04x)", op); return 2;}
int arcompact_handle18_07_0f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_0f> (%04x)", op); return 2;}
int arcompact_handle18_07_10_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_10> (%04x)", op); return 2;}

int arcompact_handle18_07_11_dasm(DASM_OPS_16) 
{
	int res = (op & 0x0700) >> 8;
	op &= ~0x0700; // all bits now used

	if (res)
		print("PUSH_S [BLINK] (Reserved Bits set %04x)", op);
	else
		print("PUSH_S [BLINK]");

	return 2;
}

int arcompact_handle18_07_12_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_12> (%04x)",  op); return 2;}
int arcompact_handle18_07_13_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_13> (%04x)",  op); return 2;}
int arcompact_handle18_07_14_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_14> (%04x)",  op); return 2;}
int arcompact_handle18_07_15_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_15> (%04x)",  op); return 2;}
int arcompact_handle18_07_16_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_16> (%04x)",  op); return 2;}
int arcompact_handle18_07_17_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_17> (%04x)",  op); return 2;}
int arcompact_handle18_07_18_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_18> (%04x)",  op); return 2;}
int arcompact_handle18_07_19_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_19> (%04x)",  op); return 2;}
int arcompact_handle18_07_1a_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1a> (%04x)",  op); return 2;}
int arcompact_handle18_07_1b_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1b> (%04x)",  op); return 2;}
int arcompact_handle18_07_1c_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1c> (%04x)",  op); return 2;}
int arcompact_handle18_07_1d_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1d> (%04x)",  op); return 2;}
int arcompact_handle18_07_1e_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1e> (%04x)",  op); return 2;}
int arcompact_handle18_07_1f_dasm(DASM_OPS_16)  { print("<illegal 0x18_07_1f> (%04x)",  op); return 2;}


int arcompact_handle19_dasm(DASM_OPS_16)
{
	print("GP Instr (%04x)",  op);
	return 2;
}


int arcompact_handle1a_dasm(DASM_OPS_16)
{
	print("PCL Instr (%04x)", op);
	return 2;
}

int arcompact_handle1b_dasm(DASM_OPS_16)
{
	print("MOV_S (%04x)", op);
	return 2;
}

int arcompact_handle1c_dasm(DASM_OPS_16)
{
	print("ADD_S/CMP_S (%04x)", op);
	return 2;
}

int arcompact_handle1d_dasm(DASM_OPS_16)
{
	print("BRcc_S (%04x)", op);
	return 2;
}

int arcompact_handle1e_dasm(DASM_OPS_16)
{
	print("Bcc_S (%04x)", op);
	return 2;
}

int arcompact_handle1f_dasm(DASM_OPS_16)
{
	print("BL_S (%04x)", op);
	return 2;
}

CPU_DISASSEMBLE(arcompact)
{
	int size = 2;

	UINT32 op = oprom[0] | (oprom[1] << 8);
	output = buffer;

	UINT8 instruction = ARCOMPACT_OPERATION;

	if (instruction < 0x0c)
	{
		size = 4;
		op <<= 16;
		op |= oprom[2] | (oprom[3] << 8);

		op &= ~0xf8000000;

		switch (instruction) // 32-bit instructions (with optional extra dword for immediate data)
		{
			case 0x00: size = arcompact_handle00_dasm(DASM_PARAMS);	break; // Bcc
			case 0x01: size = arcompact_handle01_dasm(DASM_PARAMS);	break; // BLcc/BRcc
			case 0x02: size = arcompact_handle02_dasm(DASM_PARAMS);	break; // LD r+o
			case 0x03: size = arcompact_handle03_dasm(DASM_PARAMS);	break; // ST r+o
			case 0x04: size = arcompact_handle04_dasm(DASM_PARAMS);	break; // op a,b,c (basecase)
			case 0x05: size = arcompact_handle05_dasm(DASM_PARAMS);	break; // op a,b,c (05 ARC ext)
			case 0x06: size = arcompact_handle06_dasm(DASM_PARAMS);	break; // op a,b,c (06 ARC ext)
			case 0x07: size = arcompact_handle07_dasm(DASM_PARAMS);	break; // op a,b,c (07 User ext)
			case 0x08: size = arcompact_handle08_dasm(DASM_PARAMS);	break; // op a,b,c (08 User ext)
			case 0x09: size = arcompact_handle09_dasm(DASM_PARAMS);	break; // op a,b,c (09 Market ext)
			case 0x0a: size = arcompact_handle0a_dasm(DASM_PARAMS);	break; // op a,b,c (0a Market ext)
			case 0x0b: size = arcompact_handle0b_dasm(DASM_PARAMS);	break; // op a,b,c (0b Market ext)
		}
	}
	else
	{	
		size = 2;
		op &= ~0xf800;


		switch (instruction) // 16-bit instructions
		{
			case 0x0c: size = arcompact_handle0c_dasm(DASM_PARAMS);	break; // Load/Add reg-reg
			case 0x0d: size = arcompact_handle0d_dasm(DASM_PARAMS);	break; // Add/Sub/Shft imm
			case 0x0e: size = arcompact_handle0e_dasm(DASM_PARAMS);	break; // Mov/Cmp/Add
			case 0x0f: size = arcompact_handle0f_dasm(DASM_PARAMS);	break; // op_S b,b,c (single 16-bit ops)
			case 0x10: size = arcompact_handle10_dasm(DASM_PARAMS);	break; // LD_S
			case 0x11: size = arcompact_handle11_dasm(DASM_PARAMS);	break; // LDB_S
			case 0x12: size = arcompact_handle12_dasm(DASM_PARAMS);	break; // LDW_S
			case 0x13: size = arcompact_handle13_dasm(DASM_PARAMS);	break; // LSW_S.X
			case 0x14: size = arcompact_handle14_dasm(DASM_PARAMS);	break; // ST_S
			case 0x15: size = arcompact_handle15_dasm(DASM_PARAMS);	break; // STB_S
			case 0x16: size = arcompact_handle16_dasm(DASM_PARAMS);	break; // STW_S
			case 0x17: size = arcompact_handle17_dasm(DASM_PARAMS);	break; // Shift/Sub/Bit
			case 0x18: size = arcompact_handle18_dasm(DASM_PARAMS);	break; // Stack Instr
			case 0x19: size = arcompact_handle19_dasm(DASM_PARAMS);	break; // GP Instr
			case 0x1a: size = arcompact_handle1a_dasm(DASM_PARAMS);	break; // PCL Instr
			case 0x1b: size = arcompact_handle1b_dasm(DASM_PARAMS);	break; // MOV_S
			case 0x1c: size = arcompact_handle1c_dasm(DASM_PARAMS);	break; // ADD_S/CMP_S
			case 0x1d: size = arcompact_handle1d_dasm(DASM_PARAMS);	break; // BRcc_S
			case 0x1e: size = arcompact_handle1e_dasm(DASM_PARAMS);	break; // Bcc_S
			case 0x1f: size = arcompact_handle1f_dasm(DASM_PARAMS);	break; // BL_S
		}
	}

	return size | DASMFLAG_SUPPORTED;
}