35 ;---------------------------------------------------------------
36 ; Section 1 - Logic and Arithmetic
37 ;---------------------------------------------------------------
49 .byt "=========================================", 10
50 .byt "* Arithmetic/Logical Instruction Tests *", 10
51 .byt "=========================================", 10, 10, 0
53 ;---------------------------------------------------------------
55 ;---------------------------------------------------------------
160 .byt "[TEST #1] ADC", 0
163 ;---------------------------------------------------------------
165 ;---------------------------------------------------------------
203 .byt "[TEST #2] AND", 0
207 ;---------------------------------------------------------------
209 ;---------------------------------------------------------------
258 .byt "[TEST #3] ASL", 0
262 ;---------------------------------------------------------------
264 ;---------------------------------------------------------------
308 .byt "[TEST #4] BIT", 0
311 ;---------------------------------------------------------------
313 ;---------------------------------------------------------------
353 .byt "[TEST #5] CMP", 0
356 ;---------------------------------------------------------------
358 ;---------------------------------------------------------------
398 .byt "[TEST #6] CPX", 0
401 ;---------------------------------------------------------------
403 ;---------------------------------------------------------------
443 .byt "[TEST #7] CPY", 0
446 ;---------------------------------------------------------------
448 ;---------------------------------------------------------------
499 .byt "[TEST #8] DEC", 0
502 ;---------------------------------------------------------------
504 ;---------------------------------------------------------------
549 .byt "[TEST #9] DEX", 0
552 ;---------------------------------------------------------------
554 ;---------------------------------------------------------------
600 .byt "[TEST #10] DEY", 0
603 ;---------------------------------------------------------------
605 ;---------------------------------------------------------------
641 .byt "[TEST #11] EOR", 0
644 ;---------------------------------------------------------------
646 ;---------------------------------------------------------------
698 .byt "[TEST #12] INC", 0
701 ;---------------------------------------------------------------
703 ;---------------------------------------------------------------
752 .byt "[TEST #13] INX", 0
755 ;---------------------------------------------------------------
757 ;---------------------------------------------------------------
804 .byt "[TEST #14] INY", 0
806 ;---------------------------------------------------------------
808 ;---------------------------------------------------------------
857 .byt "[TEST #15] LSR", 0
860 ;---------------------------------------------------------------
862 ;---------------------------------------------------------------
892 .byt "[TEST #16] NOP", 0
895 ;---------------------------------------------------------------
897 ;---------------------------------------------------------------
945 .byt "[TEST #17] ORA", 0
948 ;---------------------------------------------------------------
950 ;---------------------------------------------------------------
1012 .byt "[TEST #18] ROL", 0
1015 ;---------------------------------------------------------------
1017 ;---------------------------------------------------------------
1078 .byt "[TEST #19] ROR", 0
1081 ;--------------------------------------------------------------
1083 ;---------------------------------------------------------------
1173 .byt "[TEST #20] SBC", 0
1176 ;---------------------------------------------------------------
1177 ; Section 2 - Load/Store/Transfer
1178 ;---------------------------------------------------------------
1191 .byt "=========================================", 10
1192 .byt "* Load/Store/Transfer Instruction Tests *", 10
1193 .byt "=========================================", 10, 10, 0
1196 ;--------------------------------------------------------------
1198 ;---------------------------------------------------------------
1240 .byt "[TEST #21] LDA", 0
1242 ;--------------------------------------------------------------
1244 ;---------------------------------------------------------------
1287 .byt "[TEST #22] LDX", 0
1289 ;--------------------------------------------------------------
1291 ;---------------------------------------------------------------
1334 .byt "[TEST #23] LDY", 0
1336 ;--------------------------------------------------------------
1338 ;---------------------------------------------------------------
1373 .byt "[TEST #24] STA", 0
1375 ;--------------------------------------------------------------
1377 ;---------------------------------------------------------------
1412 .byt "[TEST #25] STX", 0
1414 ;--------------------------------------------------------------
1416 ;---------------------------------------------------------------
1452 .byt "[TEST #26] STY", 0
1454 ;--------------------------------------------------------------
1456 ;---------------------------------------------------------------
1503 .byt "[TEST #27] TAX", 0
1505 ;--------------------------------------------------------------
1507 ;---------------------------------------------------------------
1553 .byt "[TEST #28] TAY", 0
1555 ;--------------------------------------------------------------
1557 ;---------------------------------------------------------------
1609 .byt "[TEST #29] TSX", 0
1612 ;--------------------------------------------------------------
1614 ;---------------------------------------------------------------
1659 .byt "[TEST #30] TXA", 0
1661 ;--------------------------------------------------------------
1663 ;---------------------------------------------------------------
1715 .byt "[TEST #31] TXS", 0
1717 ;--------------------------------------------------------------
1719 ;---------------------------------------------------------------
1764 .byt "[TEST #32] TYA", 0
1769 ;---------------------------------------------------------------
1770 ; Section 3 - Stack Operations
1771 ;---------------------------------------------------------------
1784 .byt "=========================================", 10
1785 .byt "* Stack Instruction Tests *", 10
1786 .byt "=========================================", 10, 10, 0
1789 ;--------------------------------------------------------------
1791 ;---------------------------------------------------------------
1839 .byt "[TEST #33] PHA", 0
1841 ;--------------------------------------------------------------
1843 ;---------------------------------------------------------------
1897 .byt "[TEST #34] PHP", 0
1899 ;--------------------------------------------------------------
1901 ;---------------------------------------------------------------
1949 .byt "[TEST #35] PLA", 0
1951 ;--------------------------------------------------------------
1953 ;---------------------------------------------------------------
2005 .byt "[TEST #36] PLP", 0
2007 ;--------------------------------------------------------------
2008 ; Test 37 Stack memory
2009 ;---------------------------------------------------------------
2064 .byt "[TEST #37] Stack memory", 0
2067 ;---------------------------------------------------------------
2068 ; Section 4 - Addressing Modes
2069 ;---------------------------------------------------------------
2082 .byt "=========================================", 10
2083 .byt "* Addressing Modes Tests *", 10
2084 .byt "=========================================", 10, 10, 0
2086 ;--------------------------------------------------------------
2087 ; Test 38 Accumulator
2088 ;---------------------------------------------------------------
2130 .byt "[TEST #38] Accumulator", 0
2132 ;--------------------------------------------------------------
2134 ;---------------------------------------------------------------
2160 .byt "[TEST #39] Immediate", 0
2162 ;--------------------------------------------------------------
2164 ;---------------------------------------------------------------
2190 .byt "[TEST #40] Zero Page", 0
2193 ;--------------------------------------------------------------
2194 ; Test 41 Zero Page Indexed (X)
2195 ;---------------------------------------------------------------
2238 .byt "[TEST #41] Zero Page Indexed (X)", 0
2240 ;--------------------------------------------------------------
2241 ; Test 42 Zero Page Indexed (Y)
2242 ;---------------------------------------------------------------
2284 .byt "[TEST #42] Zero Page Indexed (Y)", 0
2286 ;--------------------------------------------------------------
2288 ;---------------------------------------------------------------
2315 .byt "[TEST #43] Absolute", 0
2317 ;--------------------------------------------------------------
2318 ; Test 44 Absolute Indexed (X)
2319 ;---------------------------------------------------------------
2356 .byt "[TEST #44] Absolute Indexed (X)", 0
2358 ;--------------------------------------------------------------
2359 ; Test 45 Absolute Indexed (Y)
2360 ;---------------------------------------------------------------
2398 .byt "[TEST #45] Absolute Indexed (Y)", 0
2400 ;--------------------------------------------------------------
2402 ;---------------------------------------------------------------
2419 ; Bug in indirect addressing
2442 .byt "[TEST #46] Indirect", 0
2444 ;--------------------------------------------------------------
2445 ; Test 47 Indexed Indirect (X)
2446 ;---------------------------------------------------------------
2500 .byt "[TEST #47] Indexed Indirect (X)", 0
2502 ;--------------------------------------------------------------
2503 ; Test 48 Indirect Indexed (Y)
2504 ;---------------------------------------------------------------
2540 .byt "[TEST #48] Indirect Indexed (Y)", 0
2543 ;--------------------------------------------------------------
2545 ;---------------------------------------------------------------
2565 .byt "[TEST #49] Relative", 0
2568 ;--------------------------------------------------------------
2570 ;---------------------------------------------------------------
2594 .byt "[TEST #50] Implied", 0
2597 ;---------------------------------------------------------------
2598 ; Section 5 - Final tests
2599 ;---------------------------------------------------------------
2612 .byt "=========================================", 10
2613 .byt "* Final Tests *", 10
2614 .byt "=========================================", 10, 10, 0
2616 ;--------------------------------------------------------------
2618 ;---------------------------------------------------------------
2664 .byt "[TEST #51] JSR", 0
2666 ;--------------------------------------------------------------
2668 ;---------------------------------------------------------------
2718 .byt "[TEST #52] BRK", 0
2722 ;---------------------------------------------------------------
2724 ;---------------------------------------------------------------
2741 lda #<detail_error_msg
2743 lda #>detail_error_msg
2755 lda #<detail_newline_msg
2757 lda #>detail_newline_msg
2765 ;---------------------------------------------------------------
2767 ;---------------------------------------------------------------
2836 .byt ": FAIL", 10, 0
2841 .byt "-------------------------------------------------", 10
2842 .byt " Test Results ", 10
2843 .byt "-------------------------------------------------", 10
2846 .byt ", Errors: ", 0
2853 ;---------------------------------------------------------------
2855 ;---------------------------------------------------------------
2899 .dsb $FFFA-last_pos, $00