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
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
|
.file "uxn-core.s"
.section .iwram, "ax", %progbits
.extern uxn_ram
.align
@
@ Core variables
@
.global wst
wst: .space 256
.global wst_ptr
wst_ptr: .word wst
.global rst
rst: .space 256
.global rst_ptr
rst_ptr: .word rst
@ UXN evaluation function.
@
@ r0: PC pointer (argument for this function is the offset from UXN RAM).
@ r1: Stack pointer (wst).
@ r2: Stack pointer (rst).
@ r3-r6: Scratch registers.
@ r7: Ram ptr.
@
.global uxn_eval_asm
uxn_eval_asm:
@ Ensure PC is not null.
cmp r0, #0
bxeq lr
@ Initialization.
push {r4-r7}
ldr r1, wst_ptr
ldr r2, rst_ptr
ldr r7, =uxn_ram
add r0, r0, r7
uxn_decode:
ldrb r3, [r0], #1 @ current OP value / table index
@ Decode OP based on table lookup.
adr r4, op_table @ decoding table
ldr r4, [r4, r3, lsl #2] @ op_table[idx * 4]
bx r4 @ op_table[idx * 4]()
uxn_ret:
@ Update stack pointers and return.
adr r0, wst_ptr
str r1, [r0]
adr r0, rst_ptr
str r2, [r0]
pop {r4-r7}
bx lr
@
@ Macros.
@
.macro next a
ldrb \a, [r0], #1
.endm
.macro wpop8 a
ldrb \a, [r1, #-1]!
.endm
.macro wpop8s a
ldrsb \a, [r1, #-1]!
.endm
.macro wpop16 a, b
ldrb \a, [r1, #-1]!
ldrb \b, [r1, #-1]!
orr \a, \a, \b, lsl #8
.endm
.macro wpush8 a
strb \a, [r1], #1
.endm
.macro wpush16 a
strb \a, [r1, #1]
lsr \a, #8
strb \a, [r1], #2
.endm
.macro wpeek8 a, off
ldrb \a, [r1, \off]
.endm
.macro wpeek8s a, off
ldrsb \a, [r1, \off]
.endm
.macro wpeek16 a, b, offa, offb
ldrb \a, [r1, \offa]
ldrb \b, [r1, \offb]
orr \a, \a, \b, lsl #8
.endm
.macro rpop8 a
ldrb \a, [r2, #-1]!
.endm
.macro rpop8s a
ldrsb \a, [r2, #-1]!
.endm
.macro rpop16 a, b
ldrb \a, [r2, #-1]!
ldrb \b, [r2, #-1]!
orr \a, \a, \b, lsl #8
.endm
.macro rpush8 a
strb \a, [r2], #1
.endm
.macro rpush16 a
strb \a, [r2, #1]
lsr \a, #8
strb \a, [r2], #2
.endm
.macro rpeek8 a, off
ldrb \a, [r2, \off]
.endm
.macro rpeek8s a, off
ldrsb \a, [r2, \off]
.endm
.macro rpeek16 a, b, offa, offb
ldrb \a, [r2, \offa]
ldrb \b, [r2, \offb]
orr \a, \a, \b, lsl #8
.endm
.macro zsave8 a, off
strb \a, [r7, \off]
.endm
.macro zsave16 a, off
add \off, r7
strb \a, [\off, #1]
lsr \a, #8
strb \a, [\off]
.endm
.macro zload8 a, off
ldrb \a, [r7, \off]
.endm
.macro rload8 a, off
ldrb \a, [r0, \off]
.endm
.macro aload8 a, off
ldrb \a, [r7, \off]
.endm
.macro asave8 a, off
strb \a, [r7, \off]
.endm
.macro asave16 a, off
add \off, r7
strb \a, [\off, #1]
lsr \a, #8
strb \a, [\off]
.endm
.macro rsave8 a, off
strb \a, [r0, \off]
.endm
.macro rsave16 a, off
adds \off, r0
strb \a, [\off, #1]
lsr \a, #8
strb \a, [\off]
.endm
@
@ OP table
@
op_table:
.word brk @ 0x00
.word inc @ 0x01
.word pop @ 0x02
.word nip @ 0x03
.word swp @ 0x04
.word rot @ 0x05
.word dup @ 0x06
.word ovr @ 0x07
.word equ @ 0x08
.word neq @ 0x09
.word gth @ 0x0a
.word lth @ 0x0b
.word jmp @ 0x0c
.word jcn @ 0x0d
.word jsr @ 0x0e
.word sth @ 0x0f
.word ldz @ 0x10
.word stz @ 0x11
.word ldr @ 0x12
.word str @ 0x13
.word lda @ 0x14
.word sta @ 0x15
.word dei @ 0x16
.word deo @ 0x17
.word add @ 0x18
.word sub @ 0x19
.word mul @ 0x1a
.word div @ 0x1b
.word and @ 0x1c
.word ora @ 0x1d
.word eor @ 0x1e
.word sft @ 0x1f
.word jci @ 0x20
.word inc2 @ 0x21
.word pop2 @ 0x22
.word nip2 @ 0x23
.word swp2 @ 0x24
.word rot2 @ 0x25
.word dup2 @ 0x26
.word ovr2 @ 0x27
.word equ2 @ 0x28
.word neq2 @ 0x29
.word gth2 @ 0x2a
.word lth2 @ 0x2b
.word jmp2 @ 0x2c
.word jcn2 @ 0x2d
.word jsr2 @ 0x2e
.word sth2 @ 0x2f
.word ldz2 @ 0x30
.word stz2 @ 0x31
.word ldr2 @ 0x32
.word str2 @ 0x33
.word lda2 @ 0x34
.word sta2 @ 0x35
.word dei2 @ 0x36
.word deo2 @ 0x37
.word add2 @ 0x38
.word sub2 @ 0x39
.word mul2 @ 0x3a
.word div2 @ 0x3b
.word and2 @ 0x3c
.word ora2 @ 0x3d
.word eor2 @ 0x3e
.word sft2 @ 0x3f
.word jmi @ 0x40
.word incr @ 0x41
.word popr @ 0x42
.word nipr @ 0x43
.word swpr @ 0x44
.word rotr @ 0x45
.word dupr @ 0x46
.word ovrr @ 0x47
.word equr @ 0x48
.word neqr @ 0x49
.word gthr @ 0x4a
.word lthr @ 0x4b
.word jmpr @ 0x4c
.word jcnr @ 0x4d
.word jsrr @ 0x4e
.word sthr @ 0x4f
.word ldzr @ 0x50
.word stzr @ 0x51
.word ldrr @ 0x52
.word strr @ 0x53
.word ldar @ 0x54
.word star @ 0x55
.word deir @ 0x56
.word deor @ 0x57
.word addr @ 0x58
.word subr @ 0x59
.word mulr @ 0x5a
.word divr @ 0x5b
.word andr @ 0x5c
.word orar @ 0x5d
.word eorr @ 0x5e
.word sftr @ 0x5f
.word jsi @ 0x60
.word inc2r @ 0x61
.word pop2r @ 0x62
.word nip2r @ 0x63
.word swp2r @ 0x64
.word rot2r @ 0x65
.word dup2r @ 0x66
.word ovr2r @ 0x67
.word equ2r @ 0x68
.word neq2r @ 0x69
.word gth2r @ 0x6a
.word lth2r @ 0x6b
.word jmp2r @ 0x6c
.word jcn2r @ 0x6d
.word jsr2r @ 0x6e
.word sth2r @ 0x6f
.word ldz2r @ 0x70
.word stz2r @ 0x71
.word ldr2r @ 0x72
.word str2r @ 0x73
.word lda2r @ 0x74
.word sta2r @ 0x75
.word dei2r @ 0x76
.word deo2r @ 0x77
.word add2r @ 0x78
.word sub2r @ 0x79
.word mul2r @ 0x7a
.word div2r @ 0x7b
.word and2r @ 0x7c
.word ora2r @ 0x7d
.word eor2r @ 0x7e
.word sft2r @ 0x7f
.word lit @ 0x80
.word inck @ 0x81
.word popk @ 0x82
.word nipk @ 0x83
.word swpk @ 0x84
.word rotk @ 0x85
.word dupk @ 0x86
.word ovrk @ 0x87
.word equk @ 0x88
.word neqk @ 0x89
.word gthk @ 0x8a
.word lthk @ 0x8b
.word jmpk @ 0x8c
.word jcnk @ 0x8d
.word jsrk @ 0x8e
.word sthk @ 0x8f
.word ldzk @ 0x90
.word stzk @ 0x91
.word ldrk @ 0x92
.word strk @ 0x93
.word ldak @ 0x94
.word stak @ 0x95
.word deik @ 0x96
.word deok @ 0x97
.word addk @ 0x98
.word subk @ 0x99
.word mulk @ 0x9a
.word divk @ 0x9b
.word andk @ 0x9c
.word orak @ 0x9d
.word eork @ 0x9e
.word sftk @ 0x9f
.word lit2 @ 0xa0
.word inc2k @ 0xa1
.word pop2k @ 0xa2
.word nip2k @ 0xa3
.word swp2k @ 0xa4
.word rot2k @ 0xa5
.word dup2k @ 0xa6
.word ovr2k @ 0xa7
.word equ2k @ 0xa8
.word neq2k @ 0xa9
.word gth2k @ 0xaa
.word lth2k @ 0xab
.word jmp2k @ 0xac
.word jcn2k @ 0xad
.word jsr2k @ 0xae
.word sth2k @ 0xaf
.word ldz2k @ 0xb0
.word stz2k @ 0xb1
.word ldr2k @ 0xb2
.word str2k @ 0xb3
.word lda2k @ 0xb4
.word sta2k @ 0xb5
.word dei2k @ 0xb6
.word deo2k @ 0xb7
.word add2k @ 0xb8
.word sub2k @ 0xb9
.word mul2k @ 0xba
.word div2k @ 0xbb
.word and2k @ 0xbc
.word ora2k @ 0xbd
.word eor2k @ 0xbe
.word sft2k @ 0xbf
.word litr @ 0xc0
.word inckr @ 0xc1
.word popkr @ 0xc2
.word nipkr @ 0xc3
.word swpkr @ 0xc4
.word rotkr @ 0xc5
.word dupkr @ 0xc6
.word ovrkr @ 0xc7
.word equkr @ 0xc8
.word neqkr @ 0xc9
.word gthkr @ 0xca
.word lthkr @ 0xcb
.word jmpkr @ 0xcc
.word jcnkr @ 0xcd
.word jsrkr @ 0xce
.word sthkr @ 0xcf
.word ldzkr @ 0xd0
.word stzkr @ 0xd1
.word ldrkr @ 0xd2
.word strkr @ 0xd3
.word ldakr @ 0xd4
.word stakr @ 0xd5
.word deikr @ 0xd6
.word deokr @ 0xd7
.word addkr @ 0xd8
.word subkr @ 0xd9
.word mulkr @ 0xda
.word divkr @ 0xdb
.word andkr @ 0xdc
.word orakr @ 0xdd
.word eorkr @ 0xde
.word sftkr @ 0xdf
.word lit2r @ 0xe0
.word inc2kr @ 0xe1
.word pop2kr @ 0xe2
.word nip2kr @ 0xe3
.word swp2kr @ 0xe4
.word rot2kr @ 0xe5
.word dup2kr @ 0xe6
.word ovr2kr @ 0xe7
.word equ2kr @ 0xe8
.word neq2kr @ 0xe9
.word gth2kr @ 0xea
.word lth2kr @ 0xeb
.word jmp2kr @ 0xec
.word jcn2kr @ 0xed
.word jsr2kr @ 0xee
.word sth2kr @ 0xef
.word ldz2kr @ 0xf0
.word stz2kr @ 0xf1
.word ldr2kr @ 0xf2
.word str2kr @ 0xf3
.word lda2kr @ 0xf4
.word sta2kr @ 0xf5
.word dei2kr @ 0xf6
.word deo2kr @ 0xf7
.word add2kr @ 0xf8
.word sub2kr @ 0xf9
.word mul2kr @ 0xfa
.word div2kr @ 0xfb
.word and2kr @ 0xfc
.word ora2kr @ 0xfd
.word eor2kr @ 0xfe
.word sft2kr @ 0xff
@
@ OP implementations.
@
dei:
wpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
wpush8 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
dei2:
wpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
wpush16 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
deo:
@ Get args (idx/port/value).
wpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
wpop8 r5 @ value
@ Find current devide.
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
@ Save registers that can be affected.
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
@ Call the deo function.
ldr r0, =device_data
lsl r4, #4
add r0, r4
strb r5, [r0, r3]
mov r1, r3
mov lr, pc
bx r6
@ Restore saved variables.
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
deo2:
@ Get args (idx/port/value).
wpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
wpop16 r5, r6 @ value
@ Find current devide.
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
@ Save registers that can be affected.
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
@ Call the deo function.
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
add r3, r0
strb r5, [r3, #1]
lsr r5, #8
strb r5, [r3]
mov lr, pc
bx r6
@ Restore saved variables.
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
deir:
rpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
rpush8 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
dei2r:
rpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
rpush16 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
deor:
@ Get args (idx/port/value).
rpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
rpop8 r5 @ value
@ Find current devide.
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
@ Save registers that can be affected.
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
@ Call the deo function.
ldr r0, =device_data
lsl r4, #4
add r0, r4
strb r5, [r0, r3]
mov r1, r3
mov lr, pc
bx r6
@ Restore saved variables.
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
deo2r:
@ Get args (idx/port/value).
rpop8 r3
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
rpop16 r5, r6 @ value
@ Find current devide.
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
@ Save registers that can be affected.
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
@ Call the deo function.
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
add r3, r0
strb r5, [r3, #1]
lsr r5, #8
strb r5, [r3]
mov lr, pc
bx r6
@ Restore saved variables.
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
deik:
wpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
wpush8 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
dei2k:
wpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
wpush16 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
deok:
wpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
wpeek8 r5, #-2 @ value
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
strb r5, [r0, r3]
mov r1, r3
mov lr, pc
bx r6
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
deo2k:
wpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
wpeek16 r5, r6, #-2, #-3 @ value
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
add r3, r0
strb r5, [r3, #1]
lsr r5, #8
strb r5, [r3]
mov lr, pc
bx r6
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
deikr:
rpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
rpush8 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
dei2kr:
rpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
ldr r6, =dei_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
mov lr, pc
bx r6
ldr r1, wst_ptr
ldr r2, rst_ptr
rpush16 r0
ldmfd sp!, {r0, r7, lr}
b uxn_decode
deokr:
rpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
rpeek8 r5, #-2 @ value
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
strb r5, [r0, r3]
mov r1, r3
mov lr, pc
bx r6
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
deo2kr:
rpeek8 r3, #-1
mov r4, r3, lsr #4 @ idx
and r3, #0x0f @ port
rpeek16 r5, r6, #-2, #-3 @ value
ldr r6, =deo_map
ldr r6, [r6, r4, lsl #2]
stmfd sp!, {r0, r7, lr}
ldr r0, =wst_ptr
str r1, [r0]
ldr r0, =rst_ptr
str r2, [r0]
ldr r0, =device_data
lsl r4, #4
add r0, r4
mov r1, r3
add r3, r0
strb r5, [r3, #1]
lsr r5, #8
strb r5, [r3]
mov lr, pc
bx r6
ldmfd sp!, {r0, r7, lr}
ldr r1, wst_ptr
ldr r2, rst_ptr
b uxn_decode
.ltorg
.align 2
.global device_data
device_data:
.global device_0
device_0: .space 16
.global device_1
device_1: .space 16
.global device_2
device_2: .space 16
.global device_3
device_3: .space 16
.global device_4
device_4: .space 16
.global device_5
device_5: .space 16
.global device_6
device_6: .space 16
.global device_7
device_7: .space 16
.global device_8
device_8: .space 16
.global device_9
device_9: .space 16
.global device_a
device_a: .space 16
.global device_b
device_b: .space 16
.global device_c
device_c: .space 16
.global device_d
device_d: .space 16
.global device_e
device_e: .space 16
.global device_f
device_f: .space 16
.global dei_map
dei_map:
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.global deo_map
deo_map:
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
.word uxn_ret
brk:
b uxn_ret
jci:
ldrb r5, [r0], #1
ldrb r3, [r0], #1
orr r3, r3, r5, lsl #8
lsl r3, r3, #16
asr r3, r3, #16
wpop8 r4
cmp r4, #0
addne r0, r3
b uxn_decode
jmi:
ldrb r5, [r0], #1
ldrb r3, [r0], #1
orr r3, r3, r5, lsl #8
lsl r3, r3, #16
asr r3, r3, #16
add r0, r3
b uxn_decode
jsi:
ldrb r5, [r0], #1
ldrb r3, [r0], #1
orr r3, r3, r5, lsl #8
lsl r3, r3, #16
asr r3, r3, #16
mov r4, r0
rpush16 r4
add r0, r3
b uxn_decode
lit:
next r3
wpush8 r3
b uxn_decode
lit2:
next r3
next r4
wpush8 r3
wpush8 r4
b uxn_decode
litr:
next r3
rpush8 r3
b uxn_decode
lit2r:
next r3
next r4
rpush8 r3
rpush8 r4
b uxn_decode
.ltorg
.align 2
inc:
wpop8 r3
add r3, #1
wpush8 r3
b uxn_decode
inc2:
wpop16 r3, r5
add r3, r3, #1
wpush16 r3
b uxn_decode
pop:
sub r1, #1
b uxn_decode
pop2:
sub r1, #2
b uxn_decode
nip:
wpop8 r3
strb r3, [r1, #-1]
b uxn_decode
nip2:
wpop16 r3, r5
strb r3, [r1, #-1]
lsr r3, #8
strb r3, [r1, #-2]
b uxn_decode
swp:
wpop8 r3
wpop8 r4
wpush8 r3
wpush8 r4
b uxn_decode
swp2:
wpop16 r3, r5
wpop16 r4, r5
wpush16 r3
wpush16 r4
b uxn_decode
rot:
wpop8 r5
wpop8 r4
wpop8 r3
wpush8 r4
wpush8 r5
wpush8 r3
b uxn_decode
rot2:
wpop16 r5, r6
wpop16 r4, r6
wpop16 r3, r6
wpush16 r4
wpush16 r5
wpush16 r3
b uxn_decode
dup:
wpeek8 r3, #-1
wpush8 r3
b uxn_decode
dup2:
wpeek8 r3, #-2
wpeek8 r4, #-1
wpush8 r3
wpush8 r4
b uxn_decode
ovr:
wpeek8 r3, #-2
wpush8 r3
b uxn_decode
ovr2:
wpeek8 r3, #-4
wpeek8 r4, #-3
wpush8 r3
wpush8 r4
b uxn_decode
equ:
wpop8 r3
wpop8 r4
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
wpush8 r4
b uxn_decode
equ2:
wpop16 r3, r5
wpop16 r4, r5
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
wpush8 r4
b uxn_decode
neq:
wpop8 r3
wpop8 r4
subs r3, r4, r3
movne r3, #1
wpush8 r3
b uxn_decode
neq2:
wpop16 r3, r5
wpop16 r4, r5
subs r3, r4, r3
movne r3, #1
wpush8 r3
b uxn_decode
gth:
wpop8 r3
wpop8 r4
cmp r4, r3
movls r3, #0
movhi r3, #1
wpush8 r3
b uxn_decode
gth2:
wpop16 r3, r5
wpop16 r4, r5
cmp r4, r3
movls r3, #0
movhi r3, #1
wpush8 r3
b uxn_decode
lth:
wpop8 r3
wpop8 r4
cmp r4, r3
movcs r3, #0
movcc r3, #1
wpush8 r3
b uxn_decode
lth2:
wpop16 r3, r5
wpop16 r4, r5
cmp r4, r3
movcs r3, #0
movcc r3, #1
wpush8 r3
b uxn_decode
jmp:
wpop8s r3
add r0, r3
b uxn_decode
jmp2:
wpop16 r3, r5
mov r0, r7
add r0, r0, r3
b uxn_decode
jcn:
wpop8s r3
wpop8 r4
cmp r4, #0
addne r0, r3
b uxn_decode
jcn2:
wpop16 r3, r5
wpop8 r4
cmp r4, #0
movne r0, r7
cmp r4, #0
addne r0, r0, r3
b uxn_decode
jsr:
mov r3, r0
sub r3, r3, r7
wpop8s r4
rpush16 r3
add r0, r4
b uxn_decode
jsr2:
mov r3, r0
sub r3, r3, r7
wpop16 r4, r5
rpush16 r3
mov r0, r7
add r0, r0, r4
b uxn_decode
sth:
wpop8 r3
rpush8 r3
b uxn_decode
sth2:
wpop16 r3, r5
rpush16 r3
b uxn_decode
ldz:
wpop8 r3
zload8 r4, r3
wpush8 r4
b uxn_decode
ldz2:
wpop8 r3
zload8 r4, r3
wpush8 r4
add r3, #1
zload8 r4, r3
wpush8 r4
b uxn_decode
stz:
wpop8 r3
wpop8 r4
zsave8 r4, r3
b uxn_decode
stz2:
wpop8 r3
wpop16 r4, r5
zsave16 r4, r3
b uxn_decode
ldr:
wpop8s r4
rload8 r3, r4
wpush8 r3
b uxn_decode
ldr2:
wpop8s r4
rload8 r3, r4
wpush8 r3
add r4, #1
rload8 r3, r4
wpush8 r3
b uxn_decode
str:
wpop8s r4
wpop8 r3
rsave8 r3, r4
b uxn_decode
str2:
wpop8s r4
wpop16 r3, r5
rsave16 r3, r4
b uxn_decode
lda:
wpop16 r4, r5
aload8 r3, r4
wpush8 r3
b uxn_decode
lda2:
wpop16 r4, r5
aload8 r3, r4
wpush8 r3
add r4, #1
aload8 r3, r4
wpush8 r3
b uxn_decode
sta:
wpop16 r4, r5
wpop8 r3
asave8 r3, r4
b uxn_decode
sta2:
wpop16 r4, r5
wpop16 r3, r5
asave16 r3, r4
b uxn_decode
add:
wpop8 r3
wpop8 r4
add r3, r3, r4
wpush8 r3
b uxn_decode
add2:
wpop16 r3, r5
wpop16 r4, r5
add r3, r3, r4
wpush16 r3
b uxn_decode
sub:
wpop8 r3
wpop8 r4
sub r4, r4, r3
wpush8 r4
b uxn_decode
sub2:
wpop16 r3, r5
wpop16 r4, r5
sub r3, r4, r3
wpush16 r3
b uxn_decode
mul:
wpop8 r3
wpop8 r4
mul r4, r3, r4
wpush8 r4
b uxn_decode
mul2:
wpop16 r3, r5
wpop16 r4, r5
mul r3, r4, r3
wpush16 r3
b uxn_decode
div:
wpop8 r3
wpop8 r4
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
wpush8 r3
b uxn_decode
div2:
wpop16 r3, r5
wpop16 r4, r5
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
wpush16 r3
b uxn_decode
and:
wpop8 r3
wpop8 r4
and r3, r3, r4
wpush8 r3
b uxn_decode
and2:
wpop16 r3, r5
wpop16 r4, r5
and r3, r3, r4
wpush16 r3
b uxn_decode
ora:
wpop8 r3
wpop8 r4
orr r3, r3, r4
wpush8 r3
b uxn_decode
ora2:
wpop16 r3, r5
wpop16 r4, r5
orr r3, r3, r4
wpush16 r3
b uxn_decode
eor:
wpop8 r3
wpop8 r4
eor r3, r3, r4
wpush8 r3
b uxn_decode
eor2:
wpop16 r3, r5
wpop16 r4, r5
eor r3, r3, r4
wpush16 r3
b uxn_decode
sft:
wpop8 r4
wpop8 r3
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
wpush8 r3
b uxn_decode
sft2:
wpop8 r4
wpop16 r3, r5
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
wpush16 r3
b uxn_decode
.ltorg
.align 2
incr:
rpop8 r3
add r3, #1
rpush8 r3
b uxn_decode
inc2r:
rpop16 r3, r5
add r3, r3, #1
rpush16 r3
b uxn_decode
popr:
sub r2, #1
b uxn_decode
pop2r:
sub r2, #2
b uxn_decode
nipr:
rpop8 r3
strb r3, [r2, #-1]
b uxn_decode
nip2r:
rpop16 r3, r5
strb r3, [r2, #-1]
lsr r3, #8
strb r3, [r2, #-2]
b uxn_decode
swpr:
rpop8 r3
rpop8 r4
rpush8 r3
rpush8 r4
b uxn_decode
swp2r:
rpop16 r3, r5
rpop16 r4, r5
rpush16 r3
rpush16 r4
b uxn_decode
rotr:
rpop8 r5
rpop8 r4
rpop8 r3
rpush8 r4
rpush8 r5
rpush8 r3
b uxn_decode
rot2r:
rpop16 r5, r6
rpop16 r4, r6
rpop16 r3, r6
rpush16 r4
rpush16 r5
rpush16 r3
b uxn_decode
dupr:
rpeek8 r3, #-1
rpush8 r3
b uxn_decode
dup2r:
rpeek8 r3, #-2
rpeek8 r4, #-1
rpush8 r3
rpush8 r4
b uxn_decode
ovrr:
rpeek8 r3, #-2
rpush8 r3
b uxn_decode
ovr2r:
rpeek8 r3, #-4
rpeek8 r4, #-3
rpush8 r3
rpush8 r4
b uxn_decode
equr:
rpop8 r3
rpop8 r4
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
rpush8 r4
b uxn_decode
equ2r:
rpop16 r3, r5
rpop16 r4, r5
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
rpush8 r4
b uxn_decode
neqr:
rpop8 r3
rpop8 r4
subs r3, r4, r3
movne r3, #1
rpush8 r3
b uxn_decode
neq2r:
rpop16 r3, r5
rpop16 r4, r5
subs r3, r4, r3
movne r3, #1
rpush8 r3
b uxn_decode
gthr:
rpop8 r3
rpop8 r4
cmp r4, r3
movls r3, #0
movhi r3, #1
rpush8 r3
b uxn_decode
gth2r:
rpop16 r3, r5
rpop16 r4, r5
cmp r4, r3
movls r3, #0
movhi r3, #1
rpush8 r3
b uxn_decode
lthr:
rpop8 r3
rpop8 r4
cmp r4, r3
movcs r3, #0
movcc r3, #1
rpush8 r3
b uxn_decode
lth2r:
rpop16 r3, r5
rpop16 r4, r5
cmp r4, r3
movcs r3, #0
movcc r3, #1
rpush8 r3
b uxn_decode
jmpr:
rpop8s r3
add r0, r3
b uxn_decode
jmp2r:
rpop16 r3, r5
mov r0, r7
add r0, r0, r3
b uxn_decode
jcnr:
rpop8s r3
rpop8 r4
cmp r4, #0
addne r0, r3
b uxn_decode
jcn2r:
rpop16 r3, r5
rpop8 r4
cmp r4, #0
movne r0, r7
cmp r4, #0
addne r0, r0, r3
b uxn_decode
jsrr:
mov r3, r0
sub r3, r3, r7
rpop8s r4
rpush16 r3
add r0, r4
b uxn_decode
jsr2r:
mov r3, r0
sub r3, r3, r7
rpop16 r4, r5
rpush16 r3
mov r0, r7
add r0, r0, r4
b uxn_decode
sthr:
rpop8 r3
wpush8 r3
b uxn_decode
sth2r:
rpop16 r3, r5
wpush16 r3
b uxn_decode
ldzr:
rpop8 r3
zload8 r4, r3
rpush8 r4
b uxn_decode
ldz2r:
rpop8 r3
zload8 r4, r3
rpush8 r4
add r3, #1
zload8 r4, r3
rpush8 r4
b uxn_decode
stzr:
rpop8 r3
rpop8 r4
zsave8 r4, r3
b uxn_decode
stz2r:
rpop8 r3
rpop16 r4, r5
zsave16 r4, r3
b uxn_decode
ldrr:
rpop8s r4
rload8 r3, r4
rpush8 r3
b uxn_decode
ldr2r:
rpop8s r4
rload8 r3, r4
rpush8 r3
add r4, #1
rload8 r3, r4
rpush8 r3
b uxn_decode
strr:
rpop8s r4
rpop8 r3
rsave8 r3, r4
b uxn_decode
str2r:
rpop8s r4
rpop16 r3, r5
rsave16 r3, r4
b uxn_decode
ldar:
rpop16 r4, r5
aload8 r3, r4
rpush8 r3
b uxn_decode
lda2r:
rpop16 r4, r5
aload8 r3, r4
rpush8 r3
add r4, #1
aload8 r3, r4
rpush8 r3
b uxn_decode
star:
rpop16 r4, r5
rpop8 r3
asave8 r3, r4
b uxn_decode
sta2r:
rpop16 r4, r5
rpop16 r3, r5
asave16 r3, r4
b uxn_decode
addr:
rpop8 r3
rpop8 r4
add r3, r3, r4
rpush8 r3
b uxn_decode
add2r:
rpop16 r3, r5
rpop16 r4, r5
add r3, r3, r4
rpush16 r3
b uxn_decode
subr:
rpop8 r3
rpop8 r4
sub r4, r4, r3
rpush8 r4
b uxn_decode
sub2r:
rpop16 r3, r5
rpop16 r4, r5
sub r3, r4, r3
rpush16 r3
b uxn_decode
mulr:
rpop8 r3
rpop8 r4
mul r4, r3, r4
rpush8 r4
b uxn_decode
mul2r:
rpop16 r3, r5
rpop16 r4, r5
mul r3, r4, r3
rpush16 r3
b uxn_decode
divr:
rpop8 r3
rpop8 r4
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
rpush8 r3
b uxn_decode
div2r:
rpop16 r3, r5
rpop16 r4, r5
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
rpush16 r3
b uxn_decode
andr:
rpop8 r3
rpop8 r4
and r3, r3, r4
rpush8 r3
b uxn_decode
and2r:
rpop16 r3, r5
rpop16 r4, r5
and r3, r3, r4
rpush16 r3
b uxn_decode
orar:
rpop8 r3
rpop8 r4
orr r3, r3, r4
rpush8 r3
b uxn_decode
ora2r:
rpop16 r3, r5
rpop16 r4, r5
orr r3, r3, r4
rpush16 r3
b uxn_decode
eorr:
rpop8 r3
rpop8 r4
eor r3, r3, r4
rpush8 r3
b uxn_decode
eor2r:
rpop16 r3, r5
rpop16 r4, r5
eor r3, r3, r4
rpush16 r3
b uxn_decode
sftr:
rpop8 r4
rpop8 r3
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
rpush8 r3
b uxn_decode
sft2r:
rpop8 r4
rpop16 r3, r5
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
rpush16 r3
b uxn_decode
.ltorg
.align 2
inck:
wpeek8 r3, #-1
add r3, #1
wpush8 r3
b uxn_decode
inc2k:
wpeek16 r3, r5, #-1, #-2
add r3, r3, #1
wpush16 r3
b uxn_decode
popk:
b uxn_decode
pop2k:
b uxn_decode
nipk:
wpeek8 r3, #-1
wpush8 r3
b uxn_decode
nip2k:
wpeek16 r3, r5, #-1, #-2
wpush16 r3
b uxn_decode
swpk:
wpeek8 r3, #-1
wpeek8 r4, #-2
wpush8 r3
wpush8 r4
b uxn_decode
swp2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
wpush16 r3
wpush16 r4
b uxn_decode
rotk:
wpeek8 r5, #-1
wpeek8 r4, #-2
wpeek8 r3, #-3
wpush8 r4
wpush8 r5
wpush8 r3
b uxn_decode
rot2k:
wpeek16 r5, r6, #-1, #-2
wpeek16 r4, r6, #-3, #-4
wpeek16 r3, r6, #-5, #-6
wpush16 r4
wpush16 r5
wpush16 r3
b uxn_decode
dupk:
wpeek8 r3, #-1
wpush8 r3
wpush8 r3
b uxn_decode
dup2k:
wpeek8 r3, #-2
wpeek8 r4, #-1
wpush8 r3
wpush8 r4
wpush8 r3
wpush8 r4
b uxn_decode
ovrk:
wpeek8 r3, #-2
wpeek8 r4, #-1
wpush8 r3
wpush8 r4
wpush8 r3
b uxn_decode
ovr2k:
wpeek8 r3, #-4
wpeek8 r4, #-3
wpeek8 r5, #-2
wpeek8 r6, #-1
wpush8 r3
wpush8 r4
wpush8 r5
wpush8 r6
wpush8 r3
wpush8 r4
b uxn_decode
equk:
wpeek8 r3, #-1
wpeek8 r4, #-2
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
wpush8 r4
b uxn_decode
equ2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
wpush8 r4
b uxn_decode
neqk:
wpeek8 r3, #-1
wpeek8 r4, #-2
subs r3, r4, r3
movne r3, #1
wpush8 r3
b uxn_decode
neq2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
subs r3, r4, r3
movne r3, #1
wpush8 r3
b uxn_decode
gthk:
wpeek8 r3, #-1
wpeek8 r4, #-2
cmp r4, r3
movls r3, #0
movhi r3, #1
wpush8 r3
b uxn_decode
gth2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
cmp r4, r3
movls r3, #0
movhi r3, #1
wpush8 r3
b uxn_decode
lthk:
wpeek8 r3, #-1
wpeek8 r4, #-2
cmp r4, r3
movcs r3, #0
movcc r3, #1
wpush8 r3
b uxn_decode
lth2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
cmp r4, r3
movcs r3, #0
movcc r3, #1
wpush8 r3
b uxn_decode
jmpk:
wpeek8s r3, #-1
add r0, r3
b uxn_decode
jmp2k:
wpeek16 r3, r5, #-1, #-2
mov r0, r7
add r0, r0, r3
b uxn_decode
jcnk:
wpeek8s r3, #-1
wpeek8 r4, #-2
cmp r4, #0
addne r0, r3
b uxn_decode
jcn2k:
wpeek16 r3, r5, #-1, #-2
wpeek8 r4, #-3
cmp r4, #0
movne r0, r7
cmp r4, #0
addne r0, r0, r3
b uxn_decode
jsrk:
mov r3, r0
sub r3, r3, r7
wpeek8s r4, #-1
rpush16 r3
add r0, r4
b uxn_decode
jsr2k:
mov r3, r0
sub r3, r3, r7
wpeek16 r4, r5, #-1, #-2
rpush16 r3
mov r0, r7
add r0, r0, r4
b uxn_decode
sthk:
wpeek8 r3, #-1
rpush8 r3
b uxn_decode
sth2k:
wpeek16 r3, r5, #-1, #-2
rpush16 r3
b uxn_decode
ldzk:
wpeek8 r3, #-1
zload8 r4, r3
wpush8 r4
b uxn_decode
ldz2k:
wpeek8 r3, #-1
zload8 r4, r3
wpush8 r4
add r3, #1
zload8 r4, r3
wpush8 r4
b uxn_decode
stzk:
wpeek8 r3, #-1
wpeek8 r4, #-2
zsave8 r4, r3
b uxn_decode
stz2k:
wpeek8 r3, #-1
wpeek16 r4, r5, #-2, #-3
zsave16 r4, r3
b uxn_decode
ldrk:
wpeek8s r4, #-1
rload8 r3, r4
wpush8 r3
b uxn_decode
ldr2k:
wpeek8s r4, #-1
rload8 r3, r4
wpush8 r3
add r4, #1
rload8 r3, r4
wpush8 r3
b uxn_decode
strk:
wpeek8s r4, #-1
wpeek8 r3, #-2
rsave8 r3, r4
b uxn_decode
str2k:
wpeek8s r4, #-1
wpeek16 r3, r5, #-2, #-3
rsave16 r3, r4
b uxn_decode
ldak:
wpeek16 r4, r5, #-1, #-2
aload8 r3, r4
wpush8 r3
b uxn_decode
lda2k:
wpeek16 r4, r5, #-1, #-2
aload8 r3, r4
wpush8 r3
add r4, #1
aload8 r3, r4
wpush8 r3
b uxn_decode
stak:
wpeek16 r4, r5, #-1, #-2
wpeek8 r3, #-3
asave8 r3, r4
b uxn_decode
sta2k:
wpeek16 r4, r5, #-1, #-2
wpeek16 r3, r5, #-3, #-4
asave16 r3, r4
b uxn_decode
addk:
wpeek8 r3, #-1
wpeek8 r4, #-2
add r3, r3, r4
wpush8 r3
b uxn_decode
add2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
add r3, r3, r4
wpush16 r3
b uxn_decode
subk:
wpeek8 r3, #-1
wpeek8 r4, #-2
sub r4, r4, r3
wpush8 r4
b uxn_decode
sub2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
sub r3, r4, r3
wpush16 r3
b uxn_decode
mulk:
wpeek8 r3, #-1
wpeek8 r4, #-2
mul r4, r3, r4
wpush8 r4
b uxn_decode
mul2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
mul r3, r4, r3
wpush16 r3
b uxn_decode
divk:
wpeek8 r3, #-1
wpeek8 r4, #-2
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
wpush8 r3
b uxn_decode
div2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
wpush16 r3
b uxn_decode
andk:
wpeek8 r3, #-1
wpeek8 r4, #-2
and r3, r3, r4
wpush8 r3
b uxn_decode
and2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
and r3, r3, r4
wpush16 r3
b uxn_decode
orak:
wpeek8 r3, #-1
wpeek8 r4, #-2
orr r3, r3, r4
wpush8 r3
b uxn_decode
ora2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
orr r3, r3, r4
wpush16 r3
b uxn_decode
eork:
wpeek8 r3, #-1
wpeek8 r4, #-2
eor r3, r3, r4
wpush8 r3
b uxn_decode
eor2k:
wpeek16 r3, r5, #-1, #-2
wpeek16 r4, r5, #-3, #-4
eor r3, r3, r4
wpush16 r3
b uxn_decode
sftk:
wpeek8 r4, #-1
wpeek8 r3, #-2
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
wpush8 r3
b uxn_decode
sft2k:
wpeek8 r4, #-1
wpeek16 r3, r5, #-2, #-3
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
wpush16 r3
b uxn_decode
.ltorg
.align 2
inckr:
rpeek8 r3, #-1
add r3, #1
rpush8 r3
b uxn_decode
inc2kr:
rpeek16 r3, r5, #-1, #-2
add r3, r3, #1
rpush16 r3
b uxn_decode
popkr:
b uxn_decode
pop2kr:
b uxn_decode
nipkr:
rpeek8 r3, #-1
wpush8 r3
b uxn_decode
nip2kr:
rpeek16 r3, r5, #-1, #-2
rpush16 r3
b uxn_decode
swpkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
rpush8 r3
rpush8 r4
b uxn_decode
swp2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
rpush16 r3
rpush16 r4
b uxn_decode
rotkr:
rpeek8 r5, #-1
rpeek8 r4, #-2
rpeek8 r3, #-3
rpush8 r4
rpush8 r5
rpush8 r3
b uxn_decode
rot2kr:
rpeek16 r5, r6, #-1, #-2
rpeek16 r4, r6, #-3, #-4
rpeek16 r3, r6, #-5, #-6
rpush16 r4
rpush16 r5
rpush16 r3
b uxn_decode
dupkr:
rpeek8 r3, #-1
rpush8 r3
rpush8 r3
b uxn_decode
dup2kr:
rpeek8 r3, #-2
rpeek8 r4, #-1
rpush8 r3
rpush8 r4
rpush8 r3
rpush8 r4
b uxn_decode
ovrkr:
rpeek8 r3, #-2
rpeek8 r4, #-1
rpush8 r3
rpush8 r4
rpush8 r3
b uxn_decode
ovr2kr:
rpeek8 r3, #-4
rpeek8 r4, #-3
rpeek8 r5, #-2
rpeek8 r6, #-1
rpush8 r3
rpush8 r4
rpush8 r5
rpush8 r6
rpush8 r3
rpush8 r4
b uxn_decode
equkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
rpush8 r4
b uxn_decode
equ2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
sub r3, r4, r3
rsbs r4, r3, #0
adc r4, r4, r3
rpush8 r4
b uxn_decode
neqkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
subs r3, r4, r3
movne r3, #1
rpush8 r3
b uxn_decode
neq2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
subs r3, r4, r3
movne r3, #1
rpush8 r3
b uxn_decode
gthkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
cmp r4, r3
movls r3, #0
movhi r3, #1
rpush8 r3
b uxn_decode
gth2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
cmp r4, r3
movls r3, #0
movhi r3, #1
rpush8 r3
b uxn_decode
lthkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
cmp r4, r3
movcs r3, #0
movcc r3, #1
rpush8 r3
b uxn_decode
lth2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
cmp r4, r3
movcs r3, #0
movcc r3, #1
rpush8 r3
b uxn_decode
jmpkr:
rpeek8s r3, #-1
add r0, r3
b uxn_decode
jmp2kr:
rpeek16 r3, r5, #-1, #-2
mov r0, r7
add r0, r0, r3
b uxn_decode
jcnkr:
rpeek8s r3, #-1
rpeek8 r4, #-2
cmp r4, #0
addne r0, r3
b uxn_decode
jcn2kr:
rpeek16 r3, r5, #-1, #-2
rpeek8 r4, #-3
cmp r4, #0
movne r0, r7
cmp r4, #0
addne r0, r0, r3
b uxn_decode
jsrkr:
mov r3, r0
sub r3, r3, r7
rpeek8s r4, #-1
rpush16 r3
add r0, r4
b uxn_decode
jsr2kr:
mov r3, r0
sub r3, r3, r7
rpeek16 r4, r5, #-1, #-2
rpush16 r3
mov r0, r7
add r0, r0, r4
b uxn_decode
sthkr:
rpeek8 r3, #-1
wpush8 r3
b uxn_decode
sth2kr:
rpeek16 r3, r5, #-1, #-2
wpush16 r3
b uxn_decode
ldzkr:
rpeek8 r3, #-1
zload8 r4, r3
rpush8 r4
b uxn_decode
ldz2kr:
rpeek8 r3, #-1
zload8 r4, r3
rpush8 r4
add r3, #1
zload8 r4, r3
rpush8 r4
b uxn_decode
stzkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
zsave8 r4, r3
b uxn_decode
stz2kr:
rpeek8 r3, #-1
rpeek16 r4, r5, #-2, #-3
zsave16 r4, r3
b uxn_decode
ldrkr:
rpeek8s r4, #-1
rload8 r3, r4
rpush8 r3
b uxn_decode
ldr2kr:
rpeek8s r4, #-1
rload8 r3, r4
rpush8 r3
add r4, #1
rload8 r3, r4
rpush8 r3
b uxn_decode
strkr:
rpeek8s r4, #-1
rpeek8 r3, #-2
rsave8 r3, r4
b uxn_decode
str2kr:
rpeek8s r4, #-1
rpeek16 r3, r5, #-1, #-2
rsave16 r3, r4
b uxn_decode
ldakr:
rpeek16 r4, r5, #-1, #-2
aload8 r3, r4
rpush8 r3
b uxn_decode
lda2kr:
rpeek16 r4, r5, #-1, #-2
aload8 r3, r4
rpush8 r3
add r4, #1
aload8 r3, r4
rpush8 r3
b uxn_decode
stakr:
rpeek16 r4, r5, #-1, #-2
rpeek8 r3, #-3
asave8 r3, r4
b uxn_decode
sta2kr:
rpeek16 r4, r5, #-1, #-2
rpeek16 r3, r5, #-3, #-4
asave16 r3, r4
b uxn_decode
addkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
add r3, r3, r4
rpush8 r3
b uxn_decode
add2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
add r3, r3, r4
rpush16 r3
b uxn_decode
subkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
sub r4, r4, r3
rpush8 r4
b uxn_decode
sub2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
sub r3, r4, r3
rpush16 r3
b uxn_decode
mulkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
mul r4, r3, r4
rpush8 r4
b uxn_decode
mul2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
mul r3, r4, r3
rpush16 r3
b uxn_decode
divkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
rpush8 r3
b uxn_decode
div2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
push {r0, r1, r2, r7, lr}
mov r1, r3
mov r0, r4
bl __aeabi_uidiv
mov r3, r0
pop {r0, r1, r2, r7, lr}
rpush16 r3
b uxn_decode
andkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
and r3, r3, r4
rpush8 r3
b uxn_decode
and2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
and r3, r3, r4
rpush16 r3
b uxn_decode
orakr:
rpeek8 r3, #-1
rpeek8 r4, #-2
orr r3, r3, r4
rpush8 r3
b uxn_decode
ora2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
orr r3, r3, r4
rpush16 r3
b uxn_decode
eorkr:
rpeek8 r3, #-1
rpeek8 r4, #-2
eor r3, r3, r4
rpush8 r3
b uxn_decode
eor2kr:
rpeek16 r3, r5, #-1, #-2
rpeek16 r4, r5, #-3, #-4
eor r3, r3, r4
rpush16 r3
b uxn_decode
sftkr:
rpeek8 r4, #-1
rpeek8 r3, #-2
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
rpush8 r3
b uxn_decode
sft2kr:
rpeek8 r4, #-1
rpeek16 r3, r5, #-2, #-3
lsr r5, r4, #4
and r4, #0x0f
lsr r3, r3, r4
lsl r3, r3, r5
rpush16 r3
b uxn_decode
|