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
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
|
AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood Page 1
---------------------------------------------------- 6502_functional_test.a65 ----------------------------------------------------
6104 lines read, no errors in pass 1.
;
; 6 5 0 2 F U N C T I O N A L T E S T
;
; Copyright (C) 2012-2015 Klaus Dormann
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
; This program is designed to test all opcodes of a 6502 emulator using all
; addressing modes with focus on propper setting of the processor status
; register bits.
;
; version 04-dec-2017
; contact info at http://2m5.de or email [email protected]
;
; assembled with AS65 from http://www.kingswood-consulting.co.uk/assemblers/
; command line switches: -l -m -s2 -w -h0
; | | | | no page headers in listing
; | | | wide listing (133 char/col)
; | | write intel hex file instead of binary
; | expand macros in listing
; generate pass2 listing
;
; No IO - should be run from a monitor with access to registers.
; To run load intel hex image with a load command, than alter PC to 400 hex
; (code_segment) and enter a go command.
; Loop on program counter determines error or successful completion of test.
; Check listing for relevant traps (jump/branch *).
; Please note that in early tests some instructions will have to be used before
; they are actually tested!
;
; RESET, NMI or IRQ should not occur and will be trapped if vectors are enabled.
; Tests documented behavior of the original NMOS 6502 only! No unofficial
; opcodes. Additional opcodes of newer versions of the CPU (65C02, 65816) will
; not be tested. Decimal ops will only be tested with valid BCD operands and
; N V Z flags will be ignored.
;
; Debugging hints:
; Most of the code is written sequentially. if you hit a trap, check the
; immediately preceeding code for the instruction to be tested. Results are
; tested first, flags are checked second by pushing them onto the stack and
; pulling them to the accumulator after the result was checked. The "real"
; flags are no longer valid for the tested instruction at this time!
; If the tested instruction was indexed, the relevant index (X or Y) must
; also be checked. Opposed to the flags, X and Y registers are still valid.
;
; versions:
; 28-jul-2012 1st version distributed for testing
; 29-jul-2012 fixed references to location 0, now #0
; added license - GPLv3
; 30-jul-2012 added configuration options
; 01-aug-2012 added trap macro to allow user to change error handling
; 01-dec-2012 fixed trap in branch field must be a branch
; 02-mar-2013 fixed PLA flags not tested
; 19-jul-2013 allowed ROM vectors to be loaded when load_data_direct = 0
; added test sequence check to detect if tests jump their fence
; 23-jul-2013 added RAM integrity check option
; 16-aug-2013 added error report to standard output option
; 13-dec-2014 added binary/decimal opcode table switch test
; 14-dec-2014 improved relative address test
; 23-aug-2015 added option to disable self modifying tests
; 24-aug-2015 all self modifying immediate opcodes now execute in data RAM
; added small branch offset pretest
; 21-oct-2015 added option to disable decimal mode ADC & SBC tests
; 04-dec-2017 fixed BRK only tested with interrupts enabled
; added option to skip the remainder of a failing test
; in report.i65
; C O N F I G U R A T I O N
;ROM_vectors writable (0=no, 1=yes)
;if ROM vectors can not be used interrupts will not be trapped
;as a consequence BRK can not be tested but will be emulated to test RTI
0001 = ROM_vectors = 1
;load_data_direct (0=move from code segment, 1=load directly)
;loading directly is preferred but may not be supported by your platform
;0 produces only consecutive object code, 1 is not suitable for a binary image
0001 = load_data_direct = 1
;I_flag behavior (0=force enabled, 1=force disabled, 2=prohibit change, 3=allow
;change) 2 requires extra code and is not recommended. SEI & CLI can only be
;tested if you allow changing the interrupt status (I_flag = 3)
0003 = I_flag = 3
;configure memory - try to stay away from memory used by the system
;zero_page memory start address, $50 (80) consecutive Bytes required
; add 2 if I_flag = 2
000a = zero_page = $a
;data_segment memory start address, $6A (106) consecutive Bytes required
0200 = data_segment = $200
if (data_segment & $ff) != 0
ERROR ERROR ERROR low byte of data_segment MUST be $00 !!
endif
;code_segment memory start address, 13kB of consecutive space required
; add 2.5 kB if I_flag = 2
0400 = code_segment = $400
;self modifying code may be disabled to allow running in ROM
;0=part of the code is self modifying and must reside in RAM
;1=tests disabled: branch range
0000 = disable_selfmod = 0
;report errors through I/O channel (0=use standard self trap loops, 1=include
;report.i65 as I/O channel, add 3.5 kB)
0000 = report = 0
;RAM integrity test option. Checks for undesired RAM writes.
;set lowest non RAM or RAM mirror address page (-1=disable, 0=64k, $40=16k)
;leave disabled if a monitor, OS or background interrupt is allowed to alter RAM
ffff = ram_top = -1
;disable test decimal mode ADC & SBC, 0=enable, 1=disable,
;2=disable including decimal flag in processor status
0000 = disable_decimal = 0
noopt ;do not take shortcuts
;macros for error & success traps to allow user modification
;example:
;trap macro
; jsr my_error_handler
; endm
;trap_eq macro
; bne skip\?
; trap ;failed equal (zero)
;skip\?
; endm
;
; my_error_handler should pop the calling address from the stack and report it.
; putting larger portions of code (more than 3 bytes) inside the trap macro
; may lead to branch range problems for some tests.
if report = 0
trap macro
jmp * ;failed anyway
endm
trap_eq macro
beq * ;failed equal (zero)
endm
trap_ne macro
bne * ;failed not equal (non zero)
endm
trap_cs macro
bcs * ;failed carry set
endm
trap_cc macro
bcc * ;failed carry clear
endm
trap_mi macro
bmi * ;failed minus (bit 7 set)
endm
trap_pl macro
bpl * ;failed plus (bit 7 clear)
endm
trap_vs macro
bvs * ;failed overflow set
endm
trap_vc macro
bvc * ;failed overflow clear
endm
; please observe that during the test the stack gets invalidated
; therefore a RTS inside the success macro is not possible
success macro
jmp * ;test passed, no errors
endm
endif
if report = 1
trap macro
jsr report_error
endm
trap_eq macro
bne skip\?
trap ;failed equal (zero)
skip\?
endm
trap_ne macro
beq skip\?
trap ;failed not equal (non zero)
skip\?
endm
trap_cs macro
bcc skip\?
trap ;failed carry set
skip\?
endm
trap_cc macro
bcs skip\?
trap ;failed carry clear
skip\?
endm
trap_mi macro
bpl skip\?
trap ;failed minus (bit 7 set)
skip\?
endm
trap_pl macro
bmi skip\?
trap ;failed plus (bit 7 clear)
skip\?
endm
trap_vs macro
bvc skip\?
trap ;failed overflow set
skip\?
endm
trap_vc macro
bvs skip\?
trap ;failed overflow clear
skip\?
endm
; please observe that during the test the stack gets invalidated
; therefore a RTS inside the success macro is not possible
success macro
jsr report_success
endm
endif
0001 = carry equ %00000001 ;flag bits in status
0002 = zero equ %00000010
0004 = intdis equ %00000100
0008 = decmode equ %00001000
0010 = break equ %00010000
0020 = reserv equ %00100000
0040 = overfl equ %01000000
0080 = minus equ %10000000
0001 = fc equ carry
0002 = fz equ zero
0003 = fzc equ carry+zero
0040 = fv equ overfl
0042 = fvz equ overfl+zero
0080 = fn equ minus
0081 = fnc equ minus+carry
0082 = fnz equ minus+zero
0083 = fnzc equ minus+zero+carry
00c0 = fnv equ minus+overfl
0030 = fao equ break+reserv ;bits always on after PHP, BRK
0034 = fai equ fao+intdis ;+ forced interrupt disable
0038 = faod equ fao+decmode ;+ ignore decimal
003c = faid equ fai+decmode ;+ ignore decimal
00ff = m8 equ $ff ;8 bit mask
00fb = m8i equ $ff&~intdis ;8 bit mask - interrupt disable
;macros to allow masking of status bits.
;masking test of decimal bit
;masking of interrupt enable/disable on load and compare
;masking of always on bits after PHP or BRK (unused & break) on compare
if disable_decimal < 2
if I_flag = 0
load_flag macro
lda #\1&m8i ;force enable interrupts (mask I)
endm
cmp_flag macro
cmp #(\1|fao)&m8i ;I_flag is always enabled + always on bits
endm
eor_flag macro
eor #(\1&m8i|fao) ;mask I, invert expected flags + always on bits
endm
endif
if I_flag = 1
load_flag macro
lda #\1|intdis ;force disable interrupts
endm
cmp_flag macro
cmp #(\1|fai)&m8 ;I_flag is always disabled + always on bits
endm
eor_flag macro
eor #(\1|fai) ;invert expected flags + always on bits + I
endm
endif
if I_flag = 2
load_flag macro
lda #\1
ora flag_I_on ;restore I-flag
and flag_I_off
endm
cmp_flag macro
eor flag_I_on ;I_flag is never changed
cmp #(\1|fao)&m8i ;expected flags + always on bits, mask I
endm
eor_flag macro
eor flag_I_on ;I_flag is never changed
eor #(\1&m8i|fao) ;mask I, invert expected flags + always on bits
endm
endif
if I_flag = 3
load_flag macro
lda #\1 ;allow test to change I-flag (no mask)
endm
cmp_flag macro
cmp #(\1|fao)&m8 ;expected flags + always on bits
endm
eor_flag macro
eor #\1|fao ;invert expected flags + always on bits
endm
endif
else
if I_flag = 0
load_flag macro
lda #\1&m8i ;force enable interrupts (mask I)
endm
cmp_flag macro
ora #decmode ;ignore decimal mode bit
cmp #(\1|faod)&m8i ;I_flag is always enabled + always on bits
endm
eor_flag macro
ora #decmode ;ignore decimal mode bit
eor #(\1&m8i|faod) ;mask I, invert expected flags + always on bits
endm
endif
if I_flag = 1
load_flag macro
lda #\1|intdis ;force disable interrupts
endm
cmp_flag macro
ora #decmode ;ignore decimal mode bit
cmp #(\1|faid)&m8 ;I_flag is always disabled + always on bits
endm
eor_flag macro
ora #decmode ;ignore decimal mode bit
eor #(\1|faid) ;invert expected flags + always on bits + I
endm
endif
if I_flag = 2
load_flag macro
lda #\1
ora flag_I_on ;restore I-flag
and flag_I_off
endm
cmp_flag macro
eor flag_I_on ;I_flag is never changed
ora #decmode ;ignore decimal mode bit
cmp #(\1|faod)&m8i ;expected flags + always on bits, mask I
endm
eor_flag macro
eor flag_I_on ;I_flag is never changed
ora #decmode ;ignore decimal mode bit
eor #(\1&m8i|faod) ;mask I, invert expected flags + always on bits
endm
endif
if I_flag = 3
load_flag macro
lda #\1 ;allow test to change I-flag (no mask)
endm
cmp_flag macro
ora #decmode ;ignore decimal mode bit
cmp #(\1|faod)&m8 ;expected flags + always on bits
endm
eor_flag macro
ora #decmode ;ignore decimal mode bit
eor #\1|faod ;invert expected flags + always on bits
endm
endif
endif
;macros to set (register|memory|zeropage) & status
set_stat macro ;setting flags in the processor status register
load_flag \1
pha ;use stack to load status
plp
endm
set_a macro ;precharging accu & status
load_flag \2
pha ;use stack to load status
lda #\1 ;precharge accu
plp
endm
set_x macro ;precharging index & status
load_flag \2
pha ;use stack to load status
ldx #\1 ;precharge index x
plp
endm
set_y macro ;precharging index & status
load_flag \2
pha ;use stack to load status
ldy #\1 ;precharge index y
plp
endm
set_ax macro ;precharging indexed accu & immediate status
load_flag \2
pha ;use stack to load status
lda \1,x ;precharge accu
plp
endm
set_ay macro ;precharging indexed accu & immediate status
load_flag \2
pha ;use stack to load status
lda \1,y ;precharge accu
plp
endm
set_z macro ;precharging indexed zp & immediate status
load_flag \2
pha ;use stack to load status
lda \1,x ;load to zeropage
sta zpt
plp
endm
set_zx macro ;precharging zp,x & immediate status
load_flag \2
pha ;use stack to load status
lda \1,x ;load to indexed zeropage
sta zpt,x
plp
endm
set_abs macro ;precharging indexed memory & immediate status
load_flag \2
pha ;use stack to load status
lda \1,x ;load to memory
sta abst
plp
endm
set_absx macro ;precharging abs,x & immediate status
load_flag \2
pha ;use stack to load status
lda \1,x ;load to indexed memory
sta abst,x
plp
endm
;macros to test (register|memory|zeropage) & status & (mask)
tst_stat macro ;testing flags in the processor status register
php ;save status
pla ;use stack to retrieve status
pha
cmp_flag \1
trap_ne
plp ;restore status
endm
tst_a macro ;testing result in accu & flags
php ;save flags
cmp #\1 ;test result
trap_ne
pla ;load status
pha
cmp_flag \2
trap_ne
plp ;restore status
endm
tst_x macro ;testing result in x index & flags
php ;save flags
cpx #\1 ;test result
trap_ne
pla ;load status
pha
cmp_flag \2
trap_ne
plp ;restore status
endm
tst_y macro ;testing result in y index & flags
php ;save flags
cpy #\1 ;test result
trap_ne
pla ;load status
pha
cmp_flag \2
trap_ne
plp ;restore status
endm
tst_ax macro ;indexed testing result in accu & flags
php ;save flags
cmp \1,x ;test result
trap_ne
pla ;load status
eor_flag \3
cmp \2,x ;test flags
trap_ne ;
endm
tst_ay macro ;indexed testing result in accu & flags
php ;save flags
cmp \1,y ;test result
trap_ne ;
pla ;load status
eor_flag \3
cmp \2,y ;test flags
trap_ne
endm
tst_z macro ;indexed testing result in zp & flags
php ;save flags
lda zpt
cmp \1,x ;test result
trap_ne
pla ;load status
eor_flag \3
cmp \2,x ;test flags
trap_ne
endm
tst_zx macro ;testing result in zp,x & flags
php ;save flags
lda zpt,x
cmp \1,x ;test result
trap_ne
pla ;load status
eor_flag \3
cmp \2,x ;test flags
trap_ne
endm
tst_abs macro ;indexed testing result in memory & flags
php ;save flags
lda abst
cmp \1,x ;test result
trap_ne
pla ;load status
eor_flag \3
cmp \2,x ;test flags
trap_ne
endm
tst_absx macro ;testing result in abs,x & flags
php ;save flags
lda abst,x
cmp \1,x ;test result
trap_ne
pla ;load status
eor_flag \3
cmp \2,x ;test flags
trap_ne
endm
; RAM integrity test
; verifies that none of the previous tests has altered RAM outside of the
; designated write areas.
; uses zpt word as indirect pointer, zpt+2 word as checksum
if ram_top > -1
check_ram macro
cld
lda #0
sta zpt ;set low byte of indirect pointer
sta zpt+3 ;checksum high byte
if disable_selfmod = 0
sta range_adr ;reset self modifying code
endif
clc
ldx #zp_bss-zero_page ;zeropage - write test area
ccs3\? adc zero_page,x
bcc ccs2\?
inc zpt+3 ;carry to high byte
clc
ccs2\? inx
bne ccs3\?
ldx #hi(abs1) ;set high byte of indirect pointer
stx zpt+1
ldy #lo(abs1) ;data after write & execute test area
ccs5\? adc (zpt),y
bcc ccs4\?
inc zpt+3 ;carry to high byte
clc
ccs4\? iny
bne ccs5\?
inx ;advance RAM high address
stx zpt+1
cpx #ram_top
bne ccs5\?
sta zpt+2 ;checksum low is
cmp ram_chksm ;checksum low expected
trap_ne ;checksum mismatch
lda zpt+3 ;checksum high is
cmp ram_chksm+1 ;checksum high expected
trap_ne ;checksum mismatch
endm
else
check_ram macro
;RAM check disabled - RAM size not set
endm
endif
next_test macro ;make sure, tests don't jump the fence
lda test_case ;previous test
cmp #test_num
trap_ne ;test is out of sequence
test_num = test_num + 1
lda #test_num ;*** next tests' number
sta test_case
;check_ram ;uncomment to find altered RAM after each test
endm
if load_data_direct = 1
data
else
bss ;uninitialized segment, copy of data at end of code!
endif
; org zero_page
0000 = org 0 ;edited to provide binaries loading from 0
0000 : 00000000000000.. ds zero_page
;break test interrupt save
000a : 00 irq_a ds 1 ;a register
000b : 00 irq_x ds 1 ;x register
if I_flag = 2
;masking for I bit in status
flag_I_on ds 1 ;or mask to load flags
flag_I_off ds 1 ;and mask to load flags
endif
000c : zpt ;5 bytes store/modify test area
;add/subtract operand generation and result/flag prediction
000c : 00 adfc ds 1 ;carry flag before op
000d : 00 ad1 ds 1 ;operand 1 - accumulator
000e : 00 ad2 ds 1 ;operand 2 - memory / immediate
000f : 00 adrl ds 1 ;expected result bits 0-7
0010 : 00 adrh ds 1 ;expected result bit 8 (carry)
0011 : 00 adrf ds 1 ;expected flags NV0000ZC (only binary mode)
0012 : 00 sb2 ds 1 ;operand 2 complemented for subtract
0013 : zp_bss
0013 : c3824100 zp1 db $c3,$82,$41,0 ;test patterns for LDx BIT ROL ROR ASL LSR
0017 : 7f zp7f db $7f ;test pattern for compare
;logical zeropage operands
0018 : 001f7180 zpOR db 0,$1f,$71,$80 ;test pattern for OR
001c : 0fff7f80 zpAN db $0f,$ff,$7f,$80 ;test pattern for AND
0020 : ff0f8f8f zpEO db $ff,$0f,$8f,$8f ;test pattern for EOR
;indirect addressing pointers
0024 : 1702 ind1 dw abs1 ;indirect pointer to pattern in absolute memory
0026 : 1802 dw abs1+1
0028 : 1902 dw abs1+2
002a : 1a02 dw abs1+3
002c : 1b02 dw abs7f
002e : 1f01 inw1 dw abs1-$f8 ;indirect pointer for wrap-test pattern
0030 : 0302 indt dw abst ;indirect pointer to store area in absolute memory
0032 : 0402 dw abst+1
0034 : 0502 dw abst+2
0036 : 0602 dw abst+3
0038 : 0b01 inwt dw abst-$f8 ;indirect pointer for wrap-test store
003a : 4e02 indAN dw absAN ;indirect pointer to AND pattern in absolute memory
003c : 4f02 dw absAN+1
003e : 5002 dw absAN+2
0040 : 5102 dw absAN+3
0042 : 5202 indEO dw absEO ;indirect pointer to EOR pattern in absolute memory
0044 : 5302 dw absEO+1
0046 : 5402 dw absEO+2
0048 : 5502 dw absEO+3
004a : 4a02 indOR dw absOR ;indirect pointer to OR pattern in absolute memory
004c : 4b02 dw absOR+1
004e : 4c02 dw absOR+2
0050 : 4d02 dw absOR+3
;add/subtract indirect pointers
0052 : 0302 adi2 dw ada2 ;indirect pointer to operand 2 in absolute memory
0054 : 0402 sbi2 dw sba2 ;indirect pointer to complemented operand 2 (SBC)
0056 : 0401 adiy2 dw ada2-$ff ;with offset for indirect indexed
0058 : 0501 sbiy2 dw sba2-$ff
005a : zp_bss_end
0200 = org data_segment
0200 : 00 test_case ds 1 ;current test number
0201 : 0000 ram_chksm ds 2 ;checksum for RAM integrity test
;add/subtract operand copy - abs tests write area
0203 : abst ;5 bytes store/modify test area
0203 : 00 ada2 ds 1 ;operand 2
0204 : 00 sba2 ds 1 ;operand 2 complemented for subtract
0205 : 000000 ds 3 ;fill remaining bytes
0208 : data_bss
if load_data_direct = 1
0208 : 2900 ex_andi and #0 ;execute immediate opcodes
020a : 60 rts
020b : 4900 ex_eori eor #0 ;execute immediate opcodes
020d : 60 rts
020e : 0900 ex_orai ora #0 ;execute immediate opcodes
0210 : 60 rts
0211 : 6900 ex_adci adc #0 ;execute immediate opcodes
0213 : 60 rts
0214 : e900 ex_sbci sbc #0 ;execute immediate opcodes
0216 : 60 rts
else
ex_andi ds 3
ex_eori ds 3
ex_orai ds 3
ex_adci ds 3
ex_sbci ds 3
endif
0217 : c3824100 abs1 db $c3,$82,$41,0 ;test patterns for LDx BIT ROL ROR ASL LSR
021b : 7f abs7f db $7f ;test pattern for compare
;loads
021c : 80800002 fLDx db fn,fn,0,fz ;expected flags for load
;shifts
0220 : rASL ;expected result ASL & ROL -carry
0220 : 86048200 rROL db $86,$04,$82,0 ; "
0224 : 87058301 rROLc db $87,$05,$83,1 ;expected result ROL +carry
0228 : rLSR ;expected result LSR & ROR -carry
0228 : 61412000 rROR db $61,$41,$20,0 ; "
022c : e1c1a080 rRORc db $e1,$c1,$a0,$80 ;expected result ROR +carry
0230 : fASL ;expected flags for shifts
0230 : 81018002 fROL db fnc,fc,fn,fz ;no carry in
0234 : 81018000 fROLc db fnc,fc,fn,0 ;carry in
0238 : fLSR
0238 : 01000102 fROR db fc,0,fc,fz ;no carry in
023c : 81808180 fRORc db fnc,fn,fnc,fn ;carry in
;increments (decrements)
0240 : 7f80ff0001 rINC db $7f,$80,$ff,0,1 ;expected result for INC/DEC
0245 : 0080800200 fINC db 0,fn,fn,fz,0 ;expected flags for INC/DEC
;logical memory operand
024a : 001f7180 absOR db 0,$1f,$71,$80 ;test pattern for OR
024e : 0fff7f80 absAN db $0f,$ff,$7f,$80 ;test pattern for AND
0252 : ff0f8f8f absEO db $ff,$0f,$8f,$8f ;test pattern for EOR
;logical accu operand
0256 : 00f11f00 absORa db 0,$f1,$1f,0 ;test pattern for OR
025a : f0ffffff absANa db $f0,$ff,$ff,$ff ;test pattern for AND
025e : fff0f00f absEOa db $ff,$f0,$f0,$0f ;test pattern for EOR
;logical results
0262 : 00ff7f80 absrlo db 0,$ff,$7f,$80
0266 : 02800080 absflo db fz,fn,0,fn
026a : data_bss_end
code
0400 = org code_segment
0400 : d8 start cld
0401 : a2ff ldx #$ff
0403 : 9a txs
0404 : a900 lda #0 ;*** test 0 = initialize
0406 : 8d0002 sta test_case
0000 = test_num = 0
;stop interrupts before initializing BSS
if I_flag = 1
sei
endif
;initialize I/O for report channel
if report = 1
jsr report_init
endif
;pretest small branch offset
0409 : a205 ldx #5
040b : 4c3304 jmp psb_test
040e : psb_bwok
040e : a005 ldy #5
0410 : d008 bne psb_forw
trap ;branch should be taken
0412 : 4c1204 > jmp * ;failed anyway
0415 : 88 dey ;forward landing zone
0416 : 88 dey
0417 : 88 dey
0418 : 88 dey
0419 : 88 dey
041a : psb_forw
041a : 88 dey
041b : 88 dey
041c : 88 dey
041d : 88 dey
041e : 88 dey
041f : f017 beq psb_fwok
trap ;forward offset
0421 : 4c2104 > jmp * ;failed anyway
0424 : ca dex ;backward landing zone
0425 : ca dex
0426 : ca dex
0427 : ca dex
0428 : ca dex
0429 : psb_back
0429 : ca dex
042a : ca dex
042b : ca dex
042c : ca dex
042d : ca dex
042e : f0de beq psb_bwok
trap ;backward offset
0430 : 4c3004 > jmp * ;failed anyway
0433 : psb_test
0433 : d0f4 bne psb_back
trap ;branch should be taken
0435 : 4c3504 > jmp * ;failed anyway
0438 : psb_fwok
;initialize BSS segment
if load_data_direct != 1
ldx #zp_end-zp_init-1
ld_zp lda zp_init,x
sta zp_bss,x
dex
bpl ld_zp
ldx #data_end-data_init-1
ld_data lda data_init,x
sta data_bss,x
dex
bpl ld_data
if ROM_vectors = 1
ldx #5
ld_vect lda vec_init,x
sta vec_bss,x
dex
bpl ld_vect
endif
endif
;retain status of interrupt flag
if I_flag = 2
php
pla
and #4 ;isolate flag
sta flag_I_on ;or mask
eor #lo(~4) ;reverse
sta flag_I_off ;and mask
endif
;generate checksum for RAM integrity test
if ram_top > -1
lda #0
sta zpt ;set low byte of indirect pointer
sta ram_chksm+1 ;checksum high byte
if disable_selfmod = 0
sta range_adr ;reset self modifying code
endif
clc
ldx #zp_bss-zero_page ;zeropage - write test area
gcs3 adc zero_page,x
bcc gcs2
inc ram_chksm+1 ;carry to high byte
clc
gcs2 inx
bne gcs3
ldx #hi(abs1) ;set high byte of indirect pointer
stx zpt+1
ldy #lo(abs1) ;data after write & execute test area
gcs5 adc (zpt),y
bcc gcs4
inc ram_chksm+1 ;carry to high byte
clc
gcs4 iny
bne gcs5
inx ;advance RAM high address
stx zpt+1
cpx #ram_top
bne gcs5
sta ram_chksm ;checksum complete
endif
next_test
0438 : ad0002 > lda test_case ;previous test
043b : c900 > cmp #test_num
> trap_ne ;test is out of sequence
043d : d0fe > bne * ;failed not equal (non zero)
>
0001 = >test_num = test_num + 1
043f : a901 > lda #test_num ;*** next tests' number
0441 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
if disable_selfmod = 0
;testing relative addressing with BEQ
0444 : a0fe ldy #$fe ;testing maximum range, not -1/-2 (invalid/self adr)
0446 : range_loop
0446 : 88 dey ;next relative address
0447 : 98 tya
0448 : aa tax ;precharge count to end of loop
0449 : 1008 bpl range_fw ;calculate relative address
044b : 18 clc ;avoid branch self or to relative address of branch
044c : 6902 adc #2
044e : ea nop ;offset landing zone - tolerate +/-5 offset to branch
044f : ea nop
0450 : ea nop
0451 : ea nop
0452 : ea nop
0453 : range_fw
0453 : ea nop
0454 : ea nop
0455 : ea nop
0456 : ea nop
0457 : ea nop
0458 : 497f eor #$7f ;complement except sign
045a : 8de604 sta range_adr ;load into test target
045d : a900 lda #0 ;should set zero flag in status register
045f : 4ce504 jmp range_op
0462 : ca dex ; offset landing zone - backward branch too far
0463 : ca dex
0464 : ca dex
0465 : ca dex
0466 : ca dex
;relative address target field with branch under test in the middle
0467 : ca dex ;-128 - max backward
0468 : ca dex
0469 : ca dex
046a : ca dex
046b : ca dex
046c : ca dex
046d : ca dex
046e : ca dex
046f : ca dex ;-120
0470 : ca dex
0471 : ca dex
0472 : ca dex
0473 : ca dex
0474 : ca dex
0475 : ca dex
0476 : ca dex
0477 : ca dex
0478 : ca dex
0479 : ca dex ;-110
047a : ca dex
047b : ca dex
047c : ca dex
047d : ca dex
047e : ca dex
047f : ca dex
0480 : ca dex
0481 : ca dex
0482 : ca dex
0483 : ca dex ;-100
0484 : ca dex
0485 : ca dex
0486 : ca dex
0487 : ca dex
0488 : ca dex
0489 : ca dex
048a : ca dex
048b : ca dex
048c : ca dex
048d : ca dex ;-90
048e : ca dex
048f : ca dex
0490 : ca dex
0491 : ca dex
0492 : ca dex
0493 : ca dex
0494 : ca dex
0495 : ca dex
0496 : ca dex
0497 : ca dex ;-80
0498 : ca dex
0499 : ca dex
049a : ca dex
049b : ca dex
049c : ca dex
049d : ca dex
049e : ca dex
049f : ca dex
04a0 : ca dex
04a1 : ca dex ;-70
04a2 : ca dex
04a3 : ca dex
04a4 : ca dex
04a5 : ca dex
04a6 : ca dex
04a7 : ca dex
04a8 : ca dex
04a9 : ca dex
04aa : ca dex
04ab : ca dex ;-60
04ac : ca dex
04ad : ca dex
04ae : ca dex
04af : ca dex
04b0 : ca dex
04b1 : ca dex
04b2 : ca dex
04b3 : ca dex
04b4 : ca dex
04b5 : ca dex ;-50
04b6 : ca dex
04b7 : ca dex
04b8 : ca dex
04b9 : ca dex
04ba : ca dex
04bb : ca dex
04bc : ca dex
04bd : ca dex
04be : ca dex
04bf : ca dex ;-40
04c0 : ca dex
04c1 : ca dex
04c2 : ca dex
04c3 : ca dex
04c4 : ca dex
04c5 : ca dex
04c6 : ca dex
04c7 : ca dex
04c8 : ca dex
04c9 : ca dex ;-30
04ca : ca dex
04cb : ca dex
04cc : ca dex
04cd : ca dex
04ce : ca dex
04cf : ca dex
04d0 : ca dex
04d1 : ca dex
04d2 : ca dex
04d3 : ca dex ;-20
04d4 : ca dex
04d5 : ca dex
04d6 : ca dex
04d7 : ca dex
04d8 : ca dex
04d9 : ca dex
04da : ca dex
04db : ca dex
04dc : ca dex
04dd : ca dex ;-10
04de : ca dex
04df : ca dex
04e0 : ca dex
04e1 : ca dex
04e2 : ca dex
04e3 : ca dex
04e4 : ca dex ;-3
04e5 : range_op ;test target with zero flag=0, z=1 if previous dex
04e6 = range_adr = *+1 ;modifiable relative address
04e5 : f03e beq *+64 ;+64 if called without modification
04e7 : ca dex ;+0
04e8 : ca dex
04e9 : ca dex
04ea : ca dex
04eb : ca dex
04ec : ca dex
04ed : ca dex
04ee : ca dex
04ef : ca dex
04f0 : ca dex
04f1 : ca dex ;+10
04f2 : ca dex
04f3 : ca dex
04f4 : ca dex
04f5 : ca dex
04f6 : ca dex
04f7 : ca dex
04f8 : ca dex
04f9 : ca dex
04fa : ca dex
04fb : ca dex ;+20
04fc : ca dex
04fd : ca dex
04fe : ca dex
04ff : ca dex
0500 : ca dex
0501 : ca dex
0502 : ca dex
0503 : ca dex
0504 : ca dex
0505 : ca dex ;+30
0506 : ca dex
0507 : ca dex
0508 : ca dex
0509 : ca dex
050a : ca dex
050b : ca dex
050c : ca dex
050d : ca dex
050e : ca dex
050f : ca dex ;+40
0510 : ca dex
0511 : ca dex
0512 : ca dex
0513 : ca dex
0514 : ca dex
0515 : ca dex
0516 : ca dex
0517 : ca dex
0518 : ca dex
0519 : ca dex ;+50
051a : ca dex
051b : ca dex
051c : ca dex
051d : ca dex
051e : ca dex
051f : ca dex
0520 : ca dex
0521 : ca dex
0522 : ca dex
0523 : ca dex ;+60
0524 : ca dex
0525 : ca dex
0526 : ca dex
0527 : ca dex
0528 : ca dex
0529 : ca dex
052a : ca dex
052b : ca dex
052c : ca dex
052d : ca dex ;+70
052e : ca dex
052f : ca dex
0530 : ca dex
0531 : ca dex
0532 : ca dex
0533 : ca dex
0534 : ca dex
0535 : ca dex
0536 : ca dex
0537 : ca dex ;+80
0538 : ca dex
0539 : ca dex
053a : ca dex
053b : ca dex
053c : ca dex
053d : ca dex
053e : ca dex
053f : ca dex
0540 : ca dex
0541 : ca dex ;+90
0542 : ca dex
0543 : ca dex
0544 : ca dex
0545 : ca dex
0546 : ca dex
0547 : ca dex
0548 : ca dex
0549 : ca dex
054a : ca dex
054b : ca dex ;+100
054c : ca dex
054d : ca dex
054e : ca dex
054f : ca dex
0550 : ca dex
0551 : ca dex
0552 : ca dex
0553 : ca dex
0554 : ca dex
0555 : ca dex ;+110
0556 : ca dex
0557 : ca dex
0558 : ca dex
0559 : ca dex
055a : ca dex
055b : ca dex
055c : ca dex
055d : ca dex
055e : ca dex
055f : ca dex ;+120
0560 : ca dex
0561 : ca dex
0562 : ca dex
0563 : ca dex
0564 : ca dex
0565 : ca dex
0566 : ea nop ;offset landing zone - forward branch too far
0567 : ea nop
0568 : ea nop
0569 : ea nop
056a : ea nop
056b : f008 beq range_ok ;+127 - max forward
trap ; bad range
056d : 4c6d05 > jmp * ;failed anyway
0570 : ea nop ;offset landing zone - tolerate +/-5 offset to branch
0571 : ea nop
0572 : ea nop
0573 : ea nop
0574 : ea nop
0575 : range_ok
0575 : ea nop
0576 : ea nop
0577 : ea nop
0578 : ea nop
0579 : ea nop
057a : c000 cpy #0
057c : f003 beq range_end
057e : 4c4604 jmp range_loop
0581 : range_end ;range test successful
endif
next_test
0581 : ad0002 > lda test_case ;previous test
0584 : c901 > cmp #test_num
> trap_ne ;test is out of sequence
0586 : d0fe > bne * ;failed not equal (non zero)
>
0002 = >test_num = test_num + 1
0588 : a902 > lda #test_num ;*** next tests' number
058a : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
;partial test BNE & CMP, CPX, CPY immediate
058d : c001 cpy #1 ;testing BNE true
058f : d003 bne test_bne
trap
0591 : 4c9105 > jmp * ;failed anyway
0594 : test_bne
0594 : a900 lda #0
0596 : c900 cmp #0 ;test compare immediate
trap_ne
0598 : d0fe > bne * ;failed not equal (non zero)
trap_cc
059a : 90fe > bcc * ;failed carry clear
trap_mi
059c : 30fe > bmi * ;failed minus (bit 7 set)
059e : c901 cmp #1
trap_eq
05a0 : f0fe > beq * ;failed equal (zero)
trap_cs
05a2 : b0fe > bcs * ;failed carry set
trap_pl
05a4 : 10fe > bpl * ;failed plus (bit 7 clear)
05a6 : aa tax
05a7 : e000 cpx #0 ;test compare x immediate
trap_ne
05a9 : d0fe > bne * ;failed not equal (non zero)
trap_cc
05ab : 90fe > bcc * ;failed carry clear
trap_mi
05ad : 30fe > bmi * ;failed minus (bit 7 set)
05af : e001 cpx #1
trap_eq
05b1 : f0fe > beq * ;failed equal (zero)
trap_cs
05b3 : b0fe > bcs * ;failed carry set
trap_pl
05b5 : 10fe > bpl * ;failed plus (bit 7 clear)
05b7 : a8 tay
05b8 : c000 cpy #0 ;test compare y immediate
trap_ne
05ba : d0fe > bne * ;failed not equal (non zero)
trap_cc
05bc : 90fe > bcc * ;failed carry clear
trap_mi
05be : 30fe > bmi * ;failed minus (bit 7 set)
05c0 : c001 cpy #1
trap_eq
05c2 : f0fe > beq * ;failed equal (zero)
trap_cs
05c4 : b0fe > bcs * ;failed carry set
trap_pl
05c6 : 10fe > bpl * ;failed plus (bit 7 clear)
next_test
05c8 : ad0002 > lda test_case ;previous test
05cb : c902 > cmp #test_num
> trap_ne ;test is out of sequence
05cd : d0fe > bne * ;failed not equal (non zero)
>
0003 = >test_num = test_num + 1
05cf : a903 > lda #test_num ;*** next tests' number
05d1 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
;testing stack operations PHA PHP PLA PLP
05d4 : a2ff ldx #$ff ;initialize stack
05d6 : 9a txs
05d7 : a955 lda #$55
05d9 : 48 pha
05da : a9aa lda #$aa
05dc : 48 pha
05dd : cdfe01 cmp $1fe ;on stack ?
trap_ne
05e0 : d0fe > bne * ;failed not equal (non zero)
05e2 : ba tsx
05e3 : 8a txa ;overwrite accu
05e4 : c9fd cmp #$fd ;sp decremented?
trap_ne
05e6 : d0fe > bne * ;failed not equal (non zero)
05e8 : 68 pla
05e9 : c9aa cmp #$aa ;successful retreived from stack?
trap_ne
05eb : d0fe > bne * ;failed not equal (non zero)
05ed : 68 pla
05ee : c955 cmp #$55
trap_ne
05f0 : d0fe > bne * ;failed not equal (non zero)
05f2 : cdff01 cmp $1ff ;remains on stack?
trap_ne
05f5 : d0fe > bne * ;failed not equal (non zero)
05f7 : ba tsx
05f8 : e0ff cpx #$ff ;sp incremented?
trap_ne
05fa : d0fe > bne * ;failed not equal (non zero)
next_test
05fc : ad0002 > lda test_case ;previous test
05ff : c903 > cmp #test_num
> trap_ne ;test is out of sequence
0601 : d0fe > bne * ;failed not equal (non zero)
>
0004 = >test_num = test_num + 1
0603 : a904 > lda #test_num ;*** next tests' number
0605 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
;testing branch decisions BPL BMI BVC BVS BCC BCS BNE BEQ
set_stat $ff ;all on
> load_flag $ff
0608 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
060a : 48 > pha ;use stack to load status
060b : 28 > plp
060c : 101a bpl nbr1 ;branches should not be taken
060e : 501b bvc nbr2
0610 : 901c bcc nbr3
0612 : d01d bne nbr4
0614 : 3003 bmi br1 ;branches should be taken
trap
0616 : 4c1606 > jmp * ;failed anyway
0619 : 7003 br1 bvs br2
trap
061b : 4c1b06 > jmp * ;failed anyway
061e : b003 br2 bcs br3
trap
0620 : 4c2006 > jmp * ;failed anyway
0623 : f00f br3 beq br4
trap
0625 : 4c2506 > jmp * ;failed anyway
0628 : nbr1
trap ;previous bpl taken
0628 : 4c2806 > jmp * ;failed anyway
062b : nbr2
trap ;previous bvc taken
062b : 4c2b06 > jmp * ;failed anyway
062e : nbr3
trap ;previous bcc taken
062e : 4c2e06 > jmp * ;failed anyway
0631 : nbr4
trap ;previous bne taken
0631 : 4c3106 > jmp * ;failed anyway
0634 : 08 br4 php
0635 : ba tsx
0636 : e0fe cpx #$fe ;sp after php?
trap_ne
0638 : d0fe > bne * ;failed not equal (non zero)
063a : 68 pla
cmp_flag $ff ;returned all flags on?
063b : c9ff > cmp #($ff |fao)&m8 ;expected flags + always on bits
trap_ne
063d : d0fe > bne * ;failed not equal (non zero)
063f : ba tsx
0640 : e0ff cpx #$ff ;sp after php?
trap_ne
0642 : d0fe > bne * ;failed not equal (non zero)
set_stat 0 ;all off
> load_flag 0
0644 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0646 : 48 > pha ;use stack to load status
0647 : 28 > plp
0648 : 301a bmi nbr11 ;branches should not be taken
064a : 701b bvs nbr12
064c : b01c bcs nbr13
064e : f01d beq nbr14
0650 : 1003 bpl br11 ;branches should be taken
trap
0652 : 4c5206 > jmp * ;failed anyway
0655 : 5003 br11 bvc br12
trap
0657 : 4c5706 > jmp * ;failed anyway
065a : 9003 br12 bcc br13
trap
065c : 4c5c06 > jmp * ;failed anyway
065f : d00f br13 bne br14
trap
0661 : 4c6106 > jmp * ;failed anyway
0664 : nbr11
trap ;previous bmi taken
0664 : 4c6406 > jmp * ;failed anyway
0667 : nbr12
trap ;previous bvs taken
0667 : 4c6706 > jmp * ;failed anyway
066a : nbr13
trap ;previous bcs taken
066a : 4c6a06 > jmp * ;failed anyway
066d : nbr14
trap ;previous beq taken
066d : 4c6d06 > jmp * ;failed anyway
0670 : 08 br14 php
0671 : 68 pla
cmp_flag 0 ;flags off except break (pushed by sw) + reserved?
0672 : c930 > cmp #(0 |fao)&m8 ;expected flags + always on bits
trap_ne
0674 : d0fe > bne * ;failed not equal (non zero)
;crosscheck flags
set_stat zero
> load_flag zero
0676 : a902 > lda #zero ;allow test to change I-flag (no mask)
>
0678 : 48 > pha ;use stack to load status
0679 : 28 > plp
067a : d002 bne brzs1
067c : f003 beq brzs2
067e : brzs1
trap ;branch zero/non zero
067e : 4c7e06 > jmp * ;failed anyway
0681 : b002 brzs2 bcs brzs3
0683 : 9003 bcc brzs4
0685 : brzs3
trap ;branch carry/no carry
0685 : 4c8506 > jmp * ;failed anyway
0688 : 3002 brzs4 bmi brzs5
068a : 1003 bpl brzs6
068c : brzs5
trap ;branch minus/plus
068c : 4c8c06 > jmp * ;failed anyway
068f : 7002 brzs6 bvs brzs7
0691 : 5003 bvc brzs8
0693 : brzs7
trap ;branch overflow/no overflow
0693 : 4c9306 > jmp * ;failed anyway
0696 : brzs8
set_stat carry
> load_flag carry
0696 : a901 > lda #carry ;allow test to change I-flag (no mask)
>
0698 : 48 > pha ;use stack to load status
0699 : 28 > plp
069a : f002 beq brcs1
069c : d003 bne brcs2
069e : brcs1
trap ;branch zero/non zero
069e : 4c9e06 > jmp * ;failed anyway
06a1 : 9002 brcs2 bcc brcs3
06a3 : b003 bcs brcs4
06a5 : brcs3
trap ;branch carry/no carry
06a5 : 4ca506 > jmp * ;failed anyway
06a8 : 3002 brcs4 bmi brcs5
06aa : 1003 bpl brcs6
06ac : brcs5
trap ;branch minus/plus
06ac : 4cac06 > jmp * ;failed anyway
06af : 7002 brcs6 bvs brcs7
06b1 : 5003 bvc brcs8
06b3 : brcs7
trap ;branch overflow/no overflow
06b3 : 4cb306 > jmp * ;failed anyway
06b6 : brcs8
set_stat minus
> load_flag minus
06b6 : a980 > lda #minus ;allow test to change I-flag (no mask)
>
06b8 : 48 > pha ;use stack to load status
06b9 : 28 > plp
06ba : f002 beq brmi1
06bc : d003 bne brmi2
06be : brmi1
trap ;branch zero/non zero
06be : 4cbe06 > jmp * ;failed anyway
06c1 : b002 brmi2 bcs brmi3
06c3 : 9003 bcc brmi4
06c5 : brmi3
trap ;branch carry/no carry
06c5 : 4cc506 > jmp * ;failed anyway
06c8 : 1002 brmi4 bpl brmi5
06ca : 3003 bmi brmi6
06cc : brmi5
trap ;branch minus/plus
06cc : 4ccc06 > jmp * ;failed anyway
06cf : 7002 brmi6 bvs brmi7
06d1 : 5003 bvc brmi8
06d3 : brmi7
trap ;branch overflow/no overflow
06d3 : 4cd306 > jmp * ;failed anyway
06d6 : brmi8
set_stat overfl
> load_flag overfl
06d6 : a940 > lda #overfl ;allow test to change I-flag (no mask)
>
06d8 : 48 > pha ;use stack to load status
06d9 : 28 > plp
06da : f002 beq brvs1
06dc : d003 bne brvs2
06de : brvs1
trap ;branch zero/non zero
06de : 4cde06 > jmp * ;failed anyway
06e1 : b002 brvs2 bcs brvs3
06e3 : 9003 bcc brvs4
06e5 : brvs3
trap ;branch carry/no carry
06e5 : 4ce506 > jmp * ;failed anyway
06e8 : 3002 brvs4 bmi brvs5
06ea : 1003 bpl brvs6
06ec : brvs5
trap ;branch minus/plus
06ec : 4cec06 > jmp * ;failed anyway
06ef : 5002 brvs6 bvc brvs7
06f1 : 7003 bvs brvs8
06f3 : brvs7
trap ;branch overflow/no overflow
06f3 : 4cf306 > jmp * ;failed anyway
06f6 : brvs8
set_stat $ff-zero
> load_flag $ff-zero
06f6 : a9fd > lda #$ff-zero ;allow test to change I-flag (no mask)
>
06f8 : 48 > pha ;use stack to load status
06f9 : 28 > plp
06fa : f002 beq brzc1
06fc : d003 bne brzc2
06fe : brzc1
trap ;branch zero/non zero
06fe : 4cfe06 > jmp * ;failed anyway
0701 : 9002 brzc2 bcc brzc3
0703 : b003 bcs brzc4
0705 : brzc3
trap ;branch carry/no carry
0705 : 4c0507 > jmp * ;failed anyway
0708 : 1002 brzc4 bpl brzc5
070a : 3003 bmi brzc6
070c : brzc5
trap ;branch minus/plus
070c : 4c0c07 > jmp * ;failed anyway
070f : 5002 brzc6 bvc brzc7
0711 : 7003 bvs brzc8
0713 : brzc7
trap ;branch overflow/no overflow
0713 : 4c1307 > jmp * ;failed anyway
0716 : brzc8
set_stat $ff-carry
> load_flag $ff-carry
0716 : a9fe > lda #$ff-carry ;allow test to change I-flag (no mask)
>
0718 : 48 > pha ;use stack to load status
0719 : 28 > plp
071a : d002 bne brcc1
071c : f003 beq brcc2
071e : brcc1
trap ;branch zero/non zero
071e : 4c1e07 > jmp * ;failed anyway
0721 : b002 brcc2 bcs brcc3
0723 : 9003 bcc brcc4
0725 : brcc3
trap ;branch carry/no carry
0725 : 4c2507 > jmp * ;failed anyway
0728 : 1002 brcc4 bpl brcc5
072a : 3003 bmi brcc6
072c : brcc5
trap ;branch minus/plus
072c : 4c2c07 > jmp * ;failed anyway
072f : 5002 brcc6 bvc brcc7
0731 : 7003 bvs brcc8
0733 : brcc7
trap ;branch overflow/no overflow
0733 : 4c3307 > jmp * ;failed anyway
0736 : brcc8
set_stat $ff-minus
> load_flag $ff-minus
0736 : a97f > lda #$ff-minus ;allow test to change I-flag (no mask)
>
0738 : 48 > pha ;use stack to load status
0739 : 28 > plp
073a : d002 bne brpl1
073c : f003 beq brpl2
073e : brpl1
trap ;branch zero/non zero
073e : 4c3e07 > jmp * ;failed anyway
0741 : 9002 brpl2 bcc brpl3
0743 : b003 bcs brpl4
0745 : brpl3
trap ;branch carry/no carry
0745 : 4c4507 > jmp * ;failed anyway
0748 : 3002 brpl4 bmi brpl5
074a : 1003 bpl brpl6
074c : brpl5
trap ;branch minus/plus
074c : 4c4c07 > jmp * ;failed anyway
074f : 5002 brpl6 bvc brpl7
0751 : 7003 bvs brpl8
0753 : brpl7
trap ;branch overflow/no overflow
0753 : 4c5307 > jmp * ;failed anyway
0756 : brpl8
set_stat $ff-overfl
> load_flag $ff-overfl
0756 : a9bf > lda #$ff-overfl ;allow test to change I-flag (no mask)
>
0758 : 48 > pha ;use stack to load status
0759 : 28 > plp
075a : d002 bne brvc1
075c : f003 beq brvc2
075e : brvc1
trap ;branch zero/non zero
075e : 4c5e07 > jmp * ;failed anyway
0761 : 9002 brvc2 bcc brvc3
0763 : b003 bcs brvc4
0765 : brvc3
trap ;branch carry/no carry
0765 : 4c6507 > jmp * ;failed anyway
0768 : 1002 brvc4 bpl brvc5
076a : 3003 bmi brvc6
076c : brvc5
trap ;branch minus/plus
076c : 4c6c07 > jmp * ;failed anyway
076f : 7002 brvc6 bvs brvc7
0771 : 5003 bvc brvc8
0773 : brvc7
trap ;branch overflow/no overflow
0773 : 4c7307 > jmp * ;failed anyway
0776 : brvc8
next_test
0776 : ad0002 > lda test_case ;previous test
0779 : c904 > cmp #test_num
> trap_ne ;test is out of sequence
077b : d0fe > bne * ;failed not equal (non zero)
>
0005 = >test_num = test_num + 1
077d : a905 > lda #test_num ;*** next tests' number
077f : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; test PHA does not alter flags or accumulator but PLA does
0782 : a255 ldx #$55 ;x & y protected
0784 : a0aa ldy #$aa
set_a 1,$ff ;push
> load_flag $ff
0786 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0788 : 48 > pha ;use stack to load status
0789 : a901 > lda #1 ;precharge accu
078b : 28 > plp
078c : 48 pha
tst_a 1,$ff
078d : 08 > php ;save flags
078e : c901 > cmp #1 ;test result
> trap_ne
0790 : d0fe > bne * ;failed not equal (non zero)
>
0792 : 68 > pla ;load status
0793 : 48 > pha
> cmp_flag $ff
0794 : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0796 : d0fe > bne * ;failed not equal (non zero)
>
0798 : 28 > plp ;restore status
set_a 0,0
> load_flag 0
0799 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
079b : 48 > pha ;use stack to load status
079c : a900 > lda #0 ;precharge accu
079e : 28 > plp
079f : 48 pha
tst_a 0,0
07a0 : 08 > php ;save flags
07a1 : c900 > cmp #0 ;test result
> trap_ne
07a3 : d0fe > bne * ;failed not equal (non zero)
>
07a5 : 68 > pla ;load status
07a6 : 48 > pha
> cmp_flag 0
07a7 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
07a9 : d0fe > bne * ;failed not equal (non zero)
>
07ab : 28 > plp ;restore status
set_a $ff,$ff
> load_flag $ff
07ac : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
07ae : 48 > pha ;use stack to load status
07af : a9ff > lda #$ff ;precharge accu
07b1 : 28 > plp
07b2 : 48 pha
tst_a $ff,$ff
07b3 : 08 > php ;save flags
07b4 : c9ff > cmp #$ff ;test result
> trap_ne
07b6 : d0fe > bne * ;failed not equal (non zero)
>
07b8 : 68 > pla ;load status
07b9 : 48 > pha
> cmp_flag $ff
07ba : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
>
> trap_ne
07bc : d0fe > bne * ;failed not equal (non zero)
>
07be : 28 > plp ;restore status
set_a 1,0
> load_flag 0
07bf : a900 > lda #0 ;allow test to change I-flag (no mask)
>
07c1 : 48 > pha ;use stack to load status
07c2 : a901 > lda #1 ;precharge accu
07c4 : 28 > plp
07c5 : 48 pha
tst_a 1,0
07c6 : 08 > php ;save flags
07c7 : c901 > cmp #1 ;test result
> trap_ne
07c9 : d0fe > bne * ;failed not equal (non zero)
>
07cb : 68 > pla ;load status
07cc : 48 > pha
> cmp_flag 0
07cd : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
07cf : d0fe > bne * ;failed not equal (non zero)
>
07d1 : 28 > plp ;restore status
set_a 0,$ff
> load_flag $ff
07d2 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
07d4 : 48 > pha ;use stack to load status
07d5 : a900 > lda #0 ;precharge accu
07d7 : 28 > plp
07d8 : 48 pha
tst_a 0,$ff
07d9 : 08 > php ;save flags
07da : c900 > cmp #0 ;test result
> trap_ne
07dc : d0fe > bne * ;failed not equal (non zero)
>
07de : 68 > pla ;load status
07df : 48 > pha
> cmp_flag $ff
07e0 : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
>
> trap_ne
07e2 : d0fe > bne * ;failed not equal (non zero)
>
07e4 : 28 > plp ;restore status
set_a $ff,0
> load_flag 0
07e5 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
07e7 : 48 > pha ;use stack to load status
07e8 : a9ff > lda #$ff ;precharge accu
07ea : 28 > plp
07eb : 48 pha
tst_a $ff,0
07ec : 08 > php ;save flags
07ed : c9ff > cmp #$ff ;test result
> trap_ne
07ef : d0fe > bne * ;failed not equal (non zero)
>
07f1 : 68 > pla ;load status
07f2 : 48 > pha
> cmp_flag 0
07f3 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
07f5 : d0fe > bne * ;failed not equal (non zero)
>
07f7 : 28 > plp ;restore status
set_a 0,$ff ;pull
> load_flag $ff
07f8 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
07fa : 48 > pha ;use stack to load status
07fb : a900 > lda #0 ;precharge accu
07fd : 28 > plp
07fe : 68 pla
tst_a $ff,$ff-zero
07ff : 08 > php ;save flags
0800 : c9ff > cmp #$ff ;test result
> trap_ne
0802 : d0fe > bne * ;failed not equal (non zero)
>
0804 : 68 > pla ;load status
0805 : 48 > pha
> cmp_flag $ff-zero
0806 : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0808 : d0fe > bne * ;failed not equal (non zero)
>
080a : 28 > plp ;restore status
set_a $ff,0
> load_flag 0
080b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
080d : 48 > pha ;use stack to load status
080e : a9ff > lda #$ff ;precharge accu
0810 : 28 > plp
0811 : 68 pla
tst_a 0,zero
0812 : 08 > php ;save flags
0813 : c900 > cmp #0 ;test result
> trap_ne
0815 : d0fe > bne * ;failed not equal (non zero)
>
0817 : 68 > pla ;load status
0818 : 48 > pha
> cmp_flag zero
0819 : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
081b : d0fe > bne * ;failed not equal (non zero)
>
081d : 28 > plp ;restore status
set_a $fe,$ff
> load_flag $ff
081e : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0820 : 48 > pha ;use stack to load status
0821 : a9fe > lda #$fe ;precharge accu
0823 : 28 > plp
0824 : 68 pla
tst_a 1,$ff-zero-minus
0825 : 08 > php ;save flags
0826 : c901 > cmp #1 ;test result
> trap_ne
0828 : d0fe > bne * ;failed not equal (non zero)
>
082a : 68 > pla ;load status
082b : 48 > pha
> cmp_flag $ff-zero-minus
082c : c97d > cmp #($ff-zero-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
082e : d0fe > bne * ;failed not equal (non zero)
>
0830 : 28 > plp ;restore status
set_a 0,0
> load_flag 0
0831 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0833 : 48 > pha ;use stack to load status
0834 : a900 > lda #0 ;precharge accu
0836 : 28 > plp
0837 : 68 pla
tst_a $ff,minus
0838 : 08 > php ;save flags
0839 : c9ff > cmp #$ff ;test result
> trap_ne
083b : d0fe > bne * ;failed not equal (non zero)
>
083d : 68 > pla ;load status
083e : 48 > pha
> cmp_flag minus
083f : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0841 : d0fe > bne * ;failed not equal (non zero)
>
0843 : 28 > plp ;restore status
set_a $ff,$ff
> load_flag $ff
0844 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0846 : 48 > pha ;use stack to load status
0847 : a9ff > lda #$ff ;precharge accu
0849 : 28 > plp
084a : 68 pla
tst_a 0,$ff-minus
084b : 08 > php ;save flags
084c : c900 > cmp #0 ;test result
> trap_ne
084e : d0fe > bne * ;failed not equal (non zero)
>
0850 : 68 > pla ;load status
0851 : 48 > pha
> cmp_flag $ff-minus
0852 : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0854 : d0fe > bne * ;failed not equal (non zero)
>
0856 : 28 > plp ;restore status
set_a $fe,0
> load_flag 0
0857 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0859 : 48 > pha ;use stack to load status
085a : a9fe > lda #$fe ;precharge accu
085c : 28 > plp
085d : 68 pla
tst_a 1,0
085e : 08 > php ;save flags
085f : c901 > cmp #1 ;test result
> trap_ne
0861 : d0fe > bne * ;failed not equal (non zero)
>
0863 : 68 > pla ;load status
0864 : 48 > pha
> cmp_flag 0
0865 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0867 : d0fe > bne * ;failed not equal (non zero)
>
0869 : 28 > plp ;restore status
086a : e055 cpx #$55 ;x & y unchanged?
trap_ne
086c : d0fe > bne * ;failed not equal (non zero)
086e : c0aa cpy #$aa
trap_ne
0870 : d0fe > bne * ;failed not equal (non zero)
next_test
0872 : ad0002 > lda test_case ;previous test
0875 : c905 > cmp #test_num
> trap_ne ;test is out of sequence
0877 : d0fe > bne * ;failed not equal (non zero)
>
0006 = >test_num = test_num + 1
0879 : a906 > lda #test_num ;*** next tests' number
087b : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; partial pretest EOR #
set_a $3c,0
> load_flag 0
087e : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0880 : 48 > pha ;use stack to load status
0881 : a93c > lda #$3c ;precharge accu
0883 : 28 > plp
0884 : 49c3 eor #$c3
tst_a $ff,fn
0886 : 08 > php ;save flags
0887 : c9ff > cmp #$ff ;test result
> trap_ne
0889 : d0fe > bne * ;failed not equal (non zero)
>
088b : 68 > pla ;load status
088c : 48 > pha
> cmp_flag fn
088d : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
088f : d0fe > bne * ;failed not equal (non zero)
>
0891 : 28 > plp ;restore status
set_a $c3,0
> load_flag 0
0892 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0894 : 48 > pha ;use stack to load status
0895 : a9c3 > lda #$c3 ;precharge accu
0897 : 28 > plp
0898 : 49c3 eor #$c3
tst_a 0,fz
089a : 08 > php ;save flags
089b : c900 > cmp #0 ;test result
> trap_ne
089d : d0fe > bne * ;failed not equal (non zero)
>
089f : 68 > pla ;load status
08a0 : 48 > pha
> cmp_flag fz
08a1 : c932 > cmp #(fz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
08a3 : d0fe > bne * ;failed not equal (non zero)
>
08a5 : 28 > plp ;restore status
next_test
08a6 : ad0002 > lda test_case ;previous test
08a9 : c906 > cmp #test_num
> trap_ne ;test is out of sequence
08ab : d0fe > bne * ;failed not equal (non zero)
>
0007 = >test_num = test_num + 1
08ad : a907 > lda #test_num ;*** next tests' number
08af : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; PC modifying instructions except branches (NOP, JMP, JSR, RTS, BRK, RTI)
; testing NOP
08b2 : a224 ldx #$24
08b4 : a042 ldy #$42
set_a $18,0
> load_flag 0
08b6 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
08b8 : 48 > pha ;use stack to load status
08b9 : a918 > lda #$18 ;precharge accu
08bb : 28 > plp
08bc : ea nop
tst_a $18,0
08bd : 08 > php ;save flags
08be : c918 > cmp #$18 ;test result
> trap_ne
08c0 : d0fe > bne * ;failed not equal (non zero)
>
08c2 : 68 > pla ;load status
08c3 : 48 > pha
> cmp_flag 0
08c4 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
08c6 : d0fe > bne * ;failed not equal (non zero)
>
08c8 : 28 > plp ;restore status
08c9 : e024 cpx #$24
trap_ne
08cb : d0fe > bne * ;failed not equal (non zero)
08cd : c042 cpy #$42
trap_ne
08cf : d0fe > bne * ;failed not equal (non zero)
08d1 : a2db ldx #$db
08d3 : a0bd ldy #$bd
set_a $e7,$ff
> load_flag $ff
08d5 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
08d7 : 48 > pha ;use stack to load status
08d8 : a9e7 > lda #$e7 ;precharge accu
08da : 28 > plp
08db : ea nop
tst_a $e7,$ff
08dc : 08 > php ;save flags
08dd : c9e7 > cmp #$e7 ;test result
> trap_ne
08df : d0fe > bne * ;failed not equal (non zero)
>
08e1 : 68 > pla ;load status
08e2 : 48 > pha
> cmp_flag $ff
08e3 : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
>
> trap_ne
08e5 : d0fe > bne * ;failed not equal (non zero)
>
08e7 : 28 > plp ;restore status
08e8 : e0db cpx #$db
trap_ne
08ea : d0fe > bne * ;failed not equal (non zero)
08ec : c0bd cpy #$bd
trap_ne
08ee : d0fe > bne * ;failed not equal (non zero)
next_test
08f0 : ad0002 > lda test_case ;previous test
08f3 : c907 > cmp #test_num
> trap_ne ;test is out of sequence
08f5 : d0fe > bne * ;failed not equal (non zero)
>
0008 = >test_num = test_num + 1
08f7 : a908 > lda #test_num ;*** next tests' number
08f9 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; jump absolute
set_stat $0
> load_flag $0
08fc : a900 > lda #$0 ;allow test to change I-flag (no mask)
>
08fe : 48 > pha ;use stack to load status
08ff : 28 > plp
0900 : a946 lda #'F'
0902 : a241 ldx #'A'
0904 : a052 ldy #'R' ;N=0, V=0, Z=0, C=0
0906 : 4cef36 jmp test_far
0909 : ea nop
090a : ea nop
trap_ne ;runover protection
090b : d0fe > bne * ;failed not equal (non zero)
090d : e8 inx
090e : e8 inx
090f : far_ret
trap_eq ;returned flags OK?
090f : f0fe > beq * ;failed equal (zero)
trap_pl
0911 : 10fe > bpl * ;failed plus (bit 7 clear)
trap_cc
0913 : 90fe > bcc * ;failed carry clear
trap_vc
0915 : 50fe > bvc * ;failed overflow clear
0917 : c9ec cmp #('F'^$aa) ;returned registers OK?
trap_ne
0919 : d0fe > bne * ;failed not equal (non zero)
091b : e042 cpx #('A'+1)
trap_ne
091d : d0fe > bne * ;failed not equal (non zero)
091f : c04f cpy #('R'-3)
trap_ne
0921 : d0fe > bne * ;failed not equal (non zero)
0923 : ca dex
0924 : c8 iny
0925 : c8 iny
0926 : c8 iny
0927 : 49aa eor #$aa ;N=0, V=1, Z=0, C=1
0929 : 4c3209 jmp test_near
092c : ea nop
092d : ea nop
trap_ne ;runover protection
092e : d0fe > bne * ;failed not equal (non zero)
0930 : e8 inx
0931 : e8 inx
0932 : test_near
trap_eq ;passed flags OK?
0932 : f0fe > beq * ;failed equal (zero)
trap_mi
0934 : 30fe > bmi * ;failed minus (bit 7 set)
trap_cc
0936 : 90fe > bcc * ;failed carry clear
trap_vc
0938 : 50fe > bvc * ;failed overflow clear
093a : c946 cmp #'F' ;passed registers OK?
trap_ne
093c : d0fe > bne * ;failed not equal (non zero)
093e : e041 cpx #'A'
trap_ne
0940 : d0fe > bne * ;failed not equal (non zero)
0942 : c052 cpy #'R'
trap_ne
0944 : d0fe > bne * ;failed not equal (non zero)
next_test
0946 : ad0002 > lda test_case ;previous test
0949 : c908 > cmp #test_num
> trap_ne ;test is out of sequence
094b : d0fe > bne * ;failed not equal (non zero)
>
0009 = >test_num = test_num + 1
094d : a909 > lda #test_num ;*** next tests' number
094f : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; jump indirect
set_stat 0
> load_flag 0
0952 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0954 : 48 > pha ;use stack to load status
0955 : 28 > plp
0956 : a949 lda #'I'
0958 : a24e ldx #'N'
095a : a044 ldy #'D' ;N=0, V=0, Z=0, C=0
095c : 6c1e37 jmp (ptr_tst_ind)
095f : ea nop
trap_ne ;runover protection
0960 : d0fe > bne * ;failed not equal (non zero)
0962 : 88 dey
0963 : 88 dey
0964 : ind_ret
0964 : 08 php ;either SP or Y count will fail, if we do not hit
0965 : 88 dey
0966 : 88 dey
0967 : 88 dey
0968 : 28 plp
trap_eq ;returned flags OK?
0969 : f0fe > beq * ;failed equal (zero)
trap_pl
096b : 10fe > bpl * ;failed plus (bit 7 clear)
trap_cc
096d : 90fe > bcc * ;failed carry clear
trap_vc
096f : 50fe > bvc * ;failed overflow clear
0971 : c9e3 cmp #('I'^$aa) ;returned registers OK?
trap_ne
0973 : d0fe > bne * ;failed not equal (non zero)
0975 : e04f cpx #('N'+1)
trap_ne
0977 : d0fe > bne * ;failed not equal (non zero)
0979 : c03e cpy #('D'-6)
trap_ne
097b : d0fe > bne * ;failed not equal (non zero)
097d : ba tsx ;SP check
097e : e0ff cpx #$ff
trap_ne
0980 : d0fe > bne * ;failed not equal (non zero)
next_test
0982 : ad0002 > lda test_case ;previous test
0985 : c909 > cmp #test_num
> trap_ne ;test is out of sequence
0987 : d0fe > bne * ;failed not equal (non zero)
>
000a = >test_num = test_num + 1
0989 : a90a > lda #test_num ;*** next tests' number
098b : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; jump subroutine & return from subroutine
set_stat 0
> load_flag 0
098e : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0990 : 48 > pha ;use stack to load status
0991 : 28 > plp
0992 : a94a lda #'J'
0994 : a253 ldx #'S'
0996 : a052 ldy #'R' ;N=0, V=0, Z=0, C=0
0998 : 205d37 jsr test_jsr
099a = jsr_ret = *-1 ;last address of jsr = return address
099b : 08 php ;either SP or Y count will fail, if we do not hit
099c : 88 dey
099d : 88 dey
099e : 88 dey
099f : 28 plp
trap_eq ;returned flags OK?
09a0 : f0fe > beq * ;failed equal (zero)
trap_pl
09a2 : 10fe > bpl * ;failed plus (bit 7 clear)
trap_cc
09a4 : 90fe > bcc * ;failed carry clear
trap_vc
09a6 : 50fe > bvc * ;failed overflow clear
09a8 : c9e0 cmp #('J'^$aa) ;returned registers OK?
trap_ne
09aa : d0fe > bne * ;failed not equal (non zero)
09ac : e054 cpx #('S'+1)
trap_ne
09ae : d0fe > bne * ;failed not equal (non zero)
09b0 : c04c cpy #('R'-6)
trap_ne
09b2 : d0fe > bne * ;failed not equal (non zero)
09b4 : ba tsx ;sp?
09b5 : e0ff cpx #$ff
trap_ne
09b7 : d0fe > bne * ;failed not equal (non zero)
next_test
09b9 : ad0002 > lda test_case ;previous test
09bc : c90a > cmp #test_num
> trap_ne ;test is out of sequence
09be : d0fe > bne * ;failed not equal (non zero)
>
000b = >test_num = test_num + 1
09c0 : a90b > lda #test_num ;*** next tests' number
09c2 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; break & return from interrupt
if ROM_vectors = 1
load_flag 0 ;with interrupts enabled if allowed!
09c5 : a900 > lda #0 ;allow test to change I-flag (no mask)
09c7 : 48 pha
09c8 : a942 lda #'B'
09ca : a252 ldx #'R'
09cc : a04b ldy #'K'
09ce : 28 plp ;N=0, V=0, Z=0, C=0
09cf : 00 brk
else
lda #hi brk_ret0 ;emulated break
pha
lda #lo brk_ret0
pha
load_flag fao ;set break & unused on stack
pha
load_flag intdis ;during interrupt
pha
lda #'B'
ldx #'R'
ldy #'K'
plp ;N=0, V=0, Z=0, C=0
jmp irq_trap
endif
09d0 : 88 dey ;should not be executed
09d1 : brk_ret0 ;address of break return
09d1 : 08 php ;either SP or Y count will fail, if we do not hit
09d2 : 88 dey
09d3 : 88 dey
09d4 : 88 dey
09d5 : c9e8 cmp #'B'^$aa ;returned registers OK?
;the IRQ vector was never executed if A & X stay unmodified
trap_ne
09d7 : d0fe > bne * ;failed not equal (non zero)
09d9 : e053 cpx #'R'+1
trap_ne
09db : d0fe > bne * ;failed not equal (non zero)
09dd : c045 cpy #'K'-6
trap_ne
09df : d0fe > bne * ;failed not equal (non zero)
09e1 : 68 pla ;returned flags OK (unchanged)?
cmp_flag 0
09e2 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
trap_ne
09e4 : d0fe > bne * ;failed not equal (non zero)
09e6 : ba tsx ;sp?
09e7 : e0ff cpx #$ff
trap_ne
09e9 : d0fe > bne * ;failed not equal (non zero)
if ROM_vectors = 1
load_flag $ff ;with interrupts disabled if allowed!
09eb : a9ff > lda #$ff ;allow test to change I-flag (no mask)
09ed : 48 pha
09ee : a9bd lda #$ff-'B'
09f0 : a2ad ldx #$ff-'R'
09f2 : a0b4 ldy #$ff-'K'
09f4 : 28 plp ;N=1, V=1, Z=1, C=1
09f5 : 00 brk
else
lda #hi brk_ret1 ;emulated break
pha
lda #lo brk_ret1
pha
load_flag $ff
pha ;set break & unused on stack
pha ;actual flags
lda #$ff-'B'
ldx #$ff-'R'
ldy #$ff-'K'
plp ;N=1, V=1, Z=1, C=1
jmp irq_trap
endif
09f6 : 88 dey ;should not be executed
09f7 : brk_ret1 ;address of break return
09f7 : 08 php ;either SP or Y count will fail, if we do not hit
09f8 : 88 dey
09f9 : 88 dey
09fa : 88 dey
09fb : c917 cmp #($ff-'B')^$aa ;returned registers OK?
;the IRQ vector was never executed if A & X stay unmodified
trap_ne
09fd : d0fe > bne * ;failed not equal (non zero)
09ff : e0ae cpx #$ff-'R'+1
trap_ne
0a01 : d0fe > bne * ;failed not equal (non zero)
0a03 : c0ae cpy #$ff-'K'-6
trap_ne
0a05 : d0fe > bne * ;failed not equal (non zero)
0a07 : 68 pla ;returned flags OK (unchanged)?
cmp_flag $ff
0a08 : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
trap_ne
0a0a : d0fe > bne * ;failed not equal (non zero)
0a0c : ba tsx ;sp?
0a0d : e0ff cpx #$ff
trap_ne
0a0f : d0fe > bne * ;failed not equal (non zero)
next_test
0a11 : ad0002 > lda test_case ;previous test
0a14 : c90b > cmp #test_num
> trap_ne ;test is out of sequence
0a16 : d0fe > bne * ;failed not equal (non zero)
>
000c = >test_num = test_num + 1
0a18 : a90c > lda #test_num ;*** next tests' number
0a1a : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; test set and clear flags CLC CLI CLD CLV SEC SEI SED
set_stat $ff
> load_flag $ff
0a1d : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0a1f : 48 > pha ;use stack to load status
0a20 : 28 > plp
0a21 : 18 clc
tst_stat $ff-carry
0a22 : 08 > php ;save status
0a23 : 68 > pla ;use stack to retrieve status
0a24 : 48 > pha
> cmp_flag $ff-carry
0a25 : c9fe > cmp #($ff-carry|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a27 : d0fe > bne * ;failed not equal (non zero)
>
0a29 : 28 > plp ;restore status
0a2a : 38 sec
tst_stat $ff
0a2b : 08 > php ;save status
0a2c : 68 > pla ;use stack to retrieve status
0a2d : 48 > pha
> cmp_flag $ff
0a2e : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a30 : d0fe > bne * ;failed not equal (non zero)
>
0a32 : 28 > plp ;restore status
if I_flag = 3
0a33 : 58 cli
tst_stat $ff-intdis
0a34 : 08 > php ;save status
0a35 : 68 > pla ;use stack to retrieve status
0a36 : 48 > pha
> cmp_flag $ff-intdis
0a37 : c9fb > cmp #($ff-intdis|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a39 : d0fe > bne * ;failed not equal (non zero)
>
0a3b : 28 > plp ;restore status
0a3c : 78 sei
tst_stat $ff
0a3d : 08 > php ;save status
0a3e : 68 > pla ;use stack to retrieve status
0a3f : 48 > pha
> cmp_flag $ff
0a40 : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a42 : d0fe > bne * ;failed not equal (non zero)
>
0a44 : 28 > plp ;restore status
endif
0a45 : d8 cld
tst_stat $ff-decmode
0a46 : 08 > php ;save status
0a47 : 68 > pla ;use stack to retrieve status
0a48 : 48 > pha
> cmp_flag $ff-decmode
0a49 : c9f7 > cmp #($ff-decmode|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a4b : d0fe > bne * ;failed not equal (non zero)
>
0a4d : 28 > plp ;restore status
0a4e : f8 sed
tst_stat $ff
0a4f : 08 > php ;save status
0a50 : 68 > pla ;use stack to retrieve status
0a51 : 48 > pha
> cmp_flag $ff
0a52 : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a54 : d0fe > bne * ;failed not equal (non zero)
>
0a56 : 28 > plp ;restore status
0a57 : b8 clv
tst_stat $ff-overfl
0a58 : 08 > php ;save status
0a59 : 68 > pla ;use stack to retrieve status
0a5a : 48 > pha
> cmp_flag $ff-overfl
0a5b : c9bf > cmp #($ff-overfl|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a5d : d0fe > bne * ;failed not equal (non zero)
>
0a5f : 28 > plp ;restore status
set_stat 0
> load_flag 0
0a60 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0a62 : 48 > pha ;use stack to load status
0a63 : 28 > plp
tst_stat 0
0a64 : 08 > php ;save status
0a65 : 68 > pla ;use stack to retrieve status
0a66 : 48 > pha
> cmp_flag 0
0a67 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a69 : d0fe > bne * ;failed not equal (non zero)
>
0a6b : 28 > plp ;restore status
0a6c : 38 sec
tst_stat carry
0a6d : 08 > php ;save status
0a6e : 68 > pla ;use stack to retrieve status
0a6f : 48 > pha
> cmp_flag carry
0a70 : c931 > cmp #(carry|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a72 : d0fe > bne * ;failed not equal (non zero)
>
0a74 : 28 > plp ;restore status
0a75 : 18 clc
tst_stat 0
0a76 : 08 > php ;save status
0a77 : 68 > pla ;use stack to retrieve status
0a78 : 48 > pha
> cmp_flag 0
0a79 : c930 > cmp #(0 |fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a7b : d0fe > bne * ;failed not equal (non zero)
>
0a7d : 28 > plp ;restore status
if I_flag = 3
0a7e : 78 sei
tst_stat intdis
0a7f : 08 > php ;save status
0a80 : 68 > pla ;use stack to retrieve status
0a81 : 48 > pha
> cmp_flag intdis
0a82 : c934 > cmp #(intdis|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a84 : d0fe > bne * ;failed not equal (non zero)
>
0a86 : 28 > plp ;restore status
0a87 : 58 cli
tst_stat 0
0a88 : 08 > php ;save status
0a89 : 68 > pla ;use stack to retrieve status
0a8a : 48 > pha
> cmp_flag 0
0a8b : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a8d : d0fe > bne * ;failed not equal (non zero)
>
0a8f : 28 > plp ;restore status
endif
0a90 : f8 sed
tst_stat decmode
0a91 : 08 > php ;save status
0a92 : 68 > pla ;use stack to retrieve status
0a93 : 48 > pha
> cmp_flag decmode
0a94 : c938 > cmp #(decmode|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a96 : d0fe > bne * ;failed not equal (non zero)
>
0a98 : 28 > plp ;restore status
0a99 : d8 cld
tst_stat 0
0a9a : 08 > php ;save status
0a9b : 68 > pla ;use stack to retrieve status
0a9c : 48 > pha
> cmp_flag 0
0a9d : c930 > cmp #(0 |fao)&m8 ;expected flags + always on bits
>
> trap_ne
0a9f : d0fe > bne * ;failed not equal (non zero)
>
0aa1 : 28 > plp ;restore status
set_stat overfl
> load_flag overfl
0aa2 : a940 > lda #overfl ;allow test to change I-flag (no mask)
>
0aa4 : 48 > pha ;use stack to load status
0aa5 : 28 > plp
tst_stat overfl
0aa6 : 08 > php ;save status
0aa7 : 68 > pla ;use stack to retrieve status
0aa8 : 48 > pha
> cmp_flag overfl
0aa9 : c970 > cmp #(overfl|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0aab : d0fe > bne * ;failed not equal (non zero)
>
0aad : 28 > plp ;restore status
0aae : b8 clv
tst_stat 0
0aaf : 08 > php ;save status
0ab0 : 68 > pla ;use stack to retrieve status
0ab1 : 48 > pha
> cmp_flag 0
0ab2 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0ab4 : d0fe > bne * ;failed not equal (non zero)
>
0ab6 : 28 > plp ;restore status
next_test
0ab7 : ad0002 > lda test_case ;previous test
0aba : c90c > cmp #test_num
> trap_ne ;test is out of sequence
0abc : d0fe > bne * ;failed not equal (non zero)
>
000d = >test_num = test_num + 1
0abe : a90d > lda #test_num ;*** next tests' number
0ac0 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; testing index register increment/decrement and transfer
; INX INY DEX DEY TAX TXA TAY TYA
0ac3 : a2fe ldx #$fe
set_stat $ff
> load_flag $ff
0ac5 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0ac7 : 48 > pha ;use stack to load status
0ac8 : 28 > plp
0ac9 : e8 inx ;ff
tst_x $ff,$ff-zero
0aca : 08 > php ;save flags
0acb : e0ff > cpx #$ff ;test result
> trap_ne
0acd : d0fe > bne * ;failed not equal (non zero)
>
0acf : 68 > pla ;load status
0ad0 : 48 > pha
> cmp_flag $ff-zero
0ad1 : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0ad3 : d0fe > bne * ;failed not equal (non zero)
>
0ad5 : 28 > plp ;restore status
0ad6 : e8 inx ;00
tst_x 0,$ff-minus
0ad7 : 08 > php ;save flags
0ad8 : e000 > cpx #0 ;test result
> trap_ne
0ada : d0fe > bne * ;failed not equal (non zero)
>
0adc : 68 > pla ;load status
0add : 48 > pha
> cmp_flag $ff-minus
0ade : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0ae0 : d0fe > bne * ;failed not equal (non zero)
>
0ae2 : 28 > plp ;restore status
0ae3 : e8 inx ;01
tst_x 1,$ff-minus-zero
0ae4 : 08 > php ;save flags
0ae5 : e001 > cpx #1 ;test result
> trap_ne
0ae7 : d0fe > bne * ;failed not equal (non zero)
>
0ae9 : 68 > pla ;load status
0aea : 48 > pha
> cmp_flag $ff-minus-zero
0aeb : c97d > cmp #($ff-minus-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0aed : d0fe > bne * ;failed not equal (non zero)
>
0aef : 28 > plp ;restore status
0af0 : ca dex ;00
tst_x 0,$ff-minus
0af1 : 08 > php ;save flags
0af2 : e000 > cpx #0 ;test result
> trap_ne
0af4 : d0fe > bne * ;failed not equal (non zero)
>
0af6 : 68 > pla ;load status
0af7 : 48 > pha
> cmp_flag $ff-minus
0af8 : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0afa : d0fe > bne * ;failed not equal (non zero)
>
0afc : 28 > plp ;restore status
0afd : ca dex ;ff
tst_x $ff,$ff-zero
0afe : 08 > php ;save flags
0aff : e0ff > cpx #$ff ;test result
> trap_ne
0b01 : d0fe > bne * ;failed not equal (non zero)
>
0b03 : 68 > pla ;load status
0b04 : 48 > pha
> cmp_flag $ff-zero
0b05 : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b07 : d0fe > bne * ;failed not equal (non zero)
>
0b09 : 28 > plp ;restore status
0b0a : ca dex ;fe
set_stat 0
> load_flag 0
0b0b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0b0d : 48 > pha ;use stack to load status
0b0e : 28 > plp
0b0f : e8 inx ;ff
tst_x $ff,minus
0b10 : 08 > php ;save flags
0b11 : e0ff > cpx #$ff ;test result
> trap_ne
0b13 : d0fe > bne * ;failed not equal (non zero)
>
0b15 : 68 > pla ;load status
0b16 : 48 > pha
> cmp_flag minus
0b17 : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b19 : d0fe > bne * ;failed not equal (non zero)
>
0b1b : 28 > plp ;restore status
0b1c : e8 inx ;00
tst_x 0,zero
0b1d : 08 > php ;save flags
0b1e : e000 > cpx #0 ;test result
> trap_ne
0b20 : d0fe > bne * ;failed not equal (non zero)
>
0b22 : 68 > pla ;load status
0b23 : 48 > pha
> cmp_flag zero
0b24 : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b26 : d0fe > bne * ;failed not equal (non zero)
>
0b28 : 28 > plp ;restore status
0b29 : e8 inx ;01
tst_x 1,0
0b2a : 08 > php ;save flags
0b2b : e001 > cpx #1 ;test result
> trap_ne
0b2d : d0fe > bne * ;failed not equal (non zero)
>
0b2f : 68 > pla ;load status
0b30 : 48 > pha
> cmp_flag 0
0b31 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b33 : d0fe > bne * ;failed not equal (non zero)
>
0b35 : 28 > plp ;restore status
0b36 : ca dex ;00
tst_x 0,zero
0b37 : 08 > php ;save flags
0b38 : e000 > cpx #0 ;test result
> trap_ne
0b3a : d0fe > bne * ;failed not equal (non zero)
>
0b3c : 68 > pla ;load status
0b3d : 48 > pha
> cmp_flag zero
0b3e : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b40 : d0fe > bne * ;failed not equal (non zero)
>
0b42 : 28 > plp ;restore status
0b43 : ca dex ;ff
tst_x $ff,minus
0b44 : 08 > php ;save flags
0b45 : e0ff > cpx #$ff ;test result
> trap_ne
0b47 : d0fe > bne * ;failed not equal (non zero)
>
0b49 : 68 > pla ;load status
0b4a : 48 > pha
> cmp_flag minus
0b4b : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b4d : d0fe > bne * ;failed not equal (non zero)
>
0b4f : 28 > plp ;restore status
0b50 : a0fe ldy #$fe
set_stat $ff
> load_flag $ff
0b52 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0b54 : 48 > pha ;use stack to load status
0b55 : 28 > plp
0b56 : c8 iny ;ff
tst_y $ff,$ff-zero
0b57 : 08 > php ;save flags
0b58 : c0ff > cpy #$ff ;test result
> trap_ne
0b5a : d0fe > bne * ;failed not equal (non zero)
>
0b5c : 68 > pla ;load status
0b5d : 48 > pha
> cmp_flag $ff-zero
0b5e : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b60 : d0fe > bne * ;failed not equal (non zero)
>
0b62 : 28 > plp ;restore status
0b63 : c8 iny ;00
tst_y 0,$ff-minus
0b64 : 08 > php ;save flags
0b65 : c000 > cpy #0 ;test result
> trap_ne
0b67 : d0fe > bne * ;failed not equal (non zero)
>
0b69 : 68 > pla ;load status
0b6a : 48 > pha
> cmp_flag $ff-minus
0b6b : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b6d : d0fe > bne * ;failed not equal (non zero)
>
0b6f : 28 > plp ;restore status
0b70 : c8 iny ;01
tst_y 1,$ff-minus-zero
0b71 : 08 > php ;save flags
0b72 : c001 > cpy #1 ;test result
> trap_ne
0b74 : d0fe > bne * ;failed not equal (non zero)
>
0b76 : 68 > pla ;load status
0b77 : 48 > pha
> cmp_flag $ff-minus-zero
0b78 : c97d > cmp #($ff-minus-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b7a : d0fe > bne * ;failed not equal (non zero)
>
0b7c : 28 > plp ;restore status
0b7d : 88 dey ;00
tst_y 0,$ff-minus
0b7e : 08 > php ;save flags
0b7f : c000 > cpy #0 ;test result
> trap_ne
0b81 : d0fe > bne * ;failed not equal (non zero)
>
0b83 : 68 > pla ;load status
0b84 : 48 > pha
> cmp_flag $ff-minus
0b85 : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b87 : d0fe > bne * ;failed not equal (non zero)
>
0b89 : 28 > plp ;restore status
0b8a : 88 dey ;ff
tst_y $ff,$ff-zero
0b8b : 08 > php ;save flags
0b8c : c0ff > cpy #$ff ;test result
> trap_ne
0b8e : d0fe > bne * ;failed not equal (non zero)
>
0b90 : 68 > pla ;load status
0b91 : 48 > pha
> cmp_flag $ff-zero
0b92 : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0b94 : d0fe > bne * ;failed not equal (non zero)
>
0b96 : 28 > plp ;restore status
0b97 : 88 dey ;fe
set_stat 0
> load_flag 0
0b98 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0b9a : 48 > pha ;use stack to load status
0b9b : 28 > plp
0b9c : c8 iny ;ff
tst_y $ff,0+minus
0b9d : 08 > php ;save flags
0b9e : c0ff > cpy #$ff ;test result
> trap_ne
0ba0 : d0fe > bne * ;failed not equal (non zero)
>
0ba2 : 68 > pla ;load status
0ba3 : 48 > pha
> cmp_flag 0+minus
0ba4 : c9b0 > cmp #(0+minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0ba6 : d0fe > bne * ;failed not equal (non zero)
>
0ba8 : 28 > plp ;restore status
0ba9 : c8 iny ;00
tst_y 0,zero
0baa : 08 > php ;save flags
0bab : c000 > cpy #0 ;test result
> trap_ne
0bad : d0fe > bne * ;failed not equal (non zero)
>
0baf : 68 > pla ;load status
0bb0 : 48 > pha
> cmp_flag zero
0bb1 : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0bb3 : d0fe > bne * ;failed not equal (non zero)
>
0bb5 : 28 > plp ;restore status
0bb6 : c8 iny ;01
tst_y 1,0
0bb7 : 08 > php ;save flags
0bb8 : c001 > cpy #1 ;test result
> trap_ne
0bba : d0fe > bne * ;failed not equal (non zero)
>
0bbc : 68 > pla ;load status
0bbd : 48 > pha
> cmp_flag 0
0bbe : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0bc0 : d0fe > bne * ;failed not equal (non zero)
>
0bc2 : 28 > plp ;restore status
0bc3 : 88 dey ;00
tst_y 0,zero
0bc4 : 08 > php ;save flags
0bc5 : c000 > cpy #0 ;test result
> trap_ne
0bc7 : d0fe > bne * ;failed not equal (non zero)
>
0bc9 : 68 > pla ;load status
0bca : 48 > pha
> cmp_flag zero
0bcb : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0bcd : d0fe > bne * ;failed not equal (non zero)
>
0bcf : 28 > plp ;restore status
0bd0 : 88 dey ;ff
tst_y $ff,minus
0bd1 : 08 > php ;save flags
0bd2 : c0ff > cpy #$ff ;test result
> trap_ne
0bd4 : d0fe > bne * ;failed not equal (non zero)
>
0bd6 : 68 > pla ;load status
0bd7 : 48 > pha
> cmp_flag minus
0bd8 : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0bda : d0fe > bne * ;failed not equal (non zero)
>
0bdc : 28 > plp ;restore status
0bdd : a2ff ldx #$ff
set_stat $ff
> load_flag $ff
0bdf : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0be1 : 48 > pha ;use stack to load status
0be2 : 28 > plp
0be3 : 8a txa
tst_a $ff,$ff-zero
0be4 : 08 > php ;save flags
0be5 : c9ff > cmp #$ff ;test result
> trap_ne
0be7 : d0fe > bne * ;failed not equal (non zero)
>
0be9 : 68 > pla ;load status
0bea : 48 > pha
> cmp_flag $ff-zero
0beb : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0bed : d0fe > bne * ;failed not equal (non zero)
>
0bef : 28 > plp ;restore status
0bf0 : 08 php
0bf1 : e8 inx ;00
0bf2 : 28 plp
0bf3 : 8a txa
tst_a 0,$ff-minus
0bf4 : 08 > php ;save flags
0bf5 : c900 > cmp #0 ;test result
> trap_ne
0bf7 : d0fe > bne * ;failed not equal (non zero)
>
0bf9 : 68 > pla ;load status
0bfa : 48 > pha
> cmp_flag $ff-minus
0bfb : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0bfd : d0fe > bne * ;failed not equal (non zero)
>
0bff : 28 > plp ;restore status
0c00 : 08 php
0c01 : e8 inx ;01
0c02 : 28 plp
0c03 : 8a txa
tst_a 1,$ff-minus-zero
0c04 : 08 > php ;save flags
0c05 : c901 > cmp #1 ;test result
> trap_ne
0c07 : d0fe > bne * ;failed not equal (non zero)
>
0c09 : 68 > pla ;load status
0c0a : 48 > pha
> cmp_flag $ff-minus-zero
0c0b : c97d > cmp #($ff-minus-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c0d : d0fe > bne * ;failed not equal (non zero)
>
0c0f : 28 > plp ;restore status
set_stat 0
> load_flag 0
0c10 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0c12 : 48 > pha ;use stack to load status
0c13 : 28 > plp
0c14 : 8a txa
tst_a 1,0
0c15 : 08 > php ;save flags
0c16 : c901 > cmp #1 ;test result
> trap_ne
0c18 : d0fe > bne * ;failed not equal (non zero)
>
0c1a : 68 > pla ;load status
0c1b : 48 > pha
> cmp_flag 0
0c1c : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c1e : d0fe > bne * ;failed not equal (non zero)
>
0c20 : 28 > plp ;restore status
0c21 : 08 php
0c22 : ca dex ;00
0c23 : 28 plp
0c24 : 8a txa
tst_a 0,zero
0c25 : 08 > php ;save flags
0c26 : c900 > cmp #0 ;test result
> trap_ne
0c28 : d0fe > bne * ;failed not equal (non zero)
>
0c2a : 68 > pla ;load status
0c2b : 48 > pha
> cmp_flag zero
0c2c : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c2e : d0fe > bne * ;failed not equal (non zero)
>
0c30 : 28 > plp ;restore status
0c31 : 08 php
0c32 : ca dex ;ff
0c33 : 28 plp
0c34 : 8a txa
tst_a $ff,minus
0c35 : 08 > php ;save flags
0c36 : c9ff > cmp #$ff ;test result
> trap_ne
0c38 : d0fe > bne * ;failed not equal (non zero)
>
0c3a : 68 > pla ;load status
0c3b : 48 > pha
> cmp_flag minus
0c3c : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c3e : d0fe > bne * ;failed not equal (non zero)
>
0c40 : 28 > plp ;restore status
0c41 : a0ff ldy #$ff
set_stat $ff
> load_flag $ff
0c43 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0c45 : 48 > pha ;use stack to load status
0c46 : 28 > plp
0c47 : 98 tya
tst_a $ff,$ff-zero
0c48 : 08 > php ;save flags
0c49 : c9ff > cmp #$ff ;test result
> trap_ne
0c4b : d0fe > bne * ;failed not equal (non zero)
>
0c4d : 68 > pla ;load status
0c4e : 48 > pha
> cmp_flag $ff-zero
0c4f : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c51 : d0fe > bne * ;failed not equal (non zero)
>
0c53 : 28 > plp ;restore status
0c54 : 08 php
0c55 : c8 iny ;00
0c56 : 28 plp
0c57 : 98 tya
tst_a 0,$ff-minus
0c58 : 08 > php ;save flags
0c59 : c900 > cmp #0 ;test result
> trap_ne
0c5b : d0fe > bne * ;failed not equal (non zero)
>
0c5d : 68 > pla ;load status
0c5e : 48 > pha
> cmp_flag $ff-minus
0c5f : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c61 : d0fe > bne * ;failed not equal (non zero)
>
0c63 : 28 > plp ;restore status
0c64 : 08 php
0c65 : c8 iny ;01
0c66 : 28 plp
0c67 : 98 tya
tst_a 1,$ff-minus-zero
0c68 : 08 > php ;save flags
0c69 : c901 > cmp #1 ;test result
> trap_ne
0c6b : d0fe > bne * ;failed not equal (non zero)
>
0c6d : 68 > pla ;load status
0c6e : 48 > pha
> cmp_flag $ff-minus-zero
0c6f : c97d > cmp #($ff-minus-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c71 : d0fe > bne * ;failed not equal (non zero)
>
0c73 : 28 > plp ;restore status
set_stat 0
> load_flag 0
0c74 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0c76 : 48 > pha ;use stack to load status
0c77 : 28 > plp
0c78 : 98 tya
tst_a 1,0
0c79 : 08 > php ;save flags
0c7a : c901 > cmp #1 ;test result
> trap_ne
0c7c : d0fe > bne * ;failed not equal (non zero)
>
0c7e : 68 > pla ;load status
0c7f : 48 > pha
> cmp_flag 0
0c80 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c82 : d0fe > bne * ;failed not equal (non zero)
>
0c84 : 28 > plp ;restore status
0c85 : 08 php
0c86 : 88 dey ;00
0c87 : 28 plp
0c88 : 98 tya
tst_a 0,zero
0c89 : 08 > php ;save flags
0c8a : c900 > cmp #0 ;test result
> trap_ne
0c8c : d0fe > bne * ;failed not equal (non zero)
>
0c8e : 68 > pla ;load status
0c8f : 48 > pha
> cmp_flag zero
0c90 : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0c92 : d0fe > bne * ;failed not equal (non zero)
>
0c94 : 28 > plp ;restore status
0c95 : 08 php
0c96 : 88 dey ;ff
0c97 : 28 plp
0c98 : 98 tya
tst_a $ff,minus
0c99 : 08 > php ;save flags
0c9a : c9ff > cmp #$ff ;test result
> trap_ne
0c9c : d0fe > bne * ;failed not equal (non zero)
>
0c9e : 68 > pla ;load status
0c9f : 48 > pha
> cmp_flag minus
0ca0 : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0ca2 : d0fe > bne * ;failed not equal (non zero)
>
0ca4 : 28 > plp ;restore status
load_flag $ff
0ca5 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
0ca7 : 48 pha
0ca8 : a2ff ldx #$ff ;ff
0caa : 8a txa
0cab : 28 plp
0cac : a8 tay
tst_y $ff,$ff-zero
0cad : 08 > php ;save flags
0cae : c0ff > cpy #$ff ;test result
> trap_ne
0cb0 : d0fe > bne * ;failed not equal (non zero)
>
0cb2 : 68 > pla ;load status
0cb3 : 48 > pha
> cmp_flag $ff-zero
0cb4 : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0cb6 : d0fe > bne * ;failed not equal (non zero)
>
0cb8 : 28 > plp ;restore status
0cb9 : 08 php
0cba : e8 inx ;00
0cbb : 8a txa
0cbc : 28 plp
0cbd : a8 tay
tst_y 0,$ff-minus
0cbe : 08 > php ;save flags
0cbf : c000 > cpy #0 ;test result
> trap_ne
0cc1 : d0fe > bne * ;failed not equal (non zero)
>
0cc3 : 68 > pla ;load status
0cc4 : 48 > pha
> cmp_flag $ff-minus
0cc5 : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0cc7 : d0fe > bne * ;failed not equal (non zero)
>
0cc9 : 28 > plp ;restore status
0cca : 08 php
0ccb : e8 inx ;01
0ccc : 8a txa
0ccd : 28 plp
0cce : a8 tay
tst_y 1,$ff-minus-zero
0ccf : 08 > php ;save flags
0cd0 : c001 > cpy #1 ;test result
> trap_ne
0cd2 : d0fe > bne * ;failed not equal (non zero)
>
0cd4 : 68 > pla ;load status
0cd5 : 48 > pha
> cmp_flag $ff-minus-zero
0cd6 : c97d > cmp #($ff-minus-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0cd8 : d0fe > bne * ;failed not equal (non zero)
>
0cda : 28 > plp ;restore status
load_flag 0
0cdb : a900 > lda #0 ;allow test to change I-flag (no mask)
0cdd : 48 pha
0cde : a900 lda #0
0ce0 : 8a txa
0ce1 : 28 plp
0ce2 : a8 tay
tst_y 1,0
0ce3 : 08 > php ;save flags
0ce4 : c001 > cpy #1 ;test result
> trap_ne
0ce6 : d0fe > bne * ;failed not equal (non zero)
>
0ce8 : 68 > pla ;load status
0ce9 : 48 > pha
> cmp_flag 0
0cea : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0cec : d0fe > bne * ;failed not equal (non zero)
>
0cee : 28 > plp ;restore status
0cef : 08 php
0cf0 : ca dex ;00
0cf1 : 8a txa
0cf2 : 28 plp
0cf3 : a8 tay
tst_y 0,zero
0cf4 : 08 > php ;save flags
0cf5 : c000 > cpy #0 ;test result
> trap_ne
0cf7 : d0fe > bne * ;failed not equal (non zero)
>
0cf9 : 68 > pla ;load status
0cfa : 48 > pha
> cmp_flag zero
0cfb : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0cfd : d0fe > bne * ;failed not equal (non zero)
>
0cff : 28 > plp ;restore status
0d00 : 08 php
0d01 : ca dex ;ff
0d02 : 8a txa
0d03 : 28 plp
0d04 : a8 tay
tst_y $ff,minus
0d05 : 08 > php ;save flags
0d06 : c0ff > cpy #$ff ;test result
> trap_ne
0d08 : d0fe > bne * ;failed not equal (non zero)
>
0d0a : 68 > pla ;load status
0d0b : 48 > pha
> cmp_flag minus
0d0c : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0d0e : d0fe > bne * ;failed not equal (non zero)
>
0d10 : 28 > plp ;restore status
load_flag $ff
0d11 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
0d13 : 48 pha
0d14 : a0ff ldy #$ff ;ff
0d16 : 98 tya
0d17 : 28 plp
0d18 : aa tax
tst_x $ff,$ff-zero
0d19 : 08 > php ;save flags
0d1a : e0ff > cpx #$ff ;test result
> trap_ne
0d1c : d0fe > bne * ;failed not equal (non zero)
>
0d1e : 68 > pla ;load status
0d1f : 48 > pha
> cmp_flag $ff-zero
0d20 : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0d22 : d0fe > bne * ;failed not equal (non zero)
>
0d24 : 28 > plp ;restore status
0d25 : 08 php
0d26 : c8 iny ;00
0d27 : 98 tya
0d28 : 28 plp
0d29 : aa tax
tst_x 0,$ff-minus
0d2a : 08 > php ;save flags
0d2b : e000 > cpx #0 ;test result
> trap_ne
0d2d : d0fe > bne * ;failed not equal (non zero)
>
0d2f : 68 > pla ;load status
0d30 : 48 > pha
> cmp_flag $ff-minus
0d31 : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0d33 : d0fe > bne * ;failed not equal (non zero)
>
0d35 : 28 > plp ;restore status
0d36 : 08 php
0d37 : c8 iny ;01
0d38 : 98 tya
0d39 : 28 plp
0d3a : aa tax
tst_x 1,$ff-minus-zero
0d3b : 08 > php ;save flags
0d3c : e001 > cpx #1 ;test result
> trap_ne
0d3e : d0fe > bne * ;failed not equal (non zero)
>
0d40 : 68 > pla ;load status
0d41 : 48 > pha
> cmp_flag $ff-minus-zero
0d42 : c97d > cmp #($ff-minus-zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0d44 : d0fe > bne * ;failed not equal (non zero)
>
0d46 : 28 > plp ;restore status
load_flag 0
0d47 : a900 > lda #0 ;allow test to change I-flag (no mask)
0d49 : 48 pha
0d4a : a900 lda #0 ;preset status
0d4c : 98 tya
0d4d : 28 plp
0d4e : aa tax
tst_x 1,0
0d4f : 08 > php ;save flags
0d50 : e001 > cpx #1 ;test result
> trap_ne
0d52 : d0fe > bne * ;failed not equal (non zero)
>
0d54 : 68 > pla ;load status
0d55 : 48 > pha
> cmp_flag 0
0d56 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0d58 : d0fe > bne * ;failed not equal (non zero)
>
0d5a : 28 > plp ;restore status
0d5b : 08 php
0d5c : 88 dey ;00
0d5d : 98 tya
0d5e : 28 plp
0d5f : aa tax
tst_x 0,zero
0d60 : 08 > php ;save flags
0d61 : e000 > cpx #0 ;test result
> trap_ne
0d63 : d0fe > bne * ;failed not equal (non zero)
>
0d65 : 68 > pla ;load status
0d66 : 48 > pha
> cmp_flag zero
0d67 : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0d69 : d0fe > bne * ;failed not equal (non zero)
>
0d6b : 28 > plp ;restore status
0d6c : 08 php
0d6d : 88 dey ;ff
0d6e : 98 tya
0d6f : 28 plp
0d70 : aa tax
tst_x $ff,minus
0d71 : 08 > php ;save flags
0d72 : e0ff > cpx #$ff ;test result
> trap_ne
0d74 : d0fe > bne * ;failed not equal (non zero)
>
0d76 : 68 > pla ;load status
0d77 : 48 > pha
> cmp_flag minus
0d78 : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
>
> trap_ne
0d7a : d0fe > bne * ;failed not equal (non zero)
>
0d7c : 28 > plp ;restore status
next_test
0d7d : ad0002 > lda test_case ;previous test
0d80 : c90d > cmp #test_num
> trap_ne ;test is out of sequence
0d82 : d0fe > bne * ;failed not equal (non zero)
>
000e = >test_num = test_num + 1
0d84 : a90e > lda #test_num ;*** next tests' number
0d86 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
;TSX sets NZ - TXS does not
; This section also tests for proper stack wrap around.
0d89 : a201 ldx #1 ;01
set_stat $ff
> load_flag $ff
0d8b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0d8d : 48 > pha ;use stack to load status
0d8e : 28 > plp
0d8f : 9a txs
0d90 : 08 php
0d91 : ad0101 lda $101
cmp_flag $ff
0d94 : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
trap_ne
0d96 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
0d98 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0d9a : 48 > pha ;use stack to load status
0d9b : 28 > plp
0d9c : 9a txs
0d9d : 08 php
0d9e : ad0101 lda $101
cmp_flag 0
0da1 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
trap_ne
0da3 : d0fe > bne * ;failed not equal (non zero)
0da5 : ca dex ;00
set_stat $ff
> load_flag $ff
0da6 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0da8 : 48 > pha ;use stack to load status
0da9 : 28 > plp
0daa : 9a txs
0dab : 08 php
0dac : ad0001 lda $100
cmp_flag $ff
0daf : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
trap_ne
0db1 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
0db3 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0db5 : 48 > pha ;use stack to load status
0db6 : 28 > plp
0db7 : 9a txs
0db8 : 08 php
0db9 : ad0001 lda $100
cmp_flag 0
0dbc : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
trap_ne
0dbe : d0fe > bne * ;failed not equal (non zero)
0dc0 : ca dex ;ff
set_stat $ff
> load_flag $ff
0dc1 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0dc3 : 48 > pha ;use stack to load status
0dc4 : 28 > plp
0dc5 : 9a txs
0dc6 : 08 php
0dc7 : adff01 lda $1ff
cmp_flag $ff
0dca : c9ff > cmp #($ff|fao)&m8 ;expected flags + always on bits
trap_ne
0dcc : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
0dce : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0dd0 : 48 > pha ;use stack to load status
0dd1 : 28 > plp
0dd2 : 9a txs
0dd3 : 08 php
0dd4 : adff01 lda $1ff
cmp_flag 0
0dd7 : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
0dd9 : a201 ldx #1
0ddb : 9a txs ;sp=01
set_stat $ff
> load_flag $ff
0ddc : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0dde : 48 > pha ;use stack to load status
0ddf : 28 > plp
0de0 : ba tsx ;clears Z, N
0de1 : 08 php ;sp=00
0de2 : e001 cpx #1
trap_ne
0de4 : d0fe > bne * ;failed not equal (non zero)
0de6 : ad0101 lda $101
cmp_flag $ff-minus-zero
0de9 : c97d > cmp #($ff-minus-zero|fao)&m8 ;expected flags + always on bits
trap_ne
0deb : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
0ded : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0def : 48 > pha ;use stack to load status
0df0 : 28 > plp
0df1 : ba tsx ;clears N, sets Z
0df2 : 08 php ;sp=ff
0df3 : e000 cpx #0
trap_ne
0df5 : d0fe > bne * ;failed not equal (non zero)
0df7 : ad0001 lda $100
cmp_flag $ff-minus
0dfa : c97f > cmp #($ff-minus|fao)&m8 ;expected flags + always on bits
trap_ne
0dfc : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
0dfe : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0e00 : 48 > pha ;use stack to load status
0e01 : 28 > plp
0e02 : ba tsx ;clears N, sets Z
0e03 : 08 php ;sp=fe
0e04 : e0ff cpx #$ff
trap_ne
0e06 : d0fe > bne * ;failed not equal (non zero)
0e08 : adff01 lda $1ff
cmp_flag $ff-zero
0e0b : c9fd > cmp #($ff-zero|fao)&m8 ;expected flags + always on bits
trap_ne
0e0d : d0fe > bne * ;failed not equal (non zero)
0e0f : a201 ldx #1
0e11 : 9a txs ;sp=01
set_stat 0
> load_flag 0
0e12 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0e14 : 48 > pha ;use stack to load status
0e15 : 28 > plp
0e16 : ba tsx ;clears Z, N
0e17 : 08 php ;sp=00
0e18 : e001 cpx #1
trap_ne
0e1a : d0fe > bne * ;failed not equal (non zero)
0e1c : ad0101 lda $101
cmp_flag 0
0e1f : c930 > cmp #(0|fao)&m8 ;expected flags + always on bits
trap_ne
0e21 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
0e23 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0e25 : 48 > pha ;use stack to load status
0e26 : 28 > plp
0e27 : ba tsx ;clears N, sets Z
0e28 : 08 php ;sp=ff
0e29 : e000 cpx #0
trap_ne
0e2b : d0fe > bne * ;failed not equal (non zero)
0e2d : ad0001 lda $100
cmp_flag zero
0e30 : c932 > cmp #(zero|fao)&m8 ;expected flags + always on bits
trap_ne
0e32 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
0e34 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0e36 : 48 > pha ;use stack to load status
0e37 : 28 > plp
0e38 : ba tsx ;clears N, sets Z
0e39 : 08 php ;sp=fe
0e3a : e0ff cpx #$ff
trap_ne
0e3c : d0fe > bne * ;failed not equal (non zero)
0e3e : adff01 lda $1ff
cmp_flag minus
0e41 : c9b0 > cmp #(minus|fao)&m8 ;expected flags + always on bits
trap_ne
0e43 : d0fe > bne * ;failed not equal (non zero)
0e45 : 68 pla ;sp=ff
next_test
0e46 : ad0002 > lda test_case ;previous test
0e49 : c90e > cmp #test_num
> trap_ne ;test is out of sequence
0e4b : d0fe > bne * ;failed not equal (non zero)
>
000f = >test_num = test_num + 1
0e4d : a90f > lda #test_num ;*** next tests' number
0e4f : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; testing index register load & store LDY LDX STY STX all addressing modes
; LDX / STX - zp,y / abs,y
0e52 : a003 ldy #3
0e54 : tldx
set_stat 0
> load_flag 0
0e54 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0e56 : 48 > pha ;use stack to load status
0e57 : 28 > plp
0e58 : b613 ldx zp1,y
0e5a : 08 php ;test stores do not alter flags
0e5b : 8a txa
0e5c : 49c3 eor #$c3
0e5e : 28 plp
0e5f : 990302 sta abst,y
0e62 : 08 php ;flags after load/store sequence
0e63 : 49c3 eor #$c3
0e65 : d91702 cmp abs1,y ;test result
trap_ne
0e68 : d0fe > bne * ;failed not equal (non zero)
0e6a : 68 pla ;load status
eor_flag 0
0e6b : 4930 > eor #0|fao ;invert expected flags + always on bits
0e6d : d91c02 cmp fLDx,y ;test flags
trap_ne
0e70 : d0fe > bne * ;failed not equal (non zero)
0e72 : 88 dey
0e73 : 10df bpl tldx
0e75 : a003 ldy #3
0e77 : tldx1
set_stat $ff
> load_flag $ff
0e77 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0e79 : 48 > pha ;use stack to load status
0e7a : 28 > plp
0e7b : b613 ldx zp1,y
0e7d : 08 php ;test stores do not alter flags
0e7e : 8a txa
0e7f : 49c3 eor #$c3
0e81 : 28 plp
0e82 : 990302 sta abst,y
0e85 : 08 php ;flags after load/store sequence
0e86 : 49c3 eor #$c3
0e88 : d91702 cmp abs1,y ;test result
trap_ne
0e8b : d0fe > bne * ;failed not equal (non zero)
0e8d : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
0e8e : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
0e90 : d91c02 cmp fLDx,y ;test flags
trap_ne
0e93 : d0fe > bne * ;failed not equal (non zero)
0e95 : 88 dey
0e96 : 10df bpl tldx1
0e98 : a003 ldy #3
0e9a : tldx2
set_stat 0
> load_flag 0
0e9a : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0e9c : 48 > pha ;use stack to load status
0e9d : 28 > plp
0e9e : be1702 ldx abs1,y
0ea1 : 08 php ;test stores do not alter flags
0ea2 : 8a txa
0ea3 : 49c3 eor #$c3
0ea5 : aa tax
0ea6 : 28 plp
0ea7 : 960c stx zpt,y
0ea9 : 08 php ;flags after load/store sequence
0eaa : 49c3 eor #$c3
0eac : d91300 cmp zp1,y ;test result
trap_ne
0eaf : d0fe > bne * ;failed not equal (non zero)
0eb1 : 68 pla ;load status
eor_flag 0
0eb2 : 4930 > eor #0|fao ;invert expected flags + always on bits
0eb4 : d91c02 cmp fLDx,y ;test flags
trap_ne
0eb7 : d0fe > bne * ;failed not equal (non zero)
0eb9 : 88 dey
0eba : 10de bpl tldx2
0ebc : a003 ldy #3
0ebe : tldx3
set_stat $ff
> load_flag $ff
0ebe : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0ec0 : 48 > pha ;use stack to load status
0ec1 : 28 > plp
0ec2 : be1702 ldx abs1,y
0ec5 : 08 php ;test stores do not alter flags
0ec6 : 8a txa
0ec7 : 49c3 eor #$c3
0ec9 : aa tax
0eca : 28 plp
0ecb : 960c stx zpt,y
0ecd : 08 php ;flags after load/store sequence
0ece : 49c3 eor #$c3
0ed0 : d91300 cmp zp1,y ;test result
trap_ne
0ed3 : d0fe > bne * ;failed not equal (non zero)
0ed5 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
0ed6 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
0ed8 : d91c02 cmp fLDx,y ;test flags
trap_ne
0edb : d0fe > bne * ;failed not equal (non zero)
0edd : 88 dey
0ede : 10de bpl tldx3
0ee0 : a003 ldy #3 ;testing store result
0ee2 : a200 ldx #0
0ee4 : b90c00 tstx lda zpt,y
0ee7 : 49c3 eor #$c3
0ee9 : d91300 cmp zp1,y
trap_ne ;store to zp data
0eec : d0fe > bne * ;failed not equal (non zero)
0eee : 960c stx zpt,y ;clear
0ef0 : b90302 lda abst,y
0ef3 : 49c3 eor #$c3
0ef5 : d91702 cmp abs1,y
trap_ne ;store to abs data
0ef8 : d0fe > bne * ;failed not equal (non zero)
0efa : 8a txa
0efb : 990302 sta abst,y ;clear
0efe : 88 dey
0eff : 10e3 bpl tstx
next_test
0f01 : ad0002 > lda test_case ;previous test
0f04 : c90f > cmp #test_num
> trap_ne ;test is out of sequence
0f06 : d0fe > bne * ;failed not equal (non zero)
>
0010 = >test_num = test_num + 1
0f08 : a910 > lda #test_num ;*** next tests' number
0f0a : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; indexed wraparound test (only zp should wrap)
0f0d : a0fd ldy #3+$fa
0f0f : b619 tldx4 ldx zp1-$fa&$ff,y ;wrap on indexed zp
0f11 : 8a txa
0f12 : 990901 sta abst-$fa,y ;no STX abs,y!
0f15 : 88 dey
0f16 : c0fa cpy #$fa
0f18 : b0f5 bcs tldx4
0f1a : a0fd ldy #3+$fa
0f1c : be1d01 tldx5 ldx abs1-$fa,y ;no wrap on indexed abs
0f1f : 9612 stx zpt-$fa&$ff,y
0f21 : 88 dey
0f22 : c0fa cpy #$fa
0f24 : b0f6 bcs tldx5
0f26 : a003 ldy #3 ;testing wraparound result
0f28 : a200 ldx #0
0f2a : b90c00 tstx1 lda zpt,y
0f2d : d91300 cmp zp1,y
trap_ne ;store to zp data
0f30 : d0fe > bne * ;failed not equal (non zero)
0f32 : 960c stx zpt,y ;clear
0f34 : b90302 lda abst,y
0f37 : d91702 cmp abs1,y
trap_ne ;store to abs data
0f3a : d0fe > bne * ;failed not equal (non zero)
0f3c : 8a txa
0f3d : 990302 sta abst,y ;clear
0f40 : 88 dey
0f41 : 10e7 bpl tstx1
next_test
0f43 : ad0002 > lda test_case ;previous test
0f46 : c910 > cmp #test_num
> trap_ne ;test is out of sequence
0f48 : d0fe > bne * ;failed not equal (non zero)
>
0011 = >test_num = test_num + 1
0f4a : a911 > lda #test_num ;*** next tests' number
0f4c : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; LDY / STY - zp,x / abs,x
0f4f : a203 ldx #3
0f51 : tldy
set_stat 0
> load_flag 0
0f51 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0f53 : 48 > pha ;use stack to load status
0f54 : 28 > plp
0f55 : b413 ldy zp1,x
0f57 : 08 php ;test stores do not alter flags
0f58 : 98 tya
0f59 : 49c3 eor #$c3
0f5b : 28 plp
0f5c : 9d0302 sta abst,x
0f5f : 08 php ;flags after load/store sequence
0f60 : 49c3 eor #$c3
0f62 : dd1702 cmp abs1,x ;test result
trap_ne
0f65 : d0fe > bne * ;failed not equal (non zero)
0f67 : 68 pla ;load status
eor_flag 0
0f68 : 4930 > eor #0|fao ;invert expected flags + always on bits
0f6a : dd1c02 cmp fLDx,x ;test flags
trap_ne
0f6d : d0fe > bne * ;failed not equal (non zero)
0f6f : ca dex
0f70 : 10df bpl tldy
0f72 : a203 ldx #3
0f74 : tldy1
set_stat $ff
> load_flag $ff
0f74 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0f76 : 48 > pha ;use stack to load status
0f77 : 28 > plp
0f78 : b413 ldy zp1,x
0f7a : 08 php ;test stores do not alter flags
0f7b : 98 tya
0f7c : 49c3 eor #$c3
0f7e : 28 plp
0f7f : 9d0302 sta abst,x
0f82 : 08 php ;flags after load/store sequence
0f83 : 49c3 eor #$c3
0f85 : dd1702 cmp abs1,x ;test result
trap_ne
0f88 : d0fe > bne * ;failed not equal (non zero)
0f8a : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
0f8b : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
0f8d : dd1c02 cmp fLDx,x ;test flags
trap_ne
0f90 : d0fe > bne * ;failed not equal (non zero)
0f92 : ca dex
0f93 : 10df bpl tldy1
0f95 : a203 ldx #3
0f97 : tldy2
set_stat 0
> load_flag 0
0f97 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
0f99 : 48 > pha ;use stack to load status
0f9a : 28 > plp
0f9b : bc1702 ldy abs1,x
0f9e : 08 php ;test stores do not alter flags
0f9f : 98 tya
0fa0 : 49c3 eor #$c3
0fa2 : a8 tay
0fa3 : 28 plp
0fa4 : 940c sty zpt,x
0fa6 : 08 php ;flags after load/store sequence
0fa7 : 49c3 eor #$c3
0fa9 : d513 cmp zp1,x ;test result
trap_ne
0fab : d0fe > bne * ;failed not equal (non zero)
0fad : 68 pla ;load status
eor_flag 0
0fae : 4930 > eor #0|fao ;invert expected flags + always on bits
0fb0 : dd1c02 cmp fLDx,x ;test flags
trap_ne
0fb3 : d0fe > bne * ;failed not equal (non zero)
0fb5 : ca dex
0fb6 : 10df bpl tldy2
0fb8 : a203 ldx #3
0fba : tldy3
set_stat $ff
> load_flag $ff
0fba : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
0fbc : 48 > pha ;use stack to load status
0fbd : 28 > plp
0fbe : bc1702 ldy abs1,x
0fc1 : 08 php ;test stores do not alter flags
0fc2 : 98 tya
0fc3 : 49c3 eor #$c3
0fc5 : a8 tay
0fc6 : 28 plp
0fc7 : 940c sty zpt,x
0fc9 : 08 php ;flags after load/store sequence
0fca : 49c3 eor #$c3
0fcc : d513 cmp zp1,x ;test result
trap_ne
0fce : d0fe > bne * ;failed not equal (non zero)
0fd0 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
0fd1 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
0fd3 : dd1c02 cmp fLDx,x ;test flags
trap_ne
0fd6 : d0fe > bne * ;failed not equal (non zero)
0fd8 : ca dex
0fd9 : 10df bpl tldy3
0fdb : a203 ldx #3 ;testing store result
0fdd : a000 ldy #0
0fdf : b50c tsty lda zpt,x
0fe1 : 49c3 eor #$c3
0fe3 : d513 cmp zp1,x
trap_ne ;store to zp,x data
0fe5 : d0fe > bne * ;failed not equal (non zero)
0fe7 : 940c sty zpt,x ;clear
0fe9 : bd0302 lda abst,x
0fec : 49c3 eor #$c3
0fee : dd1702 cmp abs1,x
trap_ne ;store to abs,x data
0ff1 : d0fe > bne * ;failed not equal (non zero)
0ff3 : 8a txa
0ff4 : 9d0302 sta abst,x ;clear
0ff7 : ca dex
0ff8 : 10e5 bpl tsty
next_test
0ffa : ad0002 > lda test_case ;previous test
0ffd : c911 > cmp #test_num
> trap_ne ;test is out of sequence
0fff : d0fe > bne * ;failed not equal (non zero)
>
0012 = >test_num = test_num + 1
1001 : a912 > lda #test_num ;*** next tests' number
1003 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; indexed wraparound test (only zp should wrap)
1006 : a2fd ldx #3+$fa
1008 : b419 tldy4 ldy zp1-$fa&$ff,x ;wrap on indexed zp
100a : 98 tya
100b : 9d0901 sta abst-$fa,x ;no STX abs,x!
100e : ca dex
100f : e0fa cpx #$fa
1011 : b0f5 bcs tldy4
1013 : a2fd ldx #3+$fa
1015 : bc1d01 tldy5 ldy abs1-$fa,x ;no wrap on indexed abs
1018 : 9412 sty zpt-$fa&$ff,x
101a : ca dex
101b : e0fa cpx #$fa
101d : b0f6 bcs tldy5
101f : a203 ldx #3 ;testing wraparound result
1021 : a000 ldy #0
1023 : b50c tsty1 lda zpt,x
1025 : d513 cmp zp1,x
trap_ne ;store to zp,x data
1027 : d0fe > bne * ;failed not equal (non zero)
1029 : 940c sty zpt,x ;clear
102b : bd0302 lda abst,x
102e : dd1702 cmp abs1,x
trap_ne ;store to abs,x data
1031 : d0fe > bne * ;failed not equal (non zero)
1033 : 8a txa
1034 : 9d0302 sta abst,x ;clear
1037 : ca dex
1038 : 10e9 bpl tsty1
next_test
103a : ad0002 > lda test_case ;previous test
103d : c912 > cmp #test_num
> trap_ne ;test is out of sequence
103f : d0fe > bne * ;failed not equal (non zero)
>
0013 = >test_num = test_num + 1
1041 : a913 > lda #test_num ;*** next tests' number
1043 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; LDX / STX - zp / abs / #
set_stat 0
> load_flag 0
1046 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1048 : 48 > pha ;use stack to load status
1049 : 28 > plp
104a : a613 ldx zp1
104c : 08 php ;test stores do not alter flags
104d : 8a txa
104e : 49c3 eor #$c3
1050 : aa tax
1051 : 28 plp
1052 : 8e0302 stx abst
1055 : 08 php ;flags after load/store sequence
1056 : 49c3 eor #$c3
1058 : aa tax
1059 : e0c3 cpx #$c3 ;test result
trap_ne
105b : d0fe > bne * ;failed not equal (non zero)
105d : 68 pla ;load status
eor_flag 0
105e : 4930 > eor #0|fao ;invert expected flags + always on bits
1060 : cd1c02 cmp fLDx ;test flags
trap_ne
1063 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1065 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1067 : 48 > pha ;use stack to load status
1068 : 28 > plp
1069 : a614 ldx zp1+1
106b : 08 php ;test stores do not alter flags
106c : 8a txa
106d : 49c3 eor #$c3
106f : aa tax
1070 : 28 plp
1071 : 8e0402 stx abst+1
1074 : 08 php ;flags after load/store sequence
1075 : 49c3 eor #$c3
1077 : aa tax
1078 : e082 cpx #$82 ;test result
trap_ne
107a : d0fe > bne * ;failed not equal (non zero)
107c : 68 pla ;load status
eor_flag 0
107d : 4930 > eor #0|fao ;invert expected flags + always on bits
107f : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1082 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1084 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1086 : 48 > pha ;use stack to load status
1087 : 28 > plp
1088 : a615 ldx zp1+2
108a : 08 php ;test stores do not alter flags
108b : 8a txa
108c : 49c3 eor #$c3
108e : aa tax
108f : 28 plp
1090 : 8e0502 stx abst+2
1093 : 08 php ;flags after load/store sequence
1094 : 49c3 eor #$c3
1096 : aa tax
1097 : e041 cpx #$41 ;test result
trap_ne
1099 : d0fe > bne * ;failed not equal (non zero)
109b : 68 pla ;load status
eor_flag 0
109c : 4930 > eor #0|fao ;invert expected flags + always on bits
109e : cd1e02 cmp fLDx+2 ;test flags
trap_ne
10a1 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
10a3 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
10a5 : 48 > pha ;use stack to load status
10a6 : 28 > plp
10a7 : a616 ldx zp1+3
10a9 : 08 php ;test stores do not alter flags
10aa : 8a txa
10ab : 49c3 eor #$c3
10ad : aa tax
10ae : 28 plp
10af : 8e0602 stx abst+3
10b2 : 08 php ;flags after load/store sequence
10b3 : 49c3 eor #$c3
10b5 : aa tax
10b6 : e000 cpx #0 ;test result
trap_ne
10b8 : d0fe > bne * ;failed not equal (non zero)
10ba : 68 pla ;load status
eor_flag 0
10bb : 4930 > eor #0|fao ;invert expected flags + always on bits
10bd : cd1f02 cmp fLDx+3 ;test flags
trap_ne
10c0 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
10c2 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
10c4 : 48 > pha ;use stack to load status
10c5 : 28 > plp
10c6 : a613 ldx zp1
10c8 : 08 php ;test stores do not alter flags
10c9 : 8a txa
10ca : 49c3 eor #$c3
10cc : aa tax
10cd : 28 plp
10ce : 8e0302 stx abst
10d1 : 08 php ;flags after load/store sequence
10d2 : 49c3 eor #$c3
10d4 : aa tax
10d5 : e0c3 cpx #$c3 ;test result
trap_ne ;
10d7 : d0fe > bne * ;failed not equal (non zero)
10d9 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
10da : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
10dc : cd1c02 cmp fLDx ;test flags
trap_ne
10df : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
10e1 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
10e3 : 48 > pha ;use stack to load status
10e4 : 28 > plp
10e5 : a614 ldx zp1+1
10e7 : 08 php ;test stores do not alter flags
10e8 : 8a txa
10e9 : 49c3 eor #$c3
10eb : aa tax
10ec : 28 plp
10ed : 8e0402 stx abst+1
10f0 : 08 php ;flags after load/store sequence
10f1 : 49c3 eor #$c3
10f3 : aa tax
10f4 : e082 cpx #$82 ;test result
trap_ne
10f6 : d0fe > bne * ;failed not equal (non zero)
10f8 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
10f9 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
10fb : cd1d02 cmp fLDx+1 ;test flags
trap_ne
10fe : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1100 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1102 : 48 > pha ;use stack to load status
1103 : 28 > plp
1104 : a615 ldx zp1+2
1106 : 08 php ;test stores do not alter flags
1107 : 8a txa
1108 : 49c3 eor #$c3
110a : aa tax
110b : 28 plp
110c : 8e0502 stx abst+2
110f : 08 php ;flags after load/store sequence
1110 : 49c3 eor #$c3
1112 : aa tax
1113 : e041 cpx #$41 ;test result
trap_ne ;
1115 : d0fe > bne * ;failed not equal (non zero)
1117 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1118 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
111a : cd1e02 cmp fLDx+2 ;test flags
trap_ne
111d : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
111f : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1121 : 48 > pha ;use stack to load status
1122 : 28 > plp
1123 : a616 ldx zp1+3
1125 : 08 php ;test stores do not alter flags
1126 : 8a txa
1127 : 49c3 eor #$c3
1129 : aa tax
112a : 28 plp
112b : 8e0602 stx abst+3
112e : 08 php ;flags after load/store sequence
112f : 49c3 eor #$c3
1131 : aa tax
1132 : e000 cpx #0 ;test result
trap_ne
1134 : d0fe > bne * ;failed not equal (non zero)
1136 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1137 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1139 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
113c : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
113e : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1140 : 48 > pha ;use stack to load status
1141 : 28 > plp
1142 : ae1702 ldx abs1
1145 : 08 php ;test stores do not alter flags
1146 : 8a txa
1147 : 49c3 eor #$c3
1149 : aa tax
114a : 28 plp
114b : 860c stx zpt
114d : 08 php ;flags after load/store sequence
114e : 49c3 eor #$c3
1150 : c513 cmp zp1 ;test result
trap_ne
1152 : d0fe > bne * ;failed not equal (non zero)
1154 : 68 pla ;load status
eor_flag 0
1155 : 4930 > eor #0|fao ;invert expected flags + always on bits
1157 : cd1c02 cmp fLDx ;test flags
trap_ne
115a : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
115c : a900 > lda #0 ;allow test to change I-flag (no mask)
>
115e : 48 > pha ;use stack to load status
115f : 28 > plp
1160 : ae1802 ldx abs1+1
1163 : 08 php ;test stores do not alter flags
1164 : 8a txa
1165 : 49c3 eor #$c3
1167 : aa tax
1168 : 28 plp
1169 : 860d stx zpt+1
116b : 08 php ;flags after load/store sequence
116c : 49c3 eor #$c3
116e : c514 cmp zp1+1 ;test result
trap_ne
1170 : d0fe > bne * ;failed not equal (non zero)
1172 : 68 pla ;load status
eor_flag 0
1173 : 4930 > eor #0|fao ;invert expected flags + always on bits
1175 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1178 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
117a : a900 > lda #0 ;allow test to change I-flag (no mask)
>
117c : 48 > pha ;use stack to load status
117d : 28 > plp
117e : ae1902 ldx abs1+2
1181 : 08 php ;test stores do not alter flags
1182 : 8a txa
1183 : 49c3 eor #$c3
1185 : aa tax
1186 : 28 plp
1187 : 860e stx zpt+2
1189 : 08 php ;flags after load/store sequence
118a : 49c3 eor #$c3
118c : c515 cmp zp1+2 ;test result
trap_ne
118e : d0fe > bne * ;failed not equal (non zero)
1190 : 68 pla ;load status
eor_flag 0
1191 : 4930 > eor #0|fao ;invert expected flags + always on bits
1193 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1196 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1198 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
119a : 48 > pha ;use stack to load status
119b : 28 > plp
119c : ae1a02 ldx abs1+3
119f : 08 php ;test stores do not alter flags
11a0 : 8a txa
11a1 : 49c3 eor #$c3
11a3 : aa tax
11a4 : 28 plp
11a5 : 860f stx zpt+3
11a7 : 08 php ;flags after load/store sequence
11a8 : 49c3 eor #$c3
11aa : c516 cmp zp1+3 ;test result
trap_ne
11ac : d0fe > bne * ;failed not equal (non zero)
11ae : 68 pla ;load status
eor_flag 0
11af : 4930 > eor #0|fao ;invert expected flags + always on bits
11b1 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
11b4 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
11b6 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
11b8 : 48 > pha ;use stack to load status
11b9 : 28 > plp
11ba : ae1702 ldx abs1
11bd : 08 php ;test stores do not alter flags
11be : 8a txa
11bf : 49c3 eor #$c3
11c1 : aa tax
11c2 : 28 plp
11c3 : 860c stx zpt
11c5 : 08 php ;flags after load/store sequence
11c6 : 49c3 eor #$c3
11c8 : aa tax
11c9 : e413 cpx zp1 ;test result
trap_ne
11cb : d0fe > bne * ;failed not equal (non zero)
11cd : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
11ce : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
11d0 : cd1c02 cmp fLDx ;test flags
trap_ne
11d3 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
11d5 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
11d7 : 48 > pha ;use stack to load status
11d8 : 28 > plp
11d9 : ae1802 ldx abs1+1
11dc : 08 php ;test stores do not alter flags
11dd : 8a txa
11de : 49c3 eor #$c3
11e0 : aa tax
11e1 : 28 plp
11e2 : 860d stx zpt+1
11e4 : 08 php ;flags after load/store sequence
11e5 : 49c3 eor #$c3
11e7 : aa tax
11e8 : e414 cpx zp1+1 ;test result
trap_ne
11ea : d0fe > bne * ;failed not equal (non zero)
11ec : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
11ed : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
11ef : cd1d02 cmp fLDx+1 ;test flags
trap_ne
11f2 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
11f4 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
11f6 : 48 > pha ;use stack to load status
11f7 : 28 > plp
11f8 : ae1902 ldx abs1+2
11fb : 08 php ;test stores do not alter flags
11fc : 8a txa
11fd : 49c3 eor #$c3
11ff : aa tax
1200 : 28 plp
1201 : 860e stx zpt+2
1203 : 08 php ;flags after load/store sequence
1204 : 49c3 eor #$c3
1206 : aa tax
1207 : e415 cpx zp1+2 ;test result
trap_ne
1209 : d0fe > bne * ;failed not equal (non zero)
120b : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
120c : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
120e : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1211 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1213 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1215 : 48 > pha ;use stack to load status
1216 : 28 > plp
1217 : ae1a02 ldx abs1+3
121a : 08 php ;test stores do not alter flags
121b : 8a txa
121c : 49c3 eor #$c3
121e : aa tax
121f : 28 plp
1220 : 860f stx zpt+3
1222 : 08 php ;flags after load/store sequence
1223 : 49c3 eor #$c3
1225 : aa tax
1226 : e416 cpx zp1+3 ;test result
trap_ne
1228 : d0fe > bne * ;failed not equal (non zero)
122a : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
122b : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
122d : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1230 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1232 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1234 : 48 > pha ;use stack to load status
1235 : 28 > plp
1236 : a2c3 ldx #$c3
1238 : 08 php
1239 : ec1702 cpx abs1 ;test result
trap_ne
123c : d0fe > bne * ;failed not equal (non zero)
123e : 68 pla ;load status
eor_flag 0
123f : 4930 > eor #0|fao ;invert expected flags + always on bits
1241 : cd1c02 cmp fLDx ;test flags
trap_ne
1244 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1246 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1248 : 48 > pha ;use stack to load status
1249 : 28 > plp
124a : a282 ldx #$82
124c : 08 php
124d : ec1802 cpx abs1+1 ;test result
trap_ne
1250 : d0fe > bne * ;failed not equal (non zero)
1252 : 68 pla ;load status
eor_flag 0
1253 : 4930 > eor #0|fao ;invert expected flags + always on bits
1255 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1258 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
125a : a900 > lda #0 ;allow test to change I-flag (no mask)
>
125c : 48 > pha ;use stack to load status
125d : 28 > plp
125e : a241 ldx #$41
1260 : 08 php
1261 : ec1902 cpx abs1+2 ;test result
trap_ne
1264 : d0fe > bne * ;failed not equal (non zero)
1266 : 68 pla ;load status
eor_flag 0
1267 : 4930 > eor #0|fao ;invert expected flags + always on bits
1269 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
126c : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
126e : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1270 : 48 > pha ;use stack to load status
1271 : 28 > plp
1272 : a200 ldx #0
1274 : 08 php
1275 : ec1a02 cpx abs1+3 ;test result
trap_ne
1278 : d0fe > bne * ;failed not equal (non zero)
127a : 68 pla ;load status
eor_flag 0
127b : 4930 > eor #0|fao ;invert expected flags + always on bits
127d : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1280 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1282 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1284 : 48 > pha ;use stack to load status
1285 : 28 > plp
1286 : a2c3 ldx #$c3
1288 : 08 php
1289 : ec1702 cpx abs1 ;test result
trap_ne
128c : d0fe > bne * ;failed not equal (non zero)
128e : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
128f : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1291 : cd1c02 cmp fLDx ;test flags
trap_ne
1294 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1296 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1298 : 48 > pha ;use stack to load status
1299 : 28 > plp
129a : a282 ldx #$82
129c : 08 php
129d : ec1802 cpx abs1+1 ;test result
trap_ne
12a0 : d0fe > bne * ;failed not equal (non zero)
12a2 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
12a3 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
12a5 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
12a8 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
12aa : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
12ac : 48 > pha ;use stack to load status
12ad : 28 > plp
12ae : a241 ldx #$41
12b0 : 08 php
12b1 : ec1902 cpx abs1+2 ;test result
trap_ne
12b4 : d0fe > bne * ;failed not equal (non zero)
12b6 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
12b7 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
12b9 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
12bc : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
12be : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
12c0 : 48 > pha ;use stack to load status
12c1 : 28 > plp
12c2 : a200 ldx #0
12c4 : 08 php
12c5 : ec1a02 cpx abs1+3 ;test result
trap_ne
12c8 : d0fe > bne * ;failed not equal (non zero)
12ca : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
12cb : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
12cd : cd1f02 cmp fLDx+3 ;test flags
trap_ne
12d0 : d0fe > bne * ;failed not equal (non zero)
12d2 : a200 ldx #0
12d4 : a50c lda zpt
12d6 : 49c3 eor #$c3
12d8 : c513 cmp zp1
trap_ne ;store to zp data
12da : d0fe > bne * ;failed not equal (non zero)
12dc : 860c stx zpt ;clear
12de : ad0302 lda abst
12e1 : 49c3 eor #$c3
12e3 : cd1702 cmp abs1
trap_ne ;store to abs data
12e6 : d0fe > bne * ;failed not equal (non zero)
12e8 : 8e0302 stx abst ;clear
12eb : a50d lda zpt+1
12ed : 49c3 eor #$c3
12ef : c514 cmp zp1+1
trap_ne ;store to zp data
12f1 : d0fe > bne * ;failed not equal (non zero)
12f3 : 860d stx zpt+1 ;clear
12f5 : ad0402 lda abst+1
12f8 : 49c3 eor #$c3
12fa : cd1802 cmp abs1+1
trap_ne ;store to abs data
12fd : d0fe > bne * ;failed not equal (non zero)
12ff : 8e0402 stx abst+1 ;clear
1302 : a50e lda zpt+2
1304 : 49c3 eor #$c3
1306 : c515 cmp zp1+2
trap_ne ;store to zp data
1308 : d0fe > bne * ;failed not equal (non zero)
130a : 860e stx zpt+2 ;clear
130c : ad0502 lda abst+2
130f : 49c3 eor #$c3
1311 : cd1902 cmp abs1+2
trap_ne ;store to abs data
1314 : d0fe > bne * ;failed not equal (non zero)
1316 : 8e0502 stx abst+2 ;clear
1319 : a50f lda zpt+3
131b : 49c3 eor #$c3
131d : c516 cmp zp1+3
trap_ne ;store to zp data
131f : d0fe > bne * ;failed not equal (non zero)
1321 : 860f stx zpt+3 ;clear
1323 : ad0602 lda abst+3
1326 : 49c3 eor #$c3
1328 : cd1a02 cmp abs1+3
trap_ne ;store to abs data
132b : d0fe > bne * ;failed not equal (non zero)
132d : 8e0602 stx abst+3 ;clear
next_test
1330 : ad0002 > lda test_case ;previous test
1333 : c913 > cmp #test_num
> trap_ne ;test is out of sequence
1335 : d0fe > bne * ;failed not equal (non zero)
>
0014 = >test_num = test_num + 1
1337 : a914 > lda #test_num ;*** next tests' number
1339 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; LDY / STY - zp / abs / #
set_stat 0
> load_flag 0
133c : a900 > lda #0 ;allow test to change I-flag (no mask)
>
133e : 48 > pha ;use stack to load status
133f : 28 > plp
1340 : a413 ldy zp1
1342 : 08 php ;test stores do not alter flags
1343 : 98 tya
1344 : 49c3 eor #$c3
1346 : a8 tay
1347 : 28 plp
1348 : 8c0302 sty abst
134b : 08 php ;flags after load/store sequence
134c : 49c3 eor #$c3
134e : a8 tay
134f : c0c3 cpy #$c3 ;test result
trap_ne
1351 : d0fe > bne * ;failed not equal (non zero)
1353 : 68 pla ;load status
eor_flag 0
1354 : 4930 > eor #0|fao ;invert expected flags + always on bits
1356 : cd1c02 cmp fLDx ;test flags
trap_ne
1359 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
135b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
135d : 48 > pha ;use stack to load status
135e : 28 > plp
135f : a414 ldy zp1+1
1361 : 08 php ;test stores do not alter flags
1362 : 98 tya
1363 : 49c3 eor #$c3
1365 : a8 tay
1366 : 28 plp
1367 : 8c0402 sty abst+1
136a : 08 php ;flags after load/store sequence
136b : 49c3 eor #$c3
136d : a8 tay
136e : c082 cpy #$82 ;test result
trap_ne
1370 : d0fe > bne * ;failed not equal (non zero)
1372 : 68 pla ;load status
eor_flag 0
1373 : 4930 > eor #0|fao ;invert expected flags + always on bits
1375 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1378 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
137a : a900 > lda #0 ;allow test to change I-flag (no mask)
>
137c : 48 > pha ;use stack to load status
137d : 28 > plp
137e : a415 ldy zp1+2
1380 : 08 php ;test stores do not alter flags
1381 : 98 tya
1382 : 49c3 eor #$c3
1384 : a8 tay
1385 : 28 plp
1386 : 8c0502 sty abst+2
1389 : 08 php ;flags after load/store sequence
138a : 49c3 eor #$c3
138c : a8 tay
138d : c041 cpy #$41 ;test result
trap_ne
138f : d0fe > bne * ;failed not equal (non zero)
1391 : 68 pla ;load status
eor_flag 0
1392 : 4930 > eor #0|fao ;invert expected flags + always on bits
1394 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1397 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1399 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
139b : 48 > pha ;use stack to load status
139c : 28 > plp
139d : a416 ldy zp1+3
139f : 08 php ;test stores do not alter flags
13a0 : 98 tya
13a1 : 49c3 eor #$c3
13a3 : a8 tay
13a4 : 28 plp
13a5 : 8c0602 sty abst+3
13a8 : 08 php ;flags after load/store sequence
13a9 : 49c3 eor #$c3
13ab : a8 tay
13ac : c000 cpy #0 ;test result
trap_ne
13ae : d0fe > bne * ;failed not equal (non zero)
13b0 : 68 pla ;load status
eor_flag 0
13b1 : 4930 > eor #0|fao ;invert expected flags + always on bits
13b3 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
13b6 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
13b8 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
13ba : 48 > pha ;use stack to load status
13bb : 28 > plp
13bc : a413 ldy zp1
13be : 08 php ;test stores do not alter flags
13bf : 98 tya
13c0 : 49c3 eor #$c3
13c2 : a8 tay
13c3 : 28 plp
13c4 : 8c0302 sty abst
13c7 : 08 php ;flags after load/store sequence
13c8 : 49c3 eor #$c3
13ca : a8 tay
13cb : c0c3 cpy #$c3 ;test result
trap_ne
13cd : d0fe > bne * ;failed not equal (non zero)
13cf : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
13d0 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
13d2 : cd1c02 cmp fLDx ;test flags
trap_ne
13d5 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
13d7 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
13d9 : 48 > pha ;use stack to load status
13da : 28 > plp
13db : a414 ldy zp1+1
13dd : 08 php ;test stores do not alter flags
13de : 98 tya
13df : 49c3 eor #$c3
13e1 : a8 tay
13e2 : 28 plp
13e3 : 8c0402 sty abst+1
13e6 : 08 php ;flags after load/store sequence
13e7 : 49c3 eor #$c3
13e9 : a8 tay
13ea : c082 cpy #$82 ;test result
trap_ne
13ec : d0fe > bne * ;failed not equal (non zero)
13ee : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
13ef : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
13f1 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
13f4 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
13f6 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
13f8 : 48 > pha ;use stack to load status
13f9 : 28 > plp
13fa : a415 ldy zp1+2
13fc : 08 php ;test stores do not alter flags
13fd : 98 tya
13fe : 49c3 eor #$c3
1400 : a8 tay
1401 : 28 plp
1402 : 8c0502 sty abst+2
1405 : 08 php ;flags after load/store sequence
1406 : 49c3 eor #$c3
1408 : a8 tay
1409 : c041 cpy #$41 ;test result
trap_ne
140b : d0fe > bne * ;failed not equal (non zero)
140d : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
140e : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1410 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1413 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1415 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1417 : 48 > pha ;use stack to load status
1418 : 28 > plp
1419 : a416 ldy zp1+3
141b : 08 php ;test stores do not alter flags
141c : 98 tya
141d : 49c3 eor #$c3
141f : a8 tay
1420 : 28 plp
1421 : 8c0602 sty abst+3
1424 : 08 php ;flags after load/store sequence
1425 : 49c3 eor #$c3
1427 : a8 tay
1428 : c000 cpy #0 ;test result
trap_ne
142a : d0fe > bne * ;failed not equal (non zero)
142c : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
142d : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
142f : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1432 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1434 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1436 : 48 > pha ;use stack to load status
1437 : 28 > plp
1438 : ac1702 ldy abs1
143b : 08 php ;test stores do not alter flags
143c : 98 tya
143d : 49c3 eor #$c3
143f : a8 tay
1440 : 28 plp
1441 : 840c sty zpt
1443 : 08 php ;flags after load/store sequence
1444 : 49c3 eor #$c3
1446 : a8 tay
1447 : c413 cpy zp1 ;test result
trap_ne
1449 : d0fe > bne * ;failed not equal (non zero)
144b : 68 pla ;load status
eor_flag 0
144c : 4930 > eor #0|fao ;invert expected flags + always on bits
144e : cd1c02 cmp fLDx ;test flags
trap_ne
1451 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1453 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1455 : 48 > pha ;use stack to load status
1456 : 28 > plp
1457 : ac1802 ldy abs1+1
145a : 08 php ;test stores do not alter flags
145b : 98 tya
145c : 49c3 eor #$c3
145e : a8 tay
145f : 28 plp
1460 : 840d sty zpt+1
1462 : 08 php ;flags after load/store sequence
1463 : 49c3 eor #$c3
1465 : a8 tay
1466 : c414 cpy zp1+1 ;test result
trap_ne
1468 : d0fe > bne * ;failed not equal (non zero)
146a : 68 pla ;load status
eor_flag 0
146b : 4930 > eor #0|fao ;invert expected flags + always on bits
146d : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1470 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1472 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1474 : 48 > pha ;use stack to load status
1475 : 28 > plp
1476 : ac1902 ldy abs1+2
1479 : 08 php ;test stores do not alter flags
147a : 98 tya
147b : 49c3 eor #$c3
147d : a8 tay
147e : 28 plp
147f : 840e sty zpt+2
1481 : 08 php ;flags after load/store sequence
1482 : 49c3 eor #$c3
1484 : a8 tay
1485 : c415 cpy zp1+2 ;test result
trap_ne
1487 : d0fe > bne * ;failed not equal (non zero)
1489 : 68 pla ;load status
eor_flag 0
148a : 4930 > eor #0|fao ;invert expected flags + always on bits
148c : cd1e02 cmp fLDx+2 ;test flags
trap_ne
148f : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1491 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1493 : 48 > pha ;use stack to load status
1494 : 28 > plp
1495 : ac1a02 ldy abs1+3
1498 : 08 php ;test stores do not alter flags
1499 : 98 tya
149a : 49c3 eor #$c3
149c : a8 tay
149d : 28 plp
149e : 840f sty zpt+3
14a0 : 08 php ;flags after load/store sequence
14a1 : 49c3 eor #$c3
14a3 : a8 tay
14a4 : c416 cpy zp1+3 ;test result
trap_ne
14a6 : d0fe > bne * ;failed not equal (non zero)
14a8 : 68 pla ;load status
eor_flag 0
14a9 : 4930 > eor #0|fao ;invert expected flags + always on bits
14ab : cd1f02 cmp fLDx+3 ;test flags
trap_ne
14ae : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
14b0 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
14b2 : 48 > pha ;use stack to load status
14b3 : 28 > plp
14b4 : ac1702 ldy abs1
14b7 : 08 php ;test stores do not alter flags
14b8 : 98 tya
14b9 : 49c3 eor #$c3
14bb : a8 tay
14bc : 28 plp
14bd : 840c sty zpt
14bf : 08 php ;flags after load/store sequence
14c0 : 49c3 eor #$c3
14c2 : a8 tay
14c3 : c513 cmp zp1 ;test result
trap_ne
14c5 : d0fe > bne * ;failed not equal (non zero)
14c7 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
14c8 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
14ca : cd1c02 cmp fLDx ;test flags
trap_ne
14cd : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
14cf : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
14d1 : 48 > pha ;use stack to load status
14d2 : 28 > plp
14d3 : ac1802 ldy abs1+1
14d6 : 08 php ;test stores do not alter flags
14d7 : 98 tya
14d8 : 49c3 eor #$c3
14da : a8 tay
14db : 28 plp
14dc : 840d sty zpt+1
14de : 08 php ;flags after load/store sequence
14df : 49c3 eor #$c3
14e1 : a8 tay
14e2 : c514 cmp zp1+1 ;test result
trap_ne
14e4 : d0fe > bne * ;failed not equal (non zero)
14e6 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
14e7 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
14e9 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
14ec : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
14ee : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
14f0 : 48 > pha ;use stack to load status
14f1 : 28 > plp
14f2 : ac1902 ldy abs1+2
14f5 : 08 php ;test stores do not alter flags
14f6 : 98 tya
14f7 : 49c3 eor #$c3
14f9 : a8 tay
14fa : 28 plp
14fb : 840e sty zpt+2
14fd : 08 php ;flags after load/store sequence
14fe : 49c3 eor #$c3
1500 : a8 tay
1501 : c515 cmp zp1+2 ;test result
trap_ne
1503 : d0fe > bne * ;failed not equal (non zero)
1505 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1506 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1508 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
150b : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
150d : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
150f : 48 > pha ;use stack to load status
1510 : 28 > plp
1511 : ac1a02 ldy abs1+3
1514 : 08 php ;test stores do not alter flags
1515 : 98 tya
1516 : 49c3 eor #$c3
1518 : a8 tay
1519 : 28 plp
151a : 840f sty zpt+3
151c : 08 php ;flags after load/store sequence
151d : 49c3 eor #$c3
151f : a8 tay
1520 : c516 cmp zp1+3 ;test result
trap_ne
1522 : d0fe > bne * ;failed not equal (non zero)
1524 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1525 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1527 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
152a : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
152c : a900 > lda #0 ;allow test to change I-flag (no mask)
>
152e : 48 > pha ;use stack to load status
152f : 28 > plp
1530 : a0c3 ldy #$c3
1532 : 08 php
1533 : cc1702 cpy abs1 ;test result
trap_ne
1536 : d0fe > bne * ;failed not equal (non zero)
1538 : 68 pla ;load status
eor_flag 0
1539 : 4930 > eor #0|fao ;invert expected flags + always on bits
153b : cd1c02 cmp fLDx ;test flags
trap_ne
153e : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1540 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1542 : 48 > pha ;use stack to load status
1543 : 28 > plp
1544 : a082 ldy #$82
1546 : 08 php
1547 : cc1802 cpy abs1+1 ;test result
trap_ne
154a : d0fe > bne * ;failed not equal (non zero)
154c : 68 pla ;load status
eor_flag 0
154d : 4930 > eor #0|fao ;invert expected flags + always on bits
154f : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1552 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1554 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1556 : 48 > pha ;use stack to load status
1557 : 28 > plp
1558 : a041 ldy #$41
155a : 08 php
155b : cc1902 cpy abs1+2 ;test result
trap_ne
155e : d0fe > bne * ;failed not equal (non zero)
1560 : 68 pla ;load status
eor_flag 0
1561 : 4930 > eor #0|fao ;invert expected flags + always on bits
1563 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1566 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1568 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
156a : 48 > pha ;use stack to load status
156b : 28 > plp
156c : a000 ldy #0
156e : 08 php
156f : cc1a02 cpy abs1+3 ;test result
trap_ne
1572 : d0fe > bne * ;failed not equal (non zero)
1574 : 68 pla ;load status
eor_flag 0
1575 : 4930 > eor #0|fao ;invert expected flags + always on bits
1577 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
157a : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
157c : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
157e : 48 > pha ;use stack to load status
157f : 28 > plp
1580 : a0c3 ldy #$c3
1582 : 08 php
1583 : cc1702 cpy abs1 ;test result
trap_ne
1586 : d0fe > bne * ;failed not equal (non zero)
1588 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1589 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
158b : cd1c02 cmp fLDx ;test flags
trap_ne
158e : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1590 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1592 : 48 > pha ;use stack to load status
1593 : 28 > plp
1594 : a082 ldy #$82
1596 : 08 php
1597 : cc1802 cpy abs1+1 ;test result
trap_ne
159a : d0fe > bne * ;failed not equal (non zero)
159c : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
159d : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
159f : cd1d02 cmp fLDx+1 ;test flags
trap_ne
15a2 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
15a4 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
15a6 : 48 > pha ;use stack to load status
15a7 : 28 > plp
15a8 : a041 ldy #$41
15aa : 08 php
15ab : cc1902 cpy abs1+2 ;test result
trap_ne
15ae : d0fe > bne * ;failed not equal (non zero)
15b0 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
15b1 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
15b3 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
15b6 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
15b8 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
15ba : 48 > pha ;use stack to load status
15bb : 28 > plp
15bc : a000 ldy #0
15be : 08 php
15bf : cc1a02 cpy abs1+3 ;test result
trap_ne
15c2 : d0fe > bne * ;failed not equal (non zero)
15c4 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
15c5 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
15c7 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
15ca : d0fe > bne * ;failed not equal (non zero)
15cc : a000 ldy #0
15ce : a50c lda zpt
15d0 : 49c3 eor #$c3
15d2 : c513 cmp zp1
trap_ne ;store to zp data
15d4 : d0fe > bne * ;failed not equal (non zero)
15d6 : 840c sty zpt ;clear
15d8 : ad0302 lda abst
15db : 49c3 eor #$c3
15dd : cd1702 cmp abs1
trap_ne ;store to abs data
15e0 : d0fe > bne * ;failed not equal (non zero)
15e2 : 8c0302 sty abst ;clear
15e5 : a50d lda zpt+1
15e7 : 49c3 eor #$c3
15e9 : c514 cmp zp1+1
trap_ne ;store to zp+1 data
15eb : d0fe > bne * ;failed not equal (non zero)
15ed : 840d sty zpt+1 ;clear
15ef : ad0402 lda abst+1
15f2 : 49c3 eor #$c3
15f4 : cd1802 cmp abs1+1
trap_ne ;store to abs+1 data
15f7 : d0fe > bne * ;failed not equal (non zero)
15f9 : 8c0402 sty abst+1 ;clear
15fc : a50e lda zpt+2
15fe : 49c3 eor #$c3
1600 : c515 cmp zp1+2
trap_ne ;store to zp+2 data
1602 : d0fe > bne * ;failed not equal (non zero)
1604 : 840e sty zpt+2 ;clear
1606 : ad0502 lda abst+2
1609 : 49c3 eor #$c3
160b : cd1902 cmp abs1+2
trap_ne ;store to abs+2 data
160e : d0fe > bne * ;failed not equal (non zero)
1610 : 8c0502 sty abst+2 ;clear
1613 : a50f lda zpt+3
1615 : 49c3 eor #$c3
1617 : c516 cmp zp1+3
trap_ne ;store to zp+3 data
1619 : d0fe > bne * ;failed not equal (non zero)
161b : 840f sty zpt+3 ;clear
161d : ad0602 lda abst+3
1620 : 49c3 eor #$c3
1622 : cd1a02 cmp abs1+3
trap_ne ;store to abs+3 data
1625 : d0fe > bne * ;failed not equal (non zero)
1627 : 8c0602 sty abst+3 ;clear
next_test
162a : ad0002 > lda test_case ;previous test
162d : c914 > cmp #test_num
> trap_ne ;test is out of sequence
162f : d0fe > bne * ;failed not equal (non zero)
>
0015 = >test_num = test_num + 1
1631 : a915 > lda #test_num ;*** next tests' number
1633 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; testing load / store accumulator LDA / STA all addressing modes
; LDA / STA - zp,x / abs,x
1636 : a203 ldx #3
1638 : tldax
set_stat 0
> load_flag 0
1638 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
163a : 48 > pha ;use stack to load status
163b : 28 > plp
163c : b513 lda zp1,x
163e : 08 php ;test stores do not alter flags
163f : 49c3 eor #$c3
1641 : 28 plp
1642 : 9d0302 sta abst,x
1645 : 08 php ;flags after load/store sequence
1646 : 49c3 eor #$c3
1648 : dd1702 cmp abs1,x ;test result
trap_ne
164b : d0fe > bne * ;failed not equal (non zero)
164d : 68 pla ;load status
eor_flag 0
164e : 4930 > eor #0|fao ;invert expected flags + always on bits
1650 : dd1c02 cmp fLDx,x ;test flags
trap_ne
1653 : d0fe > bne * ;failed not equal (non zero)
1655 : ca dex
1656 : 10e0 bpl tldax
1658 : a203 ldx #3
165a : tldax1
set_stat $ff
> load_flag $ff
165a : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
165c : 48 > pha ;use stack to load status
165d : 28 > plp
165e : b513 lda zp1,x
1660 : 08 php ;test stores do not alter flags
1661 : 49c3 eor #$c3
1663 : 28 plp
1664 : 9d0302 sta abst,x
1667 : 08 php ;flags after load/store sequence
1668 : 49c3 eor #$c3
166a : dd1702 cmp abs1,x ;test result
trap_ne
166d : d0fe > bne * ;failed not equal (non zero)
166f : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1670 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1672 : dd1c02 cmp fLDx,x ;test flags
trap_ne
1675 : d0fe > bne * ;failed not equal (non zero)
1677 : ca dex
1678 : 10e0 bpl tldax1
167a : a203 ldx #3
167c : tldax2
set_stat 0
> load_flag 0
167c : a900 > lda #0 ;allow test to change I-flag (no mask)
>
167e : 48 > pha ;use stack to load status
167f : 28 > plp
1680 : bd1702 lda abs1,x
1683 : 08 php ;test stores do not alter flags
1684 : 49c3 eor #$c3
1686 : 28 plp
1687 : 950c sta zpt,x
1689 : 08 php ;flags after load/store sequence
168a : 49c3 eor #$c3
168c : d513 cmp zp1,x ;test result
trap_ne
168e : d0fe > bne * ;failed not equal (non zero)
1690 : 68 pla ;load status
eor_flag 0
1691 : 4930 > eor #0|fao ;invert expected flags + always on bits
1693 : dd1c02 cmp fLDx,x ;test flags
trap_ne
1696 : d0fe > bne * ;failed not equal (non zero)
1698 : ca dex
1699 : 10e1 bpl tldax2
169b : a203 ldx #3
169d : tldax3
set_stat $ff
> load_flag $ff
169d : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
169f : 48 > pha ;use stack to load status
16a0 : 28 > plp
16a1 : bd1702 lda abs1,x
16a4 : 08 php ;test stores do not alter flags
16a5 : 49c3 eor #$c3
16a7 : 28 plp
16a8 : 950c sta zpt,x
16aa : 08 php ;flags after load/store sequence
16ab : 49c3 eor #$c3
16ad : d513 cmp zp1,x ;test result
trap_ne
16af : d0fe > bne * ;failed not equal (non zero)
16b1 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
16b2 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
16b4 : dd1c02 cmp fLDx,x ;test flags
trap_ne
16b7 : d0fe > bne * ;failed not equal (non zero)
16b9 : ca dex
16ba : 10e1 bpl tldax3
16bc : a203 ldx #3 ;testing store result
16be : a000 ldy #0
16c0 : b50c tstax lda zpt,x
16c2 : 49c3 eor #$c3
16c4 : d513 cmp zp1,x
trap_ne ;store to zp,x data
16c6 : d0fe > bne * ;failed not equal (non zero)
16c8 : 940c sty zpt,x ;clear
16ca : bd0302 lda abst,x
16cd : 49c3 eor #$c3
16cf : dd1702 cmp abs1,x
trap_ne ;store to abs,x data
16d2 : d0fe > bne * ;failed not equal (non zero)
16d4 : 8a txa
16d5 : 9d0302 sta abst,x ;clear
16d8 : ca dex
16d9 : 10e5 bpl tstax
next_test
16db : ad0002 > lda test_case ;previous test
16de : c915 > cmp #test_num
> trap_ne ;test is out of sequence
16e0 : d0fe > bne * ;failed not equal (non zero)
>
0016 = >test_num = test_num + 1
16e2 : a916 > lda #test_num ;*** next tests' number
16e4 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; LDA / STA - (zp),y / abs,y / (zp,x)
16e7 : a003 ldy #3
16e9 : tlday
set_stat 0
> load_flag 0
16e9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
16eb : 48 > pha ;use stack to load status
16ec : 28 > plp
16ed : b124 lda (ind1),y
16ef : 08 php ;test stores do not alter flags
16f0 : 49c3 eor #$c3
16f2 : 28 plp
16f3 : 990302 sta abst,y
16f6 : 08 php ;flags after load/store sequence
16f7 : 49c3 eor #$c3
16f9 : d91702 cmp abs1,y ;test result
trap_ne
16fc : d0fe > bne * ;failed not equal (non zero)
16fe : 68 pla ;load status
eor_flag 0
16ff : 4930 > eor #0|fao ;invert expected flags + always on bits
1701 : d91c02 cmp fLDx,y ;test flags
trap_ne
1704 : d0fe > bne * ;failed not equal (non zero)
1706 : 88 dey
1707 : 10e0 bpl tlday
1709 : a003 ldy #3
170b : tlday1
set_stat $ff
> load_flag $ff
170b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
170d : 48 > pha ;use stack to load status
170e : 28 > plp
170f : b124 lda (ind1),y
1711 : 08 php ;test stores do not alter flags
1712 : 49c3 eor #$c3
1714 : 28 plp
1715 : 990302 sta abst,y
1718 : 08 php ;flags after load/store sequence
1719 : 49c3 eor #$c3
171b : d91702 cmp abs1,y ;test result
trap_ne
171e : d0fe > bne * ;failed not equal (non zero)
1720 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1721 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1723 : d91c02 cmp fLDx,y ;test flags
trap_ne
1726 : d0fe > bne * ;failed not equal (non zero)
1728 : 88 dey
1729 : 10e0 bpl tlday1
172b : a003 ldy #3 ;testing store result
172d : a200 ldx #0
172f : b90302 tstay lda abst,y
1732 : 49c3 eor #$c3
1734 : d91702 cmp abs1,y
trap_ne ;store to abs data
1737 : d0fe > bne * ;failed not equal (non zero)
1739 : 8a txa
173a : 990302 sta abst,y ;clear
173d : 88 dey
173e : 10ef bpl tstay
1740 : a003 ldy #3
1742 : tlday2
set_stat 0
> load_flag 0
1742 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1744 : 48 > pha ;use stack to load status
1745 : 28 > plp
1746 : b91702 lda abs1,y
1749 : 08 php ;test stores do not alter flags
174a : 49c3 eor #$c3
174c : 28 plp
174d : 9130 sta (indt),y
174f : 08 php ;flags after load/store sequence
1750 : 49c3 eor #$c3
1752 : d124 cmp (ind1),y ;test result
trap_ne
1754 : d0fe > bne * ;failed not equal (non zero)
1756 : 68 pla ;load status
eor_flag 0
1757 : 4930 > eor #0|fao ;invert expected flags + always on bits
1759 : d91c02 cmp fLDx,y ;test flags
trap_ne
175c : d0fe > bne * ;failed not equal (non zero)
175e : 88 dey
175f : 10e1 bpl tlday2
1761 : a003 ldy #3
1763 : tlday3
set_stat $ff
> load_flag $ff
1763 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1765 : 48 > pha ;use stack to load status
1766 : 28 > plp
1767 : b91702 lda abs1,y
176a : 08 php ;test stores do not alter flags
176b : 49c3 eor #$c3
176d : 28 plp
176e : 9130 sta (indt),y
1770 : 08 php ;flags after load/store sequence
1771 : 49c3 eor #$c3
1773 : d124 cmp (ind1),y ;test result
trap_ne
1775 : d0fe > bne * ;failed not equal (non zero)
1777 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1778 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
177a : d91c02 cmp fLDx,y ;test flags
trap_ne
177d : d0fe > bne * ;failed not equal (non zero)
177f : 88 dey
1780 : 10e1 bpl tlday3
1782 : a003 ldy #3 ;testing store result
1784 : a200 ldx #0
1786 : b90302 tstay1 lda abst,y
1789 : 49c3 eor #$c3
178b : d91702 cmp abs1,y
trap_ne ;store to abs data
178e : d0fe > bne * ;failed not equal (non zero)
1790 : 8a txa
1791 : 990302 sta abst,y ;clear
1794 : 88 dey
1795 : 10ef bpl tstay1
1797 : a206 ldx #6
1799 : a003 ldy #3
179b : tldax4
set_stat 0
> load_flag 0
179b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
179d : 48 > pha ;use stack to load status
179e : 28 > plp
179f : a124 lda (ind1,x)
17a1 : 08 php ;test stores do not alter flags
17a2 : 49c3 eor #$c3
17a4 : 28 plp
17a5 : 8130 sta (indt,x)
17a7 : 08 php ;flags after load/store sequence
17a8 : 49c3 eor #$c3
17aa : d91702 cmp abs1,y ;test result
trap_ne
17ad : d0fe > bne * ;failed not equal (non zero)
17af : 68 pla ;load status
eor_flag 0
17b0 : 4930 > eor #0|fao ;invert expected flags + always on bits
17b2 : d91c02 cmp fLDx,y ;test flags
trap_ne
17b5 : d0fe > bne * ;failed not equal (non zero)
17b7 : ca dex
17b8 : ca dex
17b9 : 88 dey
17ba : 10df bpl tldax4
17bc : a206 ldx #6
17be : a003 ldy #3
17c0 : tldax5
set_stat $ff
> load_flag $ff
17c0 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
17c2 : 48 > pha ;use stack to load status
17c3 : 28 > plp
17c4 : a124 lda (ind1,x)
17c6 : 08 php ;test stores do not alter flags
17c7 : 49c3 eor #$c3
17c9 : 28 plp
17ca : 8130 sta (indt,x)
17cc : 08 php ;flags after load/store sequence
17cd : 49c3 eor #$c3
17cf : d91702 cmp abs1,y ;test result
trap_ne
17d2 : d0fe > bne * ;failed not equal (non zero)
17d4 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
17d5 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
17d7 : d91c02 cmp fLDx,y ;test flags
trap_ne
17da : d0fe > bne * ;failed not equal (non zero)
17dc : ca dex
17dd : ca dex
17de : 88 dey
17df : 10df bpl tldax5
17e1 : a003 ldy #3 ;testing store result
17e3 : a200 ldx #0
17e5 : b90302 tstay2 lda abst,y
17e8 : 49c3 eor #$c3
17ea : d91702 cmp abs1,y
trap_ne ;store to abs data
17ed : d0fe > bne * ;failed not equal (non zero)
17ef : 8a txa
17f0 : 990302 sta abst,y ;clear
17f3 : 88 dey
17f4 : 10ef bpl tstay2
next_test
17f6 : ad0002 > lda test_case ;previous test
17f9 : c916 > cmp #test_num
> trap_ne ;test is out of sequence
17fb : d0fe > bne * ;failed not equal (non zero)
>
0017 = >test_num = test_num + 1
17fd : a917 > lda #test_num ;*** next tests' number
17ff : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; indexed wraparound test (only zp should wrap)
1802 : a2fd ldx #3+$fa
1804 : b519 tldax6 lda zp1-$fa&$ff,x ;wrap on indexed zp
1806 : 9d0901 sta abst-$fa,x ;no STX abs,x!
1809 : ca dex
180a : e0fa cpx #$fa
180c : b0f6 bcs tldax6
180e : a2fd ldx #3+$fa
1810 : bd1d01 tldax7 lda abs1-$fa,x ;no wrap on indexed abs
1813 : 9512 sta zpt-$fa&$ff,x
1815 : ca dex
1816 : e0fa cpx #$fa
1818 : b0f6 bcs tldax7
181a : a203 ldx #3 ;testing wraparound result
181c : a000 ldy #0
181e : b50c tstax1 lda zpt,x
1820 : d513 cmp zp1,x
trap_ne ;store to zp,x data
1822 : d0fe > bne * ;failed not equal (non zero)
1824 : 940c sty zpt,x ;clear
1826 : bd0302 lda abst,x
1829 : dd1702 cmp abs1,x
trap_ne ;store to abs,x data
182c : d0fe > bne * ;failed not equal (non zero)
182e : 8a txa
182f : 9d0302 sta abst,x ;clear
1832 : ca dex
1833 : 10e9 bpl tstax1
1835 : a0fb ldy #3+$f8
1837 : a2fe ldx #6+$f8
1839 : a12c tlday4 lda (ind1-$f8&$ff,x) ;wrap on indexed zp indirect
183b : 990b01 sta abst-$f8,y
183e : ca dex
183f : ca dex
1840 : 88 dey
1841 : c0f8 cpy #$f8
1843 : b0f4 bcs tlday4
1845 : a003 ldy #3 ;testing wraparound result
1847 : a200 ldx #0
1849 : b90302 tstay4 lda abst,y
184c : d91702 cmp abs1,y
trap_ne ;store to abs data
184f : d0fe > bne * ;failed not equal (non zero)
1851 : 8a txa
1852 : 990302 sta abst,y ;clear
1855 : 88 dey
1856 : 10f1 bpl tstay4
1858 : a0fb ldy #3+$f8
185a : b91f01 tlday5 lda abs1-$f8,y ;no wrap on indexed abs
185d : 9138 sta (inwt),y
185f : 88 dey
1860 : c0f8 cpy #$f8
1862 : b0f6 bcs tlday5
1864 : a003 ldy #3 ;testing wraparound result
1866 : a200 ldx #0
1868 : b90302 tstay5 lda abst,y
186b : d91702 cmp abs1,y
trap_ne ;store to abs data
186e : d0fe > bne * ;failed not equal (non zero)
1870 : 8a txa
1871 : 990302 sta abst,y ;clear
1874 : 88 dey
1875 : 10f1 bpl tstay5
1877 : a0fb ldy #3+$f8
1879 : a2fe ldx #6+$f8
187b : b12e tlday6 lda (inw1),y ;no wrap on zp indirect indexed
187d : 8138 sta (indt-$f8&$ff,x)
187f : ca dex
1880 : ca dex
1881 : 88 dey
1882 : c0f8 cpy #$f8
1884 : b0f5 bcs tlday6
1886 : a003 ldy #3 ;testing wraparound result
1888 : a200 ldx #0
188a : b90302 tstay6 lda abst,y
188d : d91702 cmp abs1,y
trap_ne ;store to abs data
1890 : d0fe > bne * ;failed not equal (non zero)
1892 : 8a txa
1893 : 990302 sta abst,y ;clear
1896 : 88 dey
1897 : 10f1 bpl tstay6
next_test
1899 : ad0002 > lda test_case ;previous test
189c : c917 > cmp #test_num
> trap_ne ;test is out of sequence
189e : d0fe > bne * ;failed not equal (non zero)
>
0018 = >test_num = test_num + 1
18a0 : a918 > lda #test_num ;*** next tests' number
18a2 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; LDA / STA - zp / abs / #
set_stat 0
> load_flag 0
18a5 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
18a7 : 48 > pha ;use stack to load status
18a8 : 28 > plp
18a9 : a513 lda zp1
18ab : 08 php ;test stores do not alter flags
18ac : 49c3 eor #$c3
18ae : 28 plp
18af : 8d0302 sta abst
18b2 : 08 php ;flags after load/store sequence
18b3 : 49c3 eor #$c3
18b5 : c9c3 cmp #$c3 ;test result
trap_ne
18b7 : d0fe > bne * ;failed not equal (non zero)
18b9 : 68 pla ;load status
eor_flag 0
18ba : 4930 > eor #0|fao ;invert expected flags + always on bits
18bc : cd1c02 cmp fLDx ;test flags
trap_ne
18bf : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
18c1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
18c3 : 48 > pha ;use stack to load status
18c4 : 28 > plp
18c5 : a514 lda zp1+1
18c7 : 08 php ;test stores do not alter flags
18c8 : 49c3 eor #$c3
18ca : 28 plp
18cb : 8d0402 sta abst+1
18ce : 08 php ;flags after load/store sequence
18cf : 49c3 eor #$c3
18d1 : c982 cmp #$82 ;test result
trap_ne
18d3 : d0fe > bne * ;failed not equal (non zero)
18d5 : 68 pla ;load status
eor_flag 0
18d6 : 4930 > eor #0|fao ;invert expected flags + always on bits
18d8 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
18db : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
18dd : a900 > lda #0 ;allow test to change I-flag (no mask)
>
18df : 48 > pha ;use stack to load status
18e0 : 28 > plp
18e1 : a515 lda zp1+2
18e3 : 08 php ;test stores do not alter flags
18e4 : 49c3 eor #$c3
18e6 : 28 plp
18e7 : 8d0502 sta abst+2
18ea : 08 php ;flags after load/store sequence
18eb : 49c3 eor #$c3
18ed : c941 cmp #$41 ;test result
trap_ne
18ef : d0fe > bne * ;failed not equal (non zero)
18f1 : 68 pla ;load status
eor_flag 0
18f2 : 4930 > eor #0|fao ;invert expected flags + always on bits
18f4 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
18f7 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
18f9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
18fb : 48 > pha ;use stack to load status
18fc : 28 > plp
18fd : a516 lda zp1+3
18ff : 08 php ;test stores do not alter flags
1900 : 49c3 eor #$c3
1902 : 28 plp
1903 : 8d0602 sta abst+3
1906 : 08 php ;flags after load/store sequence
1907 : 49c3 eor #$c3
1909 : c900 cmp #0 ;test result
trap_ne
190b : d0fe > bne * ;failed not equal (non zero)
190d : 68 pla ;load status
eor_flag 0
190e : 4930 > eor #0|fao ;invert expected flags + always on bits
1910 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1913 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1915 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1917 : 48 > pha ;use stack to load status
1918 : 28 > plp
1919 : a513 lda zp1
191b : 08 php ;test stores do not alter flags
191c : 49c3 eor #$c3
191e : 28 plp
191f : 8d0302 sta abst
1922 : 08 php ;flags after load/store sequence
1923 : 49c3 eor #$c3
1925 : c9c3 cmp #$c3 ;test result
trap_ne
1927 : d0fe > bne * ;failed not equal (non zero)
1929 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
192a : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
192c : cd1c02 cmp fLDx ;test flags
trap_ne
192f : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1931 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1933 : 48 > pha ;use stack to load status
1934 : 28 > plp
1935 : a514 lda zp1+1
1937 : 08 php ;test stores do not alter flags
1938 : 49c3 eor #$c3
193a : 28 plp
193b : 8d0402 sta abst+1
193e : 08 php ;flags after load/store sequence
193f : 49c3 eor #$c3
1941 : c982 cmp #$82 ;test result
trap_ne
1943 : d0fe > bne * ;failed not equal (non zero)
1945 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1946 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1948 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
194b : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
194d : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
194f : 48 > pha ;use stack to load status
1950 : 28 > plp
1951 : a515 lda zp1+2
1953 : 08 php ;test stores do not alter flags
1954 : 49c3 eor #$c3
1956 : 28 plp
1957 : 8d0502 sta abst+2
195a : 08 php ;flags after load/store sequence
195b : 49c3 eor #$c3
195d : c941 cmp #$41 ;test result
trap_ne
195f : d0fe > bne * ;failed not equal (non zero)
1961 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1962 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1964 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1967 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1969 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
196b : 48 > pha ;use stack to load status
196c : 28 > plp
196d : a516 lda zp1+3
196f : 08 php ;test stores do not alter flags
1970 : 49c3 eor #$c3
1972 : 28 plp
1973 : 8d0602 sta abst+3
1976 : 08 php ;flags after load/store sequence
1977 : 49c3 eor #$c3
1979 : c900 cmp #0 ;test result
trap_ne
197b : d0fe > bne * ;failed not equal (non zero)
197d : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
197e : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1980 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1983 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1985 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1987 : 48 > pha ;use stack to load status
1988 : 28 > plp
1989 : ad1702 lda abs1
198c : 08 php ;test stores do not alter flags
198d : 49c3 eor #$c3
198f : 28 plp
1990 : 850c sta zpt
1992 : 08 php ;flags after load/store sequence
1993 : 49c3 eor #$c3
1995 : c513 cmp zp1 ;test result
trap_ne
1997 : d0fe > bne * ;failed not equal (non zero)
1999 : 68 pla ;load status
eor_flag 0
199a : 4930 > eor #0|fao ;invert expected flags + always on bits
199c : cd1c02 cmp fLDx ;test flags
trap_ne
199f : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
19a1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
19a3 : 48 > pha ;use stack to load status
19a4 : 28 > plp
19a5 : ad1802 lda abs1+1
19a8 : 08 php ;test stores do not alter flags
19a9 : 49c3 eor #$c3
19ab : 28 plp
19ac : 850d sta zpt+1
19ae : 08 php ;flags after load/store sequence
19af : 49c3 eor #$c3
19b1 : c514 cmp zp1+1 ;test result
trap_ne
19b3 : d0fe > bne * ;failed not equal (non zero)
19b5 : 68 pla ;load status
eor_flag 0
19b6 : 4930 > eor #0|fao ;invert expected flags + always on bits
19b8 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
19bb : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
19bd : a900 > lda #0 ;allow test to change I-flag (no mask)
>
19bf : 48 > pha ;use stack to load status
19c0 : 28 > plp
19c1 : ad1902 lda abs1+2
19c4 : 08 php ;test stores do not alter flags
19c5 : 49c3 eor #$c3
19c7 : 28 plp
19c8 : 850e sta zpt+2
19ca : 08 php ;flags after load/store sequence
19cb : 49c3 eor #$c3
19cd : c515 cmp zp1+2 ;test result
trap_ne
19cf : d0fe > bne * ;failed not equal (non zero)
19d1 : 68 pla ;load status
eor_flag 0
19d2 : 4930 > eor #0|fao ;invert expected flags + always on bits
19d4 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
19d7 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
19d9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
19db : 48 > pha ;use stack to load status
19dc : 28 > plp
19dd : ad1a02 lda abs1+3
19e0 : 08 php ;test stores do not alter flags
19e1 : 49c3 eor #$c3
19e3 : 28 plp
19e4 : 850f sta zpt+3
19e6 : 08 php ;flags after load/store sequence
19e7 : 49c3 eor #$c3
19e9 : c516 cmp zp1+3 ;test result
trap_ne
19eb : d0fe > bne * ;failed not equal (non zero)
19ed : 68 pla ;load status
eor_flag 0
19ee : 4930 > eor #0|fao ;invert expected flags + always on bits
19f0 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
19f3 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
19f5 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
19f7 : 48 > pha ;use stack to load status
19f8 : 28 > plp
19f9 : ad1702 lda abs1
19fc : 08 php ;test stores do not alter flags
19fd : 49c3 eor #$c3
19ff : 28 plp
1a00 : 850c sta zpt
1a02 : 08 php ;flags after load/store sequence
1a03 : 49c3 eor #$c3
1a05 : c513 cmp zp1 ;test result
trap_ne
1a07 : d0fe > bne * ;failed not equal (non zero)
1a09 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1a0a : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1a0c : cd1c02 cmp fLDx ;test flags
trap_ne
1a0f : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1a11 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1a13 : 48 > pha ;use stack to load status
1a14 : 28 > plp
1a15 : ad1802 lda abs1+1
1a18 : 08 php ;test stores do not alter flags
1a19 : 49c3 eor #$c3
1a1b : 28 plp
1a1c : 850d sta zpt+1
1a1e : 08 php ;flags after load/store sequence
1a1f : 49c3 eor #$c3
1a21 : c514 cmp zp1+1 ;test result
trap_ne
1a23 : d0fe > bne * ;failed not equal (non zero)
1a25 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1a26 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1a28 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1a2b : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1a2d : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1a2f : 48 > pha ;use stack to load status
1a30 : 28 > plp
1a31 : ad1902 lda abs1+2
1a34 : 08 php ;test stores do not alter flags
1a35 : 49c3 eor #$c3
1a37 : 28 plp
1a38 : 850e sta zpt+2
1a3a : 08 php ;flags after load/store sequence
1a3b : 49c3 eor #$c3
1a3d : c515 cmp zp1+2 ;test result
trap_ne
1a3f : d0fe > bne * ;failed not equal (non zero)
1a41 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1a42 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1a44 : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1a47 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1a49 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1a4b : 48 > pha ;use stack to load status
1a4c : 28 > plp
1a4d : ad1a02 lda abs1+3
1a50 : 08 php ;test stores do not alter flags
1a51 : 49c3 eor #$c3
1a53 : 28 plp
1a54 : 850f sta zpt+3
1a56 : 08 php ;flags after load/store sequence
1a57 : 49c3 eor #$c3
1a59 : c516 cmp zp1+3 ;test result
trap_ne
1a5b : d0fe > bne * ;failed not equal (non zero)
1a5d : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1a5e : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1a60 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1a63 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1a65 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1a67 : 48 > pha ;use stack to load status
1a68 : 28 > plp
1a69 : a9c3 lda #$c3
1a6b : 08 php
1a6c : cd1702 cmp abs1 ;test result
trap_ne
1a6f : d0fe > bne * ;failed not equal (non zero)
1a71 : 68 pla ;load status
eor_flag 0
1a72 : 4930 > eor #0|fao ;invert expected flags + always on bits
1a74 : cd1c02 cmp fLDx ;test flags
trap_ne
1a77 : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1a79 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1a7b : 48 > pha ;use stack to load status
1a7c : 28 > plp
1a7d : a982 lda #$82
1a7f : 08 php
1a80 : cd1802 cmp abs1+1 ;test result
trap_ne
1a83 : d0fe > bne * ;failed not equal (non zero)
1a85 : 68 pla ;load status
eor_flag 0
1a86 : 4930 > eor #0|fao ;invert expected flags + always on bits
1a88 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1a8b : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1a8d : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1a8f : 48 > pha ;use stack to load status
1a90 : 28 > plp
1a91 : a941 lda #$41
1a93 : 08 php
1a94 : cd1902 cmp abs1+2 ;test result
trap_ne
1a97 : d0fe > bne * ;failed not equal (non zero)
1a99 : 68 pla ;load status
eor_flag 0
1a9a : 4930 > eor #0|fao ;invert expected flags + always on bits
1a9c : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1a9f : d0fe > bne * ;failed not equal (non zero)
set_stat 0
> load_flag 0
1aa1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1aa3 : 48 > pha ;use stack to load status
1aa4 : 28 > plp
1aa5 : a900 lda #0
1aa7 : 08 php
1aa8 : cd1a02 cmp abs1+3 ;test result
trap_ne
1aab : d0fe > bne * ;failed not equal (non zero)
1aad : 68 pla ;load status
eor_flag 0
1aae : 4930 > eor #0|fao ;invert expected flags + always on bits
1ab0 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1ab3 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1ab5 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1ab7 : 48 > pha ;use stack to load status
1ab8 : 28 > plp
1ab9 : a9c3 lda #$c3
1abb : 08 php
1abc : cd1702 cmp abs1 ;test result
trap_ne
1abf : d0fe > bne * ;failed not equal (non zero)
1ac1 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1ac2 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1ac4 : cd1c02 cmp fLDx ;test flags
trap_ne
1ac7 : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1ac9 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1acb : 48 > pha ;use stack to load status
1acc : 28 > plp
1acd : a982 lda #$82
1acf : 08 php
1ad0 : cd1802 cmp abs1+1 ;test result
trap_ne
1ad3 : d0fe > bne * ;failed not equal (non zero)
1ad5 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1ad6 : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1ad8 : cd1d02 cmp fLDx+1 ;test flags
trap_ne
1adb : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1add : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1adf : 48 > pha ;use stack to load status
1ae0 : 28 > plp
1ae1 : a941 lda #$41
1ae3 : 08 php
1ae4 : cd1902 cmp abs1+2 ;test result
trap_ne
1ae7 : d0fe > bne * ;failed not equal (non zero)
1ae9 : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1aea : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1aec : cd1e02 cmp fLDx+2 ;test flags
trap_ne
1aef : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
1af1 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1af3 : 48 > pha ;use stack to load status
1af4 : 28 > plp
1af5 : a900 lda #0
1af7 : 08 php
1af8 : cd1a02 cmp abs1+3 ;test result
trap_ne
1afb : d0fe > bne * ;failed not equal (non zero)
1afd : 68 pla ;load status
eor_flag lo~fnz ;mask bits not altered
1afe : 497d > eor #lo~fnz |fao ;invert expected flags + always on bits
1b00 : cd1f02 cmp fLDx+3 ;test flags
trap_ne
1b03 : d0fe > bne * ;failed not equal (non zero)
1b05 : a200 ldx #0
1b07 : a50c lda zpt
1b09 : 49c3 eor #$c3
1b0b : c513 cmp zp1
trap_ne ;store to zp data
1b0d : d0fe > bne * ;failed not equal (non zero)
1b0f : 860c stx zpt ;clear
1b11 : ad0302 lda abst
1b14 : 49c3 eor #$c3
1b16 : cd1702 cmp abs1
trap_ne ;store to abs data
1b19 : d0fe > bne * ;failed not equal (non zero)
1b1b : 8e0302 stx abst ;clear
1b1e : a50d lda zpt+1
1b20 : 49c3 eor #$c3
1b22 : c514 cmp zp1+1
trap_ne ;store to zp data
1b24 : d0fe > bne * ;failed not equal (non zero)
1b26 : 860d stx zpt+1 ;clear
1b28 : ad0402 lda abst+1
1b2b : 49c3 eor #$c3
1b2d : cd1802 cmp abs1+1
trap_ne ;store to abs data
1b30 : d0fe > bne * ;failed not equal (non zero)
1b32 : 8e0402 stx abst+1 ;clear
1b35 : a50e lda zpt+2
1b37 : 49c3 eor #$c3
1b39 : c515 cmp zp1+2
trap_ne ;store to zp data
1b3b : d0fe > bne * ;failed not equal (non zero)
1b3d : 860e stx zpt+2 ;clear
1b3f : ad0502 lda abst+2
1b42 : 49c3 eor #$c3
1b44 : cd1902 cmp abs1+2
trap_ne ;store to abs data
1b47 : d0fe > bne * ;failed not equal (non zero)
1b49 : 8e0502 stx abst+2 ;clear
1b4c : a50f lda zpt+3
1b4e : 49c3 eor #$c3
1b50 : c516 cmp zp1+3
trap_ne ;store to zp data
1b52 : d0fe > bne * ;failed not equal (non zero)
1b54 : 860f stx zpt+3 ;clear
1b56 : ad0602 lda abst+3
1b59 : 49c3 eor #$c3
1b5b : cd1a02 cmp abs1+3
trap_ne ;store to abs data
1b5e : d0fe > bne * ;failed not equal (non zero)
1b60 : 8e0602 stx abst+3 ;clear
next_test
1b63 : ad0002 > lda test_case ;previous test
1b66 : c918 > cmp #test_num
> trap_ne ;test is out of sequence
1b68 : d0fe > bne * ;failed not equal (non zero)
>
0019 = >test_num = test_num + 1
1b6a : a919 > lda #test_num ;*** next tests' number
1b6c : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; testing bit test & compares BIT CPX CPY CMP all addressing modes
; BIT - zp / abs
set_a $ff,0
> load_flag 0
1b6f : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1b71 : 48 > pha ;use stack to load status
1b72 : a9ff > lda #$ff ;precharge accu
1b74 : 28 > plp
1b75 : 2416 bit zp1+3 ;00 - should set Z / clear NV
tst_a $ff,fz
1b77 : 08 > php ;save flags
1b78 : c9ff > cmp #$ff ;test result
> trap_ne
1b7a : d0fe > bne * ;failed not equal (non zero)
>
1b7c : 68 > pla ;load status
1b7d : 48 > pha
> cmp_flag fz
1b7e : c932 > cmp #(fz |fao)&m8 ;expected flags + always on bits
>
> trap_ne
1b80 : d0fe > bne * ;failed not equal (non zero)
>
1b82 : 28 > plp ;restore status
set_a 1,0
> load_flag 0
1b83 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1b85 : 48 > pha ;use stack to load status
1b86 : a901 > lda #1 ;precharge accu
1b88 : 28 > plp
1b89 : 2415 bit zp1+2 ;41 - should set V (M6) / clear NZ
tst_a 1,fv
1b8b : 08 > php ;save flags
1b8c : c901 > cmp #1 ;test result
> trap_ne
1b8e : d0fe > bne * ;failed not equal (non zero)
>
1b90 : 68 > pla ;load status
1b91 : 48 > pha
> cmp_flag fv
1b92 : c970 > cmp #(fv|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1b94 : d0fe > bne * ;failed not equal (non zero)
>
1b96 : 28 > plp ;restore status
set_a 1,0
> load_flag 0
1b97 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1b99 : 48 > pha ;use stack to load status
1b9a : a901 > lda #1 ;precharge accu
1b9c : 28 > plp
1b9d : 2414 bit zp1+1 ;82 - should set N (M7) & Z / clear V
tst_a 1,fnz
1b9f : 08 > php ;save flags
1ba0 : c901 > cmp #1 ;test result
> trap_ne
1ba2 : d0fe > bne * ;failed not equal (non zero)
>
1ba4 : 68 > pla ;load status
1ba5 : 48 > pha
> cmp_flag fnz
1ba6 : c9b2 > cmp #(fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1ba8 : d0fe > bne * ;failed not equal (non zero)
>
1baa : 28 > plp ;restore status
set_a 1,0
> load_flag 0
1bab : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1bad : 48 > pha ;use stack to load status
1bae : a901 > lda #1 ;precharge accu
1bb0 : 28 > plp
1bb1 : 2413 bit zp1 ;c3 - should set N (M7) & V (M6) / clear Z
tst_a 1,fnv
1bb3 : 08 > php ;save flags
1bb4 : c901 > cmp #1 ;test result
> trap_ne
1bb6 : d0fe > bne * ;failed not equal (non zero)
>
1bb8 : 68 > pla ;load status
1bb9 : 48 > pha
> cmp_flag fnv
1bba : c9f0 > cmp #(fnv|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1bbc : d0fe > bne * ;failed not equal (non zero)
>
1bbe : 28 > plp ;restore status
set_a $ff,$ff
> load_flag $ff
1bbf : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1bc1 : 48 > pha ;use stack to load status
1bc2 : a9ff > lda #$ff ;precharge accu
1bc4 : 28 > plp
1bc5 : 2416 bit zp1+3 ;00 - should set Z / clear NV
tst_a $ff,~fnv
1bc7 : 08 > php ;save flags
1bc8 : c9ff > cmp #$ff ;test result
> trap_ne
1bca : d0fe > bne * ;failed not equal (non zero)
>
1bcc : 68 > pla ;load status
1bcd : 48 > pha
> cmp_flag ~fnv
1bce : c93f > cmp #(~fnv |fao)&m8 ;expected flags + always on bits
>
> trap_ne
1bd0 : d0fe > bne * ;failed not equal (non zero)
>
1bd2 : 28 > plp ;restore status
set_a 1,$ff
> load_flag $ff
1bd3 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1bd5 : 48 > pha ;use stack to load status
1bd6 : a901 > lda #1 ;precharge accu
1bd8 : 28 > plp
1bd9 : 2415 bit zp1+2 ;41 - should set V (M6) / clear NZ
tst_a 1,~fnz
1bdb : 08 > php ;save flags
1bdc : c901 > cmp #1 ;test result
> trap_ne
1bde : d0fe > bne * ;failed not equal (non zero)
>
1be0 : 68 > pla ;load status
1be1 : 48 > pha
> cmp_flag ~fnz
1be2 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1be4 : d0fe > bne * ;failed not equal (non zero)
>
1be6 : 28 > plp ;restore status
set_a 1,$ff
> load_flag $ff
1be7 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1be9 : 48 > pha ;use stack to load status
1bea : a901 > lda #1 ;precharge accu
1bec : 28 > plp
1bed : 2414 bit zp1+1 ;82 - should set N (M7) & Z / clear V
tst_a 1,~fv
1bef : 08 > php ;save flags
1bf0 : c901 > cmp #1 ;test result
> trap_ne
1bf2 : d0fe > bne * ;failed not equal (non zero)
>
1bf4 : 68 > pla ;load status
1bf5 : 48 > pha
> cmp_flag ~fv
1bf6 : c9bf > cmp #(~fv|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1bf8 : d0fe > bne * ;failed not equal (non zero)
>
1bfa : 28 > plp ;restore status
set_a 1,$ff
> load_flag $ff
1bfb : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1bfd : 48 > pha ;use stack to load status
1bfe : a901 > lda #1 ;precharge accu
1c00 : 28 > plp
1c01 : 2413 bit zp1 ;c3 - should set N (M7) & V (M6) / clear Z
tst_a 1,~fz
1c03 : 08 > php ;save flags
1c04 : c901 > cmp #1 ;test result
> trap_ne
1c06 : d0fe > bne * ;failed not equal (non zero)
>
1c08 : 68 > pla ;load status
1c09 : 48 > pha
> cmp_flag ~fz
1c0a : c9fd > cmp #(~fz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c0c : d0fe > bne * ;failed not equal (non zero)
>
1c0e : 28 > plp ;restore status
set_a $ff,0
> load_flag 0
1c0f : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1c11 : 48 > pha ;use stack to load status
1c12 : a9ff > lda #$ff ;precharge accu
1c14 : 28 > plp
1c15 : 2c1a02 bit abs1+3 ;00 - should set Z / clear NV
tst_a $ff,fz
1c18 : 08 > php ;save flags
1c19 : c9ff > cmp #$ff ;test result
> trap_ne
1c1b : d0fe > bne * ;failed not equal (non zero)
>
1c1d : 68 > pla ;load status
1c1e : 48 > pha
> cmp_flag fz
1c1f : c932 > cmp #(fz |fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c21 : d0fe > bne * ;failed not equal (non zero)
>
1c23 : 28 > plp ;restore status
set_a 1,0
> load_flag 0
1c24 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1c26 : 48 > pha ;use stack to load status
1c27 : a901 > lda #1 ;precharge accu
1c29 : 28 > plp
1c2a : 2c1902 bit abs1+2 ;41 - should set V (M6) / clear NZ
tst_a 1,fv
1c2d : 08 > php ;save flags
1c2e : c901 > cmp #1 ;test result
> trap_ne
1c30 : d0fe > bne * ;failed not equal (non zero)
>
1c32 : 68 > pla ;load status
1c33 : 48 > pha
> cmp_flag fv
1c34 : c970 > cmp #(fv|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c36 : d0fe > bne * ;failed not equal (non zero)
>
1c38 : 28 > plp ;restore status
set_a 1,0
> load_flag 0
1c39 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1c3b : 48 > pha ;use stack to load status
1c3c : a901 > lda #1 ;precharge accu
1c3e : 28 > plp
1c3f : 2c1802 bit abs1+1 ;82 - should set N (M7) & Z / clear V
tst_a 1,fnz
1c42 : 08 > php ;save flags
1c43 : c901 > cmp #1 ;test result
> trap_ne
1c45 : d0fe > bne * ;failed not equal (non zero)
>
1c47 : 68 > pla ;load status
1c48 : 48 > pha
> cmp_flag fnz
1c49 : c9b2 > cmp #(fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c4b : d0fe > bne * ;failed not equal (non zero)
>
1c4d : 28 > plp ;restore status
set_a 1,0
> load_flag 0
1c4e : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1c50 : 48 > pha ;use stack to load status
1c51 : a901 > lda #1 ;precharge accu
1c53 : 28 > plp
1c54 : 2c1702 bit abs1 ;c3 - should set N (M7) & V (M6) / clear Z
tst_a 1,fnv
1c57 : 08 > php ;save flags
1c58 : c901 > cmp #1 ;test result
> trap_ne
1c5a : d0fe > bne * ;failed not equal (non zero)
>
1c5c : 68 > pla ;load status
1c5d : 48 > pha
> cmp_flag fnv
1c5e : c9f0 > cmp #(fnv|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c60 : d0fe > bne * ;failed not equal (non zero)
>
1c62 : 28 > plp ;restore status
set_a $ff,$ff
> load_flag $ff
1c63 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1c65 : 48 > pha ;use stack to load status
1c66 : a9ff > lda #$ff ;precharge accu
1c68 : 28 > plp
1c69 : 2c1a02 bit abs1+3 ;00 - should set Z / clear NV
tst_a $ff,~fnv
1c6c : 08 > php ;save flags
1c6d : c9ff > cmp #$ff ;test result
> trap_ne
1c6f : d0fe > bne * ;failed not equal (non zero)
>
1c71 : 68 > pla ;load status
1c72 : 48 > pha
> cmp_flag ~fnv
1c73 : c93f > cmp #(~fnv |fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c75 : d0fe > bne * ;failed not equal (non zero)
>
1c77 : 28 > plp ;restore status
set_a 1,$ff
> load_flag $ff
1c78 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1c7a : 48 > pha ;use stack to load status
1c7b : a901 > lda #1 ;precharge accu
1c7d : 28 > plp
1c7e : 2c1902 bit abs1+2 ;41 - should set V (M6) / clear NZ
tst_a 1,~fnz
1c81 : 08 > php ;save flags
1c82 : c901 > cmp #1 ;test result
> trap_ne
1c84 : d0fe > bne * ;failed not equal (non zero)
>
1c86 : 68 > pla ;load status
1c87 : 48 > pha
> cmp_flag ~fnz
1c88 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c8a : d0fe > bne * ;failed not equal (non zero)
>
1c8c : 28 > plp ;restore status
set_a 1,$ff
> load_flag $ff
1c8d : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1c8f : 48 > pha ;use stack to load status
1c90 : a901 > lda #1 ;precharge accu
1c92 : 28 > plp
1c93 : 2c1802 bit abs1+1 ;82 - should set N (M7) & Z / clear V
tst_a 1,~fv
1c96 : 08 > php ;save flags
1c97 : c901 > cmp #1 ;test result
> trap_ne
1c99 : d0fe > bne * ;failed not equal (non zero)
>
1c9b : 68 > pla ;load status
1c9c : 48 > pha
> cmp_flag ~fv
1c9d : c9bf > cmp #(~fv|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1c9f : d0fe > bne * ;failed not equal (non zero)
>
1ca1 : 28 > plp ;restore status
set_a 1,$ff
> load_flag $ff
1ca2 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1ca4 : 48 > pha ;use stack to load status
1ca5 : a901 > lda #1 ;precharge accu
1ca7 : 28 > plp
1ca8 : 2c1702 bit abs1 ;c3 - should set N (M7) & V (M6) / clear Z
tst_a 1,~fz
1cab : 08 > php ;save flags
1cac : c901 > cmp #1 ;test result
> trap_ne
1cae : d0fe > bne * ;failed not equal (non zero)
>
1cb0 : 68 > pla ;load status
1cb1 : 48 > pha
> cmp_flag ~fz
1cb2 : c9fd > cmp #(~fz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1cb4 : d0fe > bne * ;failed not equal (non zero)
>
1cb6 : 28 > plp ;restore status
next_test
1cb7 : ad0002 > lda test_case ;previous test
1cba : c919 > cmp #test_num
> trap_ne ;test is out of sequence
1cbc : d0fe > bne * ;failed not equal (non zero)
>
001a = >test_num = test_num + 1
1cbe : a91a > lda #test_num ;*** next tests' number
1cc0 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; CPX - zp / abs / #
set_x $80,0
> load_flag 0
1cc3 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1cc5 : 48 > pha ;use stack to load status
1cc6 : a280 > ldx #$80 ;precharge index x
1cc8 : 28 > plp
1cc9 : e417 cpx zp7f
tst_stat fc
1ccb : 08 > php ;save status
1ccc : 68 > pla ;use stack to retrieve status
1ccd : 48 > pha
> cmp_flag fc
1cce : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1cd0 : d0fe > bne * ;failed not equal (non zero)
>
1cd2 : 28 > plp ;restore status
1cd3 : ca dex
1cd4 : e417 cpx zp7f
tst_stat fzc
1cd6 : 08 > php ;save status
1cd7 : 68 > pla ;use stack to retrieve status
1cd8 : 48 > pha
> cmp_flag fzc
1cd9 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1cdb : d0fe > bne * ;failed not equal (non zero)
>
1cdd : 28 > plp ;restore status
1cde : ca dex
1cdf : e417 cpx zp7f
tst_x $7e,fn
1ce1 : 08 > php ;save flags
1ce2 : e07e > cpx #$7e ;test result
> trap_ne
1ce4 : d0fe > bne * ;failed not equal (non zero)
>
1ce6 : 68 > pla ;load status
1ce7 : 48 > pha
> cmp_flag fn
1ce8 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1cea : d0fe > bne * ;failed not equal (non zero)
>
1cec : 28 > plp ;restore status
set_x $80,$ff
> load_flag $ff
1ced : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1cef : 48 > pha ;use stack to load status
1cf0 : a280 > ldx #$80 ;precharge index x
1cf2 : 28 > plp
1cf3 : e417 cpx zp7f
tst_stat ~fnz
1cf5 : 08 > php ;save status
1cf6 : 68 > pla ;use stack to retrieve status
1cf7 : 48 > pha
> cmp_flag ~fnz
1cf8 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1cfa : d0fe > bne * ;failed not equal (non zero)
>
1cfc : 28 > plp ;restore status
1cfd : ca dex
1cfe : e417 cpx zp7f
tst_stat ~fn
1d00 : 08 > php ;save status
1d01 : 68 > pla ;use stack to retrieve status
1d02 : 48 > pha
> cmp_flag ~fn
1d03 : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d05 : d0fe > bne * ;failed not equal (non zero)
>
1d07 : 28 > plp ;restore status
1d08 : ca dex
1d09 : e417 cpx zp7f
tst_x $7e,~fzc
1d0b : 08 > php ;save flags
1d0c : e07e > cpx #$7e ;test result
> trap_ne
1d0e : d0fe > bne * ;failed not equal (non zero)
>
1d10 : 68 > pla ;load status
1d11 : 48 > pha
> cmp_flag ~fzc
1d12 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d14 : d0fe > bne * ;failed not equal (non zero)
>
1d16 : 28 > plp ;restore status
set_x $80,0
> load_flag 0
1d17 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1d19 : 48 > pha ;use stack to load status
1d1a : a280 > ldx #$80 ;precharge index x
1d1c : 28 > plp
1d1d : ec1b02 cpx abs7f
tst_stat fc
1d20 : 08 > php ;save status
1d21 : 68 > pla ;use stack to retrieve status
1d22 : 48 > pha
> cmp_flag fc
1d23 : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d25 : d0fe > bne * ;failed not equal (non zero)
>
1d27 : 28 > plp ;restore status
1d28 : ca dex
1d29 : ec1b02 cpx abs7f
tst_stat fzc
1d2c : 08 > php ;save status
1d2d : 68 > pla ;use stack to retrieve status
1d2e : 48 > pha
> cmp_flag fzc
1d2f : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d31 : d0fe > bne * ;failed not equal (non zero)
>
1d33 : 28 > plp ;restore status
1d34 : ca dex
1d35 : ec1b02 cpx abs7f
tst_x $7e,fn
1d38 : 08 > php ;save flags
1d39 : e07e > cpx #$7e ;test result
> trap_ne
1d3b : d0fe > bne * ;failed not equal (non zero)
>
1d3d : 68 > pla ;load status
1d3e : 48 > pha
> cmp_flag fn
1d3f : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d41 : d0fe > bne * ;failed not equal (non zero)
>
1d43 : 28 > plp ;restore status
set_x $80,$ff
> load_flag $ff
1d44 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1d46 : 48 > pha ;use stack to load status
1d47 : a280 > ldx #$80 ;precharge index x
1d49 : 28 > plp
1d4a : ec1b02 cpx abs7f
tst_stat ~fnz
1d4d : 08 > php ;save status
1d4e : 68 > pla ;use stack to retrieve status
1d4f : 48 > pha
> cmp_flag ~fnz
1d50 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d52 : d0fe > bne * ;failed not equal (non zero)
>
1d54 : 28 > plp ;restore status
1d55 : ca dex
1d56 : ec1b02 cpx abs7f
tst_stat ~fn
1d59 : 08 > php ;save status
1d5a : 68 > pla ;use stack to retrieve status
1d5b : 48 > pha
> cmp_flag ~fn
1d5c : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d5e : d0fe > bne * ;failed not equal (non zero)
>
1d60 : 28 > plp ;restore status
1d61 : ca dex
1d62 : ec1b02 cpx abs7f
tst_x $7e,~fzc
1d65 : 08 > php ;save flags
1d66 : e07e > cpx #$7e ;test result
> trap_ne
1d68 : d0fe > bne * ;failed not equal (non zero)
>
1d6a : 68 > pla ;load status
1d6b : 48 > pha
> cmp_flag ~fzc
1d6c : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d6e : d0fe > bne * ;failed not equal (non zero)
>
1d70 : 28 > plp ;restore status
set_x $80,0
> load_flag 0
1d71 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1d73 : 48 > pha ;use stack to load status
1d74 : a280 > ldx #$80 ;precharge index x
1d76 : 28 > plp
1d77 : e07f cpx #$7f
tst_stat fc
1d79 : 08 > php ;save status
1d7a : 68 > pla ;use stack to retrieve status
1d7b : 48 > pha
> cmp_flag fc
1d7c : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d7e : d0fe > bne * ;failed not equal (non zero)
>
1d80 : 28 > plp ;restore status
1d81 : ca dex
1d82 : e07f cpx #$7f
tst_stat fzc
1d84 : 08 > php ;save status
1d85 : 68 > pla ;use stack to retrieve status
1d86 : 48 > pha
> cmp_flag fzc
1d87 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d89 : d0fe > bne * ;failed not equal (non zero)
>
1d8b : 28 > plp ;restore status
1d8c : ca dex
1d8d : e07f cpx #$7f
tst_x $7e,fn
1d8f : 08 > php ;save flags
1d90 : e07e > cpx #$7e ;test result
> trap_ne
1d92 : d0fe > bne * ;failed not equal (non zero)
>
1d94 : 68 > pla ;load status
1d95 : 48 > pha
> cmp_flag fn
1d96 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1d98 : d0fe > bne * ;failed not equal (non zero)
>
1d9a : 28 > plp ;restore status
set_x $80,$ff
> load_flag $ff
1d9b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1d9d : 48 > pha ;use stack to load status
1d9e : a280 > ldx #$80 ;precharge index x
1da0 : 28 > plp
1da1 : e07f cpx #$7f
tst_stat ~fnz
1da3 : 08 > php ;save status
1da4 : 68 > pla ;use stack to retrieve status
1da5 : 48 > pha
> cmp_flag ~fnz
1da6 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1da8 : d0fe > bne * ;failed not equal (non zero)
>
1daa : 28 > plp ;restore status
1dab : ca dex
1dac : e07f cpx #$7f
tst_stat ~fn
1dae : 08 > php ;save status
1daf : 68 > pla ;use stack to retrieve status
1db0 : 48 > pha
> cmp_flag ~fn
1db1 : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1db3 : d0fe > bne * ;failed not equal (non zero)
>
1db5 : 28 > plp ;restore status
1db6 : ca dex
1db7 : e07f cpx #$7f
tst_x $7e,~fzc
1db9 : 08 > php ;save flags
1dba : e07e > cpx #$7e ;test result
> trap_ne
1dbc : d0fe > bne * ;failed not equal (non zero)
>
1dbe : 68 > pla ;load status
1dbf : 48 > pha
> cmp_flag ~fzc
1dc0 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1dc2 : d0fe > bne * ;failed not equal (non zero)
>
1dc4 : 28 > plp ;restore status
next_test
1dc5 : ad0002 > lda test_case ;previous test
1dc8 : c91a > cmp #test_num
> trap_ne ;test is out of sequence
1dca : d0fe > bne * ;failed not equal (non zero)
>
001b = >test_num = test_num + 1
1dcc : a91b > lda #test_num ;*** next tests' number
1dce : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; CPY - zp / abs / #
set_y $80,0
> load_flag 0
1dd1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1dd3 : 48 > pha ;use stack to load status
1dd4 : a080 > ldy #$80 ;precharge index y
1dd6 : 28 > plp
1dd7 : c417 cpy zp7f
tst_stat fc
1dd9 : 08 > php ;save status
1dda : 68 > pla ;use stack to retrieve status
1ddb : 48 > pha
> cmp_flag fc
1ddc : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1dde : d0fe > bne * ;failed not equal (non zero)
>
1de0 : 28 > plp ;restore status
1de1 : 88 dey
1de2 : c417 cpy zp7f
tst_stat fzc
1de4 : 08 > php ;save status
1de5 : 68 > pla ;use stack to retrieve status
1de6 : 48 > pha
> cmp_flag fzc
1de7 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1de9 : d0fe > bne * ;failed not equal (non zero)
>
1deb : 28 > plp ;restore status
1dec : 88 dey
1ded : c417 cpy zp7f
tst_y $7e,fn
1def : 08 > php ;save flags
1df0 : c07e > cpy #$7e ;test result
> trap_ne
1df2 : d0fe > bne * ;failed not equal (non zero)
>
1df4 : 68 > pla ;load status
1df5 : 48 > pha
> cmp_flag fn
1df6 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1df8 : d0fe > bne * ;failed not equal (non zero)
>
1dfa : 28 > plp ;restore status
set_y $80,$ff
> load_flag $ff
1dfb : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1dfd : 48 > pha ;use stack to load status
1dfe : a080 > ldy #$80 ;precharge index y
1e00 : 28 > plp
1e01 : c417 cpy zp7f
tst_stat ~fnz
1e03 : 08 > php ;save status
1e04 : 68 > pla ;use stack to retrieve status
1e05 : 48 > pha
> cmp_flag ~fnz
1e06 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e08 : d0fe > bne * ;failed not equal (non zero)
>
1e0a : 28 > plp ;restore status
1e0b : 88 dey
1e0c : c417 cpy zp7f
tst_stat ~fn
1e0e : 08 > php ;save status
1e0f : 68 > pla ;use stack to retrieve status
1e10 : 48 > pha
> cmp_flag ~fn
1e11 : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e13 : d0fe > bne * ;failed not equal (non zero)
>
1e15 : 28 > plp ;restore status
1e16 : 88 dey
1e17 : c417 cpy zp7f
tst_y $7e,~fzc
1e19 : 08 > php ;save flags
1e1a : c07e > cpy #$7e ;test result
> trap_ne
1e1c : d0fe > bne * ;failed not equal (non zero)
>
1e1e : 68 > pla ;load status
1e1f : 48 > pha
> cmp_flag ~fzc
1e20 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e22 : d0fe > bne * ;failed not equal (non zero)
>
1e24 : 28 > plp ;restore status
set_y $80,0
> load_flag 0
1e25 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1e27 : 48 > pha ;use stack to load status
1e28 : a080 > ldy #$80 ;precharge index y
1e2a : 28 > plp
1e2b : cc1b02 cpy abs7f
tst_stat fc
1e2e : 08 > php ;save status
1e2f : 68 > pla ;use stack to retrieve status
1e30 : 48 > pha
> cmp_flag fc
1e31 : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e33 : d0fe > bne * ;failed not equal (non zero)
>
1e35 : 28 > plp ;restore status
1e36 : 88 dey
1e37 : cc1b02 cpy abs7f
tst_stat fzc
1e3a : 08 > php ;save status
1e3b : 68 > pla ;use stack to retrieve status
1e3c : 48 > pha
> cmp_flag fzc
1e3d : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e3f : d0fe > bne * ;failed not equal (non zero)
>
1e41 : 28 > plp ;restore status
1e42 : 88 dey
1e43 : cc1b02 cpy abs7f
tst_y $7e,fn
1e46 : 08 > php ;save flags
1e47 : c07e > cpy #$7e ;test result
> trap_ne
1e49 : d0fe > bne * ;failed not equal (non zero)
>
1e4b : 68 > pla ;load status
1e4c : 48 > pha
> cmp_flag fn
1e4d : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e4f : d0fe > bne * ;failed not equal (non zero)
>
1e51 : 28 > plp ;restore status
set_y $80,$ff
> load_flag $ff
1e52 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1e54 : 48 > pha ;use stack to load status
1e55 : a080 > ldy #$80 ;precharge index y
1e57 : 28 > plp
1e58 : cc1b02 cpy abs7f
tst_stat ~fnz
1e5b : 08 > php ;save status
1e5c : 68 > pla ;use stack to retrieve status
1e5d : 48 > pha
> cmp_flag ~fnz
1e5e : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e60 : d0fe > bne * ;failed not equal (non zero)
>
1e62 : 28 > plp ;restore status
1e63 : 88 dey
1e64 : cc1b02 cpy abs7f
tst_stat ~fn
1e67 : 08 > php ;save status
1e68 : 68 > pla ;use stack to retrieve status
1e69 : 48 > pha
> cmp_flag ~fn
1e6a : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e6c : d0fe > bne * ;failed not equal (non zero)
>
1e6e : 28 > plp ;restore status
1e6f : 88 dey
1e70 : cc1b02 cpy abs7f
tst_y $7e,~fzc
1e73 : 08 > php ;save flags
1e74 : c07e > cpy #$7e ;test result
> trap_ne
1e76 : d0fe > bne * ;failed not equal (non zero)
>
1e78 : 68 > pla ;load status
1e79 : 48 > pha
> cmp_flag ~fzc
1e7a : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e7c : d0fe > bne * ;failed not equal (non zero)
>
1e7e : 28 > plp ;restore status
set_y $80,0
> load_flag 0
1e7f : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1e81 : 48 > pha ;use stack to load status
1e82 : a080 > ldy #$80 ;precharge index y
1e84 : 28 > plp
1e85 : c07f cpy #$7f
tst_stat fc
1e87 : 08 > php ;save status
1e88 : 68 > pla ;use stack to retrieve status
1e89 : 48 > pha
> cmp_flag fc
1e8a : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e8c : d0fe > bne * ;failed not equal (non zero)
>
1e8e : 28 > plp ;restore status
1e8f : 88 dey
1e90 : c07f cpy #$7f
tst_stat fzc
1e92 : 08 > php ;save status
1e93 : 68 > pla ;use stack to retrieve status
1e94 : 48 > pha
> cmp_flag fzc
1e95 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1e97 : d0fe > bne * ;failed not equal (non zero)
>
1e99 : 28 > plp ;restore status
1e9a : 88 dey
1e9b : c07f cpy #$7f
tst_y $7e,fn
1e9d : 08 > php ;save flags
1e9e : c07e > cpy #$7e ;test result
> trap_ne
1ea0 : d0fe > bne * ;failed not equal (non zero)
>
1ea2 : 68 > pla ;load status
1ea3 : 48 > pha
> cmp_flag fn
1ea4 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1ea6 : d0fe > bne * ;failed not equal (non zero)
>
1ea8 : 28 > plp ;restore status
set_y $80,$ff
> load_flag $ff
1ea9 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1eab : 48 > pha ;use stack to load status
1eac : a080 > ldy #$80 ;precharge index y
1eae : 28 > plp
1eaf : c07f cpy #$7f
tst_stat ~fnz
1eb1 : 08 > php ;save status
1eb2 : 68 > pla ;use stack to retrieve status
1eb3 : 48 > pha
> cmp_flag ~fnz
1eb4 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1eb6 : d0fe > bne * ;failed not equal (non zero)
>
1eb8 : 28 > plp ;restore status
1eb9 : 88 dey
1eba : c07f cpy #$7f
tst_stat ~fn
1ebc : 08 > php ;save status
1ebd : 68 > pla ;use stack to retrieve status
1ebe : 48 > pha
> cmp_flag ~fn
1ebf : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1ec1 : d0fe > bne * ;failed not equal (non zero)
>
1ec3 : 28 > plp ;restore status
1ec4 : 88 dey
1ec5 : c07f cpy #$7f
tst_y $7e,~fzc
1ec7 : 08 > php ;save flags
1ec8 : c07e > cpy #$7e ;test result
> trap_ne
1eca : d0fe > bne * ;failed not equal (non zero)
>
1ecc : 68 > pla ;load status
1ecd : 48 > pha
> cmp_flag ~fzc
1ece : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1ed0 : d0fe > bne * ;failed not equal (non zero)
>
1ed2 : 28 > plp ;restore status
next_test
1ed3 : ad0002 > lda test_case ;previous test
1ed6 : c91b > cmp #test_num
> trap_ne ;test is out of sequence
1ed8 : d0fe > bne * ;failed not equal (non zero)
>
001c = >test_num = test_num + 1
1eda : a91c > lda #test_num ;*** next tests' number
1edc : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; CMP - zp / abs / #
set_a $80,0
> load_flag 0
1edf : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1ee1 : 48 > pha ;use stack to load status
1ee2 : a980 > lda #$80 ;precharge accu
1ee4 : 28 > plp
1ee5 : c517 cmp zp7f
tst_a $80,fc
1ee7 : 08 > php ;save flags
1ee8 : c980 > cmp #$80 ;test result
> trap_ne
1eea : d0fe > bne * ;failed not equal (non zero)
>
1eec : 68 > pla ;load status
1eed : 48 > pha
> cmp_flag fc
1eee : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1ef0 : d0fe > bne * ;failed not equal (non zero)
>
1ef2 : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
1ef3 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1ef5 : 48 > pha ;use stack to load status
1ef6 : a97f > lda #$7f ;precharge accu
1ef8 : 28 > plp
1ef9 : c517 cmp zp7f
tst_a $7f,fzc
1efb : 08 > php ;save flags
1efc : c97f > cmp #$7f ;test result
> trap_ne
1efe : d0fe > bne * ;failed not equal (non zero)
>
1f00 : 68 > pla ;load status
1f01 : 48 > pha
> cmp_flag fzc
1f02 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f04 : d0fe > bne * ;failed not equal (non zero)
>
1f06 : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
1f07 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1f09 : 48 > pha ;use stack to load status
1f0a : a97e > lda #$7e ;precharge accu
1f0c : 28 > plp
1f0d : c517 cmp zp7f
tst_a $7e,fn
1f0f : 08 > php ;save flags
1f10 : c97e > cmp #$7e ;test result
> trap_ne
1f12 : d0fe > bne * ;failed not equal (non zero)
>
1f14 : 68 > pla ;load status
1f15 : 48 > pha
> cmp_flag fn
1f16 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f18 : d0fe > bne * ;failed not equal (non zero)
>
1f1a : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
1f1b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1f1d : 48 > pha ;use stack to load status
1f1e : a980 > lda #$80 ;precharge accu
1f20 : 28 > plp
1f21 : c517 cmp zp7f
tst_a $80,~fnz
1f23 : 08 > php ;save flags
1f24 : c980 > cmp #$80 ;test result
> trap_ne
1f26 : d0fe > bne * ;failed not equal (non zero)
>
1f28 : 68 > pla ;load status
1f29 : 48 > pha
> cmp_flag ~fnz
1f2a : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f2c : d0fe > bne * ;failed not equal (non zero)
>
1f2e : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
1f2f : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1f31 : 48 > pha ;use stack to load status
1f32 : a97f > lda #$7f ;precharge accu
1f34 : 28 > plp
1f35 : c517 cmp zp7f
tst_a $7f,~fn
1f37 : 08 > php ;save flags
1f38 : c97f > cmp #$7f ;test result
> trap_ne
1f3a : d0fe > bne * ;failed not equal (non zero)
>
1f3c : 68 > pla ;load status
1f3d : 48 > pha
> cmp_flag ~fn
1f3e : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f40 : d0fe > bne * ;failed not equal (non zero)
>
1f42 : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
1f43 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1f45 : 48 > pha ;use stack to load status
1f46 : a97e > lda #$7e ;precharge accu
1f48 : 28 > plp
1f49 : c517 cmp zp7f
tst_a $7e,~fzc
1f4b : 08 > php ;save flags
1f4c : c97e > cmp #$7e ;test result
> trap_ne
1f4e : d0fe > bne * ;failed not equal (non zero)
>
1f50 : 68 > pla ;load status
1f51 : 48 > pha
> cmp_flag ~fzc
1f52 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f54 : d0fe > bne * ;failed not equal (non zero)
>
1f56 : 28 > plp ;restore status
set_a $80,0
> load_flag 0
1f57 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1f59 : 48 > pha ;use stack to load status
1f5a : a980 > lda #$80 ;precharge accu
1f5c : 28 > plp
1f5d : cd1b02 cmp abs7f
tst_a $80,fc
1f60 : 08 > php ;save flags
1f61 : c980 > cmp #$80 ;test result
> trap_ne
1f63 : d0fe > bne * ;failed not equal (non zero)
>
1f65 : 68 > pla ;load status
1f66 : 48 > pha
> cmp_flag fc
1f67 : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f69 : d0fe > bne * ;failed not equal (non zero)
>
1f6b : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
1f6c : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1f6e : 48 > pha ;use stack to load status
1f6f : a97f > lda #$7f ;precharge accu
1f71 : 28 > plp
1f72 : cd1b02 cmp abs7f
tst_a $7f,fzc
1f75 : 08 > php ;save flags
1f76 : c97f > cmp #$7f ;test result
> trap_ne
1f78 : d0fe > bne * ;failed not equal (non zero)
>
1f7a : 68 > pla ;load status
1f7b : 48 > pha
> cmp_flag fzc
1f7c : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f7e : d0fe > bne * ;failed not equal (non zero)
>
1f80 : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
1f81 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1f83 : 48 > pha ;use stack to load status
1f84 : a97e > lda #$7e ;precharge accu
1f86 : 28 > plp
1f87 : cd1b02 cmp abs7f
tst_a $7e,fn
1f8a : 08 > php ;save flags
1f8b : c97e > cmp #$7e ;test result
> trap_ne
1f8d : d0fe > bne * ;failed not equal (non zero)
>
1f8f : 68 > pla ;load status
1f90 : 48 > pha
> cmp_flag fn
1f91 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1f93 : d0fe > bne * ;failed not equal (non zero)
>
1f95 : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
1f96 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1f98 : 48 > pha ;use stack to load status
1f99 : a980 > lda #$80 ;precharge accu
1f9b : 28 > plp
1f9c : cd1b02 cmp abs7f
tst_a $80,~fnz
1f9f : 08 > php ;save flags
1fa0 : c980 > cmp #$80 ;test result
> trap_ne
1fa2 : d0fe > bne * ;failed not equal (non zero)
>
1fa4 : 68 > pla ;load status
1fa5 : 48 > pha
> cmp_flag ~fnz
1fa6 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1fa8 : d0fe > bne * ;failed not equal (non zero)
>
1faa : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
1fab : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1fad : 48 > pha ;use stack to load status
1fae : a97f > lda #$7f ;precharge accu
1fb0 : 28 > plp
1fb1 : cd1b02 cmp abs7f
tst_a $7f,~fn
1fb4 : 08 > php ;save flags
1fb5 : c97f > cmp #$7f ;test result
> trap_ne
1fb7 : d0fe > bne * ;failed not equal (non zero)
>
1fb9 : 68 > pla ;load status
1fba : 48 > pha
> cmp_flag ~fn
1fbb : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1fbd : d0fe > bne * ;failed not equal (non zero)
>
1fbf : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
1fc0 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
1fc2 : 48 > pha ;use stack to load status
1fc3 : a97e > lda #$7e ;precharge accu
1fc5 : 28 > plp
1fc6 : cd1b02 cmp abs7f
tst_a $7e,~fzc
1fc9 : 08 > php ;save flags
1fca : c97e > cmp #$7e ;test result
> trap_ne
1fcc : d0fe > bne * ;failed not equal (non zero)
>
1fce : 68 > pla ;load status
1fcf : 48 > pha
> cmp_flag ~fzc
1fd0 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1fd2 : d0fe > bne * ;failed not equal (non zero)
>
1fd4 : 28 > plp ;restore status
set_a $80,0
> load_flag 0
1fd5 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1fd7 : 48 > pha ;use stack to load status
1fd8 : a980 > lda #$80 ;precharge accu
1fda : 28 > plp
1fdb : c97f cmp #$7f
tst_a $80,fc
1fdd : 08 > php ;save flags
1fde : c980 > cmp #$80 ;test result
> trap_ne
1fe0 : d0fe > bne * ;failed not equal (non zero)
>
1fe2 : 68 > pla ;load status
1fe3 : 48 > pha
> cmp_flag fc
1fe4 : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1fe6 : d0fe > bne * ;failed not equal (non zero)
>
1fe8 : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
1fe9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1feb : 48 > pha ;use stack to load status
1fec : a97f > lda #$7f ;precharge accu
1fee : 28 > plp
1fef : c97f cmp #$7f
tst_a $7f,fzc
1ff1 : 08 > php ;save flags
1ff2 : c97f > cmp #$7f ;test result
> trap_ne
1ff4 : d0fe > bne * ;failed not equal (non zero)
>
1ff6 : 68 > pla ;load status
1ff7 : 48 > pha
> cmp_flag fzc
1ff8 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
1ffa : d0fe > bne * ;failed not equal (non zero)
>
1ffc : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
1ffd : a900 > lda #0 ;allow test to change I-flag (no mask)
>
1fff : 48 > pha ;use stack to load status
2000 : a97e > lda #$7e ;precharge accu
2002 : 28 > plp
2003 : c97f cmp #$7f
tst_a $7e,fn
2005 : 08 > php ;save flags
2006 : c97e > cmp #$7e ;test result
> trap_ne
2008 : d0fe > bne * ;failed not equal (non zero)
>
200a : 68 > pla ;load status
200b : 48 > pha
> cmp_flag fn
200c : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
200e : d0fe > bne * ;failed not equal (non zero)
>
2010 : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
2011 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2013 : 48 > pha ;use stack to load status
2014 : a980 > lda #$80 ;precharge accu
2016 : 28 > plp
2017 : c97f cmp #$7f
tst_a $80,~fnz
2019 : 08 > php ;save flags
201a : c980 > cmp #$80 ;test result
> trap_ne
201c : d0fe > bne * ;failed not equal (non zero)
>
201e : 68 > pla ;load status
201f : 48 > pha
> cmp_flag ~fnz
2020 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2022 : d0fe > bne * ;failed not equal (non zero)
>
2024 : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
2025 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2027 : 48 > pha ;use stack to load status
2028 : a97f > lda #$7f ;precharge accu
202a : 28 > plp
202b : c97f cmp #$7f
tst_a $7f,~fn
202d : 08 > php ;save flags
202e : c97f > cmp #$7f ;test result
> trap_ne
2030 : d0fe > bne * ;failed not equal (non zero)
>
2032 : 68 > pla ;load status
2033 : 48 > pha
> cmp_flag ~fn
2034 : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2036 : d0fe > bne * ;failed not equal (non zero)
>
2038 : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
2039 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
203b : 48 > pha ;use stack to load status
203c : a97e > lda #$7e ;precharge accu
203e : 28 > plp
203f : c97f cmp #$7f
tst_a $7e,~fzc
2041 : 08 > php ;save flags
2042 : c97e > cmp #$7e ;test result
> trap_ne
2044 : d0fe > bne * ;failed not equal (non zero)
>
2046 : 68 > pla ;load status
2047 : 48 > pha
> cmp_flag ~fzc
2048 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
204a : d0fe > bne * ;failed not equal (non zero)
>
204c : 28 > plp ;restore status
204d : a204 ldx #4 ;with indexing by X
set_a $80,0
> load_flag 0
204f : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2051 : 48 > pha ;use stack to load status
2052 : a980 > lda #$80 ;precharge accu
2054 : 28 > plp
2055 : d513 cmp zp1,x
tst_a $80,fc
2057 : 08 > php ;save flags
2058 : c980 > cmp #$80 ;test result
> trap_ne
205a : d0fe > bne * ;failed not equal (non zero)
>
205c : 68 > pla ;load status
205d : 48 > pha
> cmp_flag fc
205e : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2060 : d0fe > bne * ;failed not equal (non zero)
>
2062 : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
2063 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2065 : 48 > pha ;use stack to load status
2066 : a97f > lda #$7f ;precharge accu
2068 : 28 > plp
2069 : d513 cmp zp1,x
tst_a $7f,fzc
206b : 08 > php ;save flags
206c : c97f > cmp #$7f ;test result
> trap_ne
206e : d0fe > bne * ;failed not equal (non zero)
>
2070 : 68 > pla ;load status
2071 : 48 > pha
> cmp_flag fzc
2072 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2074 : d0fe > bne * ;failed not equal (non zero)
>
2076 : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
2077 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2079 : 48 > pha ;use stack to load status
207a : a97e > lda #$7e ;precharge accu
207c : 28 > plp
207d : d513 cmp zp1,x
tst_a $7e,fn
207f : 08 > php ;save flags
2080 : c97e > cmp #$7e ;test result
> trap_ne
2082 : d0fe > bne * ;failed not equal (non zero)
>
2084 : 68 > pla ;load status
2085 : 48 > pha
> cmp_flag fn
2086 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2088 : d0fe > bne * ;failed not equal (non zero)
>
208a : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
208b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
208d : 48 > pha ;use stack to load status
208e : a980 > lda #$80 ;precharge accu
2090 : 28 > plp
2091 : d513 cmp zp1,x
tst_a $80,~fnz
2093 : 08 > php ;save flags
2094 : c980 > cmp #$80 ;test result
> trap_ne
2096 : d0fe > bne * ;failed not equal (non zero)
>
2098 : 68 > pla ;load status
2099 : 48 > pha
> cmp_flag ~fnz
209a : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
209c : d0fe > bne * ;failed not equal (non zero)
>
209e : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
209f : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
20a1 : 48 > pha ;use stack to load status
20a2 : a97f > lda #$7f ;precharge accu
20a4 : 28 > plp
20a5 : d513 cmp zp1,x
tst_a $7f,~fn
20a7 : 08 > php ;save flags
20a8 : c97f > cmp #$7f ;test result
> trap_ne
20aa : d0fe > bne * ;failed not equal (non zero)
>
20ac : 68 > pla ;load status
20ad : 48 > pha
> cmp_flag ~fn
20ae : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
20b0 : d0fe > bne * ;failed not equal (non zero)
>
20b2 : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
20b3 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
20b5 : 48 > pha ;use stack to load status
20b6 : a97e > lda #$7e ;precharge accu
20b8 : 28 > plp
20b9 : d513 cmp zp1,x
tst_a $7e,~fzc
20bb : 08 > php ;save flags
20bc : c97e > cmp #$7e ;test result
> trap_ne
20be : d0fe > bne * ;failed not equal (non zero)
>
20c0 : 68 > pla ;load status
20c1 : 48 > pha
> cmp_flag ~fzc
20c2 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
20c4 : d0fe > bne * ;failed not equal (non zero)
>
20c6 : 28 > plp ;restore status
set_a $80,0
> load_flag 0
20c7 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
20c9 : 48 > pha ;use stack to load status
20ca : a980 > lda #$80 ;precharge accu
20cc : 28 > plp
20cd : dd1702 cmp abs1,x
tst_a $80,fc
20d0 : 08 > php ;save flags
20d1 : c980 > cmp #$80 ;test result
> trap_ne
20d3 : d0fe > bne * ;failed not equal (non zero)
>
20d5 : 68 > pla ;load status
20d6 : 48 > pha
> cmp_flag fc
20d7 : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
20d9 : d0fe > bne * ;failed not equal (non zero)
>
20db : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
20dc : a900 > lda #0 ;allow test to change I-flag (no mask)
>
20de : 48 > pha ;use stack to load status
20df : a97f > lda #$7f ;precharge accu
20e1 : 28 > plp
20e2 : dd1702 cmp abs1,x
tst_a $7f,fzc
20e5 : 08 > php ;save flags
20e6 : c97f > cmp #$7f ;test result
> trap_ne
20e8 : d0fe > bne * ;failed not equal (non zero)
>
20ea : 68 > pla ;load status
20eb : 48 > pha
> cmp_flag fzc
20ec : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
20ee : d0fe > bne * ;failed not equal (non zero)
>
20f0 : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
20f1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
20f3 : 48 > pha ;use stack to load status
20f4 : a97e > lda #$7e ;precharge accu
20f6 : 28 > plp
20f7 : dd1702 cmp abs1,x
tst_a $7e,fn
20fa : 08 > php ;save flags
20fb : c97e > cmp #$7e ;test result
> trap_ne
20fd : d0fe > bne * ;failed not equal (non zero)
>
20ff : 68 > pla ;load status
2100 : 48 > pha
> cmp_flag fn
2101 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2103 : d0fe > bne * ;failed not equal (non zero)
>
2105 : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
2106 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2108 : 48 > pha ;use stack to load status
2109 : a980 > lda #$80 ;precharge accu
210b : 28 > plp
210c : dd1702 cmp abs1,x
tst_a $80,~fnz
210f : 08 > php ;save flags
2110 : c980 > cmp #$80 ;test result
> trap_ne
2112 : d0fe > bne * ;failed not equal (non zero)
>
2114 : 68 > pla ;load status
2115 : 48 > pha
> cmp_flag ~fnz
2116 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2118 : d0fe > bne * ;failed not equal (non zero)
>
211a : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
211b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
211d : 48 > pha ;use stack to load status
211e : a97f > lda #$7f ;precharge accu
2120 : 28 > plp
2121 : dd1702 cmp abs1,x
tst_a $7f,~fn
2124 : 08 > php ;save flags
2125 : c97f > cmp #$7f ;test result
> trap_ne
2127 : d0fe > bne * ;failed not equal (non zero)
>
2129 : 68 > pla ;load status
212a : 48 > pha
> cmp_flag ~fn
212b : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
212d : d0fe > bne * ;failed not equal (non zero)
>
212f : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
2130 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2132 : 48 > pha ;use stack to load status
2133 : a97e > lda #$7e ;precharge accu
2135 : 28 > plp
2136 : dd1702 cmp abs1,x
tst_a $7e,~fzc
2139 : 08 > php ;save flags
213a : c97e > cmp #$7e ;test result
> trap_ne
213c : d0fe > bne * ;failed not equal (non zero)
>
213e : 68 > pla ;load status
213f : 48 > pha
> cmp_flag ~fzc
2140 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2142 : d0fe > bne * ;failed not equal (non zero)
>
2144 : 28 > plp ;restore status
2145 : a004 ldy #4 ;with indexing by Y
2147 : a208 ldx #8 ;with indexed indirect
set_a $80,0
> load_flag 0
2149 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
214b : 48 > pha ;use stack to load status
214c : a980 > lda #$80 ;precharge accu
214e : 28 > plp
214f : d91702 cmp abs1,y
tst_a $80,fc
2152 : 08 > php ;save flags
2153 : c980 > cmp #$80 ;test result
> trap_ne
2155 : d0fe > bne * ;failed not equal (non zero)
>
2157 : 68 > pla ;load status
2158 : 48 > pha
> cmp_flag fc
2159 : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
215b : d0fe > bne * ;failed not equal (non zero)
>
215d : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
215e : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2160 : 48 > pha ;use stack to load status
2161 : a97f > lda #$7f ;precharge accu
2163 : 28 > plp
2164 : d91702 cmp abs1,y
tst_a $7f,fzc
2167 : 08 > php ;save flags
2168 : c97f > cmp #$7f ;test result
> trap_ne
216a : d0fe > bne * ;failed not equal (non zero)
>
216c : 68 > pla ;load status
216d : 48 > pha
> cmp_flag fzc
216e : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2170 : d0fe > bne * ;failed not equal (non zero)
>
2172 : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
2173 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2175 : 48 > pha ;use stack to load status
2176 : a97e > lda #$7e ;precharge accu
2178 : 28 > plp
2179 : d91702 cmp abs1,y
tst_a $7e,fn
217c : 08 > php ;save flags
217d : c97e > cmp #$7e ;test result
> trap_ne
217f : d0fe > bne * ;failed not equal (non zero)
>
2181 : 68 > pla ;load status
2182 : 48 > pha
> cmp_flag fn
2183 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2185 : d0fe > bne * ;failed not equal (non zero)
>
2187 : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
2188 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
218a : 48 > pha ;use stack to load status
218b : a980 > lda #$80 ;precharge accu
218d : 28 > plp
218e : d91702 cmp abs1,y
tst_a $80,~fnz
2191 : 08 > php ;save flags
2192 : c980 > cmp #$80 ;test result
> trap_ne
2194 : d0fe > bne * ;failed not equal (non zero)
>
2196 : 68 > pla ;load status
2197 : 48 > pha
> cmp_flag ~fnz
2198 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
219a : d0fe > bne * ;failed not equal (non zero)
>
219c : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
219d : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
219f : 48 > pha ;use stack to load status
21a0 : a97f > lda #$7f ;precharge accu
21a2 : 28 > plp
21a3 : d91702 cmp abs1,y
tst_a $7f,~fn
21a6 : 08 > php ;save flags
21a7 : c97f > cmp #$7f ;test result
> trap_ne
21a9 : d0fe > bne * ;failed not equal (non zero)
>
21ab : 68 > pla ;load status
21ac : 48 > pha
> cmp_flag ~fn
21ad : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
21af : d0fe > bne * ;failed not equal (non zero)
>
21b1 : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
21b2 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
21b4 : 48 > pha ;use stack to load status
21b5 : a97e > lda #$7e ;precharge accu
21b7 : 28 > plp
21b8 : d91702 cmp abs1,y
tst_a $7e,~fzc
21bb : 08 > php ;save flags
21bc : c97e > cmp #$7e ;test result
> trap_ne
21be : d0fe > bne * ;failed not equal (non zero)
>
21c0 : 68 > pla ;load status
21c1 : 48 > pha
> cmp_flag ~fzc
21c2 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
21c4 : d0fe > bne * ;failed not equal (non zero)
>
21c6 : 28 > plp ;restore status
set_a $80,0
> load_flag 0
21c7 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
21c9 : 48 > pha ;use stack to load status
21ca : a980 > lda #$80 ;precharge accu
21cc : 28 > plp
21cd : c124 cmp (ind1,x)
tst_a $80,fc
21cf : 08 > php ;save flags
21d0 : c980 > cmp #$80 ;test result
> trap_ne
21d2 : d0fe > bne * ;failed not equal (non zero)
>
21d4 : 68 > pla ;load status
21d5 : 48 > pha
> cmp_flag fc
21d6 : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
21d8 : d0fe > bne * ;failed not equal (non zero)
>
21da : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
21db : a900 > lda #0 ;allow test to change I-flag (no mask)
>
21dd : 48 > pha ;use stack to load status
21de : a97f > lda #$7f ;precharge accu
21e0 : 28 > plp
21e1 : c124 cmp (ind1,x)
tst_a $7f,fzc
21e3 : 08 > php ;save flags
21e4 : c97f > cmp #$7f ;test result
> trap_ne
21e6 : d0fe > bne * ;failed not equal (non zero)
>
21e8 : 68 > pla ;load status
21e9 : 48 > pha
> cmp_flag fzc
21ea : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
21ec : d0fe > bne * ;failed not equal (non zero)
>
21ee : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
21ef : a900 > lda #0 ;allow test to change I-flag (no mask)
>
21f1 : 48 > pha ;use stack to load status
21f2 : a97e > lda #$7e ;precharge accu
21f4 : 28 > plp
21f5 : c124 cmp (ind1,x)
tst_a $7e,fn
21f7 : 08 > php ;save flags
21f8 : c97e > cmp #$7e ;test result
> trap_ne
21fa : d0fe > bne * ;failed not equal (non zero)
>
21fc : 68 > pla ;load status
21fd : 48 > pha
> cmp_flag fn
21fe : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2200 : d0fe > bne * ;failed not equal (non zero)
>
2202 : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
2203 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2205 : 48 > pha ;use stack to load status
2206 : a980 > lda #$80 ;precharge accu
2208 : 28 > plp
2209 : c124 cmp (ind1,x)
tst_a $80,~fnz
220b : 08 > php ;save flags
220c : c980 > cmp #$80 ;test result
> trap_ne
220e : d0fe > bne * ;failed not equal (non zero)
>
2210 : 68 > pla ;load status
2211 : 48 > pha
> cmp_flag ~fnz
2212 : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2214 : d0fe > bne * ;failed not equal (non zero)
>
2216 : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
2217 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2219 : 48 > pha ;use stack to load status
221a : a97f > lda #$7f ;precharge accu
221c : 28 > plp
221d : c124 cmp (ind1,x)
tst_a $7f,~fn
221f : 08 > php ;save flags
2220 : c97f > cmp #$7f ;test result
> trap_ne
2222 : d0fe > bne * ;failed not equal (non zero)
>
2224 : 68 > pla ;load status
2225 : 48 > pha
> cmp_flag ~fn
2226 : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2228 : d0fe > bne * ;failed not equal (non zero)
>
222a : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
222b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
222d : 48 > pha ;use stack to load status
222e : a97e > lda #$7e ;precharge accu
2230 : 28 > plp
2231 : c124 cmp (ind1,x)
tst_a $7e,~fzc
2233 : 08 > php ;save flags
2234 : c97e > cmp #$7e ;test result
> trap_ne
2236 : d0fe > bne * ;failed not equal (non zero)
>
2238 : 68 > pla ;load status
2239 : 48 > pha
> cmp_flag ~fzc
223a : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
223c : d0fe > bne * ;failed not equal (non zero)
>
223e : 28 > plp ;restore status
set_a $80,0
> load_flag 0
223f : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2241 : 48 > pha ;use stack to load status
2242 : a980 > lda #$80 ;precharge accu
2244 : 28 > plp
2245 : d124 cmp (ind1),y
tst_a $80,fc
2247 : 08 > php ;save flags
2248 : c980 > cmp #$80 ;test result
> trap_ne
224a : d0fe > bne * ;failed not equal (non zero)
>
224c : 68 > pla ;load status
224d : 48 > pha
> cmp_flag fc
224e : c931 > cmp #(fc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2250 : d0fe > bne * ;failed not equal (non zero)
>
2252 : 28 > plp ;restore status
set_a $7f,0
> load_flag 0
2253 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2255 : 48 > pha ;use stack to load status
2256 : a97f > lda #$7f ;precharge accu
2258 : 28 > plp
2259 : d124 cmp (ind1),y
tst_a $7f,fzc
225b : 08 > php ;save flags
225c : c97f > cmp #$7f ;test result
> trap_ne
225e : d0fe > bne * ;failed not equal (non zero)
>
2260 : 68 > pla ;load status
2261 : 48 > pha
> cmp_flag fzc
2262 : c933 > cmp #(fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2264 : d0fe > bne * ;failed not equal (non zero)
>
2266 : 28 > plp ;restore status
set_a $7e,0
> load_flag 0
2267 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2269 : 48 > pha ;use stack to load status
226a : a97e > lda #$7e ;precharge accu
226c : 28 > plp
226d : d124 cmp (ind1),y
tst_a $7e,fn
226f : 08 > php ;save flags
2270 : c97e > cmp #$7e ;test result
> trap_ne
2272 : d0fe > bne * ;failed not equal (non zero)
>
2274 : 68 > pla ;load status
2275 : 48 > pha
> cmp_flag fn
2276 : c9b0 > cmp #(fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
2278 : d0fe > bne * ;failed not equal (non zero)
>
227a : 28 > plp ;restore status
set_a $80,$ff
> load_flag $ff
227b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
227d : 48 > pha ;use stack to load status
227e : a980 > lda #$80 ;precharge accu
2280 : 28 > plp
2281 : d124 cmp (ind1),y
tst_a $80,~fnz
2283 : 08 > php ;save flags
2284 : c980 > cmp #$80 ;test result
> trap_ne
2286 : d0fe > bne * ;failed not equal (non zero)
>
2288 : 68 > pla ;load status
2289 : 48 > pha
> cmp_flag ~fnz
228a : c97d > cmp #(~fnz|fao)&m8 ;expected flags + always on bits
>
> trap_ne
228c : d0fe > bne * ;failed not equal (non zero)
>
228e : 28 > plp ;restore status
set_a $7f,$ff
> load_flag $ff
228f : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2291 : 48 > pha ;use stack to load status
2292 : a97f > lda #$7f ;precharge accu
2294 : 28 > plp
2295 : d124 cmp (ind1),y
tst_a $7f,~fn
2297 : 08 > php ;save flags
2298 : c97f > cmp #$7f ;test result
> trap_ne
229a : d0fe > bne * ;failed not equal (non zero)
>
229c : 68 > pla ;load status
229d : 48 > pha
> cmp_flag ~fn
229e : c97f > cmp #(~fn|fao)&m8 ;expected flags + always on bits
>
> trap_ne
22a0 : d0fe > bne * ;failed not equal (non zero)
>
22a2 : 28 > plp ;restore status
set_a $7e,$ff
> load_flag $ff
22a3 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
22a5 : 48 > pha ;use stack to load status
22a6 : a97e > lda #$7e ;precharge accu
22a8 : 28 > plp
22a9 : d124 cmp (ind1),y
tst_a $7e,~fzc
22ab : 08 > php ;save flags
22ac : c97e > cmp #$7e ;test result
> trap_ne
22ae : d0fe > bne * ;failed not equal (non zero)
>
22b0 : 68 > pla ;load status
22b1 : 48 > pha
> cmp_flag ~fzc
22b2 : c9fc > cmp #(~fzc|fao)&m8 ;expected flags + always on bits
>
> trap_ne
22b4 : d0fe > bne * ;failed not equal (non zero)
>
22b6 : 28 > plp ;restore status
next_test
22b7 : ad0002 > lda test_case ;previous test
22ba : c91c > cmp #test_num
> trap_ne ;test is out of sequence
22bc : d0fe > bne * ;failed not equal (non zero)
>
001d = >test_num = test_num + 1
22be : a91d > lda #test_num ;*** next tests' number
22c0 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; testing shifts - ASL LSR ROL ROR all addressing modes
; shifts - accumulator
22c3 : a203 ldx #3
22c5 : tasl
set_ax zp1,0
> load_flag 0
22c5 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
22c7 : 48 > pha ;use stack to load status
22c8 : b513 > lda zp1,x ;precharge accu
22ca : 28 > plp
22cb : 0a asl a
tst_ax rASL,fASL,0
22cc : 08 > php ;save flags
22cd : dd2002 > cmp rASL,x ;test result
> trap_ne
22d0 : d0fe > bne * ;failed not equal (non zero)
>
22d2 : 68 > pla ;load status
> eor_flag 0
22d3 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
22d5 : dd3002 > cmp fASL,x ;test flags
> trap_ne ;
22d8 : d0fe > bne * ;failed not equal (non zero)
>
22da : ca dex
22db : 10e8 bpl tasl
22dd : a203 ldx #3
22df : tasl1
set_ax zp1,$ff
> load_flag $ff
22df : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
22e1 : 48 > pha ;use stack to load status
22e2 : b513 > lda zp1,x ;precharge accu
22e4 : 28 > plp
22e5 : 0a asl a
tst_ax rASL,fASL,$ff-fnzc
22e6 : 08 > php ;save flags
22e7 : dd2002 > cmp rASL,x ;test result
> trap_ne
22ea : d0fe > bne * ;failed not equal (non zero)
>
22ec : 68 > pla ;load status
> eor_flag $ff-fnzc
22ed : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
22ef : dd3002 > cmp fASL,x ;test flags
> trap_ne ;
22f2 : d0fe > bne * ;failed not equal (non zero)
>
22f4 : ca dex
22f5 : 10e8 bpl tasl1
22f7 : a203 ldx #3
22f9 : tlsr
set_ax zp1,0
> load_flag 0
22f9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
22fb : 48 > pha ;use stack to load status
22fc : b513 > lda zp1,x ;precharge accu
22fe : 28 > plp
22ff : 4a lsr a
tst_ax rLSR,fLSR,0
2300 : 08 > php ;save flags
2301 : dd2802 > cmp rLSR,x ;test result
> trap_ne
2304 : d0fe > bne * ;failed not equal (non zero)
>
2306 : 68 > pla ;load status
> eor_flag 0
2307 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2309 : dd3802 > cmp fLSR,x ;test flags
> trap_ne ;
230c : d0fe > bne * ;failed not equal (non zero)
>
230e : ca dex
230f : 10e8 bpl tlsr
2311 : a203 ldx #3
2313 : tlsr1
set_ax zp1,$ff
> load_flag $ff
2313 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2315 : 48 > pha ;use stack to load status
2316 : b513 > lda zp1,x ;precharge accu
2318 : 28 > plp
2319 : 4a lsr a
tst_ax rLSR,fLSR,$ff-fnzc
231a : 08 > php ;save flags
231b : dd2802 > cmp rLSR,x ;test result
> trap_ne
231e : d0fe > bne * ;failed not equal (non zero)
>
2320 : 68 > pla ;load status
> eor_flag $ff-fnzc
2321 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2323 : dd3802 > cmp fLSR,x ;test flags
> trap_ne ;
2326 : d0fe > bne * ;failed not equal (non zero)
>
2328 : ca dex
2329 : 10e8 bpl tlsr1
232b : a203 ldx #3
232d : trol
set_ax zp1,0
> load_flag 0
232d : a900 > lda #0 ;allow test to change I-flag (no mask)
>
232f : 48 > pha ;use stack to load status
2330 : b513 > lda zp1,x ;precharge accu
2332 : 28 > plp
2333 : 2a rol a
tst_ax rROL,fROL,0
2334 : 08 > php ;save flags
2335 : dd2002 > cmp rROL,x ;test result
> trap_ne
2338 : d0fe > bne * ;failed not equal (non zero)
>
233a : 68 > pla ;load status
> eor_flag 0
233b : 4930 > eor #0|fao ;invert expected flags + always on bits
>
233d : dd3002 > cmp fROL,x ;test flags
> trap_ne ;
2340 : d0fe > bne * ;failed not equal (non zero)
>
2342 : ca dex
2343 : 10e8 bpl trol
2345 : a203 ldx #3
2347 : trol1
set_ax zp1,$ff-fc
> load_flag $ff-fc
2347 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
2349 : 48 > pha ;use stack to load status
234a : b513 > lda zp1,x ;precharge accu
234c : 28 > plp
234d : 2a rol a
tst_ax rROL,fROL,$ff-fnzc
234e : 08 > php ;save flags
234f : dd2002 > cmp rROL,x ;test result
> trap_ne
2352 : d0fe > bne * ;failed not equal (non zero)
>
2354 : 68 > pla ;load status
> eor_flag $ff-fnzc
2355 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2357 : dd3002 > cmp fROL,x ;test flags
> trap_ne ;
235a : d0fe > bne * ;failed not equal (non zero)
>
235c : ca dex
235d : 10e8 bpl trol1
235f : a203 ldx #3
2361 : trolc
set_ax zp1,fc
> load_flag fc
2361 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
2363 : 48 > pha ;use stack to load status
2364 : b513 > lda zp1,x ;precharge accu
2366 : 28 > plp
2367 : 2a rol a
tst_ax rROLc,fROLc,0
2368 : 08 > php ;save flags
2369 : dd2402 > cmp rROLc,x ;test result
> trap_ne
236c : d0fe > bne * ;failed not equal (non zero)
>
236e : 68 > pla ;load status
> eor_flag 0
236f : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2371 : dd3402 > cmp fROLc,x ;test flags
> trap_ne ;
2374 : d0fe > bne * ;failed not equal (non zero)
>
2376 : ca dex
2377 : 10e8 bpl trolc
2379 : a203 ldx #3
237b : trolc1
set_ax zp1,$ff
> load_flag $ff
237b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
237d : 48 > pha ;use stack to load status
237e : b513 > lda zp1,x ;precharge accu
2380 : 28 > plp
2381 : 2a rol a
tst_ax rROLc,fROLc,$ff-fnzc
2382 : 08 > php ;save flags
2383 : dd2402 > cmp rROLc,x ;test result
> trap_ne
2386 : d0fe > bne * ;failed not equal (non zero)
>
2388 : 68 > pla ;load status
> eor_flag $ff-fnzc
2389 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
238b : dd3402 > cmp fROLc,x ;test flags
> trap_ne ;
238e : d0fe > bne * ;failed not equal (non zero)
>
2390 : ca dex
2391 : 10e8 bpl trolc1
2393 : a203 ldx #3
2395 : tror
set_ax zp1,0
> load_flag 0
2395 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2397 : 48 > pha ;use stack to load status
2398 : b513 > lda zp1,x ;precharge accu
239a : 28 > plp
239b : 6a ror a
tst_ax rROR,fROR,0
239c : 08 > php ;save flags
239d : dd2802 > cmp rROR,x ;test result
> trap_ne
23a0 : d0fe > bne * ;failed not equal (non zero)
>
23a2 : 68 > pla ;load status
> eor_flag 0
23a3 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
23a5 : dd3802 > cmp fROR,x ;test flags
> trap_ne ;
23a8 : d0fe > bne * ;failed not equal (non zero)
>
23aa : ca dex
23ab : 10e8 bpl tror
23ad : a203 ldx #3
23af : tror1
set_ax zp1,$ff-fc
> load_flag $ff-fc
23af : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
23b1 : 48 > pha ;use stack to load status
23b2 : b513 > lda zp1,x ;precharge accu
23b4 : 28 > plp
23b5 : 6a ror a
tst_ax rROR,fROR,$ff-fnzc
23b6 : 08 > php ;save flags
23b7 : dd2802 > cmp rROR,x ;test result
> trap_ne
23ba : d0fe > bne * ;failed not equal (non zero)
>
23bc : 68 > pla ;load status
> eor_flag $ff-fnzc
23bd : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
23bf : dd3802 > cmp fROR,x ;test flags
> trap_ne ;
23c2 : d0fe > bne * ;failed not equal (non zero)
>
23c4 : ca dex
23c5 : 10e8 bpl tror1
23c7 : a203 ldx #3
23c9 : trorc
set_ax zp1,fc
> load_flag fc
23c9 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
23cb : 48 > pha ;use stack to load status
23cc : b513 > lda zp1,x ;precharge accu
23ce : 28 > plp
23cf : 6a ror a
tst_ax rRORc,fRORc,0
23d0 : 08 > php ;save flags
23d1 : dd2c02 > cmp rRORc,x ;test result
> trap_ne
23d4 : d0fe > bne * ;failed not equal (non zero)
>
23d6 : 68 > pla ;load status
> eor_flag 0
23d7 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
23d9 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne ;
23dc : d0fe > bne * ;failed not equal (non zero)
>
23de : ca dex
23df : 10e8 bpl trorc
23e1 : a203 ldx #3
23e3 : trorc1
set_ax zp1,$ff
> load_flag $ff
23e3 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
23e5 : 48 > pha ;use stack to load status
23e6 : b513 > lda zp1,x ;precharge accu
23e8 : 28 > plp
23e9 : 6a ror a
tst_ax rRORc,fRORc,$ff-fnzc
23ea : 08 > php ;save flags
23eb : dd2c02 > cmp rRORc,x ;test result
> trap_ne
23ee : d0fe > bne * ;failed not equal (non zero)
>
23f0 : 68 > pla ;load status
> eor_flag $ff-fnzc
23f1 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
23f3 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne ;
23f6 : d0fe > bne * ;failed not equal (non zero)
>
23f8 : ca dex
23f9 : 10e8 bpl trorc1
next_test
23fb : ad0002 > lda test_case ;previous test
23fe : c91d > cmp #test_num
> trap_ne ;test is out of sequence
2400 : d0fe > bne * ;failed not equal (non zero)
>
001e = >test_num = test_num + 1
2402 : a91e > lda #test_num ;*** next tests' number
2404 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; shifts - zeropage
2407 : a203 ldx #3
2409 : tasl2
set_z zp1,0
> load_flag 0
2409 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
240b : 48 > pha ;use stack to load status
240c : b513 > lda zp1,x ;load to zeropage
240e : 850c > sta zpt
2410 : 28 > plp
2411 : 060c asl zpt
tst_z rASL,fASL,0
2413 : 08 > php ;save flags
2414 : a50c > lda zpt
2416 : dd2002 > cmp rASL,x ;test result
> trap_ne
2419 : d0fe > bne * ;failed not equal (non zero)
>
241b : 68 > pla ;load status
> eor_flag 0
241c : 4930 > eor #0|fao ;invert expected flags + always on bits
>
241e : dd3002 > cmp fASL,x ;test flags
> trap_ne
2421 : d0fe > bne * ;failed not equal (non zero)
>
2423 : ca dex
2424 : 10e3 bpl tasl2
2426 : a203 ldx #3
2428 : tasl3
set_z zp1,$ff
> load_flag $ff
2428 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
242a : 48 > pha ;use stack to load status
242b : b513 > lda zp1,x ;load to zeropage
242d : 850c > sta zpt
242f : 28 > plp
2430 : 060c asl zpt
tst_z rASL,fASL,$ff-fnzc
2432 : 08 > php ;save flags
2433 : a50c > lda zpt
2435 : dd2002 > cmp rASL,x ;test result
> trap_ne
2438 : d0fe > bne * ;failed not equal (non zero)
>
243a : 68 > pla ;load status
> eor_flag $ff-fnzc
243b : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
243d : dd3002 > cmp fASL,x ;test flags
> trap_ne
2440 : d0fe > bne * ;failed not equal (non zero)
>
2442 : ca dex
2443 : 10e3 bpl tasl3
2445 : a203 ldx #3
2447 : tlsr2
set_z zp1,0
> load_flag 0
2447 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2449 : 48 > pha ;use stack to load status
244a : b513 > lda zp1,x ;load to zeropage
244c : 850c > sta zpt
244e : 28 > plp
244f : 460c lsr zpt
tst_z rLSR,fLSR,0
2451 : 08 > php ;save flags
2452 : a50c > lda zpt
2454 : dd2802 > cmp rLSR,x ;test result
> trap_ne
2457 : d0fe > bne * ;failed not equal (non zero)
>
2459 : 68 > pla ;load status
> eor_flag 0
245a : 4930 > eor #0|fao ;invert expected flags + always on bits
>
245c : dd3802 > cmp fLSR,x ;test flags
> trap_ne
245f : d0fe > bne * ;failed not equal (non zero)
>
2461 : ca dex
2462 : 10e3 bpl tlsr2
2464 : a203 ldx #3
2466 : tlsr3
set_z zp1,$ff
> load_flag $ff
2466 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2468 : 48 > pha ;use stack to load status
2469 : b513 > lda zp1,x ;load to zeropage
246b : 850c > sta zpt
246d : 28 > plp
246e : 460c lsr zpt
tst_z rLSR,fLSR,$ff-fnzc
2470 : 08 > php ;save flags
2471 : a50c > lda zpt
2473 : dd2802 > cmp rLSR,x ;test result
> trap_ne
2476 : d0fe > bne * ;failed not equal (non zero)
>
2478 : 68 > pla ;load status
> eor_flag $ff-fnzc
2479 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
247b : dd3802 > cmp fLSR,x ;test flags
> trap_ne
247e : d0fe > bne * ;failed not equal (non zero)
>
2480 : ca dex
2481 : 10e3 bpl tlsr3
2483 : a203 ldx #3
2485 : trol2
set_z zp1,0
> load_flag 0
2485 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2487 : 48 > pha ;use stack to load status
2488 : b513 > lda zp1,x ;load to zeropage
248a : 850c > sta zpt
248c : 28 > plp
248d : 260c rol zpt
tst_z rROL,fROL,0
248f : 08 > php ;save flags
2490 : a50c > lda zpt
2492 : dd2002 > cmp rROL,x ;test result
> trap_ne
2495 : d0fe > bne * ;failed not equal (non zero)
>
2497 : 68 > pla ;load status
> eor_flag 0
2498 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
249a : dd3002 > cmp fROL,x ;test flags
> trap_ne
249d : d0fe > bne * ;failed not equal (non zero)
>
249f : ca dex
24a0 : 10e3 bpl trol2
24a2 : a203 ldx #3
24a4 : trol3
set_z zp1,$ff-fc
> load_flag $ff-fc
24a4 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
24a6 : 48 > pha ;use stack to load status
24a7 : b513 > lda zp1,x ;load to zeropage
24a9 : 850c > sta zpt
24ab : 28 > plp
24ac : 260c rol zpt
tst_z rROL,fROL,$ff-fnzc
24ae : 08 > php ;save flags
24af : a50c > lda zpt
24b1 : dd2002 > cmp rROL,x ;test result
> trap_ne
24b4 : d0fe > bne * ;failed not equal (non zero)
>
24b6 : 68 > pla ;load status
> eor_flag $ff-fnzc
24b7 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
24b9 : dd3002 > cmp fROL,x ;test flags
> trap_ne
24bc : d0fe > bne * ;failed not equal (non zero)
>
24be : ca dex
24bf : 10e3 bpl trol3
24c1 : a203 ldx #3
24c3 : trolc2
set_z zp1,fc
> load_flag fc
24c3 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
24c5 : 48 > pha ;use stack to load status
24c6 : b513 > lda zp1,x ;load to zeropage
24c8 : 850c > sta zpt
24ca : 28 > plp
24cb : 260c rol zpt
tst_z rROLc,fROLc,0
24cd : 08 > php ;save flags
24ce : a50c > lda zpt
24d0 : dd2402 > cmp rROLc,x ;test result
> trap_ne
24d3 : d0fe > bne * ;failed not equal (non zero)
>
24d5 : 68 > pla ;load status
> eor_flag 0
24d6 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
24d8 : dd3402 > cmp fROLc,x ;test flags
> trap_ne
24db : d0fe > bne * ;failed not equal (non zero)
>
24dd : ca dex
24de : 10e3 bpl trolc2
24e0 : a203 ldx #3
24e2 : trolc3
set_z zp1,$ff
> load_flag $ff
24e2 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
24e4 : 48 > pha ;use stack to load status
24e5 : b513 > lda zp1,x ;load to zeropage
24e7 : 850c > sta zpt
24e9 : 28 > plp
24ea : 260c rol zpt
tst_z rROLc,fROLc,$ff-fnzc
24ec : 08 > php ;save flags
24ed : a50c > lda zpt
24ef : dd2402 > cmp rROLc,x ;test result
> trap_ne
24f2 : d0fe > bne * ;failed not equal (non zero)
>
24f4 : 68 > pla ;load status
> eor_flag $ff-fnzc
24f5 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
24f7 : dd3402 > cmp fROLc,x ;test flags
> trap_ne
24fa : d0fe > bne * ;failed not equal (non zero)
>
24fc : ca dex
24fd : 10e3 bpl trolc3
24ff : a203 ldx #3
2501 : tror2
set_z zp1,0
> load_flag 0
2501 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2503 : 48 > pha ;use stack to load status
2504 : b513 > lda zp1,x ;load to zeropage
2506 : 850c > sta zpt
2508 : 28 > plp
2509 : 660c ror zpt
tst_z rROR,fROR,0
250b : 08 > php ;save flags
250c : a50c > lda zpt
250e : dd2802 > cmp rROR,x ;test result
> trap_ne
2511 : d0fe > bne * ;failed not equal (non zero)
>
2513 : 68 > pla ;load status
> eor_flag 0
2514 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2516 : dd3802 > cmp fROR,x ;test flags
> trap_ne
2519 : d0fe > bne * ;failed not equal (non zero)
>
251b : ca dex
251c : 10e3 bpl tror2
251e : a203 ldx #3
2520 : tror3
set_z zp1,$ff-fc
> load_flag $ff-fc
2520 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
2522 : 48 > pha ;use stack to load status
2523 : b513 > lda zp1,x ;load to zeropage
2525 : 850c > sta zpt
2527 : 28 > plp
2528 : 660c ror zpt
tst_z rROR,fROR,$ff-fnzc
252a : 08 > php ;save flags
252b : a50c > lda zpt
252d : dd2802 > cmp rROR,x ;test result
> trap_ne
2530 : d0fe > bne * ;failed not equal (non zero)
>
2532 : 68 > pla ;load status
> eor_flag $ff-fnzc
2533 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2535 : dd3802 > cmp fROR,x ;test flags
> trap_ne
2538 : d0fe > bne * ;failed not equal (non zero)
>
253a : ca dex
253b : 10e3 bpl tror3
253d : a203 ldx #3
253f : trorc2
set_z zp1,fc
> load_flag fc
253f : a901 > lda #fc ;allow test to change I-flag (no mask)
>
2541 : 48 > pha ;use stack to load status
2542 : b513 > lda zp1,x ;load to zeropage
2544 : 850c > sta zpt
2546 : 28 > plp
2547 : 660c ror zpt
tst_z rRORc,fRORc,0
2549 : 08 > php ;save flags
254a : a50c > lda zpt
254c : dd2c02 > cmp rRORc,x ;test result
> trap_ne
254f : d0fe > bne * ;failed not equal (non zero)
>
2551 : 68 > pla ;load status
> eor_flag 0
2552 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2554 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
2557 : d0fe > bne * ;failed not equal (non zero)
>
2559 : ca dex
255a : 10e3 bpl trorc2
255c : a203 ldx #3
255e : trorc3
set_z zp1,$ff
> load_flag $ff
255e : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2560 : 48 > pha ;use stack to load status
2561 : b513 > lda zp1,x ;load to zeropage
2563 : 850c > sta zpt
2565 : 28 > plp
2566 : 660c ror zpt
tst_z rRORc,fRORc,$ff-fnzc
2568 : 08 > php ;save flags
2569 : a50c > lda zpt
256b : dd2c02 > cmp rRORc,x ;test result
> trap_ne
256e : d0fe > bne * ;failed not equal (non zero)
>
2570 : 68 > pla ;load status
> eor_flag $ff-fnzc
2571 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2573 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
2576 : d0fe > bne * ;failed not equal (non zero)
>
2578 : ca dex
2579 : 10e3 bpl trorc3
next_test
257b : ad0002 > lda test_case ;previous test
257e : c91e > cmp #test_num
> trap_ne ;test is out of sequence
2580 : d0fe > bne * ;failed not equal (non zero)
>
001f = >test_num = test_num + 1
2582 : a91f > lda #test_num ;*** next tests' number
2584 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; shifts - absolute
2587 : a203 ldx #3
2589 : tasl4
set_abs zp1,0
> load_flag 0
2589 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
258b : 48 > pha ;use stack to load status
258c : b513 > lda zp1,x ;load to memory
258e : 8d0302 > sta abst
2591 : 28 > plp
2592 : 0e0302 asl abst
tst_abs rASL,fASL,0
2595 : 08 > php ;save flags
2596 : ad0302 > lda abst
2599 : dd2002 > cmp rASL,x ;test result
> trap_ne
259c : d0fe > bne * ;failed not equal (non zero)
>
259e : 68 > pla ;load status
> eor_flag 0
259f : 4930 > eor #0|fao ;invert expected flags + always on bits
>
25a1 : dd3002 > cmp fASL,x ;test flags
> trap_ne
25a4 : d0fe > bne * ;failed not equal (non zero)
>
25a6 : ca dex
25a7 : 10e0 bpl tasl4
25a9 : a203 ldx #3
25ab : tasl5
set_abs zp1,$ff
> load_flag $ff
25ab : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
25ad : 48 > pha ;use stack to load status
25ae : b513 > lda zp1,x ;load to memory
25b0 : 8d0302 > sta abst
25b3 : 28 > plp
25b4 : 0e0302 asl abst
tst_abs rASL,fASL,$ff-fnzc
25b7 : 08 > php ;save flags
25b8 : ad0302 > lda abst
25bb : dd2002 > cmp rASL,x ;test result
> trap_ne
25be : d0fe > bne * ;failed not equal (non zero)
>
25c0 : 68 > pla ;load status
> eor_flag $ff-fnzc
25c1 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
25c3 : dd3002 > cmp fASL,x ;test flags
> trap_ne
25c6 : d0fe > bne * ;failed not equal (non zero)
>
25c8 : ca dex
25c9 : 10e0 bpl tasl5
25cb : a203 ldx #3
25cd : tlsr4
set_abs zp1,0
> load_flag 0
25cd : a900 > lda #0 ;allow test to change I-flag (no mask)
>
25cf : 48 > pha ;use stack to load status
25d0 : b513 > lda zp1,x ;load to memory
25d2 : 8d0302 > sta abst
25d5 : 28 > plp
25d6 : 4e0302 lsr abst
tst_abs rLSR,fLSR,0
25d9 : 08 > php ;save flags
25da : ad0302 > lda abst
25dd : dd2802 > cmp rLSR,x ;test result
> trap_ne
25e0 : d0fe > bne * ;failed not equal (non zero)
>
25e2 : 68 > pla ;load status
> eor_flag 0
25e3 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
25e5 : dd3802 > cmp fLSR,x ;test flags
> trap_ne
25e8 : d0fe > bne * ;failed not equal (non zero)
>
25ea : ca dex
25eb : 10e0 bpl tlsr4
25ed : a203 ldx #3
25ef : tlsr5
set_abs zp1,$ff
> load_flag $ff
25ef : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
25f1 : 48 > pha ;use stack to load status
25f2 : b513 > lda zp1,x ;load to memory
25f4 : 8d0302 > sta abst
25f7 : 28 > plp
25f8 : 4e0302 lsr abst
tst_abs rLSR,fLSR,$ff-fnzc
25fb : 08 > php ;save flags
25fc : ad0302 > lda abst
25ff : dd2802 > cmp rLSR,x ;test result
> trap_ne
2602 : d0fe > bne * ;failed not equal (non zero)
>
2604 : 68 > pla ;load status
> eor_flag $ff-fnzc
2605 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2607 : dd3802 > cmp fLSR,x ;test flags
> trap_ne
260a : d0fe > bne * ;failed not equal (non zero)
>
260c : ca dex
260d : 10e0 bpl tlsr5
260f : a203 ldx #3
2611 : trol4
set_abs zp1,0
> load_flag 0
2611 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2613 : 48 > pha ;use stack to load status
2614 : b513 > lda zp1,x ;load to memory
2616 : 8d0302 > sta abst
2619 : 28 > plp
261a : 2e0302 rol abst
tst_abs rROL,fROL,0
261d : 08 > php ;save flags
261e : ad0302 > lda abst
2621 : dd2002 > cmp rROL,x ;test result
> trap_ne
2624 : d0fe > bne * ;failed not equal (non zero)
>
2626 : 68 > pla ;load status
> eor_flag 0
2627 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2629 : dd3002 > cmp fROL,x ;test flags
> trap_ne
262c : d0fe > bne * ;failed not equal (non zero)
>
262e : ca dex
262f : 10e0 bpl trol4
2631 : a203 ldx #3
2633 : trol5
set_abs zp1,$ff-fc
> load_flag $ff-fc
2633 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
2635 : 48 > pha ;use stack to load status
2636 : b513 > lda zp1,x ;load to memory
2638 : 8d0302 > sta abst
263b : 28 > plp
263c : 2e0302 rol abst
tst_abs rROL,fROL,$ff-fnzc
263f : 08 > php ;save flags
2640 : ad0302 > lda abst
2643 : dd2002 > cmp rROL,x ;test result
> trap_ne
2646 : d0fe > bne * ;failed not equal (non zero)
>
2648 : 68 > pla ;load status
> eor_flag $ff-fnzc
2649 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
264b : dd3002 > cmp fROL,x ;test flags
> trap_ne
264e : d0fe > bne * ;failed not equal (non zero)
>
2650 : ca dex
2651 : 10e0 bpl trol5
2653 : a203 ldx #3
2655 : trolc4
set_abs zp1,fc
> load_flag fc
2655 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
2657 : 48 > pha ;use stack to load status
2658 : b513 > lda zp1,x ;load to memory
265a : 8d0302 > sta abst
265d : 28 > plp
265e : 2e0302 rol abst
tst_abs rROLc,fROLc,0
2661 : 08 > php ;save flags
2662 : ad0302 > lda abst
2665 : dd2402 > cmp rROLc,x ;test result
> trap_ne
2668 : d0fe > bne * ;failed not equal (non zero)
>
266a : 68 > pla ;load status
> eor_flag 0
266b : 4930 > eor #0|fao ;invert expected flags + always on bits
>
266d : dd3402 > cmp fROLc,x ;test flags
> trap_ne
2670 : d0fe > bne * ;failed not equal (non zero)
>
2672 : ca dex
2673 : 10e0 bpl trolc4
2675 : a203 ldx #3
2677 : trolc5
set_abs zp1,$ff
> load_flag $ff
2677 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2679 : 48 > pha ;use stack to load status
267a : b513 > lda zp1,x ;load to memory
267c : 8d0302 > sta abst
267f : 28 > plp
2680 : 2e0302 rol abst
tst_abs rROLc,fROLc,$ff-fnzc
2683 : 08 > php ;save flags
2684 : ad0302 > lda abst
2687 : dd2402 > cmp rROLc,x ;test result
> trap_ne
268a : d0fe > bne * ;failed not equal (non zero)
>
268c : 68 > pla ;load status
> eor_flag $ff-fnzc
268d : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
268f : dd3402 > cmp fROLc,x ;test flags
> trap_ne
2692 : d0fe > bne * ;failed not equal (non zero)
>
2694 : ca dex
2695 : 10e0 bpl trolc5
2697 : a203 ldx #3
2699 : tror4
set_abs zp1,0
> load_flag 0
2699 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
269b : 48 > pha ;use stack to load status
269c : b513 > lda zp1,x ;load to memory
269e : 8d0302 > sta abst
26a1 : 28 > plp
26a2 : 6e0302 ror abst
tst_abs rROR,fROR,0
26a5 : 08 > php ;save flags
26a6 : ad0302 > lda abst
26a9 : dd2802 > cmp rROR,x ;test result
> trap_ne
26ac : d0fe > bne * ;failed not equal (non zero)
>
26ae : 68 > pla ;load status
> eor_flag 0
26af : 4930 > eor #0|fao ;invert expected flags + always on bits
>
26b1 : dd3802 > cmp fROR,x ;test flags
> trap_ne
26b4 : d0fe > bne * ;failed not equal (non zero)
>
26b6 : ca dex
26b7 : 10e0 bpl tror4
26b9 : a203 ldx #3
26bb : tror5
set_abs zp1,$ff-fc
> load_flag $ff-fc
26bb : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
26bd : 48 > pha ;use stack to load status
26be : b513 > lda zp1,x ;load to memory
26c0 : 8d0302 > sta abst
26c3 : 28 > plp
26c4 : 6e0302 ror abst
tst_abs rROR,fROR,$ff-fnzc
26c7 : 08 > php ;save flags
26c8 : ad0302 > lda abst
26cb : dd2802 > cmp rROR,x ;test result
> trap_ne
26ce : d0fe > bne * ;failed not equal (non zero)
>
26d0 : 68 > pla ;load status
> eor_flag $ff-fnzc
26d1 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
26d3 : dd3802 > cmp fROR,x ;test flags
> trap_ne
26d6 : d0fe > bne * ;failed not equal (non zero)
>
26d8 : ca dex
26d9 : 10e0 bpl tror5
26db : a203 ldx #3
26dd : trorc4
set_abs zp1,fc
> load_flag fc
26dd : a901 > lda #fc ;allow test to change I-flag (no mask)
>
26df : 48 > pha ;use stack to load status
26e0 : b513 > lda zp1,x ;load to memory
26e2 : 8d0302 > sta abst
26e5 : 28 > plp
26e6 : 6e0302 ror abst
tst_abs rRORc,fRORc,0
26e9 : 08 > php ;save flags
26ea : ad0302 > lda abst
26ed : dd2c02 > cmp rRORc,x ;test result
> trap_ne
26f0 : d0fe > bne * ;failed not equal (non zero)
>
26f2 : 68 > pla ;load status
> eor_flag 0
26f3 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
26f5 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
26f8 : d0fe > bne * ;failed not equal (non zero)
>
26fa : ca dex
26fb : 10e0 bpl trorc4
26fd : a203 ldx #3
26ff : trorc5
set_abs zp1,$ff
> load_flag $ff
26ff : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2701 : 48 > pha ;use stack to load status
2702 : b513 > lda zp1,x ;load to memory
2704 : 8d0302 > sta abst
2707 : 28 > plp
2708 : 6e0302 ror abst
tst_abs rRORc,fRORc,$ff-fnzc
270b : 08 > php ;save flags
270c : ad0302 > lda abst
270f : dd2c02 > cmp rRORc,x ;test result
> trap_ne
2712 : d0fe > bne * ;failed not equal (non zero)
>
2714 : 68 > pla ;load status
> eor_flag $ff-fnzc
2715 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2717 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
271a : d0fe > bne * ;failed not equal (non zero)
>
271c : ca dex
271d : 10e0 bpl trorc5
next_test
271f : ad0002 > lda test_case ;previous test
2722 : c91f > cmp #test_num
> trap_ne ;test is out of sequence
2724 : d0fe > bne * ;failed not equal (non zero)
>
0020 = >test_num = test_num + 1
2726 : a920 > lda #test_num ;*** next tests' number
2728 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; shifts - zp indexed
272b : a203 ldx #3
272d : tasl6
set_zx zp1,0
> load_flag 0
272d : a900 > lda #0 ;allow test to change I-flag (no mask)
>
272f : 48 > pha ;use stack to load status
2730 : b513 > lda zp1,x ;load to indexed zeropage
2732 : 950c > sta zpt,x
2734 : 28 > plp
2735 : 160c asl zpt,x
tst_zx rASL,fASL,0
2737 : 08 > php ;save flags
2738 : b50c > lda zpt,x
273a : dd2002 > cmp rASL,x ;test result
> trap_ne
273d : d0fe > bne * ;failed not equal (non zero)
>
273f : 68 > pla ;load status
> eor_flag 0
2740 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2742 : dd3002 > cmp fASL,x ;test flags
> trap_ne
2745 : d0fe > bne * ;failed not equal (non zero)
>
2747 : ca dex
2748 : 10e3 bpl tasl6
274a : a203 ldx #3
274c : tasl7
set_zx zp1,$ff
> load_flag $ff
274c : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
274e : 48 > pha ;use stack to load status
274f : b513 > lda zp1,x ;load to indexed zeropage
2751 : 950c > sta zpt,x
2753 : 28 > plp
2754 : 160c asl zpt,x
tst_zx rASL,fASL,$ff-fnzc
2756 : 08 > php ;save flags
2757 : b50c > lda zpt,x
2759 : dd2002 > cmp rASL,x ;test result
> trap_ne
275c : d0fe > bne * ;failed not equal (non zero)
>
275e : 68 > pla ;load status
> eor_flag $ff-fnzc
275f : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2761 : dd3002 > cmp fASL,x ;test flags
> trap_ne
2764 : d0fe > bne * ;failed not equal (non zero)
>
2766 : ca dex
2767 : 10e3 bpl tasl7
2769 : a203 ldx #3
276b : tlsr6
set_zx zp1,0
> load_flag 0
276b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
276d : 48 > pha ;use stack to load status
276e : b513 > lda zp1,x ;load to indexed zeropage
2770 : 950c > sta zpt,x
2772 : 28 > plp
2773 : 560c lsr zpt,x
tst_zx rLSR,fLSR,0
2775 : 08 > php ;save flags
2776 : b50c > lda zpt,x
2778 : dd2802 > cmp rLSR,x ;test result
> trap_ne
277b : d0fe > bne * ;failed not equal (non zero)
>
277d : 68 > pla ;load status
> eor_flag 0
277e : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2780 : dd3802 > cmp fLSR,x ;test flags
> trap_ne
2783 : d0fe > bne * ;failed not equal (non zero)
>
2785 : ca dex
2786 : 10e3 bpl tlsr6
2788 : a203 ldx #3
278a : tlsr7
set_zx zp1,$ff
> load_flag $ff
278a : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
278c : 48 > pha ;use stack to load status
278d : b513 > lda zp1,x ;load to indexed zeropage
278f : 950c > sta zpt,x
2791 : 28 > plp
2792 : 560c lsr zpt,x
tst_zx rLSR,fLSR,$ff-fnzc
2794 : 08 > php ;save flags
2795 : b50c > lda zpt,x
2797 : dd2802 > cmp rLSR,x ;test result
> trap_ne
279a : d0fe > bne * ;failed not equal (non zero)
>
279c : 68 > pla ;load status
> eor_flag $ff-fnzc
279d : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
279f : dd3802 > cmp fLSR,x ;test flags
> trap_ne
27a2 : d0fe > bne * ;failed not equal (non zero)
>
27a4 : ca dex
27a5 : 10e3 bpl tlsr7
27a7 : a203 ldx #3
27a9 : trol6
set_zx zp1,0
> load_flag 0
27a9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
27ab : 48 > pha ;use stack to load status
27ac : b513 > lda zp1,x ;load to indexed zeropage
27ae : 950c > sta zpt,x
27b0 : 28 > plp
27b1 : 360c rol zpt,x
tst_zx rROL,fROL,0
27b3 : 08 > php ;save flags
27b4 : b50c > lda zpt,x
27b6 : dd2002 > cmp rROL,x ;test result
> trap_ne
27b9 : d0fe > bne * ;failed not equal (non zero)
>
27bb : 68 > pla ;load status
> eor_flag 0
27bc : 4930 > eor #0|fao ;invert expected flags + always on bits
>
27be : dd3002 > cmp fROL,x ;test flags
> trap_ne
27c1 : d0fe > bne * ;failed not equal (non zero)
>
27c3 : ca dex
27c4 : 10e3 bpl trol6
27c6 : a203 ldx #3
27c8 : trol7
set_zx zp1,$ff-fc
> load_flag $ff-fc
27c8 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
27ca : 48 > pha ;use stack to load status
27cb : b513 > lda zp1,x ;load to indexed zeropage
27cd : 950c > sta zpt,x
27cf : 28 > plp
27d0 : 360c rol zpt,x
tst_zx rROL,fROL,$ff-fnzc
27d2 : 08 > php ;save flags
27d3 : b50c > lda zpt,x
27d5 : dd2002 > cmp rROL,x ;test result
> trap_ne
27d8 : d0fe > bne * ;failed not equal (non zero)
>
27da : 68 > pla ;load status
> eor_flag $ff-fnzc
27db : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
27dd : dd3002 > cmp fROL,x ;test flags
> trap_ne
27e0 : d0fe > bne * ;failed not equal (non zero)
>
27e2 : ca dex
27e3 : 10e3 bpl trol7
27e5 : a203 ldx #3
27e7 : trolc6
set_zx zp1,fc
> load_flag fc
27e7 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
27e9 : 48 > pha ;use stack to load status
27ea : b513 > lda zp1,x ;load to indexed zeropage
27ec : 950c > sta zpt,x
27ee : 28 > plp
27ef : 360c rol zpt,x
tst_zx rROLc,fROLc,0
27f1 : 08 > php ;save flags
27f2 : b50c > lda zpt,x
27f4 : dd2402 > cmp rROLc,x ;test result
> trap_ne
27f7 : d0fe > bne * ;failed not equal (non zero)
>
27f9 : 68 > pla ;load status
> eor_flag 0
27fa : 4930 > eor #0|fao ;invert expected flags + always on bits
>
27fc : dd3402 > cmp fROLc,x ;test flags
> trap_ne
27ff : d0fe > bne * ;failed not equal (non zero)
>
2801 : ca dex
2802 : 10e3 bpl trolc6
2804 : a203 ldx #3
2806 : trolc7
set_zx zp1,$ff
> load_flag $ff
2806 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2808 : 48 > pha ;use stack to load status
2809 : b513 > lda zp1,x ;load to indexed zeropage
280b : 950c > sta zpt,x
280d : 28 > plp
280e : 360c rol zpt,x
tst_zx rROLc,fROLc,$ff-fnzc
2810 : 08 > php ;save flags
2811 : b50c > lda zpt,x
2813 : dd2402 > cmp rROLc,x ;test result
> trap_ne
2816 : d0fe > bne * ;failed not equal (non zero)
>
2818 : 68 > pla ;load status
> eor_flag $ff-fnzc
2819 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
281b : dd3402 > cmp fROLc,x ;test flags
> trap_ne
281e : d0fe > bne * ;failed not equal (non zero)
>
2820 : ca dex
2821 : 10e3 bpl trolc7
2823 : a203 ldx #3
2825 : tror6
set_zx zp1,0
> load_flag 0
2825 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2827 : 48 > pha ;use stack to load status
2828 : b513 > lda zp1,x ;load to indexed zeropage
282a : 950c > sta zpt,x
282c : 28 > plp
282d : 760c ror zpt,x
tst_zx rROR,fROR,0
282f : 08 > php ;save flags
2830 : b50c > lda zpt,x
2832 : dd2802 > cmp rROR,x ;test result
> trap_ne
2835 : d0fe > bne * ;failed not equal (non zero)
>
2837 : 68 > pla ;load status
> eor_flag 0
2838 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
283a : dd3802 > cmp fROR,x ;test flags
> trap_ne
283d : d0fe > bne * ;failed not equal (non zero)
>
283f : ca dex
2840 : 10e3 bpl tror6
2842 : a203 ldx #3
2844 : tror7
set_zx zp1,$ff-fc
> load_flag $ff-fc
2844 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
2846 : 48 > pha ;use stack to load status
2847 : b513 > lda zp1,x ;load to indexed zeropage
2849 : 950c > sta zpt,x
284b : 28 > plp
284c : 760c ror zpt,x
tst_zx rROR,fROR,$ff-fnzc
284e : 08 > php ;save flags
284f : b50c > lda zpt,x
2851 : dd2802 > cmp rROR,x ;test result
> trap_ne
2854 : d0fe > bne * ;failed not equal (non zero)
>
2856 : 68 > pla ;load status
> eor_flag $ff-fnzc
2857 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2859 : dd3802 > cmp fROR,x ;test flags
> trap_ne
285c : d0fe > bne * ;failed not equal (non zero)
>
285e : ca dex
285f : 10e3 bpl tror7
2861 : a203 ldx #3
2863 : trorc6
set_zx zp1,fc
> load_flag fc
2863 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
2865 : 48 > pha ;use stack to load status
2866 : b513 > lda zp1,x ;load to indexed zeropage
2868 : 950c > sta zpt,x
286a : 28 > plp
286b : 760c ror zpt,x
tst_zx rRORc,fRORc,0
286d : 08 > php ;save flags
286e : b50c > lda zpt,x
2870 : dd2c02 > cmp rRORc,x ;test result
> trap_ne
2873 : d0fe > bne * ;failed not equal (non zero)
>
2875 : 68 > pla ;load status
> eor_flag 0
2876 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2878 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
287b : d0fe > bne * ;failed not equal (non zero)
>
287d : ca dex
287e : 10e3 bpl trorc6
2880 : a203 ldx #3
2882 : trorc7
set_zx zp1,$ff
> load_flag $ff
2882 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2884 : 48 > pha ;use stack to load status
2885 : b513 > lda zp1,x ;load to indexed zeropage
2887 : 950c > sta zpt,x
2889 : 28 > plp
288a : 760c ror zpt,x
tst_zx rRORc,fRORc,$ff-fnzc
288c : 08 > php ;save flags
288d : b50c > lda zpt,x
288f : dd2c02 > cmp rRORc,x ;test result
> trap_ne
2892 : d0fe > bne * ;failed not equal (non zero)
>
2894 : 68 > pla ;load status
> eor_flag $ff-fnzc
2895 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2897 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
289a : d0fe > bne * ;failed not equal (non zero)
>
289c : ca dex
289d : 10e3 bpl trorc7
next_test
289f : ad0002 > lda test_case ;previous test
28a2 : c920 > cmp #test_num
> trap_ne ;test is out of sequence
28a4 : d0fe > bne * ;failed not equal (non zero)
>
0021 = >test_num = test_num + 1
28a6 : a921 > lda #test_num ;*** next tests' number
28a8 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; shifts - abs indexed
28ab : a203 ldx #3
28ad : tasl8
set_absx zp1,0
> load_flag 0
28ad : a900 > lda #0 ;allow test to change I-flag (no mask)
>
28af : 48 > pha ;use stack to load status
28b0 : b513 > lda zp1,x ;load to indexed memory
28b2 : 9d0302 > sta abst,x
28b5 : 28 > plp
28b6 : 1e0302 asl abst,x
tst_absx rASL,fASL,0
28b9 : 08 > php ;save flags
28ba : bd0302 > lda abst,x
28bd : dd2002 > cmp rASL,x ;test result
> trap_ne
28c0 : d0fe > bne * ;failed not equal (non zero)
>
28c2 : 68 > pla ;load status
> eor_flag 0
28c3 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
28c5 : dd3002 > cmp fASL,x ;test flags
> trap_ne
28c8 : d0fe > bne * ;failed not equal (non zero)
>
28ca : ca dex
28cb : 10e0 bpl tasl8
28cd : a203 ldx #3
28cf : tasl9
set_absx zp1,$ff
> load_flag $ff
28cf : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
28d1 : 48 > pha ;use stack to load status
28d2 : b513 > lda zp1,x ;load to indexed memory
28d4 : 9d0302 > sta abst,x
28d7 : 28 > plp
28d8 : 1e0302 asl abst,x
tst_absx rASL,fASL,$ff-fnzc
28db : 08 > php ;save flags
28dc : bd0302 > lda abst,x
28df : dd2002 > cmp rASL,x ;test result
> trap_ne
28e2 : d0fe > bne * ;failed not equal (non zero)
>
28e4 : 68 > pla ;load status
> eor_flag $ff-fnzc
28e5 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
28e7 : dd3002 > cmp fASL,x ;test flags
> trap_ne
28ea : d0fe > bne * ;failed not equal (non zero)
>
28ec : ca dex
28ed : 10e0 bpl tasl9
28ef : a203 ldx #3
28f1 : tlsr8
set_absx zp1,0
> load_flag 0
28f1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
28f3 : 48 > pha ;use stack to load status
28f4 : b513 > lda zp1,x ;load to indexed memory
28f6 : 9d0302 > sta abst,x
28f9 : 28 > plp
28fa : 5e0302 lsr abst,x
tst_absx rLSR,fLSR,0
28fd : 08 > php ;save flags
28fe : bd0302 > lda abst,x
2901 : dd2802 > cmp rLSR,x ;test result
> trap_ne
2904 : d0fe > bne * ;failed not equal (non zero)
>
2906 : 68 > pla ;load status
> eor_flag 0
2907 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2909 : dd3802 > cmp fLSR,x ;test flags
> trap_ne
290c : d0fe > bne * ;failed not equal (non zero)
>
290e : ca dex
290f : 10e0 bpl tlsr8
2911 : a203 ldx #3
2913 : tlsr9
set_absx zp1,$ff
> load_flag $ff
2913 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2915 : 48 > pha ;use stack to load status
2916 : b513 > lda zp1,x ;load to indexed memory
2918 : 9d0302 > sta abst,x
291b : 28 > plp
291c : 5e0302 lsr abst,x
tst_absx rLSR,fLSR,$ff-fnzc
291f : 08 > php ;save flags
2920 : bd0302 > lda abst,x
2923 : dd2802 > cmp rLSR,x ;test result
> trap_ne
2926 : d0fe > bne * ;failed not equal (non zero)
>
2928 : 68 > pla ;load status
> eor_flag $ff-fnzc
2929 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
292b : dd3802 > cmp fLSR,x ;test flags
> trap_ne
292e : d0fe > bne * ;failed not equal (non zero)
>
2930 : ca dex
2931 : 10e0 bpl tlsr9
2933 : a203 ldx #3
2935 : trol8
set_absx zp1,0
> load_flag 0
2935 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2937 : 48 > pha ;use stack to load status
2938 : b513 > lda zp1,x ;load to indexed memory
293a : 9d0302 > sta abst,x
293d : 28 > plp
293e : 3e0302 rol abst,x
tst_absx rROL,fROL,0
2941 : 08 > php ;save flags
2942 : bd0302 > lda abst,x
2945 : dd2002 > cmp rROL,x ;test result
> trap_ne
2948 : d0fe > bne * ;failed not equal (non zero)
>
294a : 68 > pla ;load status
> eor_flag 0
294b : 4930 > eor #0|fao ;invert expected flags + always on bits
>
294d : dd3002 > cmp fROL,x ;test flags
> trap_ne
2950 : d0fe > bne * ;failed not equal (non zero)
>
2952 : ca dex
2953 : 10e0 bpl trol8
2955 : a203 ldx #3
2957 : trol9
set_absx zp1,$ff-fc
> load_flag $ff-fc
2957 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
2959 : 48 > pha ;use stack to load status
295a : b513 > lda zp1,x ;load to indexed memory
295c : 9d0302 > sta abst,x
295f : 28 > plp
2960 : 3e0302 rol abst,x
tst_absx rROL,fROL,$ff-fnzc
2963 : 08 > php ;save flags
2964 : bd0302 > lda abst,x
2967 : dd2002 > cmp rROL,x ;test result
> trap_ne
296a : d0fe > bne * ;failed not equal (non zero)
>
296c : 68 > pla ;load status
> eor_flag $ff-fnzc
296d : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
296f : dd3002 > cmp fROL,x ;test flags
> trap_ne
2972 : d0fe > bne * ;failed not equal (non zero)
>
2974 : ca dex
2975 : 10e0 bpl trol9
2977 : a203 ldx #3
2979 : trolc8
set_absx zp1,fc
> load_flag fc
2979 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
297b : 48 > pha ;use stack to load status
297c : b513 > lda zp1,x ;load to indexed memory
297e : 9d0302 > sta abst,x
2981 : 28 > plp
2982 : 3e0302 rol abst,x
tst_absx rROLc,fROLc,0
2985 : 08 > php ;save flags
2986 : bd0302 > lda abst,x
2989 : dd2402 > cmp rROLc,x ;test result
> trap_ne
298c : d0fe > bne * ;failed not equal (non zero)
>
298e : 68 > pla ;load status
> eor_flag 0
298f : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2991 : dd3402 > cmp fROLc,x ;test flags
> trap_ne
2994 : d0fe > bne * ;failed not equal (non zero)
>
2996 : ca dex
2997 : 10e0 bpl trolc8
2999 : a203 ldx #3
299b : trolc9
set_absx zp1,$ff
> load_flag $ff
299b : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
299d : 48 > pha ;use stack to load status
299e : b513 > lda zp1,x ;load to indexed memory
29a0 : 9d0302 > sta abst,x
29a3 : 28 > plp
29a4 : 3e0302 rol abst,x
tst_absx rROLc,fROLc,$ff-fnzc
29a7 : 08 > php ;save flags
29a8 : bd0302 > lda abst,x
29ab : dd2402 > cmp rROLc,x ;test result
> trap_ne
29ae : d0fe > bne * ;failed not equal (non zero)
>
29b0 : 68 > pla ;load status
> eor_flag $ff-fnzc
29b1 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
29b3 : dd3402 > cmp fROLc,x ;test flags
> trap_ne
29b6 : d0fe > bne * ;failed not equal (non zero)
>
29b8 : ca dex
29b9 : 10e0 bpl trolc9
29bb : a203 ldx #3
29bd : tror8
set_absx zp1,0
> load_flag 0
29bd : a900 > lda #0 ;allow test to change I-flag (no mask)
>
29bf : 48 > pha ;use stack to load status
29c0 : b513 > lda zp1,x ;load to indexed memory
29c2 : 9d0302 > sta abst,x
29c5 : 28 > plp
29c6 : 7e0302 ror abst,x
tst_absx rROR,fROR,0
29c9 : 08 > php ;save flags
29ca : bd0302 > lda abst,x
29cd : dd2802 > cmp rROR,x ;test result
> trap_ne
29d0 : d0fe > bne * ;failed not equal (non zero)
>
29d2 : 68 > pla ;load status
> eor_flag 0
29d3 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
29d5 : dd3802 > cmp fROR,x ;test flags
> trap_ne
29d8 : d0fe > bne * ;failed not equal (non zero)
>
29da : ca dex
29db : 10e0 bpl tror8
29dd : a203 ldx #3
29df : tror9
set_absx zp1,$ff-fc
> load_flag $ff-fc
29df : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask)
>
29e1 : 48 > pha ;use stack to load status
29e2 : b513 > lda zp1,x ;load to indexed memory
29e4 : 9d0302 > sta abst,x
29e7 : 28 > plp
29e8 : 7e0302 ror abst,x
tst_absx rROR,fROR,$ff-fnzc
29eb : 08 > php ;save flags
29ec : bd0302 > lda abst,x
29ef : dd2802 > cmp rROR,x ;test result
> trap_ne
29f2 : d0fe > bne * ;failed not equal (non zero)
>
29f4 : 68 > pla ;load status
> eor_flag $ff-fnzc
29f5 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
29f7 : dd3802 > cmp fROR,x ;test flags
> trap_ne
29fa : d0fe > bne * ;failed not equal (non zero)
>
29fc : ca dex
29fd : 10e0 bpl tror9
29ff : a203 ldx #3
2a01 : trorc8
set_absx zp1,fc
> load_flag fc
2a01 : a901 > lda #fc ;allow test to change I-flag (no mask)
>
2a03 : 48 > pha ;use stack to load status
2a04 : b513 > lda zp1,x ;load to indexed memory
2a06 : 9d0302 > sta abst,x
2a09 : 28 > plp
2a0a : 7e0302 ror abst,x
tst_absx rRORc,fRORc,0
2a0d : 08 > php ;save flags
2a0e : bd0302 > lda abst,x
2a11 : dd2c02 > cmp rRORc,x ;test result
> trap_ne
2a14 : d0fe > bne * ;failed not equal (non zero)
>
2a16 : 68 > pla ;load status
> eor_flag 0
2a17 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2a19 : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
2a1c : d0fe > bne * ;failed not equal (non zero)
>
2a1e : ca dex
2a1f : 10e0 bpl trorc8
2a21 : a203 ldx #3
2a23 : trorc9
set_absx zp1,$ff
> load_flag $ff
2a23 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2a25 : 48 > pha ;use stack to load status
2a26 : b513 > lda zp1,x ;load to indexed memory
2a28 : 9d0302 > sta abst,x
2a2b : 28 > plp
2a2c : 7e0302 ror abst,x
tst_absx rRORc,fRORc,$ff-fnzc
2a2f : 08 > php ;save flags
2a30 : bd0302 > lda abst,x
2a33 : dd2c02 > cmp rRORc,x ;test result
> trap_ne
2a36 : d0fe > bne * ;failed not equal (non zero)
>
2a38 : 68 > pla ;load status
> eor_flag $ff-fnzc
2a39 : 497c > eor #$ff-fnzc|fao ;invert expected flags + always on bits
>
2a3b : dd3c02 > cmp fRORc,x ;test flags
> trap_ne
2a3e : d0fe > bne * ;failed not equal (non zero)
>
2a40 : ca dex
2a41 : 10e0 bpl trorc9
next_test
2a43 : ad0002 > lda test_case ;previous test
2a46 : c921 > cmp #test_num
> trap_ne ;test is out of sequence
2a48 : d0fe > bne * ;failed not equal (non zero)
>
0022 = >test_num = test_num + 1
2a4a : a922 > lda #test_num ;*** next tests' number
2a4c : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; testing memory increment/decrement - INC DEC all addressing modes
; zeropage
2a4f : a200 ldx #0
2a51 : a97e lda #$7e
2a53 : 850c sta zpt
2a55 : tinc
set_stat 0
> load_flag 0
2a55 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2a57 : 48 > pha ;use stack to load status
2a58 : 28 > plp
2a59 : e60c inc zpt
tst_z rINC,fINC,0
2a5b : 08 > php ;save flags
2a5c : a50c > lda zpt
2a5e : dd4002 > cmp rINC,x ;test result
> trap_ne
2a61 : d0fe > bne * ;failed not equal (non zero)
>
2a63 : 68 > pla ;load status
> eor_flag 0
2a64 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2a66 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2a69 : d0fe > bne * ;failed not equal (non zero)
>
2a6b : e8 inx
2a6c : e002 cpx #2
2a6e : d004 bne tinc1
2a70 : a9fe lda #$fe
2a72 : 850c sta zpt
2a74 : e005 tinc1 cpx #5
2a76 : d0dd bne tinc
2a78 : ca dex
2a79 : e60c inc zpt
2a7b : tdec
set_stat 0
> load_flag 0
2a7b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2a7d : 48 > pha ;use stack to load status
2a7e : 28 > plp
2a7f : c60c dec zpt
tst_z rINC,fINC,0
2a81 : 08 > php ;save flags
2a82 : a50c > lda zpt
2a84 : dd4002 > cmp rINC,x ;test result
> trap_ne
2a87 : d0fe > bne * ;failed not equal (non zero)
>
2a89 : 68 > pla ;load status
> eor_flag 0
2a8a : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2a8c : dd4502 > cmp fINC,x ;test flags
> trap_ne
2a8f : d0fe > bne * ;failed not equal (non zero)
>
2a91 : ca dex
2a92 : 300a bmi tdec1
2a94 : e001 cpx #1
2a96 : d0e3 bne tdec
2a98 : a981 lda #$81
2a9a : 850c sta zpt
2a9c : d0dd bne tdec
2a9e : tdec1
2a9e : a200 ldx #0
2aa0 : a97e lda #$7e
2aa2 : 850c sta zpt
2aa4 : tinc10
set_stat $ff
> load_flag $ff
2aa4 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2aa6 : 48 > pha ;use stack to load status
2aa7 : 28 > plp
2aa8 : e60c inc zpt
tst_z rINC,fINC,$ff-fnz
2aaa : 08 > php ;save flags
2aab : a50c > lda zpt
2aad : dd4002 > cmp rINC,x ;test result
> trap_ne
2ab0 : d0fe > bne * ;failed not equal (non zero)
>
2ab2 : 68 > pla ;load status
> eor_flag $ff-fnz
2ab3 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2ab5 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2ab8 : d0fe > bne * ;failed not equal (non zero)
>
2aba : e8 inx
2abb : e002 cpx #2
2abd : d004 bne tinc11
2abf : a9fe lda #$fe
2ac1 : 850c sta zpt
2ac3 : e005 tinc11 cpx #5
2ac5 : d0dd bne tinc10
2ac7 : ca dex
2ac8 : e60c inc zpt
2aca : tdec10
set_stat $ff
> load_flag $ff
2aca : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2acc : 48 > pha ;use stack to load status
2acd : 28 > plp
2ace : c60c dec zpt
tst_z rINC,fINC,$ff-fnz
2ad0 : 08 > php ;save flags
2ad1 : a50c > lda zpt
2ad3 : dd4002 > cmp rINC,x ;test result
> trap_ne
2ad6 : d0fe > bne * ;failed not equal (non zero)
>
2ad8 : 68 > pla ;load status
> eor_flag $ff-fnz
2ad9 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2adb : dd4502 > cmp fINC,x ;test flags
> trap_ne
2ade : d0fe > bne * ;failed not equal (non zero)
>
2ae0 : ca dex
2ae1 : 300a bmi tdec11
2ae3 : e001 cpx #1
2ae5 : d0e3 bne tdec10
2ae7 : a981 lda #$81
2ae9 : 850c sta zpt
2aeb : d0dd bne tdec10
2aed : tdec11
next_test
2aed : ad0002 > lda test_case ;previous test
2af0 : c922 > cmp #test_num
> trap_ne ;test is out of sequence
2af2 : d0fe > bne * ;failed not equal (non zero)
>
0023 = >test_num = test_num + 1
2af4 : a923 > lda #test_num ;*** next tests' number
2af6 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; absolute memory
2af9 : a200 ldx #0
2afb : a97e lda #$7e
2afd : 8d0302 sta abst
2b00 : tinc2
set_stat 0
> load_flag 0
2b00 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2b02 : 48 > pha ;use stack to load status
2b03 : 28 > plp
2b04 : ee0302 inc abst
tst_abs rINC,fINC,0
2b07 : 08 > php ;save flags
2b08 : ad0302 > lda abst
2b0b : dd4002 > cmp rINC,x ;test result
> trap_ne
2b0e : d0fe > bne * ;failed not equal (non zero)
>
2b10 : 68 > pla ;load status
> eor_flag 0
2b11 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2b13 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2b16 : d0fe > bne * ;failed not equal (non zero)
>
2b18 : e8 inx
2b19 : e002 cpx #2
2b1b : d005 bne tinc3
2b1d : a9fe lda #$fe
2b1f : 8d0302 sta abst
2b22 : e005 tinc3 cpx #5
2b24 : d0da bne tinc2
2b26 : ca dex
2b27 : ee0302 inc abst
2b2a : tdec2
set_stat 0
> load_flag 0
2b2a : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2b2c : 48 > pha ;use stack to load status
2b2d : 28 > plp
2b2e : ce0302 dec abst
tst_abs rINC,fINC,0
2b31 : 08 > php ;save flags
2b32 : ad0302 > lda abst
2b35 : dd4002 > cmp rINC,x ;test result
> trap_ne
2b38 : d0fe > bne * ;failed not equal (non zero)
>
2b3a : 68 > pla ;load status
> eor_flag 0
2b3b : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2b3d : dd4502 > cmp fINC,x ;test flags
> trap_ne
2b40 : d0fe > bne * ;failed not equal (non zero)
>
2b42 : ca dex
2b43 : 300b bmi tdec3
2b45 : e001 cpx #1
2b47 : d0e1 bne tdec2
2b49 : a981 lda #$81
2b4b : 8d0302 sta abst
2b4e : d0da bne tdec2
2b50 : tdec3
2b50 : a200 ldx #0
2b52 : a97e lda #$7e
2b54 : 8d0302 sta abst
2b57 : tinc12
set_stat $ff
> load_flag $ff
2b57 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2b59 : 48 > pha ;use stack to load status
2b5a : 28 > plp
2b5b : ee0302 inc abst
tst_abs rINC,fINC,$ff-fnz
2b5e : 08 > php ;save flags
2b5f : ad0302 > lda abst
2b62 : dd4002 > cmp rINC,x ;test result
> trap_ne
2b65 : d0fe > bne * ;failed not equal (non zero)
>
2b67 : 68 > pla ;load status
> eor_flag $ff-fnz
2b68 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2b6a : dd4502 > cmp fINC,x ;test flags
> trap_ne
2b6d : d0fe > bne * ;failed not equal (non zero)
>
2b6f : e8 inx
2b70 : e002 cpx #2
2b72 : d005 bne tinc13
2b74 : a9fe lda #$fe
2b76 : 8d0302 sta abst
2b79 : e005 tinc13 cpx #5
2b7b : d0da bne tinc12
2b7d : ca dex
2b7e : ee0302 inc abst
2b81 : tdec12
set_stat $ff
> load_flag $ff
2b81 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2b83 : 48 > pha ;use stack to load status
2b84 : 28 > plp
2b85 : ce0302 dec abst
tst_abs rINC,fINC,$ff-fnz
2b88 : 08 > php ;save flags
2b89 : ad0302 > lda abst
2b8c : dd4002 > cmp rINC,x ;test result
> trap_ne
2b8f : d0fe > bne * ;failed not equal (non zero)
>
2b91 : 68 > pla ;load status
> eor_flag $ff-fnz
2b92 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2b94 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2b97 : d0fe > bne * ;failed not equal (non zero)
>
2b99 : ca dex
2b9a : 300b bmi tdec13
2b9c : e001 cpx #1
2b9e : d0e1 bne tdec12
2ba0 : a981 lda #$81
2ba2 : 8d0302 sta abst
2ba5 : d0da bne tdec12
2ba7 : tdec13
next_test
2ba7 : ad0002 > lda test_case ;previous test
2baa : c923 > cmp #test_num
> trap_ne ;test is out of sequence
2bac : d0fe > bne * ;failed not equal (non zero)
>
0024 = >test_num = test_num + 1
2bae : a924 > lda #test_num ;*** next tests' number
2bb0 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; zeropage indexed
2bb3 : a200 ldx #0
2bb5 : a97e lda #$7e
2bb7 : 950c tinc4 sta zpt,x
set_stat 0
> load_flag 0
2bb9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2bbb : 48 > pha ;use stack to load status
2bbc : 28 > plp
2bbd : f60c inc zpt,x
tst_zx rINC,fINC,0
2bbf : 08 > php ;save flags
2bc0 : b50c > lda zpt,x
2bc2 : dd4002 > cmp rINC,x ;test result
> trap_ne
2bc5 : d0fe > bne * ;failed not equal (non zero)
>
2bc7 : 68 > pla ;load status
> eor_flag 0
2bc8 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2bca : dd4502 > cmp fINC,x ;test flags
> trap_ne
2bcd : d0fe > bne * ;failed not equal (non zero)
>
2bcf : b50c lda zpt,x
2bd1 : e8 inx
2bd2 : e002 cpx #2
2bd4 : d002 bne tinc5
2bd6 : a9fe lda #$fe
2bd8 : e005 tinc5 cpx #5
2bda : d0db bne tinc4
2bdc : ca dex
2bdd : a902 lda #2
2bdf : 950c tdec4 sta zpt,x
set_stat 0
> load_flag 0
2be1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2be3 : 48 > pha ;use stack to load status
2be4 : 28 > plp
2be5 : d60c dec zpt,x
tst_zx rINC,fINC,0
2be7 : 08 > php ;save flags
2be8 : b50c > lda zpt,x
2bea : dd4002 > cmp rINC,x ;test result
> trap_ne
2bed : d0fe > bne * ;failed not equal (non zero)
>
2bef : 68 > pla ;load status
> eor_flag 0
2bf0 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2bf2 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2bf5 : d0fe > bne * ;failed not equal (non zero)
>
2bf7 : b50c lda zpt,x
2bf9 : ca dex
2bfa : 3008 bmi tdec5
2bfc : e001 cpx #1
2bfe : d0df bne tdec4
2c00 : a981 lda #$81
2c02 : d0db bne tdec4
2c04 : tdec5
2c04 : a200 ldx #0
2c06 : a97e lda #$7e
2c08 : 950c tinc14 sta zpt,x
set_stat $ff
> load_flag $ff
2c0a : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2c0c : 48 > pha ;use stack to load status
2c0d : 28 > plp
2c0e : f60c inc zpt,x
tst_zx rINC,fINC,$ff-fnz
2c10 : 08 > php ;save flags
2c11 : b50c > lda zpt,x
2c13 : dd4002 > cmp rINC,x ;test result
> trap_ne
2c16 : d0fe > bne * ;failed not equal (non zero)
>
2c18 : 68 > pla ;load status
> eor_flag $ff-fnz
2c19 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2c1b : dd4502 > cmp fINC,x ;test flags
> trap_ne
2c1e : d0fe > bne * ;failed not equal (non zero)
>
2c20 : b50c lda zpt,x
2c22 : e8 inx
2c23 : e002 cpx #2
2c25 : d002 bne tinc15
2c27 : a9fe lda #$fe
2c29 : e005 tinc15 cpx #5
2c2b : d0db bne tinc14
2c2d : ca dex
2c2e : a902 lda #2
2c30 : 950c tdec14 sta zpt,x
set_stat $ff
> load_flag $ff
2c32 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2c34 : 48 > pha ;use stack to load status
2c35 : 28 > plp
2c36 : d60c dec zpt,x
tst_zx rINC,fINC,$ff-fnz
2c38 : 08 > php ;save flags
2c39 : b50c > lda zpt,x
2c3b : dd4002 > cmp rINC,x ;test result
> trap_ne
2c3e : d0fe > bne * ;failed not equal (non zero)
>
2c40 : 68 > pla ;load status
> eor_flag $ff-fnz
2c41 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2c43 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2c46 : d0fe > bne * ;failed not equal (non zero)
>
2c48 : b50c lda zpt,x
2c4a : ca dex
2c4b : 3008 bmi tdec15
2c4d : e001 cpx #1
2c4f : d0df bne tdec14
2c51 : a981 lda #$81
2c53 : d0db bne tdec14
2c55 : tdec15
next_test
2c55 : ad0002 > lda test_case ;previous test
2c58 : c924 > cmp #test_num
> trap_ne ;test is out of sequence
2c5a : d0fe > bne * ;failed not equal (non zero)
>
0025 = >test_num = test_num + 1
2c5c : a925 > lda #test_num ;*** next tests' number
2c5e : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; memory indexed
2c61 : a200 ldx #0
2c63 : a97e lda #$7e
2c65 : 9d0302 tinc6 sta abst,x
set_stat 0
> load_flag 0
2c68 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2c6a : 48 > pha ;use stack to load status
2c6b : 28 > plp
2c6c : fe0302 inc abst,x
tst_absx rINC,fINC,0
2c6f : 08 > php ;save flags
2c70 : bd0302 > lda abst,x
2c73 : dd4002 > cmp rINC,x ;test result
> trap_ne
2c76 : d0fe > bne * ;failed not equal (non zero)
>
2c78 : 68 > pla ;load status
> eor_flag 0
2c79 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2c7b : dd4502 > cmp fINC,x ;test flags
> trap_ne
2c7e : d0fe > bne * ;failed not equal (non zero)
>
2c80 : bd0302 lda abst,x
2c83 : e8 inx
2c84 : e002 cpx #2
2c86 : d002 bne tinc7
2c88 : a9fe lda #$fe
2c8a : e005 tinc7 cpx #5
2c8c : d0d7 bne tinc6
2c8e : ca dex
2c8f : a902 lda #2
2c91 : 9d0302 tdec6 sta abst,x
set_stat 0
> load_flag 0
2c94 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2c96 : 48 > pha ;use stack to load status
2c97 : 28 > plp
2c98 : de0302 dec abst,x
tst_absx rINC,fINC,0
2c9b : 08 > php ;save flags
2c9c : bd0302 > lda abst,x
2c9f : dd4002 > cmp rINC,x ;test result
> trap_ne
2ca2 : d0fe > bne * ;failed not equal (non zero)
>
2ca4 : 68 > pla ;load status
> eor_flag 0
2ca5 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2ca7 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2caa : d0fe > bne * ;failed not equal (non zero)
>
2cac : bd0302 lda abst,x
2caf : ca dex
2cb0 : 3008 bmi tdec7
2cb2 : e001 cpx #1
2cb4 : d0db bne tdec6
2cb6 : a981 lda #$81
2cb8 : d0d7 bne tdec6
2cba : tdec7
2cba : a200 ldx #0
2cbc : a97e lda #$7e
2cbe : 9d0302 tinc16 sta abst,x
set_stat $ff
> load_flag $ff
2cc1 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2cc3 : 48 > pha ;use stack to load status
2cc4 : 28 > plp
2cc5 : fe0302 inc abst,x
tst_absx rINC,fINC,$ff-fnz
2cc8 : 08 > php ;save flags
2cc9 : bd0302 > lda abst,x
2ccc : dd4002 > cmp rINC,x ;test result
> trap_ne
2ccf : d0fe > bne * ;failed not equal (non zero)
>
2cd1 : 68 > pla ;load status
> eor_flag $ff-fnz
2cd2 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2cd4 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2cd7 : d0fe > bne * ;failed not equal (non zero)
>
2cd9 : bd0302 lda abst,x
2cdc : e8 inx
2cdd : e002 cpx #2
2cdf : d002 bne tinc17
2ce1 : a9fe lda #$fe
2ce3 : e005 tinc17 cpx #5
2ce5 : d0d7 bne tinc16
2ce7 : ca dex
2ce8 : a902 lda #2
2cea : 9d0302 tdec16 sta abst,x
set_stat $ff
> load_flag $ff
2ced : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2cef : 48 > pha ;use stack to load status
2cf0 : 28 > plp
2cf1 : de0302 dec abst,x
tst_absx rINC,fINC,$ff-fnz
2cf4 : 08 > php ;save flags
2cf5 : bd0302 > lda abst,x
2cf8 : dd4002 > cmp rINC,x ;test result
> trap_ne
2cfb : d0fe > bne * ;failed not equal (non zero)
>
2cfd : 68 > pla ;load status
> eor_flag $ff-fnz
2cfe : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2d00 : dd4502 > cmp fINC,x ;test flags
> trap_ne
2d03 : d0fe > bne * ;failed not equal (non zero)
>
2d05 : bd0302 lda abst,x
2d08 : ca dex
2d09 : 3008 bmi tdec17
2d0b : e001 cpx #1
2d0d : d0db bne tdec16
2d0f : a981 lda #$81
2d11 : d0d7 bne tdec16
2d13 : tdec17
next_test
2d13 : ad0002 > lda test_case ;previous test
2d16 : c925 > cmp #test_num
> trap_ne ;test is out of sequence
2d18 : d0fe > bne * ;failed not equal (non zero)
>
0026 = >test_num = test_num + 1
2d1a : a926 > lda #test_num ;*** next tests' number
2d1c : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; testing logical instructions - AND EOR ORA all addressing modes
; AND
2d1f : a203 ldx #3 ;immediate
2d21 : b51c tand lda zpAN,x
2d23 : 8d0902 sta ex_andi+1 ;set AND # operand
set_ax absANa,0
> load_flag 0
2d26 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2d28 : 48 > pha ;use stack to load status
2d29 : bd5a02 > lda absANa,x ;precharge accu
2d2c : 28 > plp
2d2d : 200802 jsr ex_andi ;execute AND # in RAM
tst_ax absrlo,absflo,0
2d30 : 08 > php ;save flags
2d31 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2d34 : d0fe > bne * ;failed not equal (non zero)
>
2d36 : 68 > pla ;load status
> eor_flag 0
2d37 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2d39 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2d3c : d0fe > bne * ;failed not equal (non zero)
>
2d3e : ca dex
2d3f : 10e0 bpl tand
2d41 : a203 ldx #3
2d43 : b51c tand1 lda zpAN,x
2d45 : 8d0902 sta ex_andi+1 ;set AND # operand
set_ax absANa,$ff
> load_flag $ff
2d48 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2d4a : 48 > pha ;use stack to load status
2d4b : bd5a02 > lda absANa,x ;precharge accu
2d4e : 28 > plp
2d4f : 200802 jsr ex_andi ;execute AND # in RAM
tst_ax absrlo,absflo,$ff-fnz
2d52 : 08 > php ;save flags
2d53 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2d56 : d0fe > bne * ;failed not equal (non zero)
>
2d58 : 68 > pla ;load status
> eor_flag $ff-fnz
2d59 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2d5b : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2d5e : d0fe > bne * ;failed not equal (non zero)
>
2d60 : ca dex
2d61 : 10e0 bpl tand1
2d63 : a203 ldx #3 ;zp
2d65 : b51c tand2 lda zpAN,x
2d67 : 850c sta zpt
set_ax absANa,0
> load_flag 0
2d69 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2d6b : 48 > pha ;use stack to load status
2d6c : bd5a02 > lda absANa,x ;precharge accu
2d6f : 28 > plp
2d70 : 250c and zpt
tst_ax absrlo,absflo,0
2d72 : 08 > php ;save flags
2d73 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2d76 : d0fe > bne * ;failed not equal (non zero)
>
2d78 : 68 > pla ;load status
> eor_flag 0
2d79 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2d7b : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2d7e : d0fe > bne * ;failed not equal (non zero)
>
2d80 : ca dex
2d81 : 10e2 bpl tand2
2d83 : a203 ldx #3
2d85 : b51c tand3 lda zpAN,x
2d87 : 850c sta zpt
set_ax absANa,$ff
> load_flag $ff
2d89 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2d8b : 48 > pha ;use stack to load status
2d8c : bd5a02 > lda absANa,x ;precharge accu
2d8f : 28 > plp
2d90 : 250c and zpt
tst_ax absrlo,absflo,$ff-fnz
2d92 : 08 > php ;save flags
2d93 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2d96 : d0fe > bne * ;failed not equal (non zero)
>
2d98 : 68 > pla ;load status
> eor_flag $ff-fnz
2d99 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2d9b : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2d9e : d0fe > bne * ;failed not equal (non zero)
>
2da0 : ca dex
2da1 : 10e2 bpl tand3
2da3 : a203 ldx #3 ;abs
2da5 : b51c tand4 lda zpAN,x
2da7 : 8d0302 sta abst
set_ax absANa,0
> load_flag 0
2daa : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2dac : 48 > pha ;use stack to load status
2dad : bd5a02 > lda absANa,x ;precharge accu
2db0 : 28 > plp
2db1 : 2d0302 and abst
tst_ax absrlo,absflo,0
2db4 : 08 > php ;save flags
2db5 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2db8 : d0fe > bne * ;failed not equal (non zero)
>
2dba : 68 > pla ;load status
> eor_flag 0
2dbb : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2dbd : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2dc0 : d0fe > bne * ;failed not equal (non zero)
>
2dc2 : ca dex
2dc3 : 10e0 bpl tand4
2dc5 : a203 ldx #3
2dc7 : b51c tand5 lda zpAN,x
2dc9 : 8d0302 sta abst
set_ax absANa,$ff
> load_flag $ff
2dcc : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2dce : 48 > pha ;use stack to load status
2dcf : bd5a02 > lda absANa,x ;precharge accu
2dd2 : 28 > plp
2dd3 : 2d0302 and abst
tst_ax absrlo,absflo,$ff-fnz
2dd6 : 08 > php ;save flags
2dd7 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2dda : d0fe > bne * ;failed not equal (non zero)
>
2ddc : 68 > pla ;load status
> eor_flag $ff-fnz
2ddd : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2ddf : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2de2 : d0fe > bne * ;failed not equal (non zero)
>
2de4 : ca dex
2de5 : 1002 bpl tand6
2de7 : a203 ldx #3 ;zp,x
2de9 : tand6
set_ax absANa,0
> load_flag 0
2de9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2deb : 48 > pha ;use stack to load status
2dec : bd5a02 > lda absANa,x ;precharge accu
2def : 28 > plp
2df0 : 351c and zpAN,x
tst_ax absrlo,absflo,0
2df2 : 08 > php ;save flags
2df3 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2df6 : d0fe > bne * ;failed not equal (non zero)
>
2df8 : 68 > pla ;load status
> eor_flag 0
2df9 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2dfb : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2dfe : d0fe > bne * ;failed not equal (non zero)
>
2e00 : ca dex
2e01 : 10e6 bpl tand6
2e03 : a203 ldx #3
2e05 : tand7
set_ax absANa,$ff
> load_flag $ff
2e05 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2e07 : 48 > pha ;use stack to load status
2e08 : bd5a02 > lda absANa,x ;precharge accu
2e0b : 28 > plp
2e0c : 351c and zpAN,x
tst_ax absrlo,absflo,$ff-fnz
2e0e : 08 > php ;save flags
2e0f : dd6202 > cmp absrlo,x ;test result
> trap_ne
2e12 : d0fe > bne * ;failed not equal (non zero)
>
2e14 : 68 > pla ;load status
> eor_flag $ff-fnz
2e15 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2e17 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2e1a : d0fe > bne * ;failed not equal (non zero)
>
2e1c : ca dex
2e1d : 10e6 bpl tand7
2e1f : a203 ldx #3 ;abs,x
2e21 : tand8
set_ax absANa,0
> load_flag 0
2e21 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2e23 : 48 > pha ;use stack to load status
2e24 : bd5a02 > lda absANa,x ;precharge accu
2e27 : 28 > plp
2e28 : 3d4e02 and absAN,x
tst_ax absrlo,absflo,0
2e2b : 08 > php ;save flags
2e2c : dd6202 > cmp absrlo,x ;test result
> trap_ne
2e2f : d0fe > bne * ;failed not equal (non zero)
>
2e31 : 68 > pla ;load status
> eor_flag 0
2e32 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2e34 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2e37 : d0fe > bne * ;failed not equal (non zero)
>
2e39 : ca dex
2e3a : 10e5 bpl tand8
2e3c : a203 ldx #3
2e3e : tand9
set_ax absANa,$ff
> load_flag $ff
2e3e : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2e40 : 48 > pha ;use stack to load status
2e41 : bd5a02 > lda absANa,x ;precharge accu
2e44 : 28 > plp
2e45 : 3d4e02 and absAN,x
tst_ax absrlo,absflo,$ff-fnz
2e48 : 08 > php ;save flags
2e49 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2e4c : d0fe > bne * ;failed not equal (non zero)
>
2e4e : 68 > pla ;load status
> eor_flag $ff-fnz
2e4f : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2e51 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2e54 : d0fe > bne * ;failed not equal (non zero)
>
2e56 : ca dex
2e57 : 10e5 bpl tand9
2e59 : a003 ldy #3 ;abs,y
2e5b : tand10
set_ay absANa,0
> load_flag 0
2e5b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2e5d : 48 > pha ;use stack to load status
2e5e : b95a02 > lda absANa,y ;precharge accu
2e61 : 28 > plp
2e62 : 394e02 and absAN,y
tst_ay absrlo,absflo,0
2e65 : 08 > php ;save flags
2e66 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
2e69 : d0fe > bne * ;failed not equal (non zero)
>
2e6b : 68 > pla ;load status
> eor_flag 0
2e6c : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2e6e : d96602 > cmp absflo,y ;test flags
> trap_ne
2e71 : d0fe > bne * ;failed not equal (non zero)
>
2e73 : 88 dey
2e74 : 10e5 bpl tand10
2e76 : a003 ldy #3
2e78 : tand11
set_ay absANa,$ff
> load_flag $ff
2e78 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2e7a : 48 > pha ;use stack to load status
2e7b : b95a02 > lda absANa,y ;precharge accu
2e7e : 28 > plp
2e7f : 394e02 and absAN,y
tst_ay absrlo,absflo,$ff-fnz
2e82 : 08 > php ;save flags
2e83 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
2e86 : d0fe > bne * ;failed not equal (non zero)
>
2e88 : 68 > pla ;load status
> eor_flag $ff-fnz
2e89 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2e8b : d96602 > cmp absflo,y ;test flags
> trap_ne
2e8e : d0fe > bne * ;failed not equal (non zero)
>
2e90 : 88 dey
2e91 : 10e5 bpl tand11
2e93 : a206 ldx #6 ;(zp,x)
2e95 : a003 ldy #3
2e97 : tand12
set_ay absANa,0
> load_flag 0
2e97 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2e99 : 48 > pha ;use stack to load status
2e9a : b95a02 > lda absANa,y ;precharge accu
2e9d : 28 > plp
2e9e : 213a and (indAN,x)
tst_ay absrlo,absflo,0
2ea0 : 08 > php ;save flags
2ea1 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
2ea4 : d0fe > bne * ;failed not equal (non zero)
>
2ea6 : 68 > pla ;load status
> eor_flag 0
2ea7 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2ea9 : d96602 > cmp absflo,y ;test flags
> trap_ne
2eac : d0fe > bne * ;failed not equal (non zero)
>
2eae : ca dex
2eaf : ca dex
2eb0 : 88 dey
2eb1 : 10e4 bpl tand12
2eb3 : a206 ldx #6
2eb5 : a003 ldy #3
2eb7 : tand13
set_ay absANa,$ff
> load_flag $ff
2eb7 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2eb9 : 48 > pha ;use stack to load status
2eba : b95a02 > lda absANa,y ;precharge accu
2ebd : 28 > plp
2ebe : 213a and (indAN,x)
tst_ay absrlo,absflo,$ff-fnz
2ec0 : 08 > php ;save flags
2ec1 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
2ec4 : d0fe > bne * ;failed not equal (non zero)
>
2ec6 : 68 > pla ;load status
> eor_flag $ff-fnz
2ec7 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2ec9 : d96602 > cmp absflo,y ;test flags
> trap_ne
2ecc : d0fe > bne * ;failed not equal (non zero)
>
2ece : ca dex
2ecf : ca dex
2ed0 : 88 dey
2ed1 : 10e4 bpl tand13
2ed3 : a003 ldy #3 ;(zp),y
2ed5 : tand14
set_ay absANa,0
> load_flag 0
2ed5 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2ed7 : 48 > pha ;use stack to load status
2ed8 : b95a02 > lda absANa,y ;precharge accu
2edb : 28 > plp
2edc : 313a and (indAN),y
tst_ay absrlo,absflo,0
2ede : 08 > php ;save flags
2edf : d96202 > cmp absrlo,y ;test result
> trap_ne ;
2ee2 : d0fe > bne * ;failed not equal (non zero)
>
2ee4 : 68 > pla ;load status
> eor_flag 0
2ee5 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2ee7 : d96602 > cmp absflo,y ;test flags
> trap_ne
2eea : d0fe > bne * ;failed not equal (non zero)
>
2eec : 88 dey
2eed : 10e6 bpl tand14
2eef : a003 ldy #3
2ef1 : tand15
set_ay absANa,$ff
> load_flag $ff
2ef1 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2ef3 : 48 > pha ;use stack to load status
2ef4 : b95a02 > lda absANa,y ;precharge accu
2ef7 : 28 > plp
2ef8 : 313a and (indAN),y
tst_ay absrlo,absflo,$ff-fnz
2efa : 08 > php ;save flags
2efb : d96202 > cmp absrlo,y ;test result
> trap_ne ;
2efe : d0fe > bne * ;failed not equal (non zero)
>
2f00 : 68 > pla ;load status
> eor_flag $ff-fnz
2f01 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2f03 : d96602 > cmp absflo,y ;test flags
> trap_ne
2f06 : d0fe > bne * ;failed not equal (non zero)
>
2f08 : 88 dey
2f09 : 10e6 bpl tand15
next_test
2f0b : ad0002 > lda test_case ;previous test
2f0e : c926 > cmp #test_num
> trap_ne ;test is out of sequence
2f10 : d0fe > bne * ;failed not equal (non zero)
>
0027 = >test_num = test_num + 1
2f12 : a927 > lda #test_num ;*** next tests' number
2f14 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; EOR
2f17 : a203 ldx #3 ;immediate - self modifying code
2f19 : b520 teor lda zpEO,x
2f1b : 8d0c02 sta ex_eori+1 ;set EOR # operand
set_ax absEOa,0
> load_flag 0
2f1e : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2f20 : 48 > pha ;use stack to load status
2f21 : bd5e02 > lda absEOa,x ;precharge accu
2f24 : 28 > plp
2f25 : 200b02 jsr ex_eori ;execute EOR # in RAM
tst_ax absrlo,absflo,0
2f28 : 08 > php ;save flags
2f29 : dd6202 > cmp absrlo,x ;test result
> trap_ne
2f2c : d0fe > bne * ;failed not equal (non zero)
>
2f2e : 68 > pla ;load status
> eor_flag 0
2f2f : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2f31 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2f34 : d0fe > bne * ;failed not equal (non zero)
>
2f36 : ca dex
2f37 : 10e0 bpl teor
2f39 : a203 ldx #3
2f3b : b520 teor1 lda zpEO,x
2f3d : 8d0c02 sta ex_eori+1 ;set EOR # operand
set_ax absEOa,$ff
> load_flag $ff
2f40 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2f42 : 48 > pha ;use stack to load status
2f43 : bd5e02 > lda absEOa,x ;precharge accu
2f46 : 28 > plp
2f47 : 200b02 jsr ex_eori ;execute EOR # in RAM
tst_ax absrlo,absflo,$ff-fnz
2f4a : 08 > php ;save flags
2f4b : dd6202 > cmp absrlo,x ;test result
> trap_ne
2f4e : d0fe > bne * ;failed not equal (non zero)
>
2f50 : 68 > pla ;load status
> eor_flag $ff-fnz
2f51 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2f53 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2f56 : d0fe > bne * ;failed not equal (non zero)
>
2f58 : ca dex
2f59 : 10e0 bpl teor1
2f5b : a203 ldx #3 ;zp
2f5d : b520 teor2 lda zpEO,x
2f5f : 850c sta zpt
set_ax absEOa,0
> load_flag 0
2f61 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2f63 : 48 > pha ;use stack to load status
2f64 : bd5e02 > lda absEOa,x ;precharge accu
2f67 : 28 > plp
2f68 : 450c eor zpt
tst_ax absrlo,absflo,0
2f6a : 08 > php ;save flags
2f6b : dd6202 > cmp absrlo,x ;test result
> trap_ne
2f6e : d0fe > bne * ;failed not equal (non zero)
>
2f70 : 68 > pla ;load status
> eor_flag 0
2f71 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2f73 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2f76 : d0fe > bne * ;failed not equal (non zero)
>
2f78 : ca dex
2f79 : 10e2 bpl teor2
2f7b : a203 ldx #3
2f7d : b520 teor3 lda zpEO,x
2f7f : 850c sta zpt
set_ax absEOa,$ff
> load_flag $ff
2f81 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2f83 : 48 > pha ;use stack to load status
2f84 : bd5e02 > lda absEOa,x ;precharge accu
2f87 : 28 > plp
2f88 : 450c eor zpt
tst_ax absrlo,absflo,$ff-fnz
2f8a : 08 > php ;save flags
2f8b : dd6202 > cmp absrlo,x ;test result
> trap_ne
2f8e : d0fe > bne * ;failed not equal (non zero)
>
2f90 : 68 > pla ;load status
> eor_flag $ff-fnz
2f91 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2f93 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2f96 : d0fe > bne * ;failed not equal (non zero)
>
2f98 : ca dex
2f99 : 10e2 bpl teor3
2f9b : a203 ldx #3 ;abs
2f9d : b520 teor4 lda zpEO,x
2f9f : 8d0302 sta abst
set_ax absEOa,0
> load_flag 0
2fa2 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2fa4 : 48 > pha ;use stack to load status
2fa5 : bd5e02 > lda absEOa,x ;precharge accu
2fa8 : 28 > plp
2fa9 : 4d0302 eor abst
tst_ax absrlo,absflo,0
2fac : 08 > php ;save flags
2fad : dd6202 > cmp absrlo,x ;test result
> trap_ne
2fb0 : d0fe > bne * ;failed not equal (non zero)
>
2fb2 : 68 > pla ;load status
> eor_flag 0
2fb3 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2fb5 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2fb8 : d0fe > bne * ;failed not equal (non zero)
>
2fba : ca dex
2fbb : 10e0 bpl teor4
2fbd : a203 ldx #3
2fbf : b520 teor5 lda zpEO,x
2fc1 : 8d0302 sta abst
set_ax absEOa,$ff
> load_flag $ff
2fc4 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2fc6 : 48 > pha ;use stack to load status
2fc7 : bd5e02 > lda absEOa,x ;precharge accu
2fca : 28 > plp
2fcb : 4d0302 eor abst
tst_ax absrlo,absflo,$ff-fnz
2fce : 08 > php ;save flags
2fcf : dd6202 > cmp absrlo,x ;test result
> trap_ne
2fd2 : d0fe > bne * ;failed not equal (non zero)
>
2fd4 : 68 > pla ;load status
> eor_flag $ff-fnz
2fd5 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
2fd7 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2fda : d0fe > bne * ;failed not equal (non zero)
>
2fdc : ca dex
2fdd : 1002 bpl teor6
2fdf : a203 ldx #3 ;zp,x
2fe1 : teor6
set_ax absEOa,0
> load_flag 0
2fe1 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
2fe3 : 48 > pha ;use stack to load status
2fe4 : bd5e02 > lda absEOa,x ;precharge accu
2fe7 : 28 > plp
2fe8 : 5520 eor zpEO,x
tst_ax absrlo,absflo,0
2fea : 08 > php ;save flags
2feb : dd6202 > cmp absrlo,x ;test result
> trap_ne
2fee : d0fe > bne * ;failed not equal (non zero)
>
2ff0 : 68 > pla ;load status
> eor_flag 0
2ff1 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
2ff3 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
2ff6 : d0fe > bne * ;failed not equal (non zero)
>
2ff8 : ca dex
2ff9 : 10e6 bpl teor6
2ffb : a203 ldx #3
2ffd : teor7
set_ax absEOa,$ff
> load_flag $ff
2ffd : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
2fff : 48 > pha ;use stack to load status
3000 : bd5e02 > lda absEOa,x ;precharge accu
3003 : 28 > plp
3004 : 5520 eor zpEO,x
tst_ax absrlo,absflo,$ff-fnz
3006 : 08 > php ;save flags
3007 : dd6202 > cmp absrlo,x ;test result
> trap_ne
300a : d0fe > bne * ;failed not equal (non zero)
>
300c : 68 > pla ;load status
> eor_flag $ff-fnz
300d : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
300f : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
3012 : d0fe > bne * ;failed not equal (non zero)
>
3014 : ca dex
3015 : 10e6 bpl teor7
3017 : a203 ldx #3 ;abs,x
3019 : teor8
set_ax absEOa,0
> load_flag 0
3019 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
301b : 48 > pha ;use stack to load status
301c : bd5e02 > lda absEOa,x ;precharge accu
301f : 28 > plp
3020 : 5d5202 eor absEO,x
tst_ax absrlo,absflo,0
3023 : 08 > php ;save flags
3024 : dd6202 > cmp absrlo,x ;test result
> trap_ne
3027 : d0fe > bne * ;failed not equal (non zero)
>
3029 : 68 > pla ;load status
> eor_flag 0
302a : 4930 > eor #0|fao ;invert expected flags + always on bits
>
302c : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
302f : d0fe > bne * ;failed not equal (non zero)
>
3031 : ca dex
3032 : 10e5 bpl teor8
3034 : a203 ldx #3
3036 : teor9
set_ax absEOa,$ff
> load_flag $ff
3036 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
3038 : 48 > pha ;use stack to load status
3039 : bd5e02 > lda absEOa,x ;precharge accu
303c : 28 > plp
303d : 5d5202 eor absEO,x
tst_ax absrlo,absflo,$ff-fnz
3040 : 08 > php ;save flags
3041 : dd6202 > cmp absrlo,x ;test result
> trap_ne
3044 : d0fe > bne * ;failed not equal (non zero)
>
3046 : 68 > pla ;load status
> eor_flag $ff-fnz
3047 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
3049 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
304c : d0fe > bne * ;failed not equal (non zero)
>
304e : ca dex
304f : 10e5 bpl teor9
3051 : a003 ldy #3 ;abs,y
3053 : teor10
set_ay absEOa,0
> load_flag 0
3053 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
3055 : 48 > pha ;use stack to load status
3056 : b95e02 > lda absEOa,y ;precharge accu
3059 : 28 > plp
305a : 595202 eor absEO,y
tst_ay absrlo,absflo,0
305d : 08 > php ;save flags
305e : d96202 > cmp absrlo,y ;test result
> trap_ne ;
3061 : d0fe > bne * ;failed not equal (non zero)
>
3063 : 68 > pla ;load status
> eor_flag 0
3064 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
3066 : d96602 > cmp absflo,y ;test flags
> trap_ne
3069 : d0fe > bne * ;failed not equal (non zero)
>
306b : 88 dey
306c : 10e5 bpl teor10
306e : a003 ldy #3
3070 : teor11
set_ay absEOa,$ff
> load_flag $ff
3070 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
3072 : 48 > pha ;use stack to load status
3073 : b95e02 > lda absEOa,y ;precharge accu
3076 : 28 > plp
3077 : 595202 eor absEO,y
tst_ay absrlo,absflo,$ff-fnz
307a : 08 > php ;save flags
307b : d96202 > cmp absrlo,y ;test result
> trap_ne ;
307e : d0fe > bne * ;failed not equal (non zero)
>
3080 : 68 > pla ;load status
> eor_flag $ff-fnz
3081 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
3083 : d96602 > cmp absflo,y ;test flags
> trap_ne
3086 : d0fe > bne * ;failed not equal (non zero)
>
3088 : 88 dey
3089 : 10e5 bpl teor11
308b : a206 ldx #6 ;(zp,x)
308d : a003 ldy #3
308f : teor12
set_ay absEOa,0
> load_flag 0
308f : a900 > lda #0 ;allow test to change I-flag (no mask)
>
3091 : 48 > pha ;use stack to load status
3092 : b95e02 > lda absEOa,y ;precharge accu
3095 : 28 > plp
3096 : 4142 eor (indEO,x)
tst_ay absrlo,absflo,0
3098 : 08 > php ;save flags
3099 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
309c : d0fe > bne * ;failed not equal (non zero)
>
309e : 68 > pla ;load status
> eor_flag 0
309f : 4930 > eor #0|fao ;invert expected flags + always on bits
>
30a1 : d96602 > cmp absflo,y ;test flags
> trap_ne
30a4 : d0fe > bne * ;failed not equal (non zero)
>
30a6 : ca dex
30a7 : ca dex
30a8 : 88 dey
30a9 : 10e4 bpl teor12
30ab : a206 ldx #6
30ad : a003 ldy #3
30af : teor13
set_ay absEOa,$ff
> load_flag $ff
30af : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
30b1 : 48 > pha ;use stack to load status
30b2 : b95e02 > lda absEOa,y ;precharge accu
30b5 : 28 > plp
30b6 : 4142 eor (indEO,x)
tst_ay absrlo,absflo,$ff-fnz
30b8 : 08 > php ;save flags
30b9 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
30bc : d0fe > bne * ;failed not equal (non zero)
>
30be : 68 > pla ;load status
> eor_flag $ff-fnz
30bf : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
30c1 : d96602 > cmp absflo,y ;test flags
> trap_ne
30c4 : d0fe > bne * ;failed not equal (non zero)
>
30c6 : ca dex
30c7 : ca dex
30c8 : 88 dey
30c9 : 10e4 bpl teor13
30cb : a003 ldy #3 ;(zp),y
30cd : teor14
set_ay absEOa,0
> load_flag 0
30cd : a900 > lda #0 ;allow test to change I-flag (no mask)
>
30cf : 48 > pha ;use stack to load status
30d0 : b95e02 > lda absEOa,y ;precharge accu
30d3 : 28 > plp
30d4 : 5142 eor (indEO),y
tst_ay absrlo,absflo,0
30d6 : 08 > php ;save flags
30d7 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
30da : d0fe > bne * ;failed not equal (non zero)
>
30dc : 68 > pla ;load status
> eor_flag 0
30dd : 4930 > eor #0|fao ;invert expected flags + always on bits
>
30df : d96602 > cmp absflo,y ;test flags
> trap_ne
30e2 : d0fe > bne * ;failed not equal (non zero)
>
30e4 : 88 dey
30e5 : 10e6 bpl teor14
30e7 : a003 ldy #3
30e9 : teor15
set_ay absEOa,$ff
> load_flag $ff
30e9 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
30eb : 48 > pha ;use stack to load status
30ec : b95e02 > lda absEOa,y ;precharge accu
30ef : 28 > plp
30f0 : 5142 eor (indEO),y
tst_ay absrlo,absflo,$ff-fnz
30f2 : 08 > php ;save flags
30f3 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
30f6 : d0fe > bne * ;failed not equal (non zero)
>
30f8 : 68 > pla ;load status
> eor_flag $ff-fnz
30f9 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
30fb : d96602 > cmp absflo,y ;test flags
> trap_ne
30fe : d0fe > bne * ;failed not equal (non zero)
>
3100 : 88 dey
3101 : 10e6 bpl teor15
next_test
3103 : ad0002 > lda test_case ;previous test
3106 : c927 > cmp #test_num
> trap_ne ;test is out of sequence
3108 : d0fe > bne * ;failed not equal (non zero)
>
0028 = >test_num = test_num + 1
310a : a928 > lda #test_num ;*** next tests' number
310c : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; OR
310f : a203 ldx #3 ;immediate - self modifying code
3111 : b518 tora lda zpOR,x
3113 : 8d0f02 sta ex_orai+1 ;set ORA # operand
set_ax absORa,0
> load_flag 0
3116 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
3118 : 48 > pha ;use stack to load status
3119 : bd5602 > lda absORa,x ;precharge accu
311c : 28 > plp
311d : 200e02 jsr ex_orai ;execute ORA # in RAM
tst_ax absrlo,absflo,0
3120 : 08 > php ;save flags
3121 : dd6202 > cmp absrlo,x ;test result
> trap_ne
3124 : d0fe > bne * ;failed not equal (non zero)
>
3126 : 68 > pla ;load status
> eor_flag 0
3127 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
3129 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
312c : d0fe > bne * ;failed not equal (non zero)
>
312e : ca dex
312f : 10e0 bpl tora
3131 : a203 ldx #3
3133 : b518 tora1 lda zpOR,x
3135 : 8d0f02 sta ex_orai+1 ;set ORA # operand
set_ax absORa,$ff
> load_flag $ff
3138 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
313a : 48 > pha ;use stack to load status
313b : bd5602 > lda absORa,x ;precharge accu
313e : 28 > plp
313f : 200e02 jsr ex_orai ;execute ORA # in RAM
tst_ax absrlo,absflo,$ff-fnz
3142 : 08 > php ;save flags
3143 : dd6202 > cmp absrlo,x ;test result
> trap_ne
3146 : d0fe > bne * ;failed not equal (non zero)
>
3148 : 68 > pla ;load status
> eor_flag $ff-fnz
3149 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
314b : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
314e : d0fe > bne * ;failed not equal (non zero)
>
3150 : ca dex
3151 : 10e0 bpl tora1
3153 : a203 ldx #3 ;zp
3155 : b518 tora2 lda zpOR,x
3157 : 850c sta zpt
set_ax absORa,0
> load_flag 0
3159 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
315b : 48 > pha ;use stack to load status
315c : bd5602 > lda absORa,x ;precharge accu
315f : 28 > plp
3160 : 050c ora zpt
tst_ax absrlo,absflo,0
3162 : 08 > php ;save flags
3163 : dd6202 > cmp absrlo,x ;test result
> trap_ne
3166 : d0fe > bne * ;failed not equal (non zero)
>
3168 : 68 > pla ;load status
> eor_flag 0
3169 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
316b : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
316e : d0fe > bne * ;failed not equal (non zero)
>
3170 : ca dex
3171 : 10e2 bpl tora2
3173 : a203 ldx #3
3175 : b518 tora3 lda zpOR,x
3177 : 850c sta zpt
set_ax absORa,$ff
> load_flag $ff
3179 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
317b : 48 > pha ;use stack to load status
317c : bd5602 > lda absORa,x ;precharge accu
317f : 28 > plp
3180 : 050c ora zpt
tst_ax absrlo,absflo,$ff-fnz
3182 : 08 > php ;save flags
3183 : dd6202 > cmp absrlo,x ;test result
> trap_ne
3186 : d0fe > bne * ;failed not equal (non zero)
>
3188 : 68 > pla ;load status
> eor_flag $ff-fnz
3189 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
318b : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
318e : d0fe > bne * ;failed not equal (non zero)
>
3190 : ca dex
3191 : 10e2 bpl tora3
3193 : a203 ldx #3 ;abs
3195 : b518 tora4 lda zpOR,x
3197 : 8d0302 sta abst
set_ax absORa,0
> load_flag 0
319a : a900 > lda #0 ;allow test to change I-flag (no mask)
>
319c : 48 > pha ;use stack to load status
319d : bd5602 > lda absORa,x ;precharge accu
31a0 : 28 > plp
31a1 : 0d0302 ora abst
tst_ax absrlo,absflo,0
31a4 : 08 > php ;save flags
31a5 : dd6202 > cmp absrlo,x ;test result
> trap_ne
31a8 : d0fe > bne * ;failed not equal (non zero)
>
31aa : 68 > pla ;load status
> eor_flag 0
31ab : 4930 > eor #0|fao ;invert expected flags + always on bits
>
31ad : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
31b0 : d0fe > bne * ;failed not equal (non zero)
>
31b2 : ca dex
31b3 : 10e0 bpl tora4
31b5 : a203 ldx #3
31b7 : b518 tora5 lda zpOR,x
31b9 : 8d0302 sta abst
set_ax absORa,$ff
> load_flag $ff
31bc : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
31be : 48 > pha ;use stack to load status
31bf : bd5602 > lda absORa,x ;precharge accu
31c2 : 28 > plp
31c3 : 0d0302 ora abst
tst_ax absrlo,absflo,$ff-fnz
31c6 : 08 > php ;save flags
31c7 : dd6202 > cmp absrlo,x ;test result
> trap_ne
31ca : d0fe > bne * ;failed not equal (non zero)
>
31cc : 68 > pla ;load status
> eor_flag $ff-fnz
31cd : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
31cf : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
31d2 : d0fe > bne * ;failed not equal (non zero)
>
31d4 : ca dex
31d5 : 1002 bpl tora6
31d7 : a203 ldx #3 ;zp,x
31d9 : tora6
set_ax absORa,0
> load_flag 0
31d9 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
31db : 48 > pha ;use stack to load status
31dc : bd5602 > lda absORa,x ;precharge accu
31df : 28 > plp
31e0 : 1518 ora zpOR,x
tst_ax absrlo,absflo,0
31e2 : 08 > php ;save flags
31e3 : dd6202 > cmp absrlo,x ;test result
> trap_ne
31e6 : d0fe > bne * ;failed not equal (non zero)
>
31e8 : 68 > pla ;load status
> eor_flag 0
31e9 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
31eb : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
31ee : d0fe > bne * ;failed not equal (non zero)
>
31f0 : ca dex
31f1 : 10e6 bpl tora6
31f3 : a203 ldx #3
31f5 : tora7
set_ax absORa,$ff
> load_flag $ff
31f5 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
31f7 : 48 > pha ;use stack to load status
31f8 : bd5602 > lda absORa,x ;precharge accu
31fb : 28 > plp
31fc : 1518 ora zpOR,x
tst_ax absrlo,absflo,$ff-fnz
31fe : 08 > php ;save flags
31ff : dd6202 > cmp absrlo,x ;test result
> trap_ne
3202 : d0fe > bne * ;failed not equal (non zero)
>
3204 : 68 > pla ;load status
> eor_flag $ff-fnz
3205 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
3207 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
320a : d0fe > bne * ;failed not equal (non zero)
>
320c : ca dex
320d : 10e6 bpl tora7
320f : a203 ldx #3 ;abs,x
3211 : tora8
set_ax absORa,0
> load_flag 0
3211 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
3213 : 48 > pha ;use stack to load status
3214 : bd5602 > lda absORa,x ;precharge accu
3217 : 28 > plp
3218 : 1d4a02 ora absOR,x
tst_ax absrlo,absflo,0
321b : 08 > php ;save flags
321c : dd6202 > cmp absrlo,x ;test result
> trap_ne
321f : d0fe > bne * ;failed not equal (non zero)
>
3221 : 68 > pla ;load status
> eor_flag 0
3222 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
3224 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
3227 : d0fe > bne * ;failed not equal (non zero)
>
3229 : ca dex
322a : 10e5 bpl tora8
322c : a203 ldx #3
322e : tora9
set_ax absORa,$ff
> load_flag $ff
322e : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
3230 : 48 > pha ;use stack to load status
3231 : bd5602 > lda absORa,x ;precharge accu
3234 : 28 > plp
3235 : 1d4a02 ora absOR,x
tst_ax absrlo,absflo,$ff-fnz
3238 : 08 > php ;save flags
3239 : dd6202 > cmp absrlo,x ;test result
> trap_ne
323c : d0fe > bne * ;failed not equal (non zero)
>
323e : 68 > pla ;load status
> eor_flag $ff-fnz
323f : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
3241 : dd6602 > cmp absflo,x ;test flags
> trap_ne ;
3244 : d0fe > bne * ;failed not equal (non zero)
>
3246 : ca dex
3247 : 10e5 bpl tora9
3249 : a003 ldy #3 ;abs,y
324b : tora10
set_ay absORa,0
> load_flag 0
324b : a900 > lda #0 ;allow test to change I-flag (no mask)
>
324d : 48 > pha ;use stack to load status
324e : b95602 > lda absORa,y ;precharge accu
3251 : 28 > plp
3252 : 194a02 ora absOR,y
tst_ay absrlo,absflo,0
3255 : 08 > php ;save flags
3256 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
3259 : d0fe > bne * ;failed not equal (non zero)
>
325b : 68 > pla ;load status
> eor_flag 0
325c : 4930 > eor #0|fao ;invert expected flags + always on bits
>
325e : d96602 > cmp absflo,y ;test flags
> trap_ne
3261 : d0fe > bne * ;failed not equal (non zero)
>
3263 : 88 dey
3264 : 10e5 bpl tora10
3266 : a003 ldy #3
3268 : tora11
set_ay absORa,$ff
> load_flag $ff
3268 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
326a : 48 > pha ;use stack to load status
326b : b95602 > lda absORa,y ;precharge accu
326e : 28 > plp
326f : 194a02 ora absOR,y
tst_ay absrlo,absflo,$ff-fnz
3272 : 08 > php ;save flags
3273 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
3276 : d0fe > bne * ;failed not equal (non zero)
>
3278 : 68 > pla ;load status
> eor_flag $ff-fnz
3279 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
327b : d96602 > cmp absflo,y ;test flags
> trap_ne
327e : d0fe > bne * ;failed not equal (non zero)
>
3280 : 88 dey
3281 : 10e5 bpl tora11
3283 : a206 ldx #6 ;(zp,x)
3285 : a003 ldy #3
3287 : tora12
set_ay absORa,0
> load_flag 0
3287 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
3289 : 48 > pha ;use stack to load status
328a : b95602 > lda absORa,y ;precharge accu
328d : 28 > plp
328e : 014a ora (indOR,x)
tst_ay absrlo,absflo,0
3290 : 08 > php ;save flags
3291 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
3294 : d0fe > bne * ;failed not equal (non zero)
>
3296 : 68 > pla ;load status
> eor_flag 0
3297 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
3299 : d96602 > cmp absflo,y ;test flags
> trap_ne
329c : d0fe > bne * ;failed not equal (non zero)
>
329e : ca dex
329f : ca dex
32a0 : 88 dey
32a1 : 10e4 bpl tora12
32a3 : a206 ldx #6
32a5 : a003 ldy #3
32a7 : tora13
set_ay absORa,$ff
> load_flag $ff
32a7 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
32a9 : 48 > pha ;use stack to load status
32aa : b95602 > lda absORa,y ;precharge accu
32ad : 28 > plp
32ae : 014a ora (indOR,x)
tst_ay absrlo,absflo,$ff-fnz
32b0 : 08 > php ;save flags
32b1 : d96202 > cmp absrlo,y ;test result
> trap_ne ;
32b4 : d0fe > bne * ;failed not equal (non zero)
>
32b6 : 68 > pla ;load status
> eor_flag $ff-fnz
32b7 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
32b9 : d96602 > cmp absflo,y ;test flags
> trap_ne
32bc : d0fe > bne * ;failed not equal (non zero)
>
32be : ca dex
32bf : ca dex
32c0 : 88 dey
32c1 : 10e4 bpl tora13
32c3 : a003 ldy #3 ;(zp),y
32c5 : tora14
set_ay absORa,0
> load_flag 0
32c5 : a900 > lda #0 ;allow test to change I-flag (no mask)
>
32c7 : 48 > pha ;use stack to load status
32c8 : b95602 > lda absORa,y ;precharge accu
32cb : 28 > plp
32cc : 114a ora (indOR),y
tst_ay absrlo,absflo,0
32ce : 08 > php ;save flags
32cf : d96202 > cmp absrlo,y ;test result
> trap_ne ;
32d2 : d0fe > bne * ;failed not equal (non zero)
>
32d4 : 68 > pla ;load status
> eor_flag 0
32d5 : 4930 > eor #0|fao ;invert expected flags + always on bits
>
32d7 : d96602 > cmp absflo,y ;test flags
> trap_ne
32da : d0fe > bne * ;failed not equal (non zero)
>
32dc : 88 dey
32dd : 10e6 bpl tora14
32df : a003 ldy #3
32e1 : tora15
set_ay absORa,$ff
> load_flag $ff
32e1 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
32e3 : 48 > pha ;use stack to load status
32e4 : b95602 > lda absORa,y ;precharge accu
32e7 : 28 > plp
32e8 : 114a ora (indOR),y
tst_ay absrlo,absflo,$ff-fnz
32ea : 08 > php ;save flags
32eb : d96202 > cmp absrlo,y ;test result
> trap_ne ;
32ee : d0fe > bne * ;failed not equal (non zero)
>
32f0 : 68 > pla ;load status
> eor_flag $ff-fnz
32f1 : 497d > eor #$ff-fnz|fao ;invert expected flags + always on bits
>
32f3 : d96602 > cmp absflo,y ;test flags
> trap_ne
32f6 : d0fe > bne * ;failed not equal (non zero)
>
32f8 : 88 dey
32f9 : 10e6 bpl tora15
if I_flag = 3
32fb : 58 cli
endif
next_test
32fc : ad0002 > lda test_case ;previous test
32ff : c928 > cmp #test_num
> trap_ne ;test is out of sequence
3301 : d0fe > bne * ;failed not equal (non zero)
>
0029 = >test_num = test_num + 1
3303 : a929 > lda #test_num ;*** next tests' number
3305 : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; full binary add/subtract test
; iterates through all combinations of operands and carry input
; uses increments/decrements to predict result & result flags
3308 : d8 cld
3309 : a20e ldx #ad2 ;for indexed test
330b : a0ff ldy #$ff ;max range
330d : a900 lda #0 ;start with adding zeroes & no carry
330f : 850c sta adfc ;carry in - for diag
3311 : 850d sta ad1 ;operand 1 - accumulator
3313 : 850e sta ad2 ;operand 2 - memory or immediate
3315 : 8d0302 sta ada2 ;non zp
3318 : 850f sta adrl ;expected result bits 0-7
331a : 8510 sta adrh ;expected result bit 8 (carry out)
331c : a9ff lda #$ff ;complemented operand 2 for subtract
331e : 8512 sta sb2
3320 : 8d0402 sta sba2 ;non zp
3323 : a902 lda #2 ;expected Z-flag
3325 : 8511 sta adrf
3327 : 18 tadd clc ;test with carry clear
3328 : 20a235 jsr chkadd
332b : e60c inc adfc ;now with carry
332d : e60f inc adrl ;result +1
332f : 08 php ;save N & Z from low result
3330 : 08 php
3331 : 68 pla ;accu holds expected flags
3332 : 2982 and #$82 ;mask N & Z
3334 : 28 plp
3335 : d002 bne tadd1
3337 : e610 inc adrh ;result bit 8 - carry
3339 : 0510 tadd1 ora adrh ;merge C to expected flags
333b : 8511 sta adrf ;save expected flags except overflow
333d : 38 sec ;test with carry set
333e : 20a235 jsr chkadd
3341 : c60c dec adfc ;same for operand +1 but no carry
3343 : e60d inc ad1
3345 : d0e0 bne tadd ;iterate op1
3347 : a900 lda #0 ;preset result to op2 when op1 = 0
3349 : 8510 sta adrh
334b : ee0302 inc ada2
334e : e60e inc ad2
3350 : 08 php ;save NZ as operand 2 becomes the new result
3351 : 68 pla
3352 : 2982 and #$82 ;mask N00000Z0
3354 : 8511 sta adrf ;no need to check carry as we are adding to 0
3356 : c612 dec sb2 ;complement subtract operand 2
3358 : ce0402 dec sba2
335b : a50e lda ad2
335d : 850f sta adrl
335f : d0c6 bne tadd ;iterate op2
if disable_decimal < 1
next_test
3361 : ad0002 > lda test_case ;previous test
3364 : c929 > cmp #test_num
> trap_ne ;test is out of sequence
3366 : d0fe > bne * ;failed not equal (non zero)
>
002a = >test_num = test_num + 1
3368 : a92a > lda #test_num ;*** next tests' number
336a : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; decimal add/subtract test
; *** WARNING - tests documented behavior only! ***
; only valid BCD operands are tested, N V Z flags are ignored
; iterates through all valid combinations of operands and carry input
; uses increments/decrements to predict result & carry flag
336d : f8 sed
336e : a20e ldx #ad2 ;for indexed test
3370 : a0ff ldy #$ff ;max range
3372 : a999 lda #$99 ;start with adding 99 to 99 with carry
3374 : 850d sta ad1 ;operand 1 - accumulator
3376 : 850e sta ad2 ;operand 2 - memory or immediate
3378 : 8d0302 sta ada2 ;non zp
337b : 850f sta adrl ;expected result bits 0-7
337d : a901 lda #1 ;set carry in & out
337f : 850c sta adfc ;carry in - for diag
3381 : 8510 sta adrh ;expected result bit 8 (carry out)
3383 : a900 lda #0 ;complemented operand 2 for subtract
3385 : 8512 sta sb2
3387 : 8d0402 sta sba2 ;non zp
338a : 38 tdad sec ;test with carry set
338b : 206f34 jsr chkdad
338e : c60c dec adfc ;now with carry clear
3390 : a50f lda adrl ;decimal adjust result
3392 : d008 bne tdad1 ;skip clear carry & preset result 99 (9A-1)
3394 : c610 dec adrh
3396 : a999 lda #$99
3398 : 850f sta adrl
339a : d012 bne tdad3
339c : 290f tdad1 and #$f ;lower nibble mask
339e : d00c bne tdad2 ;no decimal adjust needed
33a0 : c60f dec adrl ;decimal adjust (?0-6)
33a2 : c60f dec adrl
33a4 : c60f dec adrl
33a6 : c60f dec adrl
33a8 : c60f dec adrl
33aa : c60f dec adrl
33ac : c60f tdad2 dec adrl ;result -1
33ae : 18 tdad3 clc ;test with carry clear
33af : 206f34 jsr chkdad
33b2 : e60c inc adfc ;same for operand -1 but with carry
33b4 : a50d lda ad1 ;decimal adjust operand 1
33b6 : f015 beq tdad5 ;iterate operand 2
33b8 : 290f and #$f ;lower nibble mask
33ba : d00c bne tdad4 ;skip decimal adjust
33bc : c60d dec ad1 ;decimal adjust (?0-6)
33be : c60d dec ad1
33c0 : c60d dec ad1
33c2 : c60d dec ad1
33c4 : c60d dec ad1
33c6 : c60d dec ad1
33c8 : c60d tdad4 dec ad1 ;operand 1 -1
33ca : 4c8a33 jmp tdad ;iterate op1
33cd : a999 tdad5 lda #$99 ;precharge op1 max
33cf : 850d sta ad1
33d1 : a50e lda ad2 ;decimal adjust operand 2
33d3 : f030 beq tdad7 ;end of iteration
33d5 : 290f and #$f ;lower nibble mask
33d7 : d018 bne tdad6 ;skip decimal adjust
33d9 : c60e dec ad2 ;decimal adjust (?0-6)
33db : c60e dec ad2
33dd : c60e dec ad2
33df : c60e dec ad2
33e1 : c60e dec ad2
33e3 : c60e dec ad2
33e5 : e612 inc sb2 ;complemented decimal adjust for subtract (?9+6)
33e7 : e612 inc sb2
33e9 : e612 inc sb2
33eb : e612 inc sb2
33ed : e612 inc sb2
33ef : e612 inc sb2
33f1 : c60e tdad6 dec ad2 ;operand 2 -1
33f3 : e612 inc sb2 ;complemented operand for subtract
33f5 : a512 lda sb2
33f7 : 8d0402 sta sba2 ;copy as non zp operand
33fa : a50e lda ad2
33fc : 8d0302 sta ada2 ;copy as non zp operand
33ff : 850f sta adrl ;new result since op1+carry=00+carry +op2=op2
3401 : e610 inc adrh ;result carry
3403 : d085 bne tdad ;iterate op2
3405 : tdad7
next_test
3405 : ad0002 > lda test_case ;previous test
3408 : c92a > cmp #test_num
> trap_ne ;test is out of sequence
340a : d0fe > bne * ;failed not equal (non zero)
>
002b = >test_num = test_num + 1
340c : a92b > lda #test_num ;*** next tests' number
340e : 8d0002 > sta test_case
> ;check_ram ;uncomment to find altered RAM after each test
; decimal/binary switch test
; tests CLD, SED, PLP, RTI to properly switch between decimal & binary opcode
; tables
3411 : 18 clc
3412 : d8 cld
3413 : 08 php
3414 : a955 lda #$55
3416 : 6955 adc #$55
3418 : c9aa cmp #$aa
trap_ne ;expected binary result after cld
341a : d0fe > bne * ;failed not equal (non zero)
341c : 18 clc
341d : f8 sed
341e : 08 php
341f : a955 lda #$55
3421 : 6955 adc #$55
3423 : c910 cmp #$10
trap_ne ;expected decimal result after sed
3425 : d0fe > bne * ;failed not equal (non zero)
3427 : d8 cld
3428 : 28 plp
3429 : a955 lda #$55
342b : 6955 adc #$55
342d : c910 cmp #$10
trap_ne ;expected decimal result after plp D=1
342f : d0fe > bne * ;failed not equal (non zero)
3431 : 28 plp
3432 : a955 lda #$55
3434 : 6955 adc #$55
3436 : c9aa cmp #$aa
trap_ne ;expected binary result after plp D=0
3438 : d0fe > bne * ;failed not equal (non zero)
343a : 18 clc
343b : a934 lda #hi bin_rti_ret ;emulated interrupt for rti
343d : 48 pha
343e : a955 lda #lo bin_rti_ret
3440 : 48 pha
3441 : 08 php
3442 : f8 sed
3443 : a934 lda #hi dec_rti_ret ;emulated interrupt for rti
3445 : 48 pha
3446 : a94c lda #lo dec_rti_ret
3448 : 48 pha
3449 : 08 php
344a : d8 cld
344b : 40 rti
344c : dec_rti_ret
344c : a955 lda #$55
344e : 6955 adc #$55
3450 : c910 cmp #$10
trap_ne ;expected decimal result after rti D=1
3452 : d0fe > bne * ;failed not equal (non zero)
3454 : 40 rti
3455 : bin_rti_ret
3455 : a955 lda #$55
3457 : 6955 adc #$55
3459 : c9aa cmp #$aa
trap_ne ;expected binary result after rti D=0
345b : d0fe > bne * ;failed not equal (non zero)
endif
345d : ad0002 lda test_case
3460 : c92b cmp #test_num
trap_ne ;previous test is out of sequence
3462 : d0fe > bne * ;failed not equal (non zero)
3464 : a9f0 lda #$f0 ;mark opcode testing complete
3466 : 8d0002 sta test_case
; final RAM integrity test
; verifies that none of the previous tests has altered RAM outside of the
; designated write areas.
check_ram
> ;RAM check disabled - RAM size not set
; *** DEBUG INFO ***
; to debug checksum errors uncomment check_ram in the next_test macro to
; narrow down the responsible opcode.
; may give false errors when monitor, OS or other background activity is
; allowed during previous tests.
; S U C C E S S ************************************************
; -------------
success ;if you get here everything went well
3469 : 4c6934 > jmp * ;test passed, no errors
; -------------
; S U C C E S S ************************************************
346c : 4c0004 jmp start ;run again
if disable_decimal < 1
; core subroutine of the decimal add/subtract test
; *** WARNING - tests documented behavior only! ***
; only valid BCD operands are tested, N V Z flags are ignored
; iterates through all valid combinations of operands and carry input
; uses increments/decrements to predict result & carry flag
346f : chkdad
; decimal ADC / SBC zp
346f : 08 php ;save carry for subtract
3470 : a50d lda ad1
3472 : 650e adc ad2 ;perform add
3474 : 08 php
3475 : c50f cmp adrl ;check result
trap_ne ;bad result
3477 : d0fe > bne * ;failed not equal (non zero)
3479 : 68 pla ;check flags
347a : 2901 and #1 ;mask carry
347c : c510 cmp adrh
trap_ne ;bad carry
347e : d0fe > bne * ;failed not equal (non zero)
3480 : 28 plp
3481 : 08 php ;save carry for next add
3482 : a50d lda ad1
3484 : e512 sbc sb2 ;perform subtract
3486 : 08 php
3487 : c50f cmp adrl ;check result
trap_ne ;bad result
3489 : d0fe > bne * ;failed not equal (non zero)
348b : 68 pla ;check flags
348c : 2901 and #1 ;mask carry
348e : c510 cmp adrh
trap_ne ;bad flags
3490 : d0fe > bne * ;failed not equal (non zero)
3492 : 28 plp
; decimal ADC / SBC abs
3493 : 08 php ;save carry for subtract
3494 : a50d lda ad1
3496 : 6d0302 adc ada2 ;perform add
3499 : 08 php
349a : c50f cmp adrl ;check result
trap_ne ;bad result
349c : d0fe > bne * ;failed not equal (non zero)
349e : 68 pla ;check flags
349f : 2901 and #1 ;mask carry
34a1 : c510 cmp adrh
trap_ne ;bad carry
34a3 : d0fe > bne * ;failed not equal (non zero)
34a5 : 28 plp
34a6 : 08 php ;save carry for next add
34a7 : a50d lda ad1
34a9 : ed0402 sbc sba2 ;perform subtract
34ac : 08 php
34ad : c50f cmp adrl ;check result
trap_ne ;bad result
34af : d0fe > bne * ;failed not equal (non zero)
34b1 : 68 pla ;check flags
34b2 : 2901 and #1 ;mask carry
34b4 : c510 cmp adrh
trap_ne ;bad carry
34b6 : d0fe > bne * ;failed not equal (non zero)
34b8 : 28 plp
; decimal ADC / SBC #
34b9 : 08 php ;save carry for subtract
34ba : a50e lda ad2
34bc : 8d1202 sta ex_adci+1 ;set ADC # operand
34bf : a50d lda ad1
34c1 : 201102 jsr ex_adci ;execute ADC # in RAM
34c4 : 08 php
34c5 : c50f cmp adrl ;check result
trap_ne ;bad result
34c7 : d0fe > bne * ;failed not equal (non zero)
34c9 : 68 pla ;check flags
34ca : 2901 and #1 ;mask carry
34cc : c510 cmp adrh
trap_ne ;bad carry
34ce : d0fe > bne * ;failed not equal (non zero)
34d0 : 28 plp
34d1 : 08 php ;save carry for next add
34d2 : a512 lda sb2
34d4 : 8d1502 sta ex_sbci+1 ;set SBC # operand
34d7 : a50d lda ad1
34d9 : 201402 jsr ex_sbci ;execute SBC # in RAM
34dc : 08 php
34dd : c50f cmp adrl ;check result
trap_ne ;bad result
34df : d0fe > bne * ;failed not equal (non zero)
34e1 : 68 pla ;check flags
34e2 : 2901 and #1 ;mask carry
34e4 : c510 cmp adrh
trap_ne ;bad carry
34e6 : d0fe > bne * ;failed not equal (non zero)
34e8 : 28 plp
; decimal ADC / SBC zp,x
34e9 : 08 php ;save carry for subtract
34ea : a50d lda ad1
34ec : 7500 adc 0,x ;perform add
34ee : 08 php
34ef : c50f cmp adrl ;check result
trap_ne ;bad result
34f1 : d0fe > bne * ;failed not equal (non zero)
34f3 : 68 pla ;check flags
34f4 : 2901 and #1 ;mask carry
34f6 : c510 cmp adrh
trap_ne ;bad carry
34f8 : d0fe > bne * ;failed not equal (non zero)
34fa : 28 plp
34fb : 08 php ;save carry for next add
34fc : a50d lda ad1
34fe : f504 sbc sb2-ad2,x ;perform subtract
3500 : 08 php
3501 : c50f cmp adrl ;check result
trap_ne ;bad result
3503 : d0fe > bne * ;failed not equal (non zero)
3505 : 68 pla ;check flags
3506 : 2901 and #1 ;mask carry
3508 : c510 cmp adrh
trap_ne ;bad carry
350a : d0fe > bne * ;failed not equal (non zero)
350c : 28 plp
; decimal ADC / SBC abs,x
350d : 08 php ;save carry for subtract
350e : a50d lda ad1
3510 : 7df501 adc ada2-ad2,x ;perform add
3513 : 08 php
3514 : c50f cmp adrl ;check result
trap_ne ;bad result
3516 : d0fe > bne * ;failed not equal (non zero)
3518 : 68 pla ;check flags
3519 : 2901 and #1 ;mask carry
351b : c510 cmp adrh
trap_ne ;bad carry
351d : d0fe > bne * ;failed not equal (non zero)
351f : 28 plp
3520 : 08 php ;save carry for next add
3521 : a50d lda ad1
3523 : fdf601 sbc sba2-ad2,x ;perform subtract
3526 : 08 php
3527 : c50f cmp adrl ;check result
trap_ne ;bad result
3529 : d0fe > bne * ;failed not equal (non zero)
352b : 68 pla ;check flags
352c : 2901 and #1 ;mask carry
352e : c510 cmp adrh
trap_ne ;bad carry
3530 : d0fe > bne * ;failed not equal (non zero)
3532 : 28 plp
; decimal ADC / SBC abs,y
3533 : 08 php ;save carry for subtract
3534 : a50d lda ad1
3536 : 790401 adc ada2-$ff,y ;perform add
3539 : 08 php
353a : c50f cmp adrl ;check result
trap_ne ;bad result
353c : d0fe > bne * ;failed not equal (non zero)
353e : 68 pla ;check flags
353f : 2901 and #1 ;mask carry
3541 : c510 cmp adrh
trap_ne ;bad carry
3543 : d0fe > bne * ;failed not equal (non zero)
3545 : 28 plp
3546 : 08 php ;save carry for next add
3547 : a50d lda ad1
3549 : f90501 sbc sba2-$ff,y ;perform subtract
354c : 08 php
354d : c50f cmp adrl ;check result
trap_ne ;bad result
354f : d0fe > bne * ;failed not equal (non zero)
3551 : 68 pla ;check flags
3552 : 2901 and #1 ;mask carry
3554 : c510 cmp adrh
trap_ne ;bad carry
3556 : d0fe > bne * ;failed not equal (non zero)
3558 : 28 plp
; decimal ADC / SBC (zp,x)
3559 : 08 php ;save carry for subtract
355a : a50d lda ad1
355c : 6144 adc (lo adi2-ad2,x) ;perform add
355e : 08 php
355f : c50f cmp adrl ;check result
trap_ne ;bad result
3561 : d0fe > bne * ;failed not equal (non zero)
3563 : 68 pla ;check flags
3564 : 2901 and #1 ;mask carry
3566 : c510 cmp adrh
trap_ne ;bad carry
3568 : d0fe > bne * ;failed not equal (non zero)
356a : 28 plp
356b : 08 php ;save carry for next add
356c : a50d lda ad1
356e : e146 sbc (lo sbi2-ad2,x) ;perform subtract
3570 : 08 php
3571 : c50f cmp adrl ;check result
trap_ne ;bad result
3573 : d0fe > bne * ;failed not equal (non zero)
3575 : 68 pla ;check flags
3576 : 2901 and #1 ;mask carry
3578 : c510 cmp adrh
trap_ne ;bad carry
357a : d0fe > bne * ;failed not equal (non zero)
357c : 28 plp
; decimal ADC / SBC (abs),y
357d : 08 php ;save carry for subtract
357e : a50d lda ad1
3580 : 7156 adc (adiy2),y ;perform add
3582 : 08 php
3583 : c50f cmp adrl ;check result
trap_ne ;bad result
3585 : d0fe > bne * ;failed not equal (non zero)
3587 : 68 pla ;check flags
3588 : 2901 and #1 ;mask carry
358a : c510 cmp adrh
trap_ne ;bad carry
358c : d0fe > bne * ;failed not equal (non zero)
358e : 28 plp
358f : 08 php ;save carry for next add
3590 : a50d lda ad1
3592 : f158 sbc (sbiy2),y ;perform subtract
3594 : 08 php
3595 : c50f cmp adrl ;check result
trap_ne ;bad result
3597 : d0fe > bne * ;failed not equal (non zero)
3599 : 68 pla ;check flags
359a : 2901 and #1 ;mask carry
359c : c510 cmp adrh
trap_ne ;bad carry
359e : d0fe > bne * ;failed not equal (non zero)
35a0 : 28 plp
35a1 : 60 rts
endif
; core subroutine of the full binary add/subtract test
; iterates through all combinations of operands and carry input
; uses increments/decrements to predict result & result flags
35a2 : a511 chkadd lda adrf ;add V-flag if overflow
35a4 : 2983 and #$83 ;keep N-----ZC / clear V
35a6 : 48 pha
35a7 : a50d lda ad1 ;test sign unequal between operands
35a9 : 450e eor ad2
35ab : 300a bmi ckad1 ;no overflow possible - operands have different sign
35ad : a50d lda ad1 ;test sign equal between operands and result
35af : 450f eor adrl
35b1 : 1004 bpl ckad1 ;no overflow occured - operand and result have same sign
35b3 : 68 pla
35b4 : 0940 ora #$40 ;set V
35b6 : 48 pha
35b7 : 68 ckad1 pla
35b8 : 8511 sta adrf ;save expected flags
; binary ADC / SBC zp
35ba : 08 php ;save carry for subtract
35bb : a50d lda ad1
35bd : 650e adc ad2 ;perform add
35bf : 08 php
35c0 : c50f cmp adrl ;check result
trap_ne ;bad result
35c2 : d0fe > bne * ;failed not equal (non zero)
35c4 : 68 pla ;check flags
35c5 : 29c3 and #$c3 ;mask NV----ZC
35c7 : c511 cmp adrf
trap_ne ;bad flags
35c9 : d0fe > bne * ;failed not equal (non zero)
35cb : 28 plp
35cc : 08 php ;save carry for next add
35cd : a50d lda ad1
35cf : e512 sbc sb2 ;perform subtract
35d1 : 08 php
35d2 : c50f cmp adrl ;check result
trap_ne ;bad result
35d4 : d0fe > bne * ;failed not equal (non zero)
35d6 : 68 pla ;check flags
35d7 : 29c3 and #$c3 ;mask NV----ZC
35d9 : c511 cmp adrf
trap_ne ;bad flags
35db : d0fe > bne * ;failed not equal (non zero)
35dd : 28 plp
; binary ADC / SBC abs
35de : 08 php ;save carry for subtract
35df : a50d lda ad1
35e1 : 6d0302 adc ada2 ;perform add
35e4 : 08 php
35e5 : c50f cmp adrl ;check result
trap_ne ;bad result
35e7 : d0fe > bne * ;failed not equal (non zero)
35e9 : 68 pla ;check flags
35ea : 29c3 and #$c3 ;mask NV----ZC
35ec : c511 cmp adrf
trap_ne ;bad flags
35ee : d0fe > bne * ;failed not equal (non zero)
35f0 : 28 plp
35f1 : 08 php ;save carry for next add
35f2 : a50d lda ad1
35f4 : ed0402 sbc sba2 ;perform subtract
35f7 : 08 php
35f8 : c50f cmp adrl ;check result
trap_ne ;bad result
35fa : d0fe > bne * ;failed not equal (non zero)
35fc : 68 pla ;check flags
35fd : 29c3 and #$c3 ;mask NV----ZC
35ff : c511 cmp adrf
trap_ne ;bad flags
3601 : d0fe > bne * ;failed not equal (non zero)
3603 : 28 plp
; binary ADC / SBC #
3604 : 08 php ;save carry for subtract
3605 : a50e lda ad2
3607 : 8d1202 sta ex_adci+1 ;set ADC # operand
360a : a50d lda ad1
360c : 201102 jsr ex_adci ;execute ADC # in RAM
360f : 08 php
3610 : c50f cmp adrl ;check result
trap_ne ;bad result
3612 : d0fe > bne * ;failed not equal (non zero)
3614 : 68 pla ;check flags
3615 : 29c3 and #$c3 ;mask NV----ZC
3617 : c511 cmp adrf
trap_ne ;bad flags
3619 : d0fe > bne * ;failed not equal (non zero)
361b : 28 plp
361c : 08 php ;save carry for next add
361d : a512 lda sb2
361f : 8d1502 sta ex_sbci+1 ;set SBC # operand
3622 : a50d lda ad1
3624 : 201402 jsr ex_sbci ;execute SBC # in RAM
3627 : 08 php
3628 : c50f cmp adrl ;check result
trap_ne ;bad result
362a : d0fe > bne * ;failed not equal (non zero)
362c : 68 pla ;check flags
362d : 29c3 and #$c3 ;mask NV----ZC
362f : c511 cmp adrf
trap_ne ;bad flags
3631 : d0fe > bne * ;failed not equal (non zero)
3633 : 28 plp
; binary ADC / SBC zp,x
3634 : 08 php ;save carry for subtract
3635 : a50d lda ad1
3637 : 7500 adc 0,x ;perform add
3639 : 08 php
363a : c50f cmp adrl ;check result
trap_ne ;bad result
363c : d0fe > bne * ;failed not equal (non zero)
363e : 68 pla ;check flags
363f : 29c3 and #$c3 ;mask NV----ZC
3641 : c511 cmp adrf
trap_ne ;bad flags
3643 : d0fe > bne * ;failed not equal (non zero)
3645 : 28 plp
3646 : 08 php ;save carry for next add
3647 : a50d lda ad1
3649 : f504 sbc sb2-ad2,x ;perform subtract
364b : 08 php
364c : c50f cmp adrl ;check result
trap_ne ;bad result
364e : d0fe > bne * ;failed not equal (non zero)
3650 : 68 pla ;check flags
3651 : 29c3 and #$c3 ;mask NV----ZC
3653 : c511 cmp adrf
trap_ne ;bad flags
3655 : d0fe > bne * ;failed not equal (non zero)
3657 : 28 plp
; binary ADC / SBC abs,x
3658 : 08 php ;save carry for subtract
3659 : a50d lda ad1
365b : 7df501 adc ada2-ad2,x ;perform add
365e : 08 php
365f : c50f cmp adrl ;check result
trap_ne ;bad result
3661 : d0fe > bne * ;failed not equal (non zero)
3663 : 68 pla ;check flags
3664 : 29c3 and #$c3 ;mask NV----ZC
3666 : c511 cmp adrf
trap_ne ;bad flags
3668 : d0fe > bne * ;failed not equal (non zero)
366a : 28 plp
366b : 08 php ;save carry for next add
366c : a50d lda ad1
366e : fdf601 sbc sba2-ad2,x ;perform subtract
3671 : 08 php
3672 : c50f cmp adrl ;check result
trap_ne ;bad result
3674 : d0fe > bne * ;failed not equal (non zero)
3676 : 68 pla ;check flags
3677 : 29c3 and #$c3 ;mask NV----ZC
3679 : c511 cmp adrf
trap_ne ;bad flags
367b : d0fe > bne * ;failed not equal (non zero)
367d : 28 plp
; binary ADC / SBC abs,y
367e : 08 php ;save carry for subtract
367f : a50d lda ad1
3681 : 790401 adc ada2-$ff,y ;perform add
3684 : 08 php
3685 : c50f cmp adrl ;check result
trap_ne ;bad result
3687 : d0fe > bne * ;failed not equal (non zero)
3689 : 68 pla ;check flags
368a : 29c3 and #$c3 ;mask NV----ZC
368c : c511 cmp adrf
trap_ne ;bad flags
368e : d0fe > bne * ;failed not equal (non zero)
3690 : 28 plp
3691 : 08 php ;save carry for next add
3692 : a50d lda ad1
3694 : f90501 sbc sba2-$ff,y ;perform subtract
3697 : 08 php
3698 : c50f cmp adrl ;check result
trap_ne ;bad result
369a : d0fe > bne * ;failed not equal (non zero)
369c : 68 pla ;check flags
369d : 29c3 and #$c3 ;mask NV----ZC
369f : c511 cmp adrf
trap_ne ;bad flags
36a1 : d0fe > bne * ;failed not equal (non zero)
36a3 : 28 plp
; binary ADC / SBC (zp,x)
36a4 : 08 php ;save carry for subtract
36a5 : a50d lda ad1
36a7 : 6144 adc (lo adi2-ad2,x) ;perform add
36a9 : 08 php
36aa : c50f cmp adrl ;check result
trap_ne ;bad result
36ac : d0fe > bne * ;failed not equal (non zero)
36ae : 68 pla ;check flags
36af : 29c3 and #$c3 ;mask NV----ZC
36b1 : c511 cmp adrf
trap_ne ;bad flags
36b3 : d0fe > bne * ;failed not equal (non zero)
36b5 : 28 plp
36b6 : 08 php ;save carry for next add
36b7 : a50d lda ad1
36b9 : e146 sbc (lo sbi2-ad2,x) ;perform subtract
36bb : 08 php
36bc : c50f cmp adrl ;check result
trap_ne ;bad result
36be : d0fe > bne * ;failed not equal (non zero)
36c0 : 68 pla ;check flags
36c1 : 29c3 and #$c3 ;mask NV----ZC
36c3 : c511 cmp adrf
trap_ne ;bad flags
36c5 : d0fe > bne * ;failed not equal (non zero)
36c7 : 28 plp
; binary ADC / SBC (abs),y
36c8 : 08 php ;save carry for subtract
36c9 : a50d lda ad1
36cb : 7156 adc (adiy2),y ;perform add
36cd : 08 php
36ce : c50f cmp adrl ;check result
trap_ne ;bad result
36d0 : d0fe > bne * ;failed not equal (non zero)
36d2 : 68 pla ;check flags
36d3 : 29c3 and #$c3 ;mask NV----ZC
36d5 : c511 cmp adrf
trap_ne ;bad flags
36d7 : d0fe > bne * ;failed not equal (non zero)
36d9 : 28 plp
36da : 08 php ;save carry for next add
36db : a50d lda ad1
36dd : f158 sbc (sbiy2),y ;perform subtract
36df : 08 php
36e0 : c50f cmp adrl ;check result
trap_ne ;bad result
36e2 : d0fe > bne * ;failed not equal (non zero)
36e4 : 68 pla ;check flags
36e5 : 29c3 and #$c3 ;mask NV----ZC
36e7 : c511 cmp adrf
trap_ne ;bad flags
36e9 : d0fe > bne * ;failed not equal (non zero)
36eb : 28 plp
36ec : 60 rts
; target for the jump absolute test
36ed : 88 dey
36ee : 88 dey
36ef : test_far
36ef : 08 php ;either SP or Y count will fail, if we do not hit
36f0 : 88 dey
36f1 : 88 dey
36f2 : 88 dey
36f3 : 28 plp
trap_cs ;flags loaded?
36f4 : b0fe > bcs * ;failed carry set
trap_vs
36f6 : 70fe > bvs * ;failed overflow set
trap_mi
36f8 : 30fe > bmi * ;failed minus (bit 7 set)
trap_eq
36fa : f0fe > beq * ;failed equal (zero)
36fc : c946 cmp #'F' ;registers loaded?
trap_ne
36fe : d0fe > bne * ;failed not equal (non zero)
3700 : e041 cpx #'A'
trap_ne
3702 : d0fe > bne * ;failed not equal (non zero)
3704 : c04f cpy #('R'-3)
trap_ne
3706 : d0fe > bne * ;failed not equal (non zero)
3708 : 48 pha ;save a,x
3709 : 8a txa
370a : 48 pha
370b : ba tsx
370c : e0fd cpx #$fd ;check SP
trap_ne
370e : d0fe > bne * ;failed not equal (non zero)
3710 : 68 pla ;restore x
3711 : aa tax
set_stat $ff
> load_flag $ff
3712 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
3714 : 48 > pha ;use stack to load status
3715 : 28 > plp
3716 : 68 pla ;restore a
3717 : e8 inx ;return registers with modifications
3718 : 49aa eor #$aa ;N=1, V=1, Z=0, C=1
371a : 4c0f09 jmp far_ret
; target for the jump indirect test
371d : 00 align
371e : 2737 ptr_tst_ind dw test_ind
3720 : 6409 ptr_ind_ret dw ind_ret
trap ;runover protection
3722 : 4c2237 > jmp * ;failed anyway
3725 : 88 dey
3726 : 88 dey
3727 : test_ind
3727 : 08 php ;either SP or Y count will fail, if we do not hit
3728 : 88 dey
3729 : 88 dey
372a : 88 dey
372b : 28 plp
trap_cs ;flags loaded?
372c : b0fe > bcs * ;failed carry set
trap_vs
372e : 70fe > bvs * ;failed overflow set
trap_mi
3730 : 30fe > bmi * ;failed minus (bit 7 set)
trap_eq
3732 : f0fe > beq * ;failed equal (zero)
3734 : c949 cmp #'I' ;registers loaded?
trap_ne
3736 : d0fe > bne * ;failed not equal (non zero)
3738 : e04e cpx #'N'
trap_ne
373a : d0fe > bne * ;failed not equal (non zero)
373c : c041 cpy #('D'-3)
trap_ne
373e : d0fe > bne * ;failed not equal (non zero)
3740 : 48 pha ;save a,x
3741 : 8a txa
3742 : 48 pha
3743 : ba tsx
3744 : e0fd cpx #$fd ;check SP
trap_ne
3746 : d0fe > bne * ;failed not equal (non zero)
3748 : 68 pla ;restore x
3749 : aa tax
set_stat $ff
> load_flag $ff
374a : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
374c : 48 > pha ;use stack to load status
374d : 28 > plp
374e : 68 pla ;restore a
374f : e8 inx ;return registers with modifications
3750 : 49aa eor #$aa ;N=1, V=1, Z=0, C=1
3752 : 6c2037 jmp (ptr_ind_ret)
trap ;runover protection
3755 : 4c5537 > jmp * ;failed anyway
3758 : 4c0004 jmp start ;catastrophic error - cannot continue
; target for the jump subroutine test
375b : 88 dey
375c : 88 dey
375d : test_jsr
375d : 08 php ;either SP or Y count will fail, if we do not hit
375e : 88 dey
375f : 88 dey
3760 : 88 dey
3761 : 28 plp
trap_cs ;flags loaded?
3762 : b0fe > bcs * ;failed carry set
trap_vs
3764 : 70fe > bvs * ;failed overflow set
trap_mi
3766 : 30fe > bmi * ;failed minus (bit 7 set)
trap_eq
3768 : f0fe > beq * ;failed equal (zero)
376a : c94a cmp #'J' ;registers loaded?
trap_ne
376c : d0fe > bne * ;failed not equal (non zero)
376e : e053 cpx #'S'
trap_ne
3770 : d0fe > bne * ;failed not equal (non zero)
3772 : c04f cpy #('R'-3)
trap_ne
3774 : d0fe > bne * ;failed not equal (non zero)
3776 : 48 pha ;save a,x
3777 : 8a txa
3778 : 48 pha
3779 : ba tsx ;sp -4? (return addr,a,x)
377a : e0fb cpx #$fb
trap_ne
377c : d0fe > bne * ;failed not equal (non zero)
377e : adff01 lda $1ff ;propper return on stack
3781 : c909 cmp #hi(jsr_ret)
trap_ne
3783 : d0fe > bne * ;failed not equal (non zero)
3785 : adfe01 lda $1fe
3788 : c99a cmp #lo(jsr_ret)
trap_ne
378a : d0fe > bne * ;failed not equal (non zero)
set_stat $ff
> load_flag $ff
378c : a9ff > lda #$ff ;allow test to change I-flag (no mask)
>
378e : 48 > pha ;use stack to load status
378f : 28 > plp
3790 : 68 pla ;pull x,a
3791 : aa tax
3792 : 68 pla
3793 : e8 inx ;return registers with modifications
3794 : 49aa eor #$aa ;N=1, V=1, Z=0, C=1
3796 : 60 rts
trap ;runover protection
3797 : 4c9737 > jmp * ;failed anyway
379a : 4c0004 jmp start ;catastrophic error - cannot continue
;trap in case of unexpected IRQ, NMI, BRK, RESET - BRK test target
379d : nmi_trap
trap ;check stack for conditions at NMI
379d : 4c9d37 > jmp * ;failed anyway
37a0 : 4c0004 jmp start ;catastrophic error - cannot continue
37a3 : res_trap
trap ;unexpected RESET
37a3 : 4ca337 > jmp * ;failed anyway
37a6 : 4c0004 jmp start ;catastrophic error - cannot continue
37a9 : 88 dey
37aa : 88 dey
37ab : irq_trap ;BRK test or unextpected BRK or IRQ
37ab : 08 php ;either SP or Y count will fail, if we do not hit
37ac : 88 dey
37ad : 88 dey
37ae : 88 dey
;next traps could be caused by unexpected BRK or IRQ
;check stack for BREAK and originating location
;possible jump/branch into weeds (uninitialized space)
37af : c9bd cmp #$ff-'B' ;BRK pass 2 registers loaded?
37b1 : f042 beq break2
37b3 : c942 cmp #'B' ;BRK pass 1 registers loaded?
trap_ne
37b5 : d0fe > bne * ;failed not equal (non zero)
37b7 : e052 cpx #'R'
trap_ne
37b9 : d0fe > bne * ;failed not equal (non zero)
37bb : c048 cpy #'K'-3
trap_ne
37bd : d0fe > bne * ;failed not equal (non zero)
37bf : 850a sta irq_a ;save registers during break test
37c1 : 860b stx irq_x
37c3 : ba tsx ;test break on stack
37c4 : bd0201 lda $102,x
cmp_flag 0 ;break test should have B=1 & unused=1 on stack
37c7 : c930 > cmp #(0 |fao)&m8 ;expected flags + always on bits
trap_ne ; - no break flag on stack
37c9 : d0fe > bne * ;failed not equal (non zero)
37cb : 68 pla
cmp_flag intdis ;should have added interrupt disable
37cc : c934 > cmp #(intdis |fao)&m8 ;expected flags + always on bits
trap_ne
37ce : d0fe > bne * ;failed not equal (non zero)
37d0 : ba tsx
37d1 : e0fc cpx #$fc ;sp -3? (return addr, flags)
trap_ne
37d3 : d0fe > bne * ;failed not equal (non zero)
37d5 : adff01 lda $1ff ;propper return on stack
37d8 : c909 cmp #hi(brk_ret0)
trap_ne
37da : d0fe > bne * ;failed not equal (non zero)
37dc : adfe01 lda $1fe
37df : c9d1 cmp #lo(brk_ret0)
trap_ne
37e1 : d0fe > bne * ;failed not equal (non zero)
load_flag $ff
37e3 : a9ff > lda #$ff ;allow test to change I-flag (no mask)
37e5 : 48 pha
37e6 : a60b ldx irq_x
37e8 : e8 inx ;return registers with modifications
37e9 : a50a lda irq_a
37eb : 49aa eor #$aa
37ed : 28 plp ;N=1, V=1, Z=1, C=1 but original flags should be restored
37ee : 40 rti
trap ;runover protection
37ef : 4cef37 > jmp * ;failed anyway
37f2 : 4c0004 jmp start ;catastrophic error - cannot continue
37f5 : break2 ;BRK pass 2
37f5 : e0ad cpx #$ff-'R'
trap_ne
37f7 : d0fe > bne * ;failed not equal (non zero)
37f9 : c0b1 cpy #$ff-'K'-3
trap_ne
37fb : d0fe > bne * ;failed not equal (non zero)
37fd : 850a sta irq_a ;save registers during break test
37ff : 860b stx irq_x
3801 : ba tsx ;test break on stack
3802 : bd0201 lda $102,x
cmp_flag $ff ;break test should have B=1
3805 : c9ff > cmp #($ff |fao)&m8 ;expected flags + always on bits
trap_ne ; - no break flag on stack
3807 : d0fe > bne * ;failed not equal (non zero)
3809 : 68 pla
380a : 0908 ora #decmode ;ignore decmode cleared if 65c02
cmp_flag $ff ;actual passed flags
380c : c9ff > cmp #($ff |fao)&m8 ;expected flags + always on bits
trap_ne
380e : d0fe > bne * ;failed not equal (non zero)
3810 : ba tsx
3811 : e0fc cpx #$fc ;sp -3? (return addr, flags)
trap_ne
3813 : d0fe > bne * ;failed not equal (non zero)
3815 : adff01 lda $1ff ;propper return on stack
3818 : c909 cmp #hi(brk_ret1)
trap_ne
381a : d0fe > bne * ;failed not equal (non zero)
381c : adfe01 lda $1fe
381f : c9f7 cmp #lo(brk_ret1)
trap_ne
3821 : d0fe > bne * ;failed not equal (non zero)
load_flag intdis
3823 : a904 > lda #intdis ;allow test to change I-flag (no mask)
3825 : 48 pha
3826 : a60b ldx irq_x
3828 : e8 inx ;return registers with modifications
3829 : a50a lda irq_a
382b : 49aa eor #$aa
382d : 28 plp ;N=0, V=0, Z=0, C=0 but original flags should be restored
382e : 40 rti
trap ;runover protection
382f : 4c2f38 > jmp * ;failed anyway
3832 : 4c0004 jmp start ;catastrophic error - cannot continue
if report = 1
include "report.i65"
endif
;copy of data to initialize BSS segment
if load_data_direct != 1
zp_init
zp1_ db $c3,$82,$41,0 ;test patterns for LDx BIT ROL ROR ASL LSR
zp7f_ db $7f ;test pattern for compare
;logical zeropage operands
zpOR_ db 0,$1f,$71,$80 ;test pattern for OR
zpAN_ db $0f,$ff,$7f,$80 ;test pattern for AND
zpEO_ db $ff,$0f,$8f,$8f ;test pattern for EOR
;indirect addressing pointers
ind1_ dw abs1 ;indirect pointer to pattern in absolute memory
dw abs1+1
dw abs1+2
dw abs1+3
dw abs7f
inw1_ dw abs1-$f8 ;indirect pointer for wrap-test pattern
indt_ dw abst ;indirect pointer to store area in absolute memory
dw abst+1
dw abst+2
dw abst+3
inwt_ dw abst-$f8 ;indirect pointer for wrap-test store
indAN_ dw absAN ;indirect pointer to AND pattern in absolute memory
dw absAN+1
dw absAN+2
dw absAN+3
indEO_ dw absEO ;indirect pointer to EOR pattern in absolute memory
dw absEO+1
dw absEO+2
dw absEO+3
indOR_ dw absOR ;indirect pointer to OR pattern in absolute memory
dw absOR+1
dw absOR+2
dw absOR+3
;add/subtract indirect pointers
adi2_ dw ada2 ;indirect pointer to operand 2 in absolute memory
sbi2_ dw sba2 ;indirect pointer to complemented operand 2 (SBC)
adiy2_ dw ada2-$ff ;with offset for indirect indexed
sbiy2_ dw sba2-$ff
zp_end
if (zp_end - zp_init) != (zp_bss_end - zp_bss)
;force assembler error if size is different
ERROR ERROR ERROR ;mismatch between bss and zeropage data
endif
data_init
ex_and_ and #0 ;execute immediate opcodes
rts
ex_eor_ eor #0 ;execute immediate opcodes
rts
ex_ora_ ora #0 ;execute immediate opcodes
rts
ex_adc_ adc #0 ;execute immediate opcodes
rts
ex_sbc_ sbc #0 ;execute immediate opcodes
rts
abs1_ db $c3,$82,$41,0 ;test patterns for LDx BIT ROL ROR ASL LSR
abs7f_ db $7f ;test pattern for compare
;loads
fLDx_ db fn,fn,0,fz ;expected flags for load
;shifts
rASL_ ;expected result ASL & ROL -carry
rROL_ db $86,$04,$82,0 ; "
rROLc_ db $87,$05,$83,1 ;expected result ROL +carry
rLSR_ ;expected result LSR & ROR -carry
rROR_ db $61,$41,$20,0 ; "
rRORc_ db $e1,$c1,$a0,$80 ;expected result ROR +carry
fASL_ ;expected flags for shifts
fROL_ db fnc,fc,fn,fz ;no carry in
fROLc_ db fnc,fc,fn,0 ;carry in
fLSR_
fROR_ db fc,0,fc,fz ;no carry in
fRORc_ db fnc,fn,fnc,fn ;carry in
;increments (decrements)
rINC_ db $7f,$80,$ff,0,1 ;expected result for INC/DEC
fINC_ db 0,fn,fn,fz,0 ;expected flags for INC/DEC
;logical memory operand
absOR_ db 0,$1f,$71,$80 ;test pattern for OR
absAN_ db $0f,$ff,$7f,$80 ;test pattern for AND
absEO_ db $ff,$0f,$8f,$8f ;test pattern for EOR
;logical accu operand
absORa_ db 0,$f1,$1f,0 ;test pattern for OR
absANa_ db $f0,$ff,$ff,$ff ;test pattern for AND
absEOa_ db $ff,$f0,$f0,$0f ;test pattern for EOR
;logical results
absrlo_ db 0,$ff,$7f,$80
absflo_ db fz,fn,0,fn
data_end
if (data_end - data_init) != (data_bss_end - data_bss)
;force assembler error if size is different
ERROR ERROR ERROR ;mismatch between bss and data
endif
vec_init
dw nmi_trap
dw res_trap
dw irq_trap
vec_bss equ $fffa
endif ;end of RAM init data
if (load_data_direct = 1) & (ROM_vectors = 1)
fffa = org $fffa ;vectors
fffa : 9d37 dw nmi_trap
fffc : a337 dw res_trap
fffe : ab37 dw irq_trap
endif
fffa = end start
No errors in pass 2.
Wrote binary from address $0000 through $ffff.
Total size 65536 bytes.
Program start address is at $0400 (1024).
|