diff --git a/src/main/kotlin/razorvine/ksim65/Cpu6502.kt b/src/main/kotlin/razorvine/ksim65/Cpu6502.kt index 249be0f..606acf5 100644 --- a/src/main/kotlin/razorvine/ksim65/Cpu6502.kt +++ b/src/main/kotlin/razorvine/ksim65/Cpu6502.kt @@ -8,7 +8,7 @@ import razorvine.ksim65.components.UByte /** * 6502 cpu simulation (the NMOS version) including the 'illegal' opcodes. - * TODO: actually implement the illegal opcodes, see http://www.ffd2.com/fridge/docs/6502-NMOS.extra.opcodes + * TODO: actually implement the illegal opcodes, see http://www.ffd2.com/fridge/docs/6502-NMOS.extra.opcodes or https://sourceforge.net/p/moarnes/code/ci/master/tree/src/6502.c */ open class Cpu6502 : BusComponent() { open val name = "6502" @@ -1458,8 +1458,8 @@ open class Cpu6502 : BusComponent() { TODO("\$${hexB(currentOpcode)} - xaa - ('illegal' instruction) @ \$${hexW(currentOpcodeAddress)}") } - // invalid instruction (JAM / KIL) + // invalid instruction (JAM / KIL / HLT) private fun iInvalid() { - throw InstructionError("invalid instruction encountered: opcode=${hexB(currentOpcode)} instr=${currentInstruction.mnemonic}") + throw InstructionError("invalid instruction encountered: opcode=${hexB(currentOpcode)} instr=${currentInstruction.mnemonic} @ ${hexW(currentOpcodeAddress)}") } } diff --git a/src/test/kotlin/6502_functional_tests/6502_functional_test.a65 b/src/test/kotlin/6502_functional_tests/6502_functional_test.a65 index 9a2ecba..44f06f0 100644 --- a/src/test/kotlin/6502_functional_tests/6502_functional_test.a65 +++ b/src/test/kotlin/6502_functional_tests/6502_functional_test.a65 @@ -100,7 +100,7 @@ I_flag = 3 ;configure memory - try to stay away from memory used by the system ;zero_page memory start address, $52 (82) consecutive Bytes required ; add 2 if I_flag = 2 -zero_page = $a +zero_page = $0 ;data_segment memory start address, $7B (123) consecutive Bytes required data_segment = $200 @@ -6106,4 +6106,4 @@ vec_bss equ $fffa endif end start - \ No newline at end of file + diff --git a/src/test/kotlin/6502_functional_tests/6502_interrupt_test.a65 b/src/test/kotlin/6502_functional_tests/6502_interrupt_test.a65 index bfc3754..5ea2d34 100644 --- a/src/test/kotlin/6502_functional_tests/6502_interrupt_test.a65 +++ b/src/test/kotlin/6502_functional_tests/6502_interrupt_test.a65 @@ -19,7 +19,7 @@ ; This program is designed to test IRQ and NMI of a 6502 emulator. It requires ; an internal or external feedback register to the IRQ & NMI inputs -; +; ; version 15-aug-2014 ; contact info at http://2m5.de or email K@2m5.de ; @@ -83,10 +83,10 @@ D_clear = 0 ;0 = not cleared (NMOS), 1 = cleared (CMOS) ;configure memory - try to stay away from memory used by the system ;zero_page memory start address, 6 consecutive Bytes required -zero_page = $a +zero_page = $0 ;data_segment memory start address, 4 consecutive Bytes required -data_segment = $200 +data_segment = $200 ;code_segment memory start address code_segment = $400 @@ -205,7 +205,7 @@ zp_bss ;fixed stack locations lst_f equ $1fe ;last flags before interrupt lst_a equ $1ff ;last accumulator before interrupt - + org data_segment ;concurrent NMI, IRQ & BRK test result nmi_count ds 1 ;lowest number handled first, $ff = never @@ -222,7 +222,7 @@ start cld sta I_src ldx #$ff txs - + ;initialize I/O for report channel if report = 1 jsr report_init @@ -263,7 +263,7 @@ I_clr macro ibit ;ibit = interrupt bit and #I_filter ora #(1< I_DDR or I_port to force interrupt if I_ddr != 0 ;with DDR I_set macro ibit ;ibit = interrupt bit @@ -278,7 +278,7 @@ I_set macro ibit ;ibit = interrupt bit I_clr macro ibit ;ibit = interrupt bit lda I_ddr ;turn off interrupt by bit and #I_filter-(1< I_DDR or I_port to force interrupt if I_ddr != 0 ;with DDR I_set macro ibit ;ibit = interrupt bit @@ -348,7 +348,7 @@ I_set macro ibit ;ibit = interrupt bit I_clr macro ibit ;ibit = interrupt bit lda I_ddr ;turn off interrupt by bit and #I_filter-(1< pha ;use stack to load status 0e57 : 28 > plp -0e58 : b615 ldx zp1,y +0e58 : b60b ldx zp1,y 0e5a : 08 php ;test stores do not alter flags 0e5b : 8a txa 0e5c : 49c3 eor #$c3 @@ -3964,7 +3964,7 @@ ffff = ram_top = -1 0e79 : 48 > pha ;use stack to load status 0e7a : 28 > plp -0e7b : b615 ldx zp1,y +0e7b : b60b ldx zp1,y 0e7d : 08 php ;test stores do not alter flags 0e7e : 8a txa 0e7f : 49c3 eor #$c3 @@ -4002,10 +4002,10 @@ ffff = ram_top = -1 0ea3 : 49c3 eor #$c3 0ea5 : aa tax 0ea6 : 28 plp -0ea7 : 960c stx zpt,y +0ea7 : 9602 stx zpt,y 0ea9 : 08 php ;flags after load/store sequence 0eaa : 49c3 eor #$c3 -0eac : d91500 cmp zp1,y ;test result +0eac : d90b00 cmp zp1,y ;test result trap_ne 0eaf : d0fe > bne * ;failed not equal (non zero) @@ -4035,10 +4035,10 @@ ffff = ram_top = -1 0ec7 : 49c3 eor #$c3 0ec9 : aa tax 0eca : 28 plp -0ecb : 960c stx zpt,y +0ecb : 9602 stx zpt,y 0ecd : 08 php ;flags after load/store sequence 0ece : 49c3 eor #$c3 -0ed0 : d91500 cmp zp1,y ;test result +0ed0 : d90b00 cmp zp1,y ;test result trap_ne 0ed3 : d0fe > bne * ;failed not equal (non zero) @@ -4055,13 +4055,13 @@ ffff = ram_top = -1 0ee0 : a003 ldy #3 ;testing store result 0ee2 : a200 ldx #0 -0ee4 : b90c00 tstx lda zpt,y +0ee4 : b90200 tstx lda zpt,y 0ee7 : 49c3 eor #$c3 -0ee9 : d91500 cmp zp1,y +0ee9 : d90b00 cmp zp1,y trap_ne ;store to zp data 0eec : d0fe > bne * ;failed not equal (non zero) -0eee : 960c stx zpt,y ;clear +0eee : 9602 stx zpt,y ;clear 0ef0 : b90302 lda abst,y 0ef3 : 49c3 eor #$c3 0ef5 : d91802 cmp abs1,y @@ -4086,7 +4086,7 @@ ffff = ram_top = -1 ; indexed wraparound test (only zp should wrap) 0f0d : a0fd ldy #3+$fa -0f0f : b61b tldx4 ldx zp1-$fa&$ff,y ;wrap on indexed zp +0f0f : b611 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 @@ -4094,18 +4094,18 @@ ffff = ram_top = -1 0f18 : b0f5 bcs tldx4 0f1a : a0fd ldy #3+$fa 0f1c : be1e01 tldx5 ldx abs1-$fa,y ;no wrap on indexed abs -0f1f : 9612 stx zpt-$fa&$ff,y +0f1f : 9608 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 : d91500 cmp zp1,y +0f2a : b90200 tstx1 lda zpt,y +0f2d : d90b00 cmp zp1,y trap_ne ;store to zp data 0f30 : d0fe > bne * ;failed not equal (non zero) -0f32 : 960c stx zpt,y ;clear +0f32 : 9602 stx zpt,y ;clear 0f34 : b90302 lda abst,y 0f37 : d91802 cmp abs1,y trap_ne ;store to abs data @@ -4137,7 +4137,7 @@ ffff = ram_top = -1 0f53 : 48 > pha ;use stack to load status 0f54 : 28 > plp -0f55 : b415 ldy zp1,x +0f55 : b40b ldy zp1,x 0f57 : 08 php ;test stores do not alter flags 0f58 : 98 tya 0f59 : 49c3 eor #$c3 @@ -4169,7 +4169,7 @@ ffff = ram_top = -1 0f76 : 48 > pha ;use stack to load status 0f77 : 28 > plp -0f78 : b415 ldy zp1,x +0f78 : b40b ldy zp1,x 0f7a : 08 php ;test stores do not alter flags 0f7b : 98 tya 0f7c : 49c3 eor #$c3 @@ -4207,10 +4207,10 @@ ffff = ram_top = -1 0fa0 : 49c3 eor #$c3 0fa2 : a8 tay 0fa3 : 28 plp -0fa4 : 940c sty zpt,x +0fa4 : 9402 sty zpt,x 0fa6 : 08 php ;flags after load/store sequence 0fa7 : 49c3 eor #$c3 -0fa9 : d515 cmp zp1,x ;test result +0fa9 : d50b cmp zp1,x ;test result trap_ne 0fab : d0fe > bne * ;failed not equal (non zero) @@ -4240,10 +4240,10 @@ ffff = ram_top = -1 0fc3 : 49c3 eor #$c3 0fc5 : a8 tay 0fc6 : 28 plp -0fc7 : 940c sty zpt,x +0fc7 : 9402 sty zpt,x 0fc9 : 08 php ;flags after load/store sequence 0fca : 49c3 eor #$c3 -0fcc : d515 cmp zp1,x ;test result +0fcc : d50b cmp zp1,x ;test result trap_ne 0fce : d0fe > bne * ;failed not equal (non zero) @@ -4260,13 +4260,13 @@ ffff = ram_top = -1 0fdb : a203 ldx #3 ;testing store result 0fdd : a000 ldy #0 -0fdf : b50c tsty lda zpt,x +0fdf : b502 tsty lda zpt,x 0fe1 : 49c3 eor #$c3 -0fe3 : d515 cmp zp1,x +0fe3 : d50b cmp zp1,x trap_ne ;store to zp,x data 0fe5 : d0fe > bne * ;failed not equal (non zero) -0fe7 : 940c sty zpt,x ;clear +0fe7 : 9402 sty zpt,x ;clear 0fe9 : bd0302 lda abst,x 0fec : 49c3 eor #$c3 0fee : dd1802 cmp abs1,x @@ -4291,7 +4291,7 @@ ffff = ram_top = -1 ; indexed wraparound test (only zp should wrap) 1006 : a2fd ldx #3+$fa -1008 : b41b tldy4 ldy zp1-$fa&$ff,x ;wrap on indexed zp +1008 : b411 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 @@ -4299,18 +4299,18 @@ ffff = ram_top = -1 1011 : b0f5 bcs tldy4 1013 : a2fd ldx #3+$fa 1015 : bc1e01 tldy5 ldy abs1-$fa,x ;no wrap on indexed abs -1018 : 9412 sty zpt-$fa&$ff,x +1018 : 9408 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 : d515 cmp zp1,x +1023 : b502 tsty1 lda zpt,x +1025 : d50b cmp zp1,x trap_ne ;store to zp,x data 1027 : d0fe > bne * ;failed not equal (non zero) -1029 : 940c sty zpt,x ;clear +1029 : 9402 sty zpt,x ;clear 102b : bd0302 lda abst,x 102e : dd1802 cmp abs1,x trap_ne ;store to abs,x data @@ -4340,7 +4340,7 @@ ffff = ram_top = -1 1048 : 48 > pha ;use stack to load status 1049 : 28 > plp -104a : a615 ldx zp1 +104a : a60b ldx zp1 104c : 08 php ;test stores do not alter flags 104d : 8a txa 104e : 49c3 eor #$c3 @@ -4369,7 +4369,7 @@ ffff = ram_top = -1 1067 : 48 > pha ;use stack to load status 1068 : 28 > plp -1069 : a616 ldx zp1+1 +1069 : a60c ldx zp1+1 106b : 08 php ;test stores do not alter flags 106c : 8a txa 106d : 49c3 eor #$c3 @@ -4398,7 +4398,7 @@ ffff = ram_top = -1 1086 : 48 > pha ;use stack to load status 1087 : 28 > plp -1088 : a617 ldx zp1+2 +1088 : a60d ldx zp1+2 108a : 08 php ;test stores do not alter flags 108b : 8a txa 108c : 49c3 eor #$c3 @@ -4427,7 +4427,7 @@ ffff = ram_top = -1 10a5 : 48 > pha ;use stack to load status 10a6 : 28 > plp -10a7 : a618 ldx zp1+3 +10a7 : a60e ldx zp1+3 10a9 : 08 php ;test stores do not alter flags 10aa : 8a txa 10ab : 49c3 eor #$c3 @@ -4457,7 +4457,7 @@ ffff = ram_top = -1 10c4 : 48 > pha ;use stack to load status 10c5 : 28 > plp -10c6 : a615 ldx zp1 +10c6 : a60b ldx zp1 10c8 : 08 php ;test stores do not alter flags 10c9 : 8a txa 10ca : 49c3 eor #$c3 @@ -4486,7 +4486,7 @@ ffff = ram_top = -1 10e3 : 48 > pha ;use stack to load status 10e4 : 28 > plp -10e5 : a616 ldx zp1+1 +10e5 : a60c ldx zp1+1 10e7 : 08 php ;test stores do not alter flags 10e8 : 8a txa 10e9 : 49c3 eor #$c3 @@ -4515,7 +4515,7 @@ ffff = ram_top = -1 1102 : 48 > pha ;use stack to load status 1103 : 28 > plp -1104 : a617 ldx zp1+2 +1104 : a60d ldx zp1+2 1106 : 08 php ;test stores do not alter flags 1107 : 8a txa 1108 : 49c3 eor #$c3 @@ -4544,7 +4544,7 @@ ffff = ram_top = -1 1121 : 48 > pha ;use stack to load status 1122 : 28 > plp -1123 : a618 ldx zp1+3 +1123 : a60e ldx zp1+3 1125 : 08 php ;test stores do not alter flags 1126 : 8a txa 1127 : 49c3 eor #$c3 @@ -4580,10 +4580,10 @@ ffff = ram_top = -1 1147 : 49c3 eor #$c3 1149 : aa tax 114a : 28 plp -114b : 860c stx zpt +114b : 8602 stx zpt 114d : 08 php ;flags after load/store sequence 114e : 49c3 eor #$c3 -1150 : c515 cmp zp1 ;test result +1150 : c50b cmp zp1 ;test result trap_ne 1152 : d0fe > bne * ;failed not equal (non zero) @@ -4608,10 +4608,10 @@ ffff = ram_top = -1 1165 : 49c3 eor #$c3 1167 : aa tax 1168 : 28 plp -1169 : 860d stx zpt+1 +1169 : 8603 stx zpt+1 116b : 08 php ;flags after load/store sequence 116c : 49c3 eor #$c3 -116e : c516 cmp zp1+1 ;test result +116e : c50c cmp zp1+1 ;test result trap_ne 1170 : d0fe > bne * ;failed not equal (non zero) @@ -4636,10 +4636,10 @@ ffff = ram_top = -1 1183 : 49c3 eor #$c3 1185 : aa tax 1186 : 28 plp -1187 : 860e stx zpt+2 +1187 : 8604 stx zpt+2 1189 : 08 php ;flags after load/store sequence 118a : 49c3 eor #$c3 -118c : c517 cmp zp1+2 ;test result +118c : c50d cmp zp1+2 ;test result trap_ne 118e : d0fe > bne * ;failed not equal (non zero) @@ -4664,10 +4664,10 @@ ffff = ram_top = -1 11a1 : 49c3 eor #$c3 11a3 : aa tax 11a4 : 28 plp -11a5 : 860f stx zpt+3 +11a5 : 8605 stx zpt+3 11a7 : 08 php ;flags after load/store sequence 11a8 : 49c3 eor #$c3 -11aa : c518 cmp zp1+3 ;test result +11aa : c50e cmp zp1+3 ;test result trap_ne 11ac : d0fe > bne * ;failed not equal (non zero) @@ -4693,11 +4693,11 @@ ffff = ram_top = -1 11bf : 49c3 eor #$c3 11c1 : aa tax 11c2 : 28 plp -11c3 : 860c stx zpt +11c3 : 8602 stx zpt 11c5 : 08 php ;flags after load/store sequence 11c6 : 49c3 eor #$c3 11c8 : aa tax -11c9 : e415 cpx zp1 ;test result +11c9 : e40b cpx zp1 ;test result trap_ne 11cb : d0fe > bne * ;failed not equal (non zero) @@ -4722,11 +4722,11 @@ ffff = ram_top = -1 11de : 49c3 eor #$c3 11e0 : aa tax 11e1 : 28 plp -11e2 : 860d stx zpt+1 +11e2 : 8603 stx zpt+1 11e4 : 08 php ;flags after load/store sequence 11e5 : 49c3 eor #$c3 11e7 : aa tax -11e8 : e416 cpx zp1+1 ;test result +11e8 : e40c cpx zp1+1 ;test result trap_ne 11ea : d0fe > bne * ;failed not equal (non zero) @@ -4751,11 +4751,11 @@ ffff = ram_top = -1 11fd : 49c3 eor #$c3 11ff : aa tax 1200 : 28 plp -1201 : 860e stx zpt+2 +1201 : 8604 stx zpt+2 1203 : 08 php ;flags after load/store sequence 1204 : 49c3 eor #$c3 1206 : aa tax -1207 : e417 cpx zp1+2 ;test result +1207 : e40d cpx zp1+2 ;test result trap_ne 1209 : d0fe > bne * ;failed not equal (non zero) @@ -4780,11 +4780,11 @@ ffff = ram_top = -1 121c : 49c3 eor #$c3 121e : aa tax 121f : 28 plp -1220 : 860f stx zpt+3 +1220 : 8605 stx zpt+3 1222 : 08 php ;flags after load/store sequence 1223 : 49c3 eor #$c3 1225 : aa tax -1226 : e418 cpx zp1+3 ;test result +1226 : e40e cpx zp1+3 ;test result trap_ne 1228 : d0fe > bne * ;failed not equal (non zero) @@ -4968,13 +4968,13 @@ ffff = ram_top = -1 12d2 : a200 ldx #0 -12d4 : a50c lda zpt +12d4 : a502 lda zpt 12d6 : 49c3 eor #$c3 -12d8 : c515 cmp zp1 +12d8 : c50b cmp zp1 trap_ne ;store to zp data 12da : d0fe > bne * ;failed not equal (non zero) -12dc : 860c stx zpt ;clear +12dc : 8602 stx zpt ;clear 12de : ad0302 lda abst 12e1 : 49c3 eor #$c3 12e3 : cd1802 cmp abs1 @@ -4982,13 +4982,13 @@ ffff = ram_top = -1 12e6 : d0fe > bne * ;failed not equal (non zero) 12e8 : 8e0302 stx abst ;clear -12eb : a50d lda zpt+1 +12eb : a503 lda zpt+1 12ed : 49c3 eor #$c3 -12ef : c516 cmp zp1+1 +12ef : c50c cmp zp1+1 trap_ne ;store to zp data 12f1 : d0fe > bne * ;failed not equal (non zero) -12f3 : 860d stx zpt+1 ;clear +12f3 : 8603 stx zpt+1 ;clear 12f5 : ad0402 lda abst+1 12f8 : 49c3 eor #$c3 12fa : cd1902 cmp abs1+1 @@ -4996,13 +4996,13 @@ ffff = ram_top = -1 12fd : d0fe > bne * ;failed not equal (non zero) 12ff : 8e0402 stx abst+1 ;clear -1302 : a50e lda zpt+2 +1302 : a504 lda zpt+2 1304 : 49c3 eor #$c3 -1306 : c517 cmp zp1+2 +1306 : c50d cmp zp1+2 trap_ne ;store to zp data 1308 : d0fe > bne * ;failed not equal (non zero) -130a : 860e stx zpt+2 ;clear +130a : 8604 stx zpt+2 ;clear 130c : ad0502 lda abst+2 130f : 49c3 eor #$c3 1311 : cd1a02 cmp abs1+2 @@ -5010,13 +5010,13 @@ ffff = ram_top = -1 1314 : d0fe > bne * ;failed not equal (non zero) 1316 : 8e0502 stx abst+2 ;clear -1319 : a50f lda zpt+3 +1319 : a505 lda zpt+3 131b : 49c3 eor #$c3 -131d : c518 cmp zp1+3 +131d : c50e cmp zp1+3 trap_ne ;store to zp data 131f : d0fe > bne * ;failed not equal (non zero) -1321 : 860f stx zpt+3 ;clear +1321 : 8605 stx zpt+3 ;clear 1323 : ad0602 lda abst+3 1326 : 49c3 eor #$c3 1328 : cd1b02 cmp abs1+3 @@ -5044,7 +5044,7 @@ ffff = ram_top = -1 133e : 48 > pha ;use stack to load status 133f : 28 > plp -1340 : a415 ldy zp1 +1340 : a40b ldy zp1 1342 : 08 php ;test stores do not alter flags 1343 : 98 tya 1344 : 49c3 eor #$c3 @@ -5073,7 +5073,7 @@ ffff = ram_top = -1 135d : 48 > pha ;use stack to load status 135e : 28 > plp -135f : a416 ldy zp1+1 +135f : a40c ldy zp1+1 1361 : 08 php ;test stores do not alter flags 1362 : 98 tya 1363 : 49c3 eor #$c3 @@ -5102,7 +5102,7 @@ ffff = ram_top = -1 137c : 48 > pha ;use stack to load status 137d : 28 > plp -137e : a417 ldy zp1+2 +137e : a40d ldy zp1+2 1380 : 08 php ;test stores do not alter flags 1381 : 98 tya 1382 : 49c3 eor #$c3 @@ -5131,7 +5131,7 @@ ffff = ram_top = -1 139b : 48 > pha ;use stack to load status 139c : 28 > plp -139d : a418 ldy zp1+3 +139d : a40e ldy zp1+3 139f : 08 php ;test stores do not alter flags 13a0 : 98 tya 13a1 : 49c3 eor #$c3 @@ -5161,7 +5161,7 @@ ffff = ram_top = -1 13ba : 48 > pha ;use stack to load status 13bb : 28 > plp -13bc : a415 ldy zp1 +13bc : a40b ldy zp1 13be : 08 php ;test stores do not alter flags 13bf : 98 tya 13c0 : 49c3 eor #$c3 @@ -5190,7 +5190,7 @@ ffff = ram_top = -1 13d9 : 48 > pha ;use stack to load status 13da : 28 > plp -13db : a416 ldy zp1+1 +13db : a40c ldy zp1+1 13dd : 08 php ;test stores do not alter flags 13de : 98 tya 13df : 49c3 eor #$c3 @@ -5219,7 +5219,7 @@ ffff = ram_top = -1 13f8 : 48 > pha ;use stack to load status 13f9 : 28 > plp -13fa : a417 ldy zp1+2 +13fa : a40d ldy zp1+2 13fc : 08 php ;test stores do not alter flags 13fd : 98 tya 13fe : 49c3 eor #$c3 @@ -5248,7 +5248,7 @@ ffff = ram_top = -1 1417 : 48 > pha ;use stack to load status 1418 : 28 > plp -1419 : a418 ldy zp1+3 +1419 : a40e ldy zp1+3 141b : 08 php ;test stores do not alter flags 141c : 98 tya 141d : 49c3 eor #$c3 @@ -5284,11 +5284,11 @@ ffff = ram_top = -1 143d : 49c3 eor #$c3 143f : a8 tay 1440 : 28 plp -1441 : 840c sty zpt +1441 : 8402 sty zpt 1443 : 08 php ;flags after load/store sequence 1444 : 49c3 eor #$c3 1446 : a8 tay -1447 : c415 cpy zp1 ;test result +1447 : c40b cpy zp1 ;test result trap_ne 1449 : d0fe > bne * ;failed not equal (non zero) @@ -5313,11 +5313,11 @@ ffff = ram_top = -1 145c : 49c3 eor #$c3 145e : a8 tay 145f : 28 plp -1460 : 840d sty zpt+1 +1460 : 8403 sty zpt+1 1462 : 08 php ;flags after load/store sequence 1463 : 49c3 eor #$c3 1465 : a8 tay -1466 : c416 cpy zp1+1 ;test result +1466 : c40c cpy zp1+1 ;test result trap_ne 1468 : d0fe > bne * ;failed not equal (non zero) @@ -5342,11 +5342,11 @@ ffff = ram_top = -1 147b : 49c3 eor #$c3 147d : a8 tay 147e : 28 plp -147f : 840e sty zpt+2 +147f : 8404 sty zpt+2 1481 : 08 php ;flags after load/store sequence 1482 : 49c3 eor #$c3 1484 : a8 tay -1485 : c417 cpy zp1+2 ;test result +1485 : c40d cpy zp1+2 ;test result trap_ne 1487 : d0fe > bne * ;failed not equal (non zero) @@ -5371,11 +5371,11 @@ ffff = ram_top = -1 149a : 49c3 eor #$c3 149c : a8 tay 149d : 28 plp -149e : 840f sty zpt+3 +149e : 8405 sty zpt+3 14a0 : 08 php ;flags after load/store sequence 14a1 : 49c3 eor #$c3 14a3 : a8 tay -14a4 : c418 cpy zp1+3 ;test result +14a4 : c40e cpy zp1+3 ;test result trap_ne 14a6 : d0fe > bne * ;failed not equal (non zero) @@ -5401,11 +5401,11 @@ ffff = ram_top = -1 14b9 : 49c3 eor #$c3 14bb : a8 tay 14bc : 28 plp -14bd : 840c sty zpt +14bd : 8402 sty zpt 14bf : 08 php ;flags after load/store sequence 14c0 : 49c3 eor #$c3 14c2 : a8 tay -14c3 : c515 cmp zp1 ;test result +14c3 : c50b cmp zp1 ;test result trap_ne 14c5 : d0fe > bne * ;failed not equal (non zero) @@ -5430,11 +5430,11 @@ ffff = ram_top = -1 14d8 : 49c3 eor #$c3 14da : a8 tay 14db : 28 plp -14dc : 840d sty zpt+1 +14dc : 8403 sty zpt+1 14de : 08 php ;flags after load/store sequence 14df : 49c3 eor #$c3 14e1 : a8 tay -14e2 : c516 cmp zp1+1 ;test result +14e2 : c50c cmp zp1+1 ;test result trap_ne 14e4 : d0fe > bne * ;failed not equal (non zero) @@ -5459,11 +5459,11 @@ ffff = ram_top = -1 14f7 : 49c3 eor #$c3 14f9 : a8 tay 14fa : 28 plp -14fb : 840e sty zpt+2 +14fb : 8404 sty zpt+2 14fd : 08 php ;flags after load/store sequence 14fe : 49c3 eor #$c3 1500 : a8 tay -1501 : c517 cmp zp1+2 ;test result +1501 : c50d cmp zp1+2 ;test result trap_ne 1503 : d0fe > bne * ;failed not equal (non zero) @@ -5488,11 +5488,11 @@ ffff = ram_top = -1 1516 : 49c3 eor #$c3 1518 : a8 tay 1519 : 28 plp -151a : 840f sty zpt+3 +151a : 8405 sty zpt+3 151c : 08 php ;flags after load/store sequence 151d : 49c3 eor #$c3 151f : a8 tay -1520 : c518 cmp zp1+3 ;test result +1520 : c50e cmp zp1+3 ;test result trap_ne 1522 : d0fe > bne * ;failed not equal (non zero) @@ -5677,13 +5677,13 @@ ffff = ram_top = -1 15cc : a000 ldy #0 -15ce : a50c lda zpt +15ce : a502 lda zpt 15d0 : 49c3 eor #$c3 -15d2 : c515 cmp zp1 +15d2 : c50b cmp zp1 trap_ne ;store to zp data 15d4 : d0fe > bne * ;failed not equal (non zero) -15d6 : 840c sty zpt ;clear +15d6 : 8402 sty zpt ;clear 15d8 : ad0302 lda abst 15db : 49c3 eor #$c3 15dd : cd1802 cmp abs1 @@ -5691,13 +5691,13 @@ ffff = ram_top = -1 15e0 : d0fe > bne * ;failed not equal (non zero) 15e2 : 8c0302 sty abst ;clear -15e5 : a50d lda zpt+1 +15e5 : a503 lda zpt+1 15e7 : 49c3 eor #$c3 -15e9 : c516 cmp zp1+1 +15e9 : c50c cmp zp1+1 trap_ne ;store to zp+1 data 15eb : d0fe > bne * ;failed not equal (non zero) -15ed : 840d sty zpt+1 ;clear +15ed : 8403 sty zpt+1 ;clear 15ef : ad0402 lda abst+1 15f2 : 49c3 eor #$c3 15f4 : cd1902 cmp abs1+1 @@ -5705,13 +5705,13 @@ ffff = ram_top = -1 15f7 : d0fe > bne * ;failed not equal (non zero) 15f9 : 8c0402 sty abst+1 ;clear -15fc : a50e lda zpt+2 +15fc : a504 lda zpt+2 15fe : 49c3 eor #$c3 -1600 : c517 cmp zp1+2 +1600 : c50d cmp zp1+2 trap_ne ;store to zp+2 data 1602 : d0fe > bne * ;failed not equal (non zero) -1604 : 840e sty zpt+2 ;clear +1604 : 8404 sty zpt+2 ;clear 1606 : ad0502 lda abst+2 1609 : 49c3 eor #$c3 160b : cd1a02 cmp abs1+2 @@ -5719,13 +5719,13 @@ ffff = ram_top = -1 160e : d0fe > bne * ;failed not equal (non zero) 1610 : 8c0502 sty abst+2 ;clear -1613 : a50f lda zpt+3 +1613 : a505 lda zpt+3 1615 : 49c3 eor #$c3 -1617 : c518 cmp zp1+3 +1617 : c50e cmp zp1+3 trap_ne ;store to zp+3 data 1619 : d0fe > bne * ;failed not equal (non zero) -161b : 840f sty zpt+3 ;clear +161b : 8405 sty zpt+3 ;clear 161d : ad0602 lda abst+3 1620 : 49c3 eor #$c3 1622 : cd1b02 cmp abs1+3 @@ -5756,7 +5756,7 @@ ffff = ram_top = -1 163a : 48 > pha ;use stack to load status 163b : 28 > plp -163c : b515 lda zp1,x +163c : b50b lda zp1,x 163e : 08 php ;test stores do not alter flags 163f : 49c3 eor #$c3 1641 : 28 plp @@ -5787,7 +5787,7 @@ ffff = ram_top = -1 165c : 48 > pha ;use stack to load status 165d : 28 > plp -165e : b515 lda zp1,x +165e : b50b lda zp1,x 1660 : 08 php ;test stores do not alter flags 1661 : 49c3 eor #$c3 1663 : 28 plp @@ -5822,10 +5822,10 @@ ffff = ram_top = -1 1683 : 08 php ;test stores do not alter flags 1684 : 49c3 eor #$c3 1686 : 28 plp -1687 : 950c sta zpt,x +1687 : 9502 sta zpt,x 1689 : 08 php ;flags after load/store sequence 168a : 49c3 eor #$c3 -168c : d515 cmp zp1,x ;test result +168c : d50b cmp zp1,x ;test result trap_ne 168e : d0fe > bne * ;failed not equal (non zero) @@ -5853,10 +5853,10 @@ ffff = ram_top = -1 16a4 : 08 php ;test stores do not alter flags 16a5 : 49c3 eor #$c3 16a7 : 28 plp -16a8 : 950c sta zpt,x +16a8 : 9502 sta zpt,x 16aa : 08 php ;flags after load/store sequence 16ab : 49c3 eor #$c3 -16ad : d515 cmp zp1,x ;test result +16ad : d50b cmp zp1,x ;test result trap_ne 16af : d0fe > bne * ;failed not equal (non zero) @@ -5873,13 +5873,13 @@ ffff = ram_top = -1 16bc : a203 ldx #3 ;testing store result 16be : a000 ldy #0 -16c0 : b50c tstax lda zpt,x +16c0 : b502 tstax lda zpt,x 16c2 : 49c3 eor #$c3 -16c4 : d515 cmp zp1,x +16c4 : d50b cmp zp1,x trap_ne ;store to zp,x data 16c6 : d0fe > bne * ;failed not equal (non zero) -16c8 : 940c sty zpt,x ;clear +16c8 : 9402 sty zpt,x ;clear 16ca : bd0302 lda abst,x 16cd : 49c3 eor #$c3 16cf : dd1802 cmp abs1,x @@ -5912,7 +5912,7 @@ ffff = ram_top = -1 16eb : 48 > pha ;use stack to load status 16ec : 28 > plp -16ed : b126 lda (ind1),y +16ed : b11c lda (ind1),y 16ef : 08 php ;test stores do not alter flags 16f0 : 49c3 eor #$c3 16f2 : 28 plp @@ -5943,7 +5943,7 @@ ffff = ram_top = -1 170d : 48 > pha ;use stack to load status 170e : 28 > plp -170f : b126 lda (ind1),y +170f : b11c lda (ind1),y 1711 : 08 php ;test stores do not alter flags 1712 : 49c3 eor #$c3 1714 : 28 plp @@ -5991,10 +5991,10 @@ ffff = ram_top = -1 1749 : 08 php ;test stores do not alter flags 174a : 49c3 eor #$c3 174c : 28 plp -174d : 9132 sta (indt),y +174d : 9128 sta (indt),y 174f : 08 php ;flags after load/store sequence 1750 : 49c3 eor #$c3 -1752 : d126 cmp (ind1),y ;test result +1752 : d11c cmp (ind1),y ;test result trap_ne 1754 : d0fe > bne * ;failed not equal (non zero) @@ -6022,10 +6022,10 @@ ffff = ram_top = -1 176a : 08 php ;test stores do not alter flags 176b : 49c3 eor #$c3 176d : 28 plp -176e : 9132 sta (indt),y +176e : 9128 sta (indt),y 1770 : 08 php ;flags after load/store sequence 1771 : 49c3 eor #$c3 -1773 : d126 cmp (ind1),y ;test result +1773 : d11c cmp (ind1),y ;test result trap_ne 1775 : d0fe > bne * ;failed not equal (non zero) @@ -6063,11 +6063,11 @@ ffff = ram_top = -1 179d : 48 > pha ;use stack to load status 179e : 28 > plp -179f : a126 lda (ind1,x) +179f : a11c lda (ind1,x) 17a1 : 08 php ;test stores do not alter flags 17a2 : 49c3 eor #$c3 17a4 : 28 plp -17a5 : 8132 sta (indt,x) +17a5 : 8128 sta (indt,x) 17a7 : 08 php ;flags after load/store sequence 17a8 : 49c3 eor #$c3 17aa : d91802 cmp abs1,y ;test result @@ -6097,11 +6097,11 @@ ffff = ram_top = -1 17c2 : 48 > pha ;use stack to load status 17c3 : 28 > plp -17c4 : a126 lda (ind1,x) +17c4 : a11c lda (ind1,x) 17c6 : 08 php ;test stores do not alter flags 17c7 : 49c3 eor #$c3 17c9 : 28 plp -17ca : 8132 sta (indt,x) +17ca : 8128 sta (indt,x) 17cc : 08 php ;flags after load/store sequence 17cd : 49c3 eor #$c3 17cf : d91802 cmp abs1,y ;test result @@ -6147,26 +6147,26 @@ ffff = ram_top = -1 ; indexed wraparound test (only zp should wrap) 1802 : a2fd ldx #3+$fa -1804 : b51b tldax6 lda zp1-$fa&$ff,x ;wrap on indexed zp +1804 : b511 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 : bd1e01 tldax7 lda abs1-$fa,x ;no wrap on indexed abs -1813 : 9512 sta zpt-$fa&$ff,x +1813 : 9508 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 : d515 cmp zp1,x +181e : b502 tstax1 lda zpt,x +1820 : d50b cmp zp1,x trap_ne ;store to zp,x data 1822 : d0fe > bne * ;failed not equal (non zero) -1824 : 940c sty zpt,x ;clear +1824 : 9402 sty zpt,x ;clear 1826 : bd0302 lda abst,x 1829 : dd1802 cmp abs1,x trap_ne ;store to abs,x data @@ -6179,7 +6179,7 @@ ffff = ram_top = -1 1835 : a0fb ldy #3+$f8 1837 : a2fe ldx #6+$f8 -1839 : a12e tlday4 lda (ind1-$f8&$ff,x) ;wrap on indexed zp indirect +1839 : a124 tlday4 lda (ind1-$f8&$ff,x) ;wrap on indexed zp indirect 183b : 990b01 sta abst-$f8,y 183e : ca dex 183f : ca dex @@ -6200,7 +6200,7 @@ ffff = ram_top = -1 1858 : a0fb ldy #3+$f8 185a : b92001 tlday5 lda abs1-$f8,y ;no wrap on indexed abs -185d : 913a sta (inwt),y +185d : 9130 sta (inwt),y 185f : 88 dey 1860 : c0f8 cpy #$f8 1862 : b0f6 bcs tlday5 @@ -6218,8 +6218,8 @@ ffff = ram_top = -1 1877 : a0fb ldy #3+$f8 1879 : a2fe ldx #6+$f8 -187b : b130 tlday6 lda (inw1),y ;no wrap on zp indirect indexed -187d : 813a sta (indt-$f8&$ff,x) +187b : b126 tlday6 lda (inw1),y ;no wrap on zp indirect indexed +187d : 8130 sta (indt-$f8&$ff,x) 187f : ca dex 1880 : ca dex 1881 : 88 dey @@ -6256,7 +6256,7 @@ ffff = ram_top = -1 18a7 : 48 > pha ;use stack to load status 18a8 : 28 > plp -18a9 : a515 lda zp1 +18a9 : a50b lda zp1 18ab : 08 php ;test stores do not alter flags 18ac : 49c3 eor #$c3 18ae : 28 plp @@ -6282,7 +6282,7 @@ ffff = ram_top = -1 18c3 : 48 > pha ;use stack to load status 18c4 : 28 > plp -18c5 : a516 lda zp1+1 +18c5 : a50c lda zp1+1 18c7 : 08 php ;test stores do not alter flags 18c8 : 49c3 eor #$c3 18ca : 28 plp @@ -6308,7 +6308,7 @@ ffff = ram_top = -1 18df : 48 > pha ;use stack to load status 18e0 : 28 > plp -18e1 : a517 lda zp1+2 +18e1 : a50d lda zp1+2 18e3 : 08 php ;test stores do not alter flags 18e4 : 49c3 eor #$c3 18e6 : 28 plp @@ -6334,7 +6334,7 @@ ffff = ram_top = -1 18fb : 48 > pha ;use stack to load status 18fc : 28 > plp -18fd : a518 lda zp1+3 +18fd : a50e lda zp1+3 18ff : 08 php ;test stores do not alter flags 1900 : 49c3 eor #$c3 1902 : 28 plp @@ -6360,7 +6360,7 @@ ffff = ram_top = -1 1917 : 48 > pha ;use stack to load status 1918 : 28 > plp -1919 : a515 lda zp1 +1919 : a50b lda zp1 191b : 08 php ;test stores do not alter flags 191c : 49c3 eor #$c3 191e : 28 plp @@ -6386,7 +6386,7 @@ ffff = ram_top = -1 1933 : 48 > pha ;use stack to load status 1934 : 28 > plp -1935 : a516 lda zp1+1 +1935 : a50c lda zp1+1 1937 : 08 php ;test stores do not alter flags 1938 : 49c3 eor #$c3 193a : 28 plp @@ -6412,7 +6412,7 @@ ffff = ram_top = -1 194f : 48 > pha ;use stack to load status 1950 : 28 > plp -1951 : a517 lda zp1+2 +1951 : a50d lda zp1+2 1953 : 08 php ;test stores do not alter flags 1954 : 49c3 eor #$c3 1956 : 28 plp @@ -6438,7 +6438,7 @@ ffff = ram_top = -1 196b : 48 > pha ;use stack to load status 196c : 28 > plp -196d : a518 lda zp1+3 +196d : a50e lda zp1+3 196f : 08 php ;test stores do not alter flags 1970 : 49c3 eor #$c3 1972 : 28 plp @@ -6468,10 +6468,10 @@ ffff = ram_top = -1 198c : 08 php ;test stores do not alter flags 198d : 49c3 eor #$c3 198f : 28 plp -1990 : 850c sta zpt +1990 : 8502 sta zpt 1992 : 08 php ;flags after load/store sequence 1993 : 49c3 eor #$c3 -1995 : c515 cmp zp1 ;test result +1995 : c50b cmp zp1 ;test result trap_ne 1997 : d0fe > bne * ;failed not equal (non zero) @@ -6494,10 +6494,10 @@ ffff = ram_top = -1 19a8 : 08 php ;test stores do not alter flags 19a9 : 49c3 eor #$c3 19ab : 28 plp -19ac : 850d sta zpt+1 +19ac : 8503 sta zpt+1 19ae : 08 php ;flags after load/store sequence 19af : 49c3 eor #$c3 -19b1 : c516 cmp zp1+1 ;test result +19b1 : c50c cmp zp1+1 ;test result trap_ne 19b3 : d0fe > bne * ;failed not equal (non zero) @@ -6520,10 +6520,10 @@ ffff = ram_top = -1 19c4 : 08 php ;test stores do not alter flags 19c5 : 49c3 eor #$c3 19c7 : 28 plp -19c8 : 850e sta zpt+2 +19c8 : 8504 sta zpt+2 19ca : 08 php ;flags after load/store sequence 19cb : 49c3 eor #$c3 -19cd : c517 cmp zp1+2 ;test result +19cd : c50d cmp zp1+2 ;test result trap_ne 19cf : d0fe > bne * ;failed not equal (non zero) @@ -6546,10 +6546,10 @@ ffff = ram_top = -1 19e0 : 08 php ;test stores do not alter flags 19e1 : 49c3 eor #$c3 19e3 : 28 plp -19e4 : 850f sta zpt+3 +19e4 : 8505 sta zpt+3 19e6 : 08 php ;flags after load/store sequence 19e7 : 49c3 eor #$c3 -19e9 : c518 cmp zp1+3 ;test result +19e9 : c50e cmp zp1+3 ;test result trap_ne 19eb : d0fe > bne * ;failed not equal (non zero) @@ -6572,10 +6572,10 @@ ffff = ram_top = -1 19fc : 08 php ;test stores do not alter flags 19fd : 49c3 eor #$c3 19ff : 28 plp -1a00 : 850c sta zpt +1a00 : 8502 sta zpt 1a02 : 08 php ;flags after load/store sequence 1a03 : 49c3 eor #$c3 -1a05 : c515 cmp zp1 ;test result +1a05 : c50b cmp zp1 ;test result trap_ne 1a07 : d0fe > bne * ;failed not equal (non zero) @@ -6598,10 +6598,10 @@ ffff = ram_top = -1 1a18 : 08 php ;test stores do not alter flags 1a19 : 49c3 eor #$c3 1a1b : 28 plp -1a1c : 850d sta zpt+1 +1a1c : 8503 sta zpt+1 1a1e : 08 php ;flags after load/store sequence 1a1f : 49c3 eor #$c3 -1a21 : c516 cmp zp1+1 ;test result +1a21 : c50c cmp zp1+1 ;test result trap_ne 1a23 : d0fe > bne * ;failed not equal (non zero) @@ -6624,10 +6624,10 @@ ffff = ram_top = -1 1a34 : 08 php ;test stores do not alter flags 1a35 : 49c3 eor #$c3 1a37 : 28 plp -1a38 : 850e sta zpt+2 +1a38 : 8504 sta zpt+2 1a3a : 08 php ;flags after load/store sequence 1a3b : 49c3 eor #$c3 -1a3d : c517 cmp zp1+2 ;test result +1a3d : c50d cmp zp1+2 ;test result trap_ne 1a3f : d0fe > bne * ;failed not equal (non zero) @@ -6650,10 +6650,10 @@ ffff = ram_top = -1 1a50 : 08 php ;test stores do not alter flags 1a51 : 49c3 eor #$c3 1a53 : 28 plp -1a54 : 850f sta zpt+3 +1a54 : 8505 sta zpt+3 1a56 : 08 php ;flags after load/store sequence 1a57 : 49c3 eor #$c3 -1a59 : c518 cmp zp1+3 ;test result +1a59 : c50e cmp zp1+3 ;test result trap_ne 1a5b : d0fe > bne * ;failed not equal (non zero) @@ -6836,13 +6836,13 @@ ffff = ram_top = -1 1b05 : a200 ldx #0 -1b07 : a50c lda zpt +1b07 : a502 lda zpt 1b09 : 49c3 eor #$c3 -1b0b : c515 cmp zp1 +1b0b : c50b cmp zp1 trap_ne ;store to zp data 1b0d : d0fe > bne * ;failed not equal (non zero) -1b0f : 860c stx zpt ;clear +1b0f : 8602 stx zpt ;clear 1b11 : ad0302 lda abst 1b14 : 49c3 eor #$c3 1b16 : cd1802 cmp abs1 @@ -6850,13 +6850,13 @@ ffff = ram_top = -1 1b19 : d0fe > bne * ;failed not equal (non zero) 1b1b : 8e0302 stx abst ;clear -1b1e : a50d lda zpt+1 +1b1e : a503 lda zpt+1 1b20 : 49c3 eor #$c3 -1b22 : c516 cmp zp1+1 +1b22 : c50c cmp zp1+1 trap_ne ;store to zp data 1b24 : d0fe > bne * ;failed not equal (non zero) -1b26 : 860d stx zpt+1 ;clear +1b26 : 8603 stx zpt+1 ;clear 1b28 : ad0402 lda abst+1 1b2b : 49c3 eor #$c3 1b2d : cd1902 cmp abs1+1 @@ -6864,13 +6864,13 @@ ffff = ram_top = -1 1b30 : d0fe > bne * ;failed not equal (non zero) 1b32 : 8e0402 stx abst+1 ;clear -1b35 : a50e lda zpt+2 +1b35 : a504 lda zpt+2 1b37 : 49c3 eor #$c3 -1b39 : c517 cmp zp1+2 +1b39 : c50d cmp zp1+2 trap_ne ;store to zp data 1b3b : d0fe > bne * ;failed not equal (non zero) -1b3d : 860e stx zpt+2 ;clear +1b3d : 8604 stx zpt+2 ;clear 1b3f : ad0502 lda abst+2 1b42 : 49c3 eor #$c3 1b44 : cd1a02 cmp abs1+2 @@ -6878,13 +6878,13 @@ ffff = ram_top = -1 1b47 : d0fe > bne * ;failed not equal (non zero) 1b49 : 8e0502 stx abst+2 ;clear -1b4c : a50f lda zpt+3 +1b4c : a505 lda zpt+3 1b4e : 49c3 eor #$c3 -1b50 : c518 cmp zp1+3 +1b50 : c50e cmp zp1+3 trap_ne ;store to zp data 1b52 : d0fe > bne * ;failed not equal (non zero) -1b54 : 860f stx zpt+3 ;clear +1b54 : 8605 stx zpt+3 ;clear 1b56 : ad0602 lda abst+3 1b59 : 49c3 eor #$c3 1b5b : cd1b02 cmp abs1+3 @@ -6914,7 +6914,7 @@ ffff = ram_top = -1 1b72 : a9ff > lda #$ff ;precharge accu 1b74 : 28 > plp -1b75 : 2418 bit zp1+3 ;00 - should set Z / clear NV +1b75 : 240e bit zp1+3 ;00 - should set Z / clear NV tst_a $ff,fz 1b77 : 08 > php ;save flags 1b78 : c9ff > cmp #$ff ;test result @@ -6939,7 +6939,7 @@ ffff = ram_top = -1 1b86 : a901 > lda #1 ;precharge accu 1b88 : 28 > plp -1b89 : 2417 bit zp1+2 ;41 - should set V (M6) / clear NZ +1b89 : 240d 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 @@ -6964,7 +6964,7 @@ ffff = ram_top = -1 1b9a : a901 > lda #1 ;precharge accu 1b9c : 28 > plp -1b9d : 2416 bit zp1+1 ;82 - should set N (M7) & Z / clear V +1b9d : 240c 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 @@ -6989,7 +6989,7 @@ ffff = ram_top = -1 1bae : a901 > lda #1 ;precharge accu 1bb0 : 28 > plp -1bb1 : 2415 bit zp1 ;c3 - should set N (M7) & V (M6) / clear Z +1bb1 : 240b 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 @@ -7015,7 +7015,7 @@ ffff = ram_top = -1 1bc2 : a9ff > lda #$ff ;precharge accu 1bc4 : 28 > plp -1bc5 : 2418 bit zp1+3 ;00 - should set Z / clear NV +1bc5 : 240e bit zp1+3 ;00 - should set Z / clear NV tst_a $ff,~fnv 1bc7 : 08 > php ;save flags 1bc8 : c9ff > cmp #$ff ;test result @@ -7040,7 +7040,7 @@ ffff = ram_top = -1 1bd6 : a901 > lda #1 ;precharge accu 1bd8 : 28 > plp -1bd9 : 2417 bit zp1+2 ;41 - should set V (M6) / clear NZ +1bd9 : 240d 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 @@ -7065,7 +7065,7 @@ ffff = ram_top = -1 1bea : a901 > lda #1 ;precharge accu 1bec : 28 > plp -1bed : 2416 bit zp1+1 ;82 - should set N (M7) & Z / clear V +1bed : 240c 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 @@ -7090,7 +7090,7 @@ ffff = ram_top = -1 1bfe : a901 > lda #1 ;precharge accu 1c00 : 28 > plp -1c01 : 2415 bit zp1 ;c3 - should set N (M7) & V (M6) / clear Z +1c01 : 240b 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 @@ -7330,7 +7330,7 @@ ffff = ram_top = -1 1cc6 : a280 > ldx #$80 ;precharge index x 1cc8 : 28 > plp -1cc9 : e419 cpx zp7f +1cc9 : e40f cpx zp7f tst_stat fc 1ccb : 08 > php ;save status 1ccc : 68 > pla ;use stack to retrieve status @@ -7344,7 +7344,7 @@ ffff = ram_top = -1 1cd2 : 28 > plp ;restore status 1cd3 : ca dex -1cd4 : e419 cpx zp7f +1cd4 : e40f cpx zp7f tst_stat fzc 1cd6 : 08 > php ;save status 1cd7 : 68 > pla ;use stack to retrieve status @@ -7358,7 +7358,7 @@ ffff = ram_top = -1 1cdd : 28 > plp ;restore status 1cde : ca dex -1cdf : e419 cpx zp7f +1cdf : e40f cpx zp7f tst_x $7e,fn 1ce1 : 08 > php ;save flags 1ce2 : e07e > cpx #$7e ;test result @@ -7383,7 +7383,7 @@ ffff = ram_top = -1 1cf0 : a280 > ldx #$80 ;precharge index x 1cf2 : 28 > plp -1cf3 : e419 cpx zp7f +1cf3 : e40f cpx zp7f tst_stat ~fnz 1cf5 : 08 > php ;save status 1cf6 : 68 > pla ;use stack to retrieve status @@ -7397,7 +7397,7 @@ ffff = ram_top = -1 1cfc : 28 > plp ;restore status 1cfd : ca dex -1cfe : e419 cpx zp7f +1cfe : e40f cpx zp7f tst_stat ~fn 1d00 : 08 > php ;save status 1d01 : 68 > pla ;use stack to retrieve status @@ -7411,7 +7411,7 @@ ffff = ram_top = -1 1d07 : 28 > plp ;restore status 1d08 : ca dex -1d09 : e419 cpx zp7f +1d09 : e40f cpx zp7f tst_x $7e,~fzc 1d0b : 08 > php ;save flags 1d0c : e07e > cpx #$7e ;test result @@ -7663,7 +7663,7 @@ ffff = ram_top = -1 1dd4 : a080 > ldy #$80 ;precharge index y 1dd6 : 28 > plp -1dd7 : c419 cpy zp7f +1dd7 : c40f cpy zp7f tst_stat fc 1dd9 : 08 > php ;save status 1dda : 68 > pla ;use stack to retrieve status @@ -7677,7 +7677,7 @@ ffff = ram_top = -1 1de0 : 28 > plp ;restore status 1de1 : 88 dey -1de2 : c419 cpy zp7f +1de2 : c40f cpy zp7f tst_stat fzc 1de4 : 08 > php ;save status 1de5 : 68 > pla ;use stack to retrieve status @@ -7691,7 +7691,7 @@ ffff = ram_top = -1 1deb : 28 > plp ;restore status 1dec : 88 dey -1ded : c419 cpy zp7f +1ded : c40f cpy zp7f tst_y $7e,fn 1def : 08 > php ;save flags 1df0 : c07e > cpy #$7e ;test result @@ -7716,7 +7716,7 @@ ffff = ram_top = -1 1dfe : a080 > ldy #$80 ;precharge index y 1e00 : 28 > plp -1e01 : c419 cpy zp7f +1e01 : c40f cpy zp7f tst_stat ~fnz 1e03 : 08 > php ;save status 1e04 : 68 > pla ;use stack to retrieve status @@ -7730,7 +7730,7 @@ ffff = ram_top = -1 1e0a : 28 > plp ;restore status 1e0b : 88 dey -1e0c : c419 cpy zp7f +1e0c : c40f cpy zp7f tst_stat ~fn 1e0e : 08 > php ;save status 1e0f : 68 > pla ;use stack to retrieve status @@ -7744,7 +7744,7 @@ ffff = ram_top = -1 1e15 : 28 > plp ;restore status 1e16 : 88 dey -1e17 : c419 cpy zp7f +1e17 : c40f cpy zp7f tst_y $7e,~fzc 1e19 : 08 > php ;save flags 1e1a : c07e > cpy #$7e ;test result @@ -7996,7 +7996,7 @@ ffff = ram_top = -1 1ee2 : a980 > lda #$80 ;precharge accu 1ee4 : 28 > plp -1ee5 : c519 cmp zp7f +1ee5 : c50f cmp zp7f tst_a $80,fc 1ee7 : 08 > php ;save flags 1ee8 : c980 > cmp #$80 ;test result @@ -8021,7 +8021,7 @@ ffff = ram_top = -1 1ef6 : a97f > lda #$7f ;precharge accu 1ef8 : 28 > plp -1ef9 : c519 cmp zp7f +1ef9 : c50f cmp zp7f tst_a $7f,fzc 1efb : 08 > php ;save flags 1efc : c97f > cmp #$7f ;test result @@ -8046,7 +8046,7 @@ ffff = ram_top = -1 1f0a : a97e > lda #$7e ;precharge accu 1f0c : 28 > plp -1f0d : c519 cmp zp7f +1f0d : c50f cmp zp7f tst_a $7e,fn 1f0f : 08 > php ;save flags 1f10 : c97e > cmp #$7e ;test result @@ -8071,7 +8071,7 @@ ffff = ram_top = -1 1f1e : a980 > lda #$80 ;precharge accu 1f20 : 28 > plp -1f21 : c519 cmp zp7f +1f21 : c50f cmp zp7f tst_a $80,~fnz 1f23 : 08 > php ;save flags 1f24 : c980 > cmp #$80 ;test result @@ -8096,7 +8096,7 @@ ffff = ram_top = -1 1f32 : a97f > lda #$7f ;precharge accu 1f34 : 28 > plp -1f35 : c519 cmp zp7f +1f35 : c50f cmp zp7f tst_a $7f,~fn 1f37 : 08 > php ;save flags 1f38 : c97f > cmp #$7f ;test result @@ -8121,7 +8121,7 @@ ffff = ram_top = -1 1f46 : a97e > lda #$7e ;precharge accu 1f48 : 28 > plp -1f49 : c519 cmp zp7f +1f49 : c50f cmp zp7f tst_a $7e,~fzc 1f4b : 08 > php ;save flags 1f4c : c97e > cmp #$7e ;test result @@ -8450,7 +8450,7 @@ ffff = ram_top = -1 2052 : a980 > lda #$80 ;precharge accu 2054 : 28 > plp -2055 : d515 cmp zp1,x +2055 : d50b cmp zp1,x tst_a $80,fc 2057 : 08 > php ;save flags 2058 : c980 > cmp #$80 ;test result @@ -8475,7 +8475,7 @@ ffff = ram_top = -1 2066 : a97f > lda #$7f ;precharge accu 2068 : 28 > plp -2069 : d515 cmp zp1,x +2069 : d50b cmp zp1,x tst_a $7f,fzc 206b : 08 > php ;save flags 206c : c97f > cmp #$7f ;test result @@ -8500,7 +8500,7 @@ ffff = ram_top = -1 207a : a97e > lda #$7e ;precharge accu 207c : 28 > plp -207d : d515 cmp zp1,x +207d : d50b cmp zp1,x tst_a $7e,fn 207f : 08 > php ;save flags 2080 : c97e > cmp #$7e ;test result @@ -8525,7 +8525,7 @@ ffff = ram_top = -1 208e : a980 > lda #$80 ;precharge accu 2090 : 28 > plp -2091 : d515 cmp zp1,x +2091 : d50b cmp zp1,x tst_a $80,~fnz 2093 : 08 > php ;save flags 2094 : c980 > cmp #$80 ;test result @@ -8550,7 +8550,7 @@ ffff = ram_top = -1 20a2 : a97f > lda #$7f ;precharge accu 20a4 : 28 > plp -20a5 : d515 cmp zp1,x +20a5 : d50b cmp zp1,x tst_a $7f,~fn 20a7 : 08 > php ;save flags 20a8 : c97f > cmp #$7f ;test result @@ -8575,7 +8575,7 @@ ffff = ram_top = -1 20b6 : a97e > lda #$7e ;precharge accu 20b8 : 28 > plp -20b9 : d515 cmp zp1,x +20b9 : d50b cmp zp1,x tst_a $7e,~fzc 20bb : 08 > php ;save flags 20bc : c97e > cmp #$7e ;test result @@ -8905,7 +8905,7 @@ ffff = ram_top = -1 21ca : a980 > lda #$80 ;precharge accu 21cc : 28 > plp -21cd : c126 cmp (ind1,x) +21cd : c11c cmp (ind1,x) tst_a $80,fc 21cf : 08 > php ;save flags 21d0 : c980 > cmp #$80 ;test result @@ -8930,7 +8930,7 @@ ffff = ram_top = -1 21de : a97f > lda #$7f ;precharge accu 21e0 : 28 > plp -21e1 : c126 cmp (ind1,x) +21e1 : c11c cmp (ind1,x) tst_a $7f,fzc 21e3 : 08 > php ;save flags 21e4 : c97f > cmp #$7f ;test result @@ -8955,7 +8955,7 @@ ffff = ram_top = -1 21f2 : a97e > lda #$7e ;precharge accu 21f4 : 28 > plp -21f5 : c126 cmp (ind1,x) +21f5 : c11c cmp (ind1,x) tst_a $7e,fn 21f7 : 08 > php ;save flags 21f8 : c97e > cmp #$7e ;test result @@ -8980,7 +8980,7 @@ ffff = ram_top = -1 2206 : a980 > lda #$80 ;precharge accu 2208 : 28 > plp -2209 : c126 cmp (ind1,x) +2209 : c11c cmp (ind1,x) tst_a $80,~fnz 220b : 08 > php ;save flags 220c : c980 > cmp #$80 ;test result @@ -9005,7 +9005,7 @@ ffff = ram_top = -1 221a : a97f > lda #$7f ;precharge accu 221c : 28 > plp -221d : c126 cmp (ind1,x) +221d : c11c cmp (ind1,x) tst_a $7f,~fn 221f : 08 > php ;save flags 2220 : c97f > cmp #$7f ;test result @@ -9030,7 +9030,7 @@ ffff = ram_top = -1 222e : a97e > lda #$7e ;precharge accu 2230 : 28 > plp -2231 : c126 cmp (ind1,x) +2231 : c11c cmp (ind1,x) tst_a $7e,~fzc 2233 : 08 > php ;save flags 2234 : c97e > cmp #$7e ;test result @@ -9056,7 +9056,7 @@ ffff = ram_top = -1 2242 : a980 > lda #$80 ;precharge accu 2244 : 28 > plp -2245 : d126 cmp (ind1),y +2245 : d11c cmp (ind1),y tst_a $80,fc 2247 : 08 > php ;save flags 2248 : c980 > cmp #$80 ;test result @@ -9081,7 +9081,7 @@ ffff = ram_top = -1 2256 : a97f > lda #$7f ;precharge accu 2258 : 28 > plp -2259 : d126 cmp (ind1),y +2259 : d11c cmp (ind1),y tst_a $7f,fzc 225b : 08 > php ;save flags 225c : c97f > cmp #$7f ;test result @@ -9106,7 +9106,7 @@ ffff = ram_top = -1 226a : a97e > lda #$7e ;precharge accu 226c : 28 > plp -226d : d126 cmp (ind1),y +226d : d11c cmp (ind1),y tst_a $7e,fn 226f : 08 > php ;save flags 2270 : c97e > cmp #$7e ;test result @@ -9131,7 +9131,7 @@ ffff = ram_top = -1 227e : a980 > lda #$80 ;precharge accu 2280 : 28 > plp -2281 : d126 cmp (ind1),y +2281 : d11c cmp (ind1),y tst_a $80,~fnz 2283 : 08 > php ;save flags 2284 : c980 > cmp #$80 ;test result @@ -9156,7 +9156,7 @@ ffff = ram_top = -1 2292 : a97f > lda #$7f ;precharge accu 2294 : 28 > plp -2295 : d126 cmp (ind1),y +2295 : d11c cmp (ind1),y tst_a $7f,~fn 2297 : 08 > php ;save flags 2298 : c97f > cmp #$7f ;test result @@ -9181,7 +9181,7 @@ ffff = ram_top = -1 22a6 : a97e > lda #$7e ;precharge accu 22a8 : 28 > plp -22a9 : d126 cmp (ind1),y +22a9 : d11c cmp (ind1),y tst_a $7e,~fzc 22ab : 08 > php ;save flags 22ac : c97e > cmp #$7e ;test result @@ -9219,7 +9219,7 @@ ffff = ram_top = -1 22c5 : a900 > lda #0 ;allow test to change I-flag (no mask) > 22c7 : 48 > pha ;use stack to load status -22c8 : b513 > lda zps,x ;precharge accu +22c8 : b509 > lda zps,x ;precharge accu 22ca : 28 > plp 22cb : 0a asl a @@ -9247,7 +9247,7 @@ ffff = ram_top = -1 22df : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 22e1 : 48 > pha ;use stack to load status -22e2 : b513 > lda zps,x ;precharge accu +22e2 : b509 > lda zps,x ;precharge accu 22e4 : 28 > plp 22e5 : 0a asl a @@ -9276,7 +9276,7 @@ ffff = ram_top = -1 22f9 : a900 > lda #0 ;allow test to change I-flag (no mask) > 22fb : 48 > pha ;use stack to load status -22fc : b513 > lda zps,x ;precharge accu +22fc : b509 > lda zps,x ;precharge accu 22fe : 28 > plp 22ff : 4a lsr a @@ -9304,7 +9304,7 @@ ffff = ram_top = -1 2313 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2315 : 48 > pha ;use stack to load status -2316 : b513 > lda zps,x ;precharge accu +2316 : b509 > lda zps,x ;precharge accu 2318 : 28 > plp 2319 : 4a lsr a @@ -9333,7 +9333,7 @@ ffff = ram_top = -1 232d : a900 > lda #0 ;allow test to change I-flag (no mask) > 232f : 48 > pha ;use stack to load status -2330 : b513 > lda zps,x ;precharge accu +2330 : b509 > lda zps,x ;precharge accu 2332 : 28 > plp 2333 : 2a rol a @@ -9361,7 +9361,7 @@ ffff = ram_top = -1 2347 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 2349 : 48 > pha ;use stack to load status -234a : b513 > lda zps,x ;precharge accu +234a : b509 > lda zps,x ;precharge accu 234c : 28 > plp 234d : 2a rol a @@ -9390,7 +9390,7 @@ ffff = ram_top = -1 2361 : a901 > lda #fc ;allow test to change I-flag (no mask) > 2363 : 48 > pha ;use stack to load status -2364 : b513 > lda zps,x ;precharge accu +2364 : b509 > lda zps,x ;precharge accu 2366 : 28 > plp 2367 : 2a rol a @@ -9418,7 +9418,7 @@ ffff = ram_top = -1 237b : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 237d : 48 > pha ;use stack to load status -237e : b513 > lda zps,x ;precharge accu +237e : b509 > lda zps,x ;precharge accu 2380 : 28 > plp 2381 : 2a rol a @@ -9447,7 +9447,7 @@ ffff = ram_top = -1 2395 : a900 > lda #0 ;allow test to change I-flag (no mask) > 2397 : 48 > pha ;use stack to load status -2398 : b513 > lda zps,x ;precharge accu +2398 : b509 > lda zps,x ;precharge accu 239a : 28 > plp 239b : 6a ror a @@ -9475,7 +9475,7 @@ ffff = ram_top = -1 23af : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 23b1 : 48 > pha ;use stack to load status -23b2 : b513 > lda zps,x ;precharge accu +23b2 : b509 > lda zps,x ;precharge accu 23b4 : 28 > plp 23b5 : 6a ror a @@ -9504,7 +9504,7 @@ ffff = ram_top = -1 23c9 : a901 > lda #fc ;allow test to change I-flag (no mask) > 23cb : 48 > pha ;use stack to load status -23cc : b513 > lda zps,x ;precharge accu +23cc : b509 > lda zps,x ;precharge accu 23ce : 28 > plp 23cf : 6a ror a @@ -9532,7 +9532,7 @@ ffff = ram_top = -1 23e3 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 23e5 : 48 > pha ;use stack to load status -23e6 : b513 > lda zps,x ;precharge accu +23e6 : b509 > lda zps,x ;precharge accu 23e8 : 28 > plp 23e9 : 6a ror a @@ -9573,14 +9573,14 @@ ffff = ram_top = -1 2409 : a900 > lda #0 ;allow test to change I-flag (no mask) > 240b : 48 > pha ;use stack to load status -240c : b513 > lda zps,x ;load to zeropage -240e : 850c > sta zpt +240c : b509 > lda zps,x ;load to zeropage +240e : 8502 > sta zpt 2410 : 28 > plp -2411 : 060c asl zpt +2411 : 0602 asl zpt tst_z rASL,fASL,0 2413 : 08 > php ;save flags -2414 : a50c > lda zpt +2414 : a502 > lda zpt 2416 : dd2102 > cmp rASL,x ;test result > trap_ne 2419 : d0fe > bne * ;failed not equal (non zero) @@ -9603,14 +9603,14 @@ ffff = ram_top = -1 2428 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 242a : 48 > pha ;use stack to load status -242b : b513 > lda zps,x ;load to zeropage -242d : 850c > sta zpt +242b : b509 > lda zps,x ;load to zeropage +242d : 8502 > sta zpt 242f : 28 > plp -2430 : 060c asl zpt +2430 : 0602 asl zpt tst_z rASL,fASL,$ff-fnzc 2432 : 08 > php ;save flags -2433 : a50c > lda zpt +2433 : a502 > lda zpt 2435 : dd2102 > cmp rASL,x ;test result > trap_ne 2438 : d0fe > bne * ;failed not equal (non zero) @@ -9634,14 +9634,14 @@ ffff = ram_top = -1 2447 : a900 > lda #0 ;allow test to change I-flag (no mask) > 2449 : 48 > pha ;use stack to load status -244a : b513 > lda zps,x ;load to zeropage -244c : 850c > sta zpt +244a : b509 > lda zps,x ;load to zeropage +244c : 8502 > sta zpt 244e : 28 > plp -244f : 460c lsr zpt +244f : 4602 lsr zpt tst_z rLSR,fLSR,0 2451 : 08 > php ;save flags -2452 : a50c > lda zpt +2452 : a502 > lda zpt 2454 : dd2d02 > cmp rLSR,x ;test result > trap_ne 2457 : d0fe > bne * ;failed not equal (non zero) @@ -9664,14 +9664,14 @@ ffff = ram_top = -1 2466 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2468 : 48 > pha ;use stack to load status -2469 : b513 > lda zps,x ;load to zeropage -246b : 850c > sta zpt +2469 : b509 > lda zps,x ;load to zeropage +246b : 8502 > sta zpt 246d : 28 > plp -246e : 460c lsr zpt +246e : 4602 lsr zpt tst_z rLSR,fLSR,$ff-fnzc 2470 : 08 > php ;save flags -2471 : a50c > lda zpt +2471 : a502 > lda zpt 2473 : dd2d02 > cmp rLSR,x ;test result > trap_ne 2476 : d0fe > bne * ;failed not equal (non zero) @@ -9695,14 +9695,14 @@ ffff = ram_top = -1 2485 : a900 > lda #0 ;allow test to change I-flag (no mask) > 2487 : 48 > pha ;use stack to load status -2488 : b513 > lda zps,x ;load to zeropage -248a : 850c > sta zpt +2488 : b509 > lda zps,x ;load to zeropage +248a : 8502 > sta zpt 248c : 28 > plp -248d : 260c rol zpt +248d : 2602 rol zpt tst_z rROL,fROL,0 248f : 08 > php ;save flags -2490 : a50c > lda zpt +2490 : a502 > lda zpt 2492 : dd2102 > cmp rROL,x ;test result > trap_ne 2495 : d0fe > bne * ;failed not equal (non zero) @@ -9725,14 +9725,14 @@ ffff = ram_top = -1 24a4 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 24a6 : 48 > pha ;use stack to load status -24a7 : b513 > lda zps,x ;load to zeropage -24a9 : 850c > sta zpt +24a7 : b509 > lda zps,x ;load to zeropage +24a9 : 8502 > sta zpt 24ab : 28 > plp -24ac : 260c rol zpt +24ac : 2602 rol zpt tst_z rROL,fROL,$ff-fnzc 24ae : 08 > php ;save flags -24af : a50c > lda zpt +24af : a502 > lda zpt 24b1 : dd2102 > cmp rROL,x ;test result > trap_ne 24b4 : d0fe > bne * ;failed not equal (non zero) @@ -9756,14 +9756,14 @@ ffff = ram_top = -1 24c3 : a901 > lda #fc ;allow test to change I-flag (no mask) > 24c5 : 48 > pha ;use stack to load status -24c6 : b513 > lda zps,x ;load to zeropage -24c8 : 850c > sta zpt +24c6 : b509 > lda zps,x ;load to zeropage +24c8 : 8502 > sta zpt 24ca : 28 > plp -24cb : 260c rol zpt +24cb : 2602 rol zpt tst_z rROLc,fROLc,0 24cd : 08 > php ;save flags -24ce : a50c > lda zpt +24ce : a502 > lda zpt 24d0 : dd2702 > cmp rROLc,x ;test result > trap_ne 24d3 : d0fe > bne * ;failed not equal (non zero) @@ -9786,14 +9786,14 @@ ffff = ram_top = -1 24e2 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 24e4 : 48 > pha ;use stack to load status -24e5 : b513 > lda zps,x ;load to zeropage -24e7 : 850c > sta zpt +24e5 : b509 > lda zps,x ;load to zeropage +24e7 : 8502 > sta zpt 24e9 : 28 > plp -24ea : 260c rol zpt +24ea : 2602 rol zpt tst_z rROLc,fROLc,$ff-fnzc 24ec : 08 > php ;save flags -24ed : a50c > lda zpt +24ed : a502 > lda zpt 24ef : dd2702 > cmp rROLc,x ;test result > trap_ne 24f2 : d0fe > bne * ;failed not equal (non zero) @@ -9817,14 +9817,14 @@ ffff = ram_top = -1 2501 : a900 > lda #0 ;allow test to change I-flag (no mask) > 2503 : 48 > pha ;use stack to load status -2504 : b513 > lda zps,x ;load to zeropage -2506 : 850c > sta zpt +2504 : b509 > lda zps,x ;load to zeropage +2506 : 8502 > sta zpt 2508 : 28 > plp -2509 : 660c ror zpt +2509 : 6602 ror zpt tst_z rROR,fROR,0 250b : 08 > php ;save flags -250c : a50c > lda zpt +250c : a502 > lda zpt 250e : dd2d02 > cmp rROR,x ;test result > trap_ne 2511 : d0fe > bne * ;failed not equal (non zero) @@ -9847,14 +9847,14 @@ ffff = ram_top = -1 2520 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 2522 : 48 > pha ;use stack to load status -2523 : b513 > lda zps,x ;load to zeropage -2525 : 850c > sta zpt +2523 : b509 > lda zps,x ;load to zeropage +2525 : 8502 > sta zpt 2527 : 28 > plp -2528 : 660c ror zpt +2528 : 6602 ror zpt tst_z rROR,fROR,$ff-fnzc 252a : 08 > php ;save flags -252b : a50c > lda zpt +252b : a502 > lda zpt 252d : dd2d02 > cmp rROR,x ;test result > trap_ne 2530 : d0fe > bne * ;failed not equal (non zero) @@ -9878,14 +9878,14 @@ ffff = ram_top = -1 253f : a901 > lda #fc ;allow test to change I-flag (no mask) > 2541 : 48 > pha ;use stack to load status -2542 : b513 > lda zps,x ;load to zeropage -2544 : 850c > sta zpt +2542 : b509 > lda zps,x ;load to zeropage +2544 : 8502 > sta zpt 2546 : 28 > plp -2547 : 660c ror zpt +2547 : 6602 ror zpt tst_z rRORc,fRORc,0 2549 : 08 > php ;save flags -254a : a50c > lda zpt +254a : a502 > lda zpt 254c : dd3302 > cmp rRORc,x ;test result > trap_ne 254f : d0fe > bne * ;failed not equal (non zero) @@ -9908,14 +9908,14 @@ ffff = ram_top = -1 255e : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2560 : 48 > pha ;use stack to load status -2561 : b513 > lda zps,x ;load to zeropage -2563 : 850c > sta zpt +2561 : b509 > lda zps,x ;load to zeropage +2563 : 8502 > sta zpt 2565 : 28 > plp -2566 : 660c ror zpt +2566 : 6602 ror zpt tst_z rRORc,fRORc,$ff-fnzc 2568 : 08 > php ;save flags -2569 : a50c > lda zpt +2569 : a502 > lda zpt 256b : dd3302 > cmp rRORc,x ;test result > trap_ne 256e : d0fe > bne * ;failed not equal (non zero) @@ -9951,7 +9951,7 @@ ffff = ram_top = -1 2589 : a900 > lda #0 ;allow test to change I-flag (no mask) > 258b : 48 > pha ;use stack to load status -258c : b513 > lda zps,x ;load to memory +258c : b509 > lda zps,x ;load to memory 258e : 8d0302 > sta abst 2591 : 28 > plp @@ -9981,7 +9981,7 @@ ffff = ram_top = -1 25ab : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 25ad : 48 > pha ;use stack to load status -25ae : b513 > lda zps,x ;load to memory +25ae : b509 > lda zps,x ;load to memory 25b0 : 8d0302 > sta abst 25b3 : 28 > plp @@ -10012,7 +10012,7 @@ ffff = ram_top = -1 25cd : a900 > lda #0 ;allow test to change I-flag (no mask) > 25cf : 48 > pha ;use stack to load status -25d0 : b513 > lda zps,x ;load to memory +25d0 : b509 > lda zps,x ;load to memory 25d2 : 8d0302 > sta abst 25d5 : 28 > plp @@ -10042,7 +10042,7 @@ ffff = ram_top = -1 25ef : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 25f1 : 48 > pha ;use stack to load status -25f2 : b513 > lda zps,x ;load to memory +25f2 : b509 > lda zps,x ;load to memory 25f4 : 8d0302 > sta abst 25f7 : 28 > plp @@ -10073,7 +10073,7 @@ ffff = ram_top = -1 2611 : a900 > lda #0 ;allow test to change I-flag (no mask) > 2613 : 48 > pha ;use stack to load status -2614 : b513 > lda zps,x ;load to memory +2614 : b509 > lda zps,x ;load to memory 2616 : 8d0302 > sta abst 2619 : 28 > plp @@ -10103,7 +10103,7 @@ ffff = ram_top = -1 2633 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 2635 : 48 > pha ;use stack to load status -2636 : b513 > lda zps,x ;load to memory +2636 : b509 > lda zps,x ;load to memory 2638 : 8d0302 > sta abst 263b : 28 > plp @@ -10134,7 +10134,7 @@ ffff = ram_top = -1 2655 : a901 > lda #fc ;allow test to change I-flag (no mask) > 2657 : 48 > pha ;use stack to load status -2658 : b513 > lda zps,x ;load to memory +2658 : b509 > lda zps,x ;load to memory 265a : 8d0302 > sta abst 265d : 28 > plp @@ -10164,7 +10164,7 @@ ffff = ram_top = -1 2677 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2679 : 48 > pha ;use stack to load status -267a : b513 > lda zps,x ;load to memory +267a : b509 > lda zps,x ;load to memory 267c : 8d0302 > sta abst 267f : 28 > plp @@ -10195,7 +10195,7 @@ ffff = ram_top = -1 2699 : a900 > lda #0 ;allow test to change I-flag (no mask) > 269b : 48 > pha ;use stack to load status -269c : b513 > lda zps,x ;load to memory +269c : b509 > lda zps,x ;load to memory 269e : 8d0302 > sta abst 26a1 : 28 > plp @@ -10225,7 +10225,7 @@ ffff = ram_top = -1 26bb : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 26bd : 48 > pha ;use stack to load status -26be : b513 > lda zps,x ;load to memory +26be : b509 > lda zps,x ;load to memory 26c0 : 8d0302 > sta abst 26c3 : 28 > plp @@ -10256,7 +10256,7 @@ ffff = ram_top = -1 26dd : a901 > lda #fc ;allow test to change I-flag (no mask) > 26df : 48 > pha ;use stack to load status -26e0 : b513 > lda zps,x ;load to memory +26e0 : b509 > lda zps,x ;load to memory 26e2 : 8d0302 > sta abst 26e5 : 28 > plp @@ -10286,7 +10286,7 @@ ffff = ram_top = -1 26ff : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2701 : 48 > pha ;use stack to load status -2702 : b513 > lda zps,x ;load to memory +2702 : b509 > lda zps,x ;load to memory 2704 : 8d0302 > sta abst 2707 : 28 > plp @@ -10329,14 +10329,14 @@ ffff = ram_top = -1 272d : a900 > lda #0 ;allow test to change I-flag (no mask) > 272f : 48 > pha ;use stack to load status -2730 : b513 > lda zps,x ;load to indexed zeropage -2732 : 950c > sta zpt,x +2730 : b509 > lda zps,x ;load to indexed zeropage +2732 : 9502 > sta zpt,x 2734 : 28 > plp -2735 : 160c asl zpt,x +2735 : 1602 asl zpt,x tst_zx rASL,fASL,0 2737 : 08 > php ;save flags -2738 : b50c > lda zpt,x +2738 : b502 > lda zpt,x 273a : dd2102 > cmp rASL,x ;test result > trap_ne 273d : d0fe > bne * ;failed not equal (non zero) @@ -10359,14 +10359,14 @@ ffff = ram_top = -1 274c : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 274e : 48 > pha ;use stack to load status -274f : b513 > lda zps,x ;load to indexed zeropage -2751 : 950c > sta zpt,x +274f : b509 > lda zps,x ;load to indexed zeropage +2751 : 9502 > sta zpt,x 2753 : 28 > plp -2754 : 160c asl zpt,x +2754 : 1602 asl zpt,x tst_zx rASL,fASL,$ff-fnzc 2756 : 08 > php ;save flags -2757 : b50c > lda zpt,x +2757 : b502 > lda zpt,x 2759 : dd2102 > cmp rASL,x ;test result > trap_ne 275c : d0fe > bne * ;failed not equal (non zero) @@ -10390,14 +10390,14 @@ ffff = ram_top = -1 276b : a900 > lda #0 ;allow test to change I-flag (no mask) > 276d : 48 > pha ;use stack to load status -276e : b513 > lda zps,x ;load to indexed zeropage -2770 : 950c > sta zpt,x +276e : b509 > lda zps,x ;load to indexed zeropage +2770 : 9502 > sta zpt,x 2772 : 28 > plp -2773 : 560c lsr zpt,x +2773 : 5602 lsr zpt,x tst_zx rLSR,fLSR,0 2775 : 08 > php ;save flags -2776 : b50c > lda zpt,x +2776 : b502 > lda zpt,x 2778 : dd2d02 > cmp rLSR,x ;test result > trap_ne 277b : d0fe > bne * ;failed not equal (non zero) @@ -10420,14 +10420,14 @@ ffff = ram_top = -1 278a : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 278c : 48 > pha ;use stack to load status -278d : b513 > lda zps,x ;load to indexed zeropage -278f : 950c > sta zpt,x +278d : b509 > lda zps,x ;load to indexed zeropage +278f : 9502 > sta zpt,x 2791 : 28 > plp -2792 : 560c lsr zpt,x +2792 : 5602 lsr zpt,x tst_zx rLSR,fLSR,$ff-fnzc 2794 : 08 > php ;save flags -2795 : b50c > lda zpt,x +2795 : b502 > lda zpt,x 2797 : dd2d02 > cmp rLSR,x ;test result > trap_ne 279a : d0fe > bne * ;failed not equal (non zero) @@ -10451,14 +10451,14 @@ ffff = ram_top = -1 27a9 : a900 > lda #0 ;allow test to change I-flag (no mask) > 27ab : 48 > pha ;use stack to load status -27ac : b513 > lda zps,x ;load to indexed zeropage -27ae : 950c > sta zpt,x +27ac : b509 > lda zps,x ;load to indexed zeropage +27ae : 9502 > sta zpt,x 27b0 : 28 > plp -27b1 : 360c rol zpt,x +27b1 : 3602 rol zpt,x tst_zx rROL,fROL,0 27b3 : 08 > php ;save flags -27b4 : b50c > lda zpt,x +27b4 : b502 > lda zpt,x 27b6 : dd2102 > cmp rROL,x ;test result > trap_ne 27b9 : d0fe > bne * ;failed not equal (non zero) @@ -10481,14 +10481,14 @@ ffff = ram_top = -1 27c8 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 27ca : 48 > pha ;use stack to load status -27cb : b513 > lda zps,x ;load to indexed zeropage -27cd : 950c > sta zpt,x +27cb : b509 > lda zps,x ;load to indexed zeropage +27cd : 9502 > sta zpt,x 27cf : 28 > plp -27d0 : 360c rol zpt,x +27d0 : 3602 rol zpt,x tst_zx rROL,fROL,$ff-fnzc 27d2 : 08 > php ;save flags -27d3 : b50c > lda zpt,x +27d3 : b502 > lda zpt,x 27d5 : dd2102 > cmp rROL,x ;test result > trap_ne 27d8 : d0fe > bne * ;failed not equal (non zero) @@ -10512,14 +10512,14 @@ ffff = ram_top = -1 27e7 : a901 > lda #fc ;allow test to change I-flag (no mask) > 27e9 : 48 > pha ;use stack to load status -27ea : b513 > lda zps,x ;load to indexed zeropage -27ec : 950c > sta zpt,x +27ea : b509 > lda zps,x ;load to indexed zeropage +27ec : 9502 > sta zpt,x 27ee : 28 > plp -27ef : 360c rol zpt,x +27ef : 3602 rol zpt,x tst_zx rROLc,fROLc,0 27f1 : 08 > php ;save flags -27f2 : b50c > lda zpt,x +27f2 : b502 > lda zpt,x 27f4 : dd2702 > cmp rROLc,x ;test result > trap_ne 27f7 : d0fe > bne * ;failed not equal (non zero) @@ -10542,14 +10542,14 @@ ffff = ram_top = -1 2806 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2808 : 48 > pha ;use stack to load status -2809 : b513 > lda zps,x ;load to indexed zeropage -280b : 950c > sta zpt,x +2809 : b509 > lda zps,x ;load to indexed zeropage +280b : 9502 > sta zpt,x 280d : 28 > plp -280e : 360c rol zpt,x +280e : 3602 rol zpt,x tst_zx rROLc,fROLc,$ff-fnzc 2810 : 08 > php ;save flags -2811 : b50c > lda zpt,x +2811 : b502 > lda zpt,x 2813 : dd2702 > cmp rROLc,x ;test result > trap_ne 2816 : d0fe > bne * ;failed not equal (non zero) @@ -10573,14 +10573,14 @@ ffff = ram_top = -1 2825 : a900 > lda #0 ;allow test to change I-flag (no mask) > 2827 : 48 > pha ;use stack to load status -2828 : b513 > lda zps,x ;load to indexed zeropage -282a : 950c > sta zpt,x +2828 : b509 > lda zps,x ;load to indexed zeropage +282a : 9502 > sta zpt,x 282c : 28 > plp -282d : 760c ror zpt,x +282d : 7602 ror zpt,x tst_zx rROR,fROR,0 282f : 08 > php ;save flags -2830 : b50c > lda zpt,x +2830 : b502 > lda zpt,x 2832 : dd2d02 > cmp rROR,x ;test result > trap_ne 2835 : d0fe > bne * ;failed not equal (non zero) @@ -10603,14 +10603,14 @@ ffff = ram_top = -1 2844 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 2846 : 48 > pha ;use stack to load status -2847 : b513 > lda zps,x ;load to indexed zeropage -2849 : 950c > sta zpt,x +2847 : b509 > lda zps,x ;load to indexed zeropage +2849 : 9502 > sta zpt,x 284b : 28 > plp -284c : 760c ror zpt,x +284c : 7602 ror zpt,x tst_zx rROR,fROR,$ff-fnzc 284e : 08 > php ;save flags -284f : b50c > lda zpt,x +284f : b502 > lda zpt,x 2851 : dd2d02 > cmp rROR,x ;test result > trap_ne 2854 : d0fe > bne * ;failed not equal (non zero) @@ -10634,14 +10634,14 @@ ffff = ram_top = -1 2863 : a901 > lda #fc ;allow test to change I-flag (no mask) > 2865 : 48 > pha ;use stack to load status -2866 : b513 > lda zps,x ;load to indexed zeropage -2868 : 950c > sta zpt,x +2866 : b509 > lda zps,x ;load to indexed zeropage +2868 : 9502 > sta zpt,x 286a : 28 > plp -286b : 760c ror zpt,x +286b : 7602 ror zpt,x tst_zx rRORc,fRORc,0 286d : 08 > php ;save flags -286e : b50c > lda zpt,x +286e : b502 > lda zpt,x 2870 : dd3302 > cmp rRORc,x ;test result > trap_ne 2873 : d0fe > bne * ;failed not equal (non zero) @@ -10664,14 +10664,14 @@ ffff = ram_top = -1 2882 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2884 : 48 > pha ;use stack to load status -2885 : b513 > lda zps,x ;load to indexed zeropage -2887 : 950c > sta zpt,x +2885 : b509 > lda zps,x ;load to indexed zeropage +2887 : 9502 > sta zpt,x 2889 : 28 > plp -288a : 760c ror zpt,x +288a : 7602 ror zpt,x tst_zx rRORc,fRORc,$ff-fnzc 288c : 08 > php ;save flags -288d : b50c > lda zpt,x +288d : b502 > lda zpt,x 288f : dd3302 > cmp rRORc,x ;test result > trap_ne 2892 : d0fe > bne * ;failed not equal (non zero) @@ -10707,7 +10707,7 @@ ffff = ram_top = -1 28ad : a900 > lda #0 ;allow test to change I-flag (no mask) > 28af : 48 > pha ;use stack to load status -28b0 : b513 > lda zps,x ;load to indexed memory +28b0 : b509 > lda zps,x ;load to indexed memory 28b2 : 9d0302 > sta abst,x 28b5 : 28 > plp @@ -10737,7 +10737,7 @@ ffff = ram_top = -1 28cf : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 28d1 : 48 > pha ;use stack to load status -28d2 : b513 > lda zps,x ;load to indexed memory +28d2 : b509 > lda zps,x ;load to indexed memory 28d4 : 9d0302 > sta abst,x 28d7 : 28 > plp @@ -10768,7 +10768,7 @@ ffff = ram_top = -1 28f1 : a900 > lda #0 ;allow test to change I-flag (no mask) > 28f3 : 48 > pha ;use stack to load status -28f4 : b513 > lda zps,x ;load to indexed memory +28f4 : b509 > lda zps,x ;load to indexed memory 28f6 : 9d0302 > sta abst,x 28f9 : 28 > plp @@ -10798,7 +10798,7 @@ ffff = ram_top = -1 2913 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2915 : 48 > pha ;use stack to load status -2916 : b513 > lda zps,x ;load to indexed memory +2916 : b509 > lda zps,x ;load to indexed memory 2918 : 9d0302 > sta abst,x 291b : 28 > plp @@ -10829,7 +10829,7 @@ ffff = ram_top = -1 2935 : a900 > lda #0 ;allow test to change I-flag (no mask) > 2937 : 48 > pha ;use stack to load status -2938 : b513 > lda zps,x ;load to indexed memory +2938 : b509 > lda zps,x ;load to indexed memory 293a : 9d0302 > sta abst,x 293d : 28 > plp @@ -10859,7 +10859,7 @@ ffff = ram_top = -1 2957 : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 2959 : 48 > pha ;use stack to load status -295a : b513 > lda zps,x ;load to indexed memory +295a : b509 > lda zps,x ;load to indexed memory 295c : 9d0302 > sta abst,x 295f : 28 > plp @@ -10890,7 +10890,7 @@ ffff = ram_top = -1 2979 : a901 > lda #fc ;allow test to change I-flag (no mask) > 297b : 48 > pha ;use stack to load status -297c : b513 > lda zps,x ;load to indexed memory +297c : b509 > lda zps,x ;load to indexed memory 297e : 9d0302 > sta abst,x 2981 : 28 > plp @@ -10920,7 +10920,7 @@ ffff = ram_top = -1 299b : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 299d : 48 > pha ;use stack to load status -299e : b513 > lda zps,x ;load to indexed memory +299e : b509 > lda zps,x ;load to indexed memory 29a0 : 9d0302 > sta abst,x 29a3 : 28 > plp @@ -10951,7 +10951,7 @@ ffff = ram_top = -1 29bd : a900 > lda #0 ;allow test to change I-flag (no mask) > 29bf : 48 > pha ;use stack to load status -29c0 : b513 > lda zps,x ;load to indexed memory +29c0 : b509 > lda zps,x ;load to indexed memory 29c2 : 9d0302 > sta abst,x 29c5 : 28 > plp @@ -10981,7 +10981,7 @@ ffff = ram_top = -1 29df : a9fe > lda #$ff-fc ;allow test to change I-flag (no mask) > 29e1 : 48 > pha ;use stack to load status -29e2 : b513 > lda zps,x ;load to indexed memory +29e2 : b509 > lda zps,x ;load to indexed memory 29e4 : 9d0302 > sta abst,x 29e7 : 28 > plp @@ -11012,7 +11012,7 @@ ffff = ram_top = -1 2a01 : a901 > lda #fc ;allow test to change I-flag (no mask) > 2a03 : 48 > pha ;use stack to load status -2a04 : b513 > lda zps,x ;load to indexed memory +2a04 : b509 > lda zps,x ;load to indexed memory 2a06 : 9d0302 > sta abst,x 2a09 : 28 > plp @@ -11042,7 +11042,7 @@ ffff = ram_top = -1 2a23 : a9ff > lda #$ff ;allow test to change I-flag (no mask) > 2a25 : 48 > pha ;use stack to load status -2a26 : b513 > lda zps,x ;load to indexed memory +2a26 : b509 > lda zps,x ;load to indexed memory 2a28 : 9d0302 > sta abst,x 2a2b : 28 > plp @@ -11081,7 +11081,7 @@ ffff = ram_top = -1 ; zeropage 2a4f : a200 ldx #0 2a51 : a97e lda #$7e -2a53 : 850c sta zpt +2a53 : 8502 sta zpt 2a55 : tinc set_stat 0 > load_flag 0 @@ -11090,10 +11090,10 @@ ffff = ram_top = -1 2a57 : 48 > pha ;use stack to load status 2a58 : 28 > plp -2a59 : e60c inc zpt +2a59 : e602 inc zpt tst_z rINC,fINC,0 2a5b : 08 > php ;save flags -2a5c : a50c > lda zpt +2a5c : a502 > lda zpt 2a5e : dd5102 > cmp rINC,x ;test result > trap_ne 2a61 : d0fe > bne * ;failed not equal (non zero) @@ -11111,11 +11111,11 @@ ffff = ram_top = -1 2a6c : e002 cpx #2 2a6e : d004 bne tinc1 2a70 : a9fe lda #$fe -2a72 : 850c sta zpt +2a72 : 8502 sta zpt 2a74 : e005 tinc1 cpx #5 2a76 : d0dd bne tinc 2a78 : ca dex -2a79 : e60c inc zpt +2a79 : e602 inc zpt 2a7b : tdec set_stat 0 > load_flag 0 @@ -11124,10 +11124,10 @@ ffff = ram_top = -1 2a7d : 48 > pha ;use stack to load status 2a7e : 28 > plp -2a7f : c60c dec zpt +2a7f : c602 dec zpt tst_z rINC,fINC,0 2a81 : 08 > php ;save flags -2a82 : a50c > lda zpt +2a82 : a502 > lda zpt 2a84 : dd5102 > cmp rINC,x ;test result > trap_ne 2a87 : d0fe > bne * ;failed not equal (non zero) @@ -11146,12 +11146,12 @@ ffff = ram_top = -1 2a94 : e001 cpx #1 2a96 : d0e3 bne tdec 2a98 : a981 lda #$81 -2a9a : 850c sta zpt +2a9a : 8502 sta zpt 2a9c : d0dd bne tdec 2a9e : tdec1 2a9e : a200 ldx #0 2aa0 : a97e lda #$7e -2aa2 : 850c sta zpt +2aa2 : 8502 sta zpt 2aa4 : tinc10 set_stat $ff > load_flag $ff @@ -11160,10 +11160,10 @@ ffff = ram_top = -1 2aa6 : 48 > pha ;use stack to load status 2aa7 : 28 > plp -2aa8 : e60c inc zpt +2aa8 : e602 inc zpt tst_z rINC,fINC,$ff-fnz 2aaa : 08 > php ;save flags -2aab : a50c > lda zpt +2aab : a502 > lda zpt 2aad : dd5102 > cmp rINC,x ;test result > trap_ne 2ab0 : d0fe > bne * ;failed not equal (non zero) @@ -11181,11 +11181,11 @@ ffff = ram_top = -1 2abb : e002 cpx #2 2abd : d004 bne tinc11 2abf : a9fe lda #$fe -2ac1 : 850c sta zpt +2ac1 : 8502 sta zpt 2ac3 : e005 tinc11 cpx #5 2ac5 : d0dd bne tinc10 2ac7 : ca dex -2ac8 : e60c inc zpt +2ac8 : e602 inc zpt 2aca : tdec10 set_stat $ff > load_flag $ff @@ -11194,10 +11194,10 @@ ffff = ram_top = -1 2acc : 48 > pha ;use stack to load status 2acd : 28 > plp -2ace : c60c dec zpt +2ace : c602 dec zpt tst_z rINC,fINC,$ff-fnz 2ad0 : 08 > php ;save flags -2ad1 : a50c > lda zpt +2ad1 : a502 > lda zpt 2ad3 : dd5102 > cmp rINC,x ;test result > trap_ne 2ad6 : d0fe > bne * ;failed not equal (non zero) @@ -11216,7 +11216,7 @@ ffff = ram_top = -1 2ae3 : e001 cpx #1 2ae5 : d0e3 bne tdec10 2ae7 : a981 lda #$81 -2ae9 : 850c sta zpt +2ae9 : 8502 sta zpt 2aeb : d0dd bne tdec10 2aed : tdec11 next_test @@ -11387,7 +11387,7 @@ ffff = ram_top = -1 ; zeropage indexed 2bb3 : a200 ldx #0 2bb5 : a97e lda #$7e -2bb7 : 950c tinc4 sta zpt,x +2bb7 : 9502 tinc4 sta zpt,x set_stat 0 > load_flag 0 2bb9 : a900 > lda #0 ;allow test to change I-flag (no mask) @@ -11395,10 +11395,10 @@ ffff = ram_top = -1 2bbb : 48 > pha ;use stack to load status 2bbc : 28 > plp -2bbd : f60c inc zpt,x +2bbd : f602 inc zpt,x tst_zx rINC,fINC,0 2bbf : 08 > php ;save flags -2bc0 : b50c > lda zpt,x +2bc0 : b502 > lda zpt,x 2bc2 : dd5102 > cmp rINC,x ;test result > trap_ne 2bc5 : d0fe > bne * ;failed not equal (non zero) @@ -11412,7 +11412,7 @@ ffff = ram_top = -1 2bcd : d0fe > bne * ;failed not equal (non zero) > -2bcf : b50c lda zpt,x +2bcf : b502 lda zpt,x 2bd1 : e8 inx 2bd2 : e002 cpx #2 2bd4 : d002 bne tinc5 @@ -11421,7 +11421,7 @@ ffff = ram_top = -1 2bda : d0db bne tinc4 2bdc : ca dex 2bdd : a902 lda #2 -2bdf : 950c tdec4 sta zpt,x +2bdf : 9502 tdec4 sta zpt,x set_stat 0 > load_flag 0 2be1 : a900 > lda #0 ;allow test to change I-flag (no mask) @@ -11429,10 +11429,10 @@ ffff = ram_top = -1 2be3 : 48 > pha ;use stack to load status 2be4 : 28 > plp -2be5 : d60c dec zpt,x +2be5 : d602 dec zpt,x tst_zx rINC,fINC,0 2be7 : 08 > php ;save flags -2be8 : b50c > lda zpt,x +2be8 : b502 > lda zpt,x 2bea : dd5102 > cmp rINC,x ;test result > trap_ne 2bed : d0fe > bne * ;failed not equal (non zero) @@ -11446,7 +11446,7 @@ ffff = ram_top = -1 2bf5 : d0fe > bne * ;failed not equal (non zero) > -2bf7 : b50c lda zpt,x +2bf7 : b502 lda zpt,x 2bf9 : ca dex 2bfa : 3008 bmi tdec5 2bfc : e001 cpx #1 @@ -11456,7 +11456,7 @@ ffff = ram_top = -1 2c04 : tdec5 2c04 : a200 ldx #0 2c06 : a97e lda #$7e -2c08 : 950c tinc14 sta zpt,x +2c08 : 9502 tinc14 sta zpt,x set_stat $ff > load_flag $ff 2c0a : a9ff > lda #$ff ;allow test to change I-flag (no mask) @@ -11464,10 +11464,10 @@ ffff = ram_top = -1 2c0c : 48 > pha ;use stack to load status 2c0d : 28 > plp -2c0e : f60c inc zpt,x +2c0e : f602 inc zpt,x tst_zx rINC,fINC,$ff-fnz 2c10 : 08 > php ;save flags -2c11 : b50c > lda zpt,x +2c11 : b502 > lda zpt,x 2c13 : dd5102 > cmp rINC,x ;test result > trap_ne 2c16 : d0fe > bne * ;failed not equal (non zero) @@ -11481,7 +11481,7 @@ ffff = ram_top = -1 2c1e : d0fe > bne * ;failed not equal (non zero) > -2c20 : b50c lda zpt,x +2c20 : b502 lda zpt,x 2c22 : e8 inx 2c23 : e002 cpx #2 2c25 : d002 bne tinc15 @@ -11490,7 +11490,7 @@ ffff = ram_top = -1 2c2b : d0db bne tinc14 2c2d : ca dex 2c2e : a902 lda #2 -2c30 : 950c tdec14 sta zpt,x +2c30 : 9502 tdec14 sta zpt,x set_stat $ff > load_flag $ff 2c32 : a9ff > lda #$ff ;allow test to change I-flag (no mask) @@ -11498,10 +11498,10 @@ ffff = ram_top = -1 2c34 : 48 > pha ;use stack to load status 2c35 : 28 > plp -2c36 : d60c dec zpt,x +2c36 : d602 dec zpt,x tst_zx rINC,fINC,$ff-fnz 2c38 : 08 > php ;save flags -2c39 : b50c > lda zpt,x +2c39 : b502 > lda zpt,x 2c3b : dd5102 > cmp rINC,x ;test result > trap_ne 2c3e : d0fe > bne * ;failed not equal (non zero) @@ -11515,7 +11515,7 @@ ffff = ram_top = -1 2c46 : d0fe > bne * ;failed not equal (non zero) > -2c48 : b50c lda zpt,x +2c48 : b502 lda zpt,x 2c4a : ca dex 2c4b : 3008 bmi tdec15 2c4d : e001 cpx #1 @@ -11689,7 +11689,7 @@ ffff = ram_top = -1 ; testing logical instructions - AND EOR ORA all addressing modes ; AND 2d1f : a203 ldx #3 ;immediate -2d21 : b51e tand lda zpAN,x +2d21 : b514 tand lda zpAN,x 2d23 : 8d0a02 sta ex_andi+1 ;set AND # operand set_ax absANa,0 > load_flag 0 @@ -11718,7 +11718,7 @@ ffff = ram_top = -1 2d3e : ca dex 2d3f : 10e0 bpl tand 2d41 : a203 ldx #3 -2d43 : b51e tand1 lda zpAN,x +2d43 : b514 tand1 lda zpAN,x 2d45 : 8d0a02 sta ex_andi+1 ;set AND # operand set_ax absANa,$ff > load_flag $ff @@ -11748,8 +11748,8 @@ ffff = ram_top = -1 2d61 : 10e0 bpl tand1 2d63 : a203 ldx #3 ;zp -2d65 : b51e tand2 lda zpAN,x -2d67 : 850c sta zpt +2d65 : b514 tand2 lda zpAN,x +2d67 : 8502 sta zpt set_ax absANa,0 > load_flag 0 2d69 : a900 > lda #0 ;allow test to change I-flag (no mask) @@ -11758,7 +11758,7 @@ ffff = ram_top = -1 2d6c : bd6b02 > lda absANa,x ;precharge accu 2d6f : 28 > plp -2d70 : 250c and zpt +2d70 : 2502 and zpt tst_ax absrlo,absflo,0 2d72 : 08 > php ;save flags 2d73 : dd7302 > cmp absrlo,x ;test result @@ -11777,8 +11777,8 @@ ffff = ram_top = -1 2d80 : ca dex 2d81 : 10e2 bpl tand2 2d83 : a203 ldx #3 -2d85 : b51e tand3 lda zpAN,x -2d87 : 850c sta zpt +2d85 : b514 tand3 lda zpAN,x +2d87 : 8502 sta zpt set_ax absANa,$ff > load_flag $ff 2d89 : a9ff > lda #$ff ;allow test to change I-flag (no mask) @@ -11787,7 +11787,7 @@ ffff = ram_top = -1 2d8c : bd6b02 > lda absANa,x ;precharge accu 2d8f : 28 > plp -2d90 : 250c and zpt +2d90 : 2502 and zpt tst_ax absrlo,absflo,$ff-fnz 2d92 : 08 > php ;save flags 2d93 : dd7302 > cmp absrlo,x ;test result @@ -11807,7 +11807,7 @@ ffff = ram_top = -1 2da1 : 10e2 bpl tand3 2da3 : a203 ldx #3 ;abs -2da5 : b51e tand4 lda zpAN,x +2da5 : b514 tand4 lda zpAN,x 2da7 : 8d0302 sta abst set_ax absANa,0 > load_flag 0 @@ -11836,7 +11836,7 @@ ffff = ram_top = -1 2dc2 : ca dex 2dc3 : 10e0 bpl tand4 2dc5 : a203 ldx #3 -2dc7 : b51e tand5 lda zpAN,x +2dc7 : b514 tand5 lda zpAN,x 2dc9 : 8d0302 sta abst set_ax absANa,$ff > load_flag $ff @@ -11875,7 +11875,7 @@ ffff = ram_top = -1 2dec : bd6b02 > lda absANa,x ;precharge accu 2def : 28 > plp -2df0 : 351e and zpAN,x +2df0 : 3514 and zpAN,x tst_ax absrlo,absflo,0 2df2 : 08 > php ;save flags 2df3 : dd7302 > cmp absrlo,x ;test result @@ -11903,7 +11903,7 @@ ffff = ram_top = -1 2e08 : bd6b02 > lda absANa,x ;precharge accu 2e0b : 28 > plp -2e0c : 351e and zpAN,x +2e0c : 3514 and zpAN,x tst_ax absrlo,absflo,$ff-fnz 2e0e : 08 > php ;save flags 2e0f : dd7302 > cmp absrlo,x ;test result @@ -12047,7 +12047,7 @@ ffff = ram_top = -1 2e9a : b96b02 > lda absANa,y ;precharge accu 2e9d : 28 > plp -2e9e : 213c and (indAN,x) +2e9e : 2132 and (indAN,x) tst_ay absrlo,absflo,0 2ea0 : 08 > php ;save flags 2ea1 : d97302 > cmp absrlo,y ;test result @@ -12078,7 +12078,7 @@ ffff = ram_top = -1 2eba : b96b02 > lda absANa,y ;precharge accu 2ebd : 28 > plp -2ebe : 213c and (indAN,x) +2ebe : 2132 and (indAN,x) tst_ay absrlo,absflo,$ff-fnz 2ec0 : 08 > php ;save flags 2ec1 : d97302 > cmp absrlo,y ;test result @@ -12109,7 +12109,7 @@ ffff = ram_top = -1 2ed8 : b96b02 > lda absANa,y ;precharge accu 2edb : 28 > plp -2edc : 313c and (indAN),y +2edc : 3132 and (indAN),y tst_ay absrlo,absflo,0 2ede : 08 > php ;save flags 2edf : d97302 > cmp absrlo,y ;test result @@ -12137,7 +12137,7 @@ ffff = ram_top = -1 2ef4 : b96b02 > lda absANa,y ;precharge accu 2ef7 : 28 > plp -2ef8 : 313c and (indAN),y +2ef8 : 3132 and (indAN),y tst_ay absrlo,absflo,$ff-fnz 2efa : 08 > php ;save flags 2efb : d97302 > cmp absrlo,y ;test result @@ -12169,7 +12169,7 @@ ffff = ram_top = -1 ; EOR 2f17 : a203 ldx #3 ;immediate - self modifying code -2f19 : b522 teor lda zpEO,x +2f19 : b518 teor lda zpEO,x 2f1b : 8d0d02 sta ex_eori+1 ;set EOR # operand set_ax absEOa,0 > load_flag 0 @@ -12198,7 +12198,7 @@ ffff = ram_top = -1 2f36 : ca dex 2f37 : 10e0 bpl teor 2f39 : a203 ldx #3 -2f3b : b522 teor1 lda zpEO,x +2f3b : b518 teor1 lda zpEO,x 2f3d : 8d0d02 sta ex_eori+1 ;set EOR # operand set_ax absEOa,$ff > load_flag $ff @@ -12228,8 +12228,8 @@ ffff = ram_top = -1 2f59 : 10e0 bpl teor1 2f5b : a203 ldx #3 ;zp -2f5d : b522 teor2 lda zpEO,x -2f5f : 850c sta zpt +2f5d : b518 teor2 lda zpEO,x +2f5f : 8502 sta zpt set_ax absEOa,0 > load_flag 0 2f61 : a900 > lda #0 ;allow test to change I-flag (no mask) @@ -12238,7 +12238,7 @@ ffff = ram_top = -1 2f64 : bd6f02 > lda absEOa,x ;precharge accu 2f67 : 28 > plp -2f68 : 450c eor zpt +2f68 : 4502 eor zpt tst_ax absrlo,absflo,0 2f6a : 08 > php ;save flags 2f6b : dd7302 > cmp absrlo,x ;test result @@ -12257,8 +12257,8 @@ ffff = ram_top = -1 2f78 : ca dex 2f79 : 10e2 bpl teor2 2f7b : a203 ldx #3 -2f7d : b522 teor3 lda zpEO,x -2f7f : 850c sta zpt +2f7d : b518 teor3 lda zpEO,x +2f7f : 8502 sta zpt set_ax absEOa,$ff > load_flag $ff 2f81 : a9ff > lda #$ff ;allow test to change I-flag (no mask) @@ -12267,7 +12267,7 @@ ffff = ram_top = -1 2f84 : bd6f02 > lda absEOa,x ;precharge accu 2f87 : 28 > plp -2f88 : 450c eor zpt +2f88 : 4502 eor zpt tst_ax absrlo,absflo,$ff-fnz 2f8a : 08 > php ;save flags 2f8b : dd7302 > cmp absrlo,x ;test result @@ -12287,7 +12287,7 @@ ffff = ram_top = -1 2f99 : 10e2 bpl teor3 2f9b : a203 ldx #3 ;abs -2f9d : b522 teor4 lda zpEO,x +2f9d : b518 teor4 lda zpEO,x 2f9f : 8d0302 sta abst set_ax absEOa,0 > load_flag 0 @@ -12316,7 +12316,7 @@ ffff = ram_top = -1 2fba : ca dex 2fbb : 10e0 bpl teor4 2fbd : a203 ldx #3 -2fbf : b522 teor5 lda zpEO,x +2fbf : b518 teor5 lda zpEO,x 2fc1 : 8d0302 sta abst set_ax absEOa,$ff > load_flag $ff @@ -12355,7 +12355,7 @@ ffff = ram_top = -1 2fe4 : bd6f02 > lda absEOa,x ;precharge accu 2fe7 : 28 > plp -2fe8 : 5522 eor zpEO,x +2fe8 : 5518 eor zpEO,x tst_ax absrlo,absflo,0 2fea : 08 > php ;save flags 2feb : dd7302 > cmp absrlo,x ;test result @@ -12383,7 +12383,7 @@ ffff = ram_top = -1 3000 : bd6f02 > lda absEOa,x ;precharge accu 3003 : 28 > plp -3004 : 5522 eor zpEO,x +3004 : 5518 eor zpEO,x tst_ax absrlo,absflo,$ff-fnz 3006 : 08 > php ;save flags 3007 : dd7302 > cmp absrlo,x ;test result @@ -12527,7 +12527,7 @@ ffff = ram_top = -1 3092 : b96f02 > lda absEOa,y ;precharge accu 3095 : 28 > plp -3096 : 4144 eor (indEO,x) +3096 : 413a eor (indEO,x) tst_ay absrlo,absflo,0 3098 : 08 > php ;save flags 3099 : d97302 > cmp absrlo,y ;test result @@ -12558,7 +12558,7 @@ ffff = ram_top = -1 30b2 : b96f02 > lda absEOa,y ;precharge accu 30b5 : 28 > plp -30b6 : 4144 eor (indEO,x) +30b6 : 413a eor (indEO,x) tst_ay absrlo,absflo,$ff-fnz 30b8 : 08 > php ;save flags 30b9 : d97302 > cmp absrlo,y ;test result @@ -12589,7 +12589,7 @@ ffff = ram_top = -1 30d0 : b96f02 > lda absEOa,y ;precharge accu 30d3 : 28 > plp -30d4 : 5144 eor (indEO),y +30d4 : 513a eor (indEO),y tst_ay absrlo,absflo,0 30d6 : 08 > php ;save flags 30d7 : d97302 > cmp absrlo,y ;test result @@ -12617,7 +12617,7 @@ ffff = ram_top = -1 30ec : b96f02 > lda absEOa,y ;precharge accu 30ef : 28 > plp -30f0 : 5144 eor (indEO),y +30f0 : 513a eor (indEO),y tst_ay absrlo,absflo,$ff-fnz 30f2 : 08 > php ;save flags 30f3 : d97302 > cmp absrlo,y ;test result @@ -12649,7 +12649,7 @@ ffff = ram_top = -1 ; OR 310f : a203 ldx #3 ;immediate - self modifying code -3111 : b51a tora lda zpOR,x +3111 : b510 tora lda zpOR,x 3113 : 8d1002 sta ex_orai+1 ;set ORA # operand set_ax absORa,0 > load_flag 0 @@ -12678,7 +12678,7 @@ ffff = ram_top = -1 312e : ca dex 312f : 10e0 bpl tora 3131 : a203 ldx #3 -3133 : b51a tora1 lda zpOR,x +3133 : b510 tora1 lda zpOR,x 3135 : 8d1002 sta ex_orai+1 ;set ORA # operand set_ax absORa,$ff > load_flag $ff @@ -12708,8 +12708,8 @@ ffff = ram_top = -1 3151 : 10e0 bpl tora1 3153 : a203 ldx #3 ;zp -3155 : b51a tora2 lda zpOR,x -3157 : 850c sta zpt +3155 : b510 tora2 lda zpOR,x +3157 : 8502 sta zpt set_ax absORa,0 > load_flag 0 3159 : a900 > lda #0 ;allow test to change I-flag (no mask) @@ -12718,7 +12718,7 @@ ffff = ram_top = -1 315c : bd6702 > lda absORa,x ;precharge accu 315f : 28 > plp -3160 : 050c ora zpt +3160 : 0502 ora zpt tst_ax absrlo,absflo,0 3162 : 08 > php ;save flags 3163 : dd7302 > cmp absrlo,x ;test result @@ -12737,8 +12737,8 @@ ffff = ram_top = -1 3170 : ca dex 3171 : 10e2 bpl tora2 3173 : a203 ldx #3 -3175 : b51a tora3 lda zpOR,x -3177 : 850c sta zpt +3175 : b510 tora3 lda zpOR,x +3177 : 8502 sta zpt set_ax absORa,$ff > load_flag $ff 3179 : a9ff > lda #$ff ;allow test to change I-flag (no mask) @@ -12747,7 +12747,7 @@ ffff = ram_top = -1 317c : bd6702 > lda absORa,x ;precharge accu 317f : 28 > plp -3180 : 050c ora zpt +3180 : 0502 ora zpt tst_ax absrlo,absflo,$ff-fnz 3182 : 08 > php ;save flags 3183 : dd7302 > cmp absrlo,x ;test result @@ -12767,7 +12767,7 @@ ffff = ram_top = -1 3191 : 10e2 bpl tora3 3193 : a203 ldx #3 ;abs -3195 : b51a tora4 lda zpOR,x +3195 : b510 tora4 lda zpOR,x 3197 : 8d0302 sta abst set_ax absORa,0 > load_flag 0 @@ -12796,7 +12796,7 @@ ffff = ram_top = -1 31b2 : ca dex 31b3 : 10e0 bpl tora4 31b5 : a203 ldx #3 -31b7 : b51a tora5 lda zpOR,x +31b7 : b510 tora5 lda zpOR,x 31b9 : 8d0302 sta abst set_ax absORa,$ff > load_flag $ff @@ -12835,7 +12835,7 @@ ffff = ram_top = -1 31dc : bd6702 > lda absORa,x ;precharge accu 31df : 28 > plp -31e0 : 151a ora zpOR,x +31e0 : 1510 ora zpOR,x tst_ax absrlo,absflo,0 31e2 : 08 > php ;save flags 31e3 : dd7302 > cmp absrlo,x ;test result @@ -12863,7 +12863,7 @@ ffff = ram_top = -1 31f8 : bd6702 > lda absORa,x ;precharge accu 31fb : 28 > plp -31fc : 151a ora zpOR,x +31fc : 1510 ora zpOR,x tst_ax absrlo,absflo,$ff-fnz 31fe : 08 > php ;save flags 31ff : dd7302 > cmp absrlo,x ;test result @@ -13007,7 +13007,7 @@ ffff = ram_top = -1 328a : b96702 > lda absORa,y ;precharge accu 328d : 28 > plp -328e : 014c ora (indOR,x) +328e : 0142 ora (indOR,x) tst_ay absrlo,absflo,0 3290 : 08 > php ;save flags 3291 : d97302 > cmp absrlo,y ;test result @@ -13038,7 +13038,7 @@ ffff = ram_top = -1 32aa : b96702 > lda absORa,y ;precharge accu 32ad : 28 > plp -32ae : 014c ora (indOR,x) +32ae : 0142 ora (indOR,x) tst_ay absrlo,absflo,$ff-fnz 32b0 : 08 > php ;save flags 32b1 : d97302 > cmp absrlo,y ;test result @@ -13069,7 +13069,7 @@ ffff = ram_top = -1 32c8 : b96702 > lda absORa,y ;precharge accu 32cb : 28 > plp -32cc : 114c ora (indOR),y +32cc : 1142 ora (indOR),y tst_ay absrlo,absflo,0 32ce : 08 > php ;save flags 32cf : d97302 > cmp absrlo,y ;test result @@ -13097,7 +13097,7 @@ ffff = ram_top = -1 32e4 : b96702 > lda absORa,y ;precharge accu 32e7 : 28 > plp -32e8 : 114c ora (indOR),y +32e8 : 1142 ora (indOR),y tst_ay absrlo,absflo,$ff-fnz 32ea : 08 > php ;save flags 32eb : d97302 > cmp absrlo,y ;test result @@ -13134,50 +13134,50 @@ ffff = ram_top = -1 ; 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 +3309 : a204 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 +330f : 8502 sta adfc ;carry in - for diag +3311 : 8503 sta ad1 ;operand 1 - accumulator +3313 : 8504 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) +3318 : 8505 sta adrl ;expected result bits 0-7 +331a : 8506 sta adrh ;expected result bit 8 (carry out) 331c : a9ff lda #$ff ;complemented operand 2 for subtract -331e : 8512 sta sb2 +331e : 8508 sta sb2 3320 : 8d0402 sta sba2 ;non zp 3323 : a902 lda #2 ;expected Z-flag -3325 : 8511 sta adrf +3325 : 8507 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 +332b : e602 inc adfc ;now with carry +332d : e605 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 +3337 : e606 inc adrh ;result bit 8 - carry +3339 : 0506 tadd1 ora adrh ;merge C to expected flags +333b : 8507 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 +3341 : c602 dec adfc ;same for operand +1 but no carry +3343 : e603 inc ad1 3345 : d0e0 bne tadd ;iterate op1 3347 : a900 lda #0 ;preset result to op2 when op1 = 0 -3349 : 8510 sta adrh +3349 : 8506 sta adrh 334b : ee0302 inc ada2 -334e : e60e inc ad2 +334e : e604 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 +3354 : 8507 sta adrf ;no need to check carry as we are adding to 0 +3356 : c608 dec sb2 ;complement subtract operand 2 3358 : ce0402 dec sba2 -335b : a50e lda ad2 -335d : 850f sta adrl +335b : a504 lda ad2 +335d : 8505 sta adrl 335f : d0c6 bne tadd ;iterate op2 if disable_decimal < 1 next_test @@ -13198,79 +13198,79 @@ ffff = ram_top = -1 ; 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 +336e : a204 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 +3374 : 8503 sta ad1 ;operand 1 - accumulator +3376 : 8504 sta ad2 ;operand 2 - memory or immediate 3378 : 8d0302 sta ada2 ;non zp -337b : 850f sta adrl ;expected result bits 0-7 +337b : 8505 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) +337f : 8502 sta adfc ;carry in - for diag +3381 : 8506 sta adrh ;expected result bit 8 (carry out) 3383 : a900 lda #0 ;complemented operand 2 for subtract -3385 : 8512 sta sb2 +3385 : 8508 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 +338e : c602 dec adfc ;now with carry clear +3390 : a505 lda adrl ;decimal adjust result 3392 : d008 bne tdad1 ;skip clear carry & preset result 99 (9A-1) -3394 : c610 dec adrh +3394 : c606 dec adrh 3396 : a999 lda #$99 -3398 : 850f sta adrl +3398 : 8505 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 +33a0 : c605 dec adrl ;decimal adjust (?0-6) +33a2 : c605 dec adrl +33a4 : c605 dec adrl +33a6 : c605 dec adrl +33a8 : c605 dec adrl +33aa : c605 dec adrl +33ac : c605 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 +33b2 : e602 inc adfc ;same for operand -1 but with carry +33b4 : a503 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 +33bc : c603 dec ad1 ;decimal adjust (?0-6) +33be : c603 dec ad1 +33c0 : c603 dec ad1 +33c2 : c603 dec ad1 +33c4 : c603 dec ad1 +33c6 : c603 dec ad1 +33c8 : c603 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 +33cf : 8503 sta ad1 +33d1 : a504 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 +33d9 : c604 dec ad2 ;decimal adjust (?0-6) +33db : c604 dec ad2 +33dd : c604 dec ad2 +33df : c604 dec ad2 +33e1 : c604 dec ad2 +33e3 : c604 dec ad2 +33e5 : e608 inc sb2 ;complemented decimal adjust for subtract (?9+6) +33e7 : e608 inc sb2 +33e9 : e608 inc sb2 +33eb : e608 inc sb2 +33ed : e608 inc sb2 +33ef : e608 inc sb2 +33f1 : c604 tdad6 dec ad2 ;operand 2 -1 +33f3 : e608 inc sb2 ;complemented operand for subtract +33f5 : a508 lda sb2 33f7 : 8d0402 sta sba2 ;copy as non zp operand -33fa : a50e lda ad2 +33fa : a504 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 +33ff : 8505 sta adrl ;new result since op1+carry=00+carry +op2=op2 +3401 : e606 inc adrh ;result carry 3403 : d085 bne tdad ;iterate op2 3405 : tdad7 next_test @@ -13391,252 +13391,252 @@ ffff = ram_top = -1 346f : chkdad ; decimal ADC / SBC zp 346f : 08 php ;save carry for subtract -3470 : a50d lda ad1 -3472 : 650e adc ad2 ;perform add +3470 : a503 lda ad1 +3472 : 6504 adc ad2 ;perform add 3474 : 08 php -3475 : c50f cmp adrl ;check result +3475 : c505 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 +347c : c506 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 +3482 : a503 lda ad1 +3484 : e508 sbc sb2 ;perform subtract 3486 : 08 php -3487 : c50f cmp adrl ;check result +3487 : c505 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 +348e : c506 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 +3494 : a503 lda ad1 3496 : 6d0302 adc ada2 ;perform add 3499 : 08 php -349a : c50f cmp adrl ;check result +349a : c505 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 +34a1 : c506 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 +34a7 : a503 lda ad1 34a9 : ed0402 sbc sba2 ;perform subtract 34ac : 08 php -34ad : c50f cmp adrl ;check result +34ad : c505 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 +34b4 : c506 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 +34ba : a504 lda ad2 34bc : 8d1302 sta ex_adci+1 ;set ADC # operand -34bf : a50d lda ad1 +34bf : a503 lda ad1 34c1 : 201202 jsr ex_adci ;execute ADC # in RAM 34c4 : 08 php -34c5 : c50f cmp adrl ;check result +34c5 : c505 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 +34cc : c506 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 +34d2 : a508 lda sb2 34d4 : 8d1602 sta ex_sbci+1 ;set SBC # operand -34d7 : a50d lda ad1 +34d7 : a503 lda ad1 34d9 : 201502 jsr ex_sbci ;execute SBC # in RAM 34dc : 08 php -34dd : c50f cmp adrl ;check result +34dd : c505 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 +34e4 : c506 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 +34ea : a503 lda ad1 34ec : 7500 adc 0,x ;perform add 34ee : 08 php -34ef : c50f cmp adrl ;check result +34ef : c505 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 +34f6 : c506 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 +34fc : a503 lda ad1 34fe : f504 sbc sb2-ad2,x ;perform subtract 3500 : 08 php -3501 : c50f cmp adrl ;check result +3501 : c505 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 +3508 : c506 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 +350e : a503 lda ad1 +3510 : 7dff01 adc ada2-ad2,x ;perform add 3513 : 08 php -3514 : c50f cmp adrl ;check result +3514 : c505 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 +351b : c506 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 +3521 : a503 lda ad1 +3523 : fd0002 sbc sba2-ad2,x ;perform subtract 3526 : 08 php -3527 : c50f cmp adrl ;check result +3527 : c505 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 +352e : c506 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 +3534 : a503 lda ad1 3536 : 790401 adc ada2-$ff,y ;perform add 3539 : 08 php -353a : c50f cmp adrl ;check result +353a : c505 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 +3541 : c506 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 +3547 : a503 lda ad1 3549 : f90501 sbc sba2-$ff,y ;perform subtract 354c : 08 php -354d : c50f cmp adrl ;check result +354d : c505 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 +3554 : c506 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 +355a : a503 lda ad1 355c : 6146 adc (lo adi2-ad2,x) ;perform add 355e : 08 php -355f : c50f cmp adrl ;check result +355f : c505 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 +3566 : c506 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 +356c : a503 lda ad1 356e : e148 sbc (lo sbi2-ad2,x) ;perform subtract 3570 : 08 php -3571 : c50f cmp adrl ;check result +3571 : c505 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 +3578 : c506 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 : 7158 adc (adiy2),y ;perform add +357e : a503 lda ad1 +3580 : 714e adc (adiy2),y ;perform add 3582 : 08 php -3583 : c50f cmp adrl ;check result +3583 : c505 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 +358a : c506 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 : f15a sbc (sbiy2),y ;perform subtract +3590 : a503 lda ad1 +3592 : f150 sbc (sbiy2),y ;perform subtract 3594 : 08 php -3595 : c50f cmp adrl ;check result +3595 : c505 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 +359c : c506 cmp adrh trap_ne ;bad carry 359e : d0fe > bne * ;failed not equal (non zero) @@ -13647,268 +13647,268 @@ ffff = ram_top = -1 ; 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 +35a2 : a507 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 +35a7 : a503 lda ad1 ;test sign unequal between operands +35a9 : 4504 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 +35ad : a503 lda ad1 ;test sign equal between operands and result +35af : 4505 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 +35b8 : 8507 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 +35bb : a503 lda ad1 +35bd : 6504 adc ad2 ;perform add 35bf : 08 php -35c0 : c50f cmp adrl ;check result +35c0 : c505 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 +35c7 : c507 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 +35cd : a503 lda ad1 +35cf : e508 sbc sb2 ;perform subtract 35d1 : 08 php -35d2 : c50f cmp adrl ;check result +35d2 : c505 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 +35d9 : c507 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 +35df : a503 lda ad1 35e1 : 6d0302 adc ada2 ;perform add 35e4 : 08 php -35e5 : c50f cmp adrl ;check result +35e5 : c505 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 +35ec : c507 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 +35f2 : a503 lda ad1 35f4 : ed0402 sbc sba2 ;perform subtract 35f7 : 08 php -35f8 : c50f cmp adrl ;check result +35f8 : c505 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 +35ff : c507 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 +3605 : a504 lda ad2 3607 : 8d1302 sta ex_adci+1 ;set ADC # operand -360a : a50d lda ad1 +360a : a503 lda ad1 360c : 201202 jsr ex_adci ;execute ADC # in RAM 360f : 08 php -3610 : c50f cmp adrl ;check result +3610 : c505 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 +3617 : c507 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 +361d : a508 lda sb2 361f : 8d1602 sta ex_sbci+1 ;set SBC # operand -3622 : a50d lda ad1 +3622 : a503 lda ad1 3624 : 201502 jsr ex_sbci ;execute SBC # in RAM 3627 : 08 php -3628 : c50f cmp adrl ;check result +3628 : c505 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 +362f : c507 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 +3635 : a503 lda ad1 3637 : 7500 adc 0,x ;perform add 3639 : 08 php -363a : c50f cmp adrl ;check result +363a : c505 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 +3641 : c507 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 +3647 : a503 lda ad1 3649 : f504 sbc sb2-ad2,x ;perform subtract 364b : 08 php -364c : c50f cmp adrl ;check result +364c : c505 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 +3653 : c507 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 +3659 : a503 lda ad1 +365b : 7dff01 adc ada2-ad2,x ;perform add 365e : 08 php -365f : c50f cmp adrl ;check result +365f : c505 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 +3666 : c507 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 +366c : a503 lda ad1 +366e : fd0002 sbc sba2-ad2,x ;perform subtract 3671 : 08 php -3672 : c50f cmp adrl ;check result +3672 : c505 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 +3679 : c507 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 +367f : a503 lda ad1 3681 : 790401 adc ada2-$ff,y ;perform add 3684 : 08 php -3685 : c50f cmp adrl ;check result +3685 : c505 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 +368c : c507 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 +3692 : a503 lda ad1 3694 : f90501 sbc sba2-$ff,y ;perform subtract 3697 : 08 php -3698 : c50f cmp adrl ;check result +3698 : c505 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 +369f : c507 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 +36a5 : a503 lda ad1 36a7 : 6146 adc (lo adi2-ad2,x) ;perform add 36a9 : 08 php -36aa : c50f cmp adrl ;check result +36aa : c505 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 +36b1 : c507 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 +36b7 : a503 lda ad1 36b9 : e148 sbc (lo sbi2-ad2,x) ;perform subtract 36bb : 08 php -36bc : c50f cmp adrl ;check result +36bc : c505 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 +36c3 : c507 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 : 7158 adc (adiy2),y ;perform add +36c9 : a503 lda ad1 +36cb : 714e adc (adiy2),y ;perform add 36cd : 08 php -36ce : c50f cmp adrl ;check result +36ce : c505 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 +36d5 : c507 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 : f15a sbc (sbiy2),y ;perform subtract +36db : a503 lda ad1 +36dd : f150 sbc (sbiy2),y ;perform subtract 36df : 08 php -36e0 : c50f cmp adrl ;check result +36e0 : c505 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 +36e7 : c507 cmp adrf trap_ne ;bad flags 36e9 : d0fe > bne * ;failed not equal (non zero) @@ -14140,8 +14140,8 @@ ffff = ram_top = -1 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 +37bf : 8500 sta irq_a ;save registers during break test +37c1 : 8601 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 @@ -14176,9 +14176,9 @@ ffff = ram_top = -1 37e3 : a9ff > lda #$ff ;allow test to change I-flag (no mask) 37e5 : 48 pha -37e6 : a60b ldx irq_x +37e6 : a601 ldx irq_x 37e8 : e8 inx ;return registers with modifications -37e9 : a50a lda irq_a +37e9 : a500 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 @@ -14196,8 +14196,8 @@ ffff = ram_top = -1 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 +37fd : 8500 sta irq_a ;save registers during break test +37ff : 8601 stx irq_x 3801 : ba tsx ;test break on stack 3802 : bd0201 lda $102,x cmp_flag $ff ;break test should have B=1 @@ -14233,9 +14233,9 @@ ffff = ram_top = -1 3823 : a904 > lda #intdis ;allow test to change I-flag (no mask) 3825 : 48 pha -3826 : a60b ldx irq_x +3826 : a601 ldx irq_x 3828 : e8 inx ;return registers with modifications -3829 : a50a lda irq_a +3829 : a500 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 @@ -14357,8 +14357,9 @@ fffe : ab37 dw irq_trap fffa = end start + No errors in pass 2. -Wrote binary from address $000a through $ffff. -Total size 65526 bytes. +Wrote binary from address $0000 through $ffff. +Total size 65536 bytes. Program start address is at $0400 (1024). \ No newline at end of file diff --git a/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.bin b/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.bin index 52a3f6b..263e50b 100644 Binary files a/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.bin and b/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.bin differ diff --git a/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.lst b/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.lst index 4f12385..098c2c6 100644 --- a/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.lst +++ b/src/test/kotlin/6502_functional_tests/bin_files/6502_interrupt_test.lst @@ -23,7 +23,7 @@ AS65 Assembler for R6502 [1.42]. Copyright 1994-2007, Frank A. Kingswood ; This program is designed to test IRQ and NMI of a 6502 emulator. It requires ; an internal or external feedback register to the IRQ & NMI inputs - ; + ; ; version 15-aug-2014 ; contact info at http://2m5.de or email K@2m5.de ; @@ -87,10 +87,10 @@ bffc = I_port = $bffc ;feedback port address ;configure memory - try to stay away from memory used by the system ;zero_page memory start address, 6 consecutive Bytes required -000a = zero_page = $a +0000 = zero_page = $0 ;data_segment memory start address, 4 consecutive Bytes required -0200 = data_segment = $200 +0200 = data_segment = $200 ;code_segment memory start address 0400 = code_segment = $400 @@ -195,21 +195,21 @@ bffc = I_port = $bffc ;feedback port address else bss ;uninitialized segment, copy of data at end of code! endif -000a = org zero_page +0000 = org zero_page ;BRK, IRQ, NMI test interrupt save -000a : zpt -000a : 00 irq_a ds 1 ;a register -000b : 00 irq_x ds 1 ;x register -000c : 00 irq_f ds 1 ;flags -000d : 00 nmi_a ds 1 ;a register -000e : 00 nmi_x ds 1 ;x register -000f : 00 nmi_f ds 1 ;flags -0010 : zp_bss +0000 : zpt +0000 : 00 irq_a ds 1 ;a register +0001 : 00 irq_x ds 1 ;x register +0002 : 00 irq_f ds 1 ;flags +0003 : 00 nmi_a ds 1 ;a register +0004 : 00 nmi_x ds 1 ;x register +0005 : 00 nmi_f ds 1 ;flags +0006 : zp_bss ;fixed stack locations 01fe = lst_f equ $1fe ;last flags before interrupt 01ff = lst_a equ $1ff ;last accumulator before interrupt - + 0200 = org data_segment ;concurrent NMI, IRQ & BRK test result 0200 : 00 nmi_count ds 1 ;lowest number handled first, $ff = never @@ -226,7 +226,7 @@ bffc = I_port = $bffc ;feedback port address 0403 : 8d0302 sta I_src 0406 : a2ff ldx #$ff 0408 : 9a txs - + ;initialize I/O for report channel if report = 1 jsr report_init @@ -267,7 +267,7 @@ bffc = I_port = $bffc ;feedback port address and #I_filter ora #(1< I_DDR or I_port to force interrupt if I_ddr != 0 ;with DDR I_set macro ibit ;ibit = interrupt bit @@ -282,7 +282,7 @@ bffc = I_port = $bffc ;feedback port address I_clr macro ibit ;ibit = interrupt bit lda I_ddr ;turn off interrupt by bit and #I_filter-(1< I_DDR or I_port to force interrupt if I_ddr != 0 ;with DDR I_set macro ibit ;ibit = interrupt bit @@ -352,7 +352,7 @@ bffc = I_port = $bffc ;feedback port address I_clr macro ibit ;ibit = interrupt bit lda I_ddr ;turn off interrupt by bit and #I_filter-(1< bne * ;failed not equal (non zero) -043b : a50c lda irq_f ;flags seen in IRQ vector +043b : a502 lda irq_f ;flags seen in IRQ vector if D_clear = 1 and #decmode trap_ne ;D-flag not cleared @@ -492,7 +492,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned flags 047c : d0fe > bne * ;failed not equal (non zero) -047e : a50a lda irq_a ;accu seen in IRQ vector +047e : a500 lda irq_a ;accu seen in IRQ vector 0480 : cdff01 cmp lst_a trap_ne ;IRQ A received 0483 : d0fe > bne * ;failed not equal (non zero) @@ -549,7 +549,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned flags 04bd : d0fe > bne * ;failed not equal (non zero) -04bf : a50a lda irq_a ;accu seen in IRQ vector +04bf : a500 lda irq_a ;accu seen in IRQ vector 04c1 : cdff01 cmp lst_a trap_ne ;IRQ A received 04c4 : d0fe > bne * ;failed not equal (non zero) @@ -588,7 +588,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned SP 04e9 : d0fe > bne * ;failed not equal (non zero) -04eb : a50c lda irq_f ;flags seen in IRQ vector +04eb : a502 lda irq_f ;flags seen in IRQ vector if D_clear = 1 and #decmode trap_ne ;D-flag not cleared @@ -631,7 +631,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned SP 050f : d0fe > bne * ;failed not equal (non zero) -0511 : a50c lda irq_f ;flags seen in IRQ vector +0511 : a502 lda irq_f ;flags seen in IRQ vector if D_clear = 1 and #decmode trap_ne ;D-flag not cleared @@ -690,7 +690,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned flags 054a : d0fe > bne * ;failed not equal (non zero) -054c : a50a lda irq_a ;accu seen in IRQ vector +054c : a500 lda irq_a ;accu seen in IRQ vector 054e : cdff01 cmp lst_a trap_ne ;IRQ A received 0551 : d0fe > bne * ;failed not equal (non zero) @@ -739,7 +739,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned flags 0583 : d0fe > bne * ;failed not equal (non zero) -0585 : a50a lda irq_a ;accu seen in IRQ vector +0585 : a500 lda irq_a ;accu seen in IRQ vector 0587 : cdff01 cmp lst_a trap_ne ;IRQ A received 058a : d0fe > bne * ;failed not equal (non zero) @@ -770,7 +770,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned SP 05a7 : d0fe > bne * ;failed not equal (non zero) -05a9 : a50c lda irq_f ;flags seen in IRQ vector +05a9 : a502 lda irq_f ;flags seen in IRQ vector if D_clear = 1 and #decmode trap_ne ;D-flag not cleared @@ -793,7 +793,7 @@ bffc = I_port = $bffc ;feedback port address ldx #0 lda #0 sta I_src - push_stat intdis + push_stat intdis I_set IRQ_bit ;IRQ pending inx inx @@ -817,7 +817,7 @@ bffc = I_port = $bffc ;feedback port address sta nmi_count sta irq_count sta brk_count - push_stat 0 + push_stat 0 I_set IRQ_bit ;trigger IRQ else ; NMI integrity test @@ -853,7 +853,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned SP 05d5 : d0fe > bne * ;failed not equal (non zero) -05d7 : a50f lda nmi_f ;flags seen in NMI vector +05d7 : a505 lda nmi_f ;flags seen in NMI vector if D_clear = 1 and #decmode trap_ne ;D-flag not cleared @@ -920,7 +920,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned flags 0618 : d0fe > bne * ;failed not equal (non zero) -061a : a50d lda nmi_a ;accu seen in NMI vector +061a : a503 lda nmi_a ;accu seen in NMI vector 061c : cdff01 cmp lst_a trap_ne ;NMI A received 061f : d0fe > bne * ;failed not equal (non zero) @@ -977,7 +977,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned flags 0659 : d0fe > bne * ;failed not equal (non zero) -065b : a50d lda nmi_a ;accu seen in NMI vector +065b : a503 lda nmi_a ;accu seen in NMI vector 065d : cdff01 cmp lst_a trap_ne ;NMI A received 0660 : d0fe > bne * ;failed not equal (non zero) @@ -1016,7 +1016,7 @@ bffc = I_port = $bffc ;feedback port address trap_ne ;returned SP 0685 : d0fe > bne * ;failed not equal (non zero) -0687 : a50f lda nmi_f ;flags seen in NMI vector +0687 : a505 lda nmi_f ;flags seen in NMI vector if D_clear = 1 and #decmode trap_ne ;D-flag not cleared @@ -1038,8 +1038,8 @@ bffc = I_port = $bffc ;feedback port address 0693 : a200 ldx #0 0695 : a904 lda #4 ;set expected interrupt NMI only 0697 : 8d0302 sta I_src - push_stat intdis -069a : a904 > lda #intdis + push_stat intdis +069a : a904 > lda #intdis 069c : 48 > pha ;use stack to load status I_set 8 ;both interrupts pending @@ -1117,23 +1117,23 @@ bffc = I_port = $bffc ;feedback port address 06f3 : d0fe > bne * ;failed not equal (non zero) - ; S U C C E S S ************************************************ - ; ------------- + ; S U C C E S S ************************************************ + ; ------------- success ;if you get here everything went well 06f5 : 4cf506 > jmp * ;test passed, no errors - ; ------------- - ; S U C C E S S ************************************************ + ; ------------- + ; S U C C E S S ************************************************ ; check data_segment +0 to +2 for sequence of concurrent interrupts ; e.g. 0x200 = NMI, 0x201 = IRQ, 0x202 = BRK, lower values = earlier -06f8 : 4c0004 jmp start ;run again +06f8 : 4c0004 jmp start ;run again ; manual tests for the WAI opcode of the 65c02 - wai macro + wai macro db $cb ;WAI opcode endm - + ; requires single step operation, report = 0 ; set PC to the 1st instruction of the test ; step to the WAI opcode, then manually tie the IRQ input low @@ -1164,7 +1164,7 @@ bffc = I_port = $bffc ;feedback port address success 070f : 4c0f07 > jmp * ;test passed, no errors - + ; WAI with interrupts enabled 0712 : a2ff ldx #$ff 0714 : 9a txs @@ -1194,13 +1194,13 @@ bffc = I_port = $bffc ;feedback port address success 072c : 4c2c07 > jmp * ;test passed, no errors - + ; manual test for the STP opcode of the 65c02 - stp macro + stp macro db $db ;STP opcode endm - + ; set PC to the 1st instruction of the test, then run 072f : ea nop 0730 : ea nop @@ -1230,13 +1230,13 @@ bffc = I_port = $bffc ;feedback port address 073a : 88 dey 073b : 88 dey 073c : 88 dey -073d : 850d sta nmi_a ;save regsters during NMI -073f : 860e stx nmi_x +073d : 8503 sta nmi_a ;save regsters during NMI +073f : 8604 stx nmi_x 0741 : 68 pla 0742 : 48 pha -0743 : 850f sta nmi_f +0743 : 8505 sta nmi_f 0745 : ad0302 lda I_src ;NMI expected? -0748 : 2904 and #4 +0748 : 2904 and #4 trap_eq ;unexpexted NMI - check stack for conditions 074a : f0fe > beq * ;failed equal (zero) @@ -1249,7 +1249,7 @@ bffc = I_port = $bffc ;feedback port address 0752 : 68 pla ;return with other flags reversed 0753 : 49c3 eor #m8-fai-decmode 0755 : 48 pha -0756 : ba tsx +0756 : ba tsx 0757 : bd0201 lda $102,x ;test break on stack 075a : 2910 and #break trap_ne ;unexpected B-flag! - this may fail on a real 6502 @@ -1259,12 +1259,12 @@ bffc = I_port = $bffc ;feedback port address 075e : ad0302 lda I_src ;mark expected NMI has occured 0761 : 29fb and #$ff-4 0763 : 8d0302 sta I_src - I_clr NMI_bit + I_clr NMI_bit 0766 : adfcbf > lda I_port ;turn off interrupt by bit -0769 : 297d > and #I_filter-(1< and #I_filter-(1< sta I_port -076e : a60e ldx nmi_x +076e : a604 ldx nmi_x 0770 : e8 inx 0771 : 8e0002 stx nmi_count 0774 : a949 lda #'I' ;mark (NM)I @@ -1276,7 +1276,7 @@ bffc = I_port = $bffc ;feedback port address trap ;unexpected RESET 0778 : 4c7807 > jmp * ;failed anyway - + 077b : 88 dey 077c : 88 dey 077d : irq_trap ;BRK & IRQ test @@ -1284,13 +1284,13 @@ bffc = I_port = $bffc ;feedback port address 077e : 88 dey 077f : 88 dey 0780 : 88 dey -0781 : 850a sta irq_a ;save registers during IRQ/BRK -0783 : 860b stx irq_x +0781 : 8500 sta irq_a ;save registers during IRQ/BRK +0783 : 8601 stx irq_x 0785 : 68 pla 0786 : 48 pha -0787 : 850c sta irq_f +0787 : 8502 sta irq_f 0789 : ad0302 lda I_src ;IRQ expected? -078c : 2903 and #3 +078c : 2903 and #3 trap_eq ;unexpexted IRQ/BRK - check stack for conditions 078e : f0fe > beq * ;failed equal (zero) @@ -1302,32 +1302,32 @@ bffc = I_port = $bffc ;feedback port address 0796 : 68 pla ;return with other flags reversed 0797 : 49c3 eor #m8-fai-decmode -0799 : 48 pha +0799 : 48 pha 079a : ba tsx 079b : bd0201 lda $102,x ;test break on stack 079e : 2910 and #break 07a0 : d021 bne brk_trap - + 07a2 : ad0302 lda I_src ;IRQ expected? -07a5 : 2902 and #2 +07a5 : 2902 and #2 trap_eq ;unexpexted IRQ - check stack for conditions 07a7 : f0fe > beq * ;failed equal (zero) 07a9 : ad0302 lda I_src ;mark expected IRQ has occured 07ac : 29fd and #$ff-2 07ae : 8d0302 sta I_src - I_clr IRQ_bit + I_clr IRQ_bit 07b1 : adfcbf > lda I_port ;turn off interrupt by bit -07b4 : 297e > and #I_filter-(1< and #I_filter-(1< sta I_port -07b9 : a60b ldx irq_x +07b9 : a601 ldx irq_x 07bb : e8 inx 07bc : 8e0102 stx irq_count 07bf : a951 lda #'Q' ;mark (IR)Q 07c1 : 28 plp ;should be reversed by rti 07c2 : 40 rti - + 07c3 : brk_trap 07c3 : ad0302 lda I_src ;break expected? 07c6 : 2901 and #1 @@ -1337,20 +1337,20 @@ bffc = I_port = $bffc ;feedback port address 07ca : ad0302 lda I_src ;mark expected BRK has occured 07cd : 29fe and #$ff-1 07cf : 8d0302 sta I_src -07d2 : a60b ldx irq_x +07d2 : a601 ldx irq_x 07d4 : e8 inx -07d5 : 8e0202 stx brk_count -07d8 : a50a lda irq_a +07d5 : 8e0202 stx brk_count +07d8 : a500 lda irq_a 07da : a94b lda #'K' ;mark (BR)K 07dc : 28 plp ;should be reversed by rti 07dd : 40 rti - + if report = 1 rep_int = 1 include "report.i65" endif - + ;system vectors if (load_data_direct = 1) fffa = org $fffa @@ -1364,12 +1364,12 @@ fffe : 7d07 dw irq_trap dw res_trap dw irq_trap endif - + fffa = end start - - + + No errors in pass 2. -Wrote binary from address $000a through $ffff. -Total size 65526 bytes. +Wrote binary from address $0000 through $ffff. +Total size 65536 bytes. Program start address is at $0400 (1024). \ No newline at end of file diff --git a/src/test/kotlin/Test6502Klaus2m5Functional.kt b/src/test/kotlin/Test6502Klaus2m5Functional.kt index 82ee240..1997fcb 100644 --- a/src/test/kotlin/Test6502Klaus2m5Functional.kt +++ b/src/test/kotlin/Test6502Klaus2m5Functional.kt @@ -27,28 +27,22 @@ class Test6502Klaus2m5Functional { bus.add(ram) cpu.reset() cpu.regPC = 0x0400 - cpu.addBreakpoint(0x3469) { _, _ -> - // reaching this address means successful test result - if(cpu.currentOpcode==0x4c) - throw SuccessfulTestResult() - Cpu6502.BreakpointResultAction(null, null) - } - try { - while (cpu.totalCycles < 100000000) { - cpu.clock() - } - } catch (sx: SuccessfulTestResult) { - println("test successful ${cpu.totalCycles}") - return + do { + val previousPC = cpu.regPC + cpu.step() + } while(cpu.regPC!=previousPC) } catch(nx: NotImplementedError) { println("encountered a not yet implemented feature: ${nx.message}") } - println(cpu.snapshot()) - val d = cpu.disassemble(ram, max(0, cpu.regPC-20), min(65535, cpu.regPC+20)) - println(d.first.joinToString ("\n")) - fail("test failed") + // the test is successful if address 0x3469 is reached ("success" label in source code) + if(cpu.regPC!=0x3469) { + println(cpu.snapshot()) + val d = cpu.disassemble(ram, max(0, cpu.regPC-20), min(65535, cpu.regPC+20)) + println(d.first.joinToString("\n")) + fail("test failed") + } } @Test @@ -80,8 +74,8 @@ class Test6502Klaus2m5Functional { } @Test - //@Ignore("todo: fix the interrupt tests") // TODO the test code is not correct fun testInterrupts6502() { + // TODO fix this test code val cpu = Cpu6502() val bus = Bus() val ram = Ram(0, 0xffff)