OpenCores
URL https://opencores.org/ocsvn/m65c02/m65c02/trunk

Subversion Repositories m65c02

[/] [m65c02/] [trunk/] [Src/] [M65C02-Test-Programs/] [Klaus2m5_Functional_Tests/] [65c02_ft.lst] - Rev 2

Go to most recent revision | Compare with Previous | Blame | View Log

AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    1
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

---------------------------------------------------------- Symbol Table -----------------------------------------------------------

              Symbol   Value        Decimal

               absAN : $023f            575
              absANa : $024b            587
               absEO : $0243            579
              absEOa : $024f            591
              absflo : $0257            599
               absOR : $023b            571
              absORa : $0247            583
              absrlo : $0253            595
                abst : $0203            515
                abs1 : $0208            520
               abs7f : $020c            524
                ada2 : $0203            515
                adfc : $000c             12
               adiy2 : $0056             86
                adi2 : $0052             82
                adrf : $0011             17
                adrh : $0010             16
                adrl : $000f             15
                 ad1 : $000d             13
                 ad2 : $000e             14
            bin_test : $31b8          12728
               break : $0010             16
             brk_ret : $08b9           2233
                 br1 : $05c9           1481
                br11 : $060d           1549
                br12 : $0612           1554
                br13 : $0617           1559
                br14 : $0628           1576
                 br2 : $05ce           1486
                 br3 : $05d3           1491
                 br4 : $05e4           1508
               carry : $0001              1
           check_ram : <macro>
              chkadd : $3403          13315
              chkadi : $346e          13422   *
              chkdad : $32d2          13010
             chkdadi : $3325          13093   *
             chkdsbi : $333c          13116   *
              chksbi : $3485          13445   *
               ckad1 : $3418          13336
            cmp_flag : <macro>
        code_segment : $0400           1024   *
            data_bss : $0208            520
        data_bss_end : $025b            603
        data_segment : $0200            512   *
             decmode : $0008              8
            dec_test : $3220          12832
            eor_flag : <macro>
                fASL : $0221            545
                 fai : $0034             52
                 fao : $0030             48
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    2
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

             far_ret : $07f7           2039
                  fc : $0001              1
                fINC : $0236            566
                fLDx : $020d            525
                fLSR : $0229            553
                  fn : $0080            128
                 fnc : $0081            129
                 fnv : $00c0            192
                 fnz : $0082            130
                fnzc : $0083            131
                fROL : $0221            545
               fROLc : $0225            549
                fROR : $0229            553
               fRORc : $022d            557
                  fv : $0040             64
                 fvz : $0042             66
                  fz : $0002              2
                 fzc : $0003              3
              I_flag : $0003              3   *
               indAN : $003a             58
               indEO : $0042             66
               indOR : $004a             74
                indt : $0030             48
                ind1 : $0024             36
             ind_ret : $084c           2124
              intdis : $0004              4
                inwt : $0038             56
                inw1 : $002e             46
               irq_a : $000a             10
            irq_trap : $35fd          13821
               irq_x : $000b             11
             jsr_ret : $0882           2178   *
    load_data_direct : $0001              1   *
           load_flag : <macro>
               minus : $0080            128
                  m8 : $00ff            255
                 m8i : $00fb            251
                nbr1 : $05d8           1496
               nbr11 : $061c           1564
               nbr12 : $061f           1567
               nbr13 : $0622           1570
               nbr14 : $0625           1573
                nbr2 : $05db           1499
                nbr3 : $05de           1502
                nbr4 : $05e1           1505
           next_test : <macro>
            nmi_trap : $35f5          13813
              overfl : $0040             64
         ptr_ind_ret : $357e          13694
         ptr_tst_ind : $357c          13692
         ROM_vectors : $0001              1   *
                rASL : $0211            529
           ram_chksm : $0201            513
             ram_top : $ffff             -1   *
           range_adr : $04a5           1189   *
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    3
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

           range_end : $0531           1329
            range_fw : $041c           1052
          range_loop : $0414           1044
            range_ok : $052a           1322
            range_op : $04a4           1188
              reserv : $0020             32
            res_trap : $35f8          13816
                rINC : $0231            561
                rLSR : $0219            537
                rROL : $0211            529
               rROLc : $0215            533
                rROR : $0219            537
               rRORc : $021d            541
                sba2 : $0204            516
               sbiy2 : $0058             88
                sbi2 : $0054             84
                 sb2 : $0012             18
               set_a : <macro>
             set_abs : <macro>
            set_absx : <macro>
              set_ax : <macro>
              set_ay : <macro>
            set_stat : <macro>
               set_x : <macro>
               set_y : <macro>
               set_z : <macro>
              set_zx : <macro>
       skip_bin_test : $0001              1   *
       skip_dec_test : $0001              1   *
         skip_part_1 : $0000              0   *
               start : $0400           1024
             success : $32cf          13007
                tadd : $31e6          12774
               tadd1 : $31f8          12792
                tand : $2be3          11235
              tandi1 : $2bf0          11248
              tandi2 : $2c11          11281
               tand1 : $2c04          11268
              tand10 : $2d1b          11547
              tand11 : $2d38          11576
              tand12 : $2d57          11607
              tand13 : $2d77          11639
              tand14 : $2d95          11669
              tand15 : $2db1          11697
               tand2 : $2c25          11301
               tand3 : $2c45          11333
               tand4 : $2c65          11365
               tand5 : $2c87          11399
               tand6 : $2ca9          11433
               tand7 : $2cc5          11461
               tand8 : $2ce1          11489
               tand9 : $2cfe          11518
                tasl : $2187           8583
               tasl1 : $21a1           8609
               tasl2 : $22cb           8907
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    4
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

               tasl3 : $22ea           8938
               tasl4 : $244b           9291
               tasl5 : $246d           9325
               tasl6 : $25ef           9711
               tasl7 : $260e           9742
               tasl8 : $276f          10095
               tasl9 : $2791          10129
                tdad : $324c          12876
               tdad1 : $325e          12894
               tdad2 : $326e          12910
               tdad3 : $3270          12912
               tdad4 : $328a          12938
               tdad5 : $328f          12943
               tdad6 : $32b3          12979
               tdad7 : $32c7          12999
                tdec : $293d          10557
               tdec1 : $2960          10592
              tdec10 : $298c          10636
              tdec11 : $29af          10671
              tdec12 : $2a43          10819
              tdec13 : $2a69          10857
              tdec14 : $2af2          10994
              tdec15 : $2b17          11031
              tdec16 : $2bac          11180
              tdec17 : $2bd5          11221
               tdec2 : $29ec          10732
               tdec3 : $2a12          10770
               tdec4 : $2aa1          10913
               tdec5 : $2ac6          10950
               tdec6 : $2b53          11091
               tdec7 : $2b7c          11132
                teor : $2dd9          11737
              teori1 : $2de6          11750
              teori2 : $2e07          11783
               teor1 : $2dfa          11770
              teor10 : $2f11          12049
              teor11 : $2f2e          12078
              teor12 : $2f4d          12109
              teor13 : $2f6d          12141
              teor14 : $2f8b          12171
              teor15 : $2fa7          12199
               teor2 : $2e1b          11803
               teor3 : $2e3b          11835
               teor4 : $2e5b          11867
               teor5 : $2e7d          11901
               teor6 : $2e9f          11935
               teor7 : $2ebb          11963
               teor8 : $2ed7          11991
               teor9 : $2ef4          12020
            test_bne : $0544           1348
           test_case : $0200            512
            test_far : $354e          13646
            test_ind : $3585          13701
            test_jsr : $35b8          13752
           test_near : $081a           2074
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    5
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

            test_num : $002a             42   *
                tinc : $2917          10519
               tinc1 : $2936          10550
              tinc10 : $2966          10598
              tinc11 : $2985          10629
              tinc12 : $2a19          10777
              tinc13 : $2a3b          10811
              tinc14 : $2aca          10954
              tinc15 : $2aeb          10987
              tinc16 : $2b80          11136
              tinc17 : $2ba5          11173
               tinc2 : $29c2          10690
               tinc3 : $29e4          10724
               tinc4 : $2a79          10873
               tinc5 : $2a9a          10906
               tinc6 : $2b27          11047
               tinc7 : $2b4c          11084
               tldax : $14fa           5370
              tldax1 : $151c           5404
              tldax2 : $153e           5438
              tldax3 : $155f           5471
              tldax4 : $165d           5725
              tldax5 : $1682           5762
              tldax6 : $16c6           5830
              tldax7 : $16d2           5842
               tlday : $15ab           5547
              tlday1 : $15cd           5581
              tlday2 : $1604           5636
              tlday3 : $1625           5669
              tlday4 : $16fb           5883
              tlday5 : $171c           5916
              tlday6 : $173d           5949
                tldx : $0d16           3350
               tldx1 : $0d39           3385
               tldx2 : $0d5c           3420
               tldx3 : $0d80           3456
               tldx4 : $0dd1           3537
               tldx5 : $0dde           3550
                tldy : $0e13           3603
               tldy1 : $0e36           3638
               tldy2 : $0e59           3673
               tldy3 : $0e7c           3708
               tldy4 : $0eca           3786
               tldy5 : $0ed7           3799
                tlsr : $21bb           8635
               tlsr1 : $21d5           8661
               tlsr2 : $2309           8969
               tlsr3 : $2328           9000
               tlsr4 : $248f           9359
               tlsr5 : $24b1           9393
               tlsr6 : $262d           9773
               tlsr7 : $264c           9804
               tlsr8 : $27b3          10163
               tlsr9 : $27d5          10197
                tora : $2fcf          12239
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    6
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

              torai1 : $2fdc          12252
              torai2 : $2ffd          12285
               tora1 : $2ff0          12272
              tora10 : $3107          12551
              tora11 : $3124          12580
              tora12 : $3143          12611
              tora13 : $3163          12643
              tora14 : $3181          12673
              tora15 : $319d          12701
               tora2 : $3011          12305
               tora3 : $3031          12337
               tora4 : $3051          12369
               tora5 : $3073          12403
               tora6 : $3095          12437
               tora7 : $30b1          12465
               tora8 : $30cd          12493
               tora9 : $30ea          12522
                trap : <macro>
             trap_cc : <macro>
             trap_cs : <macro>
             trap_eq : <macro>
             trap_mi : <macro>
             trap_ne : <macro>
             trap_pl : <macro>
             trap_vc : <macro>
             trap_vs : <macro>
                trol : $21ef           8687
               trolc : $2223           8739
              trolc1 : $223d           8765
              trolc2 : $2385           9093
              trolc3 : $23a4           9124
              trolc4 : $2517           9495
              trolc5 : $2539           9529
              trolc6 : $26a9           9897
              trolc7 : $26c8           9928
              trolc8 : $283b          10299
              trolc9 : $285d          10333
               trol1 : $2209           8713
               trol2 : $2347           9031
               trol3 : $2366           9062
               trol4 : $24d3           9427
               trol5 : $24f5           9461
               trol6 : $266b           9835
               trol7 : $268a           9866
               trol8 : $27f7          10231
               trol9 : $2819          10265
                tror : $2257           8791
               trorc : $228b           8843
              trorc1 : $22a5           8869
              trorc2 : $2401           9217
              trorc3 : $2420           9248
              trorc4 : $259f           9631
              trorc5 : $25c1           9665
              trorc6 : $2725          10021
              trorc7 : $2744          10052
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    7
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

              trorc8 : $28c3          10435
              trorc9 : $28e5          10469
               tror1 : $2271           8817
               tror2 : $23c3           9155
               tror3 : $23e2           9186
               tror4 : $255b           9563
               tror5 : $257d           9597
               tror6 : $26e7           9959
               tror7 : $2706           9990
               tror8 : $287f          10367
               tror9 : $28a1          10401
               tstax : $1582           5506
              tstax1 : $16e0           5856
               tstay : $15f1           5617
              tstay1 : $1648           5704
              tstay2 : $16a7           5799
              tstay4 : $170b           5899
              tstay5 : $172a           5930
              tstay6 : $174c           5964
                tstx : $0da6           3494
               tstx1 : $0dec           3564
                tsty : $0ea1           3745
               tsty1 : $0ee5           3813
               tst_a : <macro>
             tst_abs : <macro>
            tst_absx : <macro>
              tst_ax : <macro>
              tst_ay : <macro>
            tst_stat : <macro>
               tst_x : <macro>
               tst_y : <macro>
               tst_z : <macro>
              tst_zx : <macro>
                zero : $0002              2
           zero_page : $000a             10   *
                zpAN : $001c             28
                zpEO : $0020             32
                zpOR : $0018             24
                 zpt : $000c             12
                 zp1 : $0013             19
                zp7f : $0017             23
              zp_bss : $0013             19
          zp_bss_end : $005a             90
          __65SC02__ : $0001              1

336 labels used

5633 lines read, no errors in pass 1.
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    8
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             ;
                             ; 6 5 0 2   F U N C T I O N A L   T E S T
                             ;
                             ; Copyright (C) 2012-2013  Klaus Dormann
                             ;
                             ; This program is free software: you can redistribute it and/or modify
                             ; it under the terms of the GNU General Public License as published by
                             ; the Free Software Foundation, either version 3 of the License, or
                             ; (at your option) any later version.
                             ;
                             ; This program is distributed in the hope that it will be useful,
                             ; but WITHOUT ANY WARRANTY; without even the implied warranty of
                             ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             ; GNU General Public License for more details.
                             ;
                             ; You should have received a copy of the GNU General Public License
                             ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             
                             
                             ; This program is designed to test all opcodes of a 6502 emulator using all
                             ; addressing modes with focus on propper setting of the processor status
                             ; register bits.
                             ; 
                             ; version 23-jul-2013
                             ; contact info at http://2m5.de or email K@2m5.de
                             ;
                             ; assembled with AS65 from http://www.kingswood-consulting.co.uk/assemblers/
                             ; command line switches: -l -m -s2 -w -h0
                             ;                         |  |  |   |  no page headers in listing
                             ;                         |  |  |   wide listing (133 char/col)
                             ;                         |  |  write intel hex file instead of binary
                             ;                         |  expand macros in listing
                             ;                         generate pass2 listing
                             ;
                             ; No IO - should be run from a monitor with access to registers.
                             ; To run load intel hex image with a load command, than alter PC to 400 hex
                             ; (code_segment) and enter a go command.
                             ; Loop on program counter determines error or successful completion of test.
                             ; Check listing for relevant traps (jump/branch *).
                             ; Please note that in early tests some instructions will have to be used before
                             ; they are actually tested!
                             ;
                             ; RESET, NMI or IRQ should not occur and will be trapped if vectors are enabled.
                             ; Tests documented behavior of the original NMOS 6502 only! No unofficial
                             ; opcodes. Additional opcodes of newer versions of the CPU (65C02, 65816) will
                             ; not be tested. Decimal ops will only be tested with valid BCD operands and
                             ; N V Z flags will be ignored.
                             ;
                             ; Debugging hints:
                             ;     Most of the code is written sequentially. if you hit a trap, check the
                             ;   immediately preceeding code for the instruction to be tested. Results are
                             ;   tested first, flags are checked second by pushing them onto the stack and
                             ;   pulling them to the accumulator after the result was checked. The "real"
                             ;   flags are no longer valid for the tested instruction at this time!
                             ;     If the tested instruction was indexed, the relevant index (X or Y) must
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    9
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             ;   also be checked. Opposed to the flags, X and Y registers are still valid.
                             ;
                             ; versions:
                             ;   28-jul-2012  1st version distributed for testing
                             ;   29-jul-2012  fixed references to location 0, now #0
                             ;                added license - GPLv3
                             ;   30-jul-2012  added configuration options
                             ;   01-aug-2012  added trap macro to allow user to change error handling
                             ;   01-dec-2012  fixed trap in branch field must be a branch
                             ;   02-mar-2013  fixed PLA flags not tested
                             ;   19-jul-2013  allowed ROM vectors to be loaded when load_data_direct = 0
                             ;                added test sequence check to detect if tests jump their fence
                             ;   23-jul-2013  added RAM integrity check
                             
                             ; C O N F I G U R A T I O N
                             ;
                             ;ROM_vectors writable (0=no, 1=yes)
                             ;if ROM vectors can not be used interrupts will not be trapped
                             ;as a consequence BRK can not be tested but will be emulated to test RTI
0001 =                       ROM_vectors = 1
                             ;load_data_direct (0=move from code segment, 1=load directly)
                             ;loading directly is preferred but may not be supported by your platform
                             ;0 produces only consecutive object code, 1 is not suitable for a binary image
0001 =                       load_data_direct = 1
                             ;I_flag behavior (0=force enabled, 1=force disabled, 2=prohibit change, 3=allow
                             ;change) 2 requires extra code and is not recommended. SEI & CLI can only be
                             ;tested if you allow changing the interrupt status (I_flag = 3)
0003 =                       I_flag = 3
                             ;configure memory - try to stay away from memory used by the system
                             ;zero_page memory start address, $50 (80) consecutive Bytes required
                             ;                                add 2 if I_flag = 2
000a =                       zero_page = $a  
                             ;data_segment memory start address, $5B (91) consecutive Bytes required
0200 =                       data_segment = $200  
                                 if (data_segment & $ff) != 0
                                     ERROR ERROR ERROR low byte of data_segment MUST be $00 !!
                                 endif  
                             ;code_segment memory start address, 13kB of consecutive space required
                             ;                                   add 2.5 kB if I_flag = 2
                             ;parts of the code are self modifying and must reside in RAM
0400 =                       code_segment = $400  
                             ;RAM integrity test option. Checks for undesired RAM writes.
                             ;set lowest non RAM or RAM mirror address page (-1=disable, 0=64k, $40=16k)
                             ;leave disabled if a monitor, OS or background interrupt is allowed to alter RAM
ffff =                       ram_top = -1
                             ;
                             ;Skip to ADC/SBC tests
                             ;
0000 =                       skip_part_1  = 0
                             ;
                             ;Skip Binary or Decimal mode ADC/SBC instruction tests
                             ;
0001 =                       skip_bin_test = 1
0001 =                       skip_dec_test = 1
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   10
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     noopt       ;do not take shortcuts
                             
                             ;macros for error & success traps to allow user modification
                             ;example:
                             ;trap    macro
                             ;        jsr my_error_handler
                             ;        endm
                             ;trap_eq macro
                             ;        bne skip\?
                             ;        trap           ;failed equal (zero)
                             ;skip\?
                             ;        endm
                             ;
                             ; my_error_handler should pop the calling address from the stack and report it.
                             ; putting larger portions of code (more than 3 bytes) inside the trap macro
                             ; may lead to branch range problems for some tests.
                             trap    macro
                                     jmp *           ;failed anyway
                                     endm
                             trap_eq macro
                                     beq *           ;failed equal (zero)
                                     endm
                             trap_ne macro
                                     bne *           ;failed not equal (non zero)
                                     endm
                             trap_cs macro
                                     bcs *           ;failed carry set
                                     endm
                             trap_cc macro
                                     bcc *           ;failed carry clear
                                     endm
                             trap_mi macro
                                     bmi *           ;failed minus (bit 7 set)
                                     endm
                             trap_pl macro
                                     bpl *           ;failed plus (bit 7 clear)
                                     endm
                             trap_vs macro
                                     bvs *           ;failed overflow set
                                     endm
                             trap_vc macro
                                     bvc *           ;failed overflow clear
                                     endm
                             success macro
                                     jmp *           ;test passed, no errors
                                     endm
                             
                             
0001 =                       carry   equ %00000001   ;flag bits in status
0002 =                       zero    equ %00000010
0004 =                       intdis  equ %00000100
0008 =                       decmode equ %00001000
0010 =                       break   equ %00010000
0020 =                       reserv  equ %00100000
0040 =                       overfl  equ %01000000
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   11
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0080 =                       minus   equ %10000000
                             
0001 =                       fc      equ carry
0002 =                       fz      equ zero
0003 =                       fzc     equ carry+zero
0040 =                       fv      equ overfl
0042 =                       fvz     equ overfl+zero
0080 =                       fn      equ minus
0081 =                       fnc     equ minus+carry
0082 =                       fnz     equ minus+zero
0083 =                       fnzc    equ minus+zero+carry
00c0 =                       fnv     equ minus+overfl
                             
0030 =                       fao     equ break+reserv    ;bits always on after PHP, BRK
0034 =                       fai     equ fao+intdis      ;+ forced interrupt disable
00ff =                       m8      equ $ff             ;8 bit mask
00fb =                       m8i     equ $ff&~intdis     ;8 bit mask - interrupt disable
                             
                             ;macros to allow masking of status bits.
                             ;masking of interrupt enable/disable on load and compare
                             ;masking of always on bits after PHP or BRK (unused & break) on compare
                                     if I_flag = 0
                             load_flag   macro
                                         lda #\1&m8i         ;force enable interrupts (mask I)
                                         endm
                             cmp_flag    macro
                                         cmp #(\1|fao)&m8i   ;I_flag is always enabled + always on bits
                                         endm
                             eor_flag    macro
                                         eor #(\1&m8i|fao)   ;mask I, invert expected flags + always on bits
                                         endm
                                     endif
                                     if I_flag = 1
                             load_flag   macro
                                         lda #\1|intdis      ;force disable interrupts
                                         endm
                             cmp_flag    macro
                                         cmp #(\1|fai)&m8    ;I_flag is always disabled + always on bits
                                         endm
                             eor_flag    macro
                                         eor #(\1|fai)       ;invert expected flags + always on bits + I
                                         endm
                                     endif
                                     if I_flag = 2
                             load_flag   macro
                                         lda #\1
                                         ora flag_I_on       ;restore I-flag
                                         and flag_I_off
                                         endm
                             cmp_flag    macro
                                         eor flag_I_on       ;I_flag is never changed
                                         cmp #(\1|fao)&m8i   ;expected flags + always on bits, mask I
                                         endm
                             eor_flag    macro
                                         eor flag_I_on       ;I_flag is never changed
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   12
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                         eor #(\1&m8i|fao)   ;mask I, invert expected flags + always on bits
                                         endm
                                     endif
                                     if I_flag = 3
                             load_flag   macro
                                         lda #\1             ;allow test to change I-flag (no mask)
                                         endm
                             cmp_flag    macro
                                         cmp #(\1|fao)&m8    ;expected flags + always on bits
                                         endm
                             eor_flag    macro
                                         eor #\1|fao         ;invert expected flags + always on bits
                                         endm
                                     endif
                             
                             ;macros to set (register|memory|zeropage) & status
                             set_stat    macro       ;setting flags in the processor status register
                                         load_flag \1
                                         pha         ;use stack to load status
                                         plp
                                         endm
                             
                             set_a       macro       ;precharging accu & status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         lda #\1     ;precharge accu
                                         plp
                                         endm
                             
                             set_x       macro       ;precharging index & status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         ldx #\1     ;precharge index x
                                         plp
                                         endm
                             
                             set_y       macro       ;precharging index & status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         ldy #\1     ;precharge index y
                                         plp
                                         endm
                             
                             set_ax      macro       ;precharging indexed accu & immediate status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         lda \1,x    ;precharge accu
                                         plp
                                         endm
                             
                             set_ay      macro       ;precharging indexed accu & immediate status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         lda \1,y    ;precharge accu
                                         plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   13
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                         endm
                             
                             set_z       macro       ;precharging indexed zp & immediate status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         lda \1,x    ;load to zeropage
                                         sta zpt
                                         plp
                                         endm
                             
                             set_zx      macro       ;precharging zp,x & immediate status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         lda \1,x    ;load to indexed zeropage
                                         sta zpt,x
                                         plp
                                         endm
                             
                             set_abs     macro       ;precharging indexed memory & immediate status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         lda \1,x    ;load to memory
                                         sta abst
                                         plp
                                         endm
                             
                             set_absx    macro       ;precharging abs,x & immediate status
                                         load_flag \2
                                         pha         ;use stack to load status
                                         lda \1,x    ;load to indexed memory
                                         sta abst,x
                                         plp
                                         endm
                             
                             ;macros to test (register|memory|zeropage) & status & (mask)
                             tst_stat    macro       ;testing flags in the processor status register
                                         php         ;save status
                                         php         ;use stack to retrieve status
                                         pla
                                         cmp_flag \1
                                         trap_ne
                                         plp         ;restore status
                                         endm
                                         
                             tst_a       macro       ;testing result in accu & flags
                                         php         ;save flags
                                         php
                                         cmp #\1     ;test result
                                         trap_ne
                                         pla         ;load status
                                         cmp_flag \2
                                         trap_ne
                                         plp         ;restore status
                                         endm
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   14
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             tst_x       macro       ;testing result in x index & flags
                                         php         ;save flags
                                         php
                                         cpx #\1     ;test result
                                         trap_ne
                                         pla         ;load status
                                         cmp_flag \2
                                         trap_ne
                                         plp         ;restore status
                                         endm
                             
                             tst_y       macro       ;testing result in y index & flags
                                         php         ;save flags
                                         php
                                         cpy #\1     ;test result
                                         trap_ne
                                         pla         ;load status
                                         cmp_flag \2
                                         trap_ne
                                         plp         ;restore status
                                         endm
                             
                             tst_ax      macro       ;indexed testing result in accu & flags
                                         php         ;save flags
                                         cmp \1,x    ;test result
                                         trap_ne
                                         pla         ;load status
                                         eor_flag \3
                                         cmp \2,x    ;test flags
                                         trap_ne     ;
                                         endm
                             
                             tst_ay      macro       ;indexed testing result in accu & flags
                                         php         ;save flags
                                         cmp \1,y    ;test result
                                         trap_ne     ;
                                         pla         ;load status
                                         eor_flag \3
                                         cmp \2,y    ;test flags
                                         trap_ne
                                         endm
                                     
                             tst_z       macro       ;indexed testing result in zp & flags
                                         php         ;save flags
                                         lda zpt
                                         cmp \1,x    ;test result
                                         trap_ne
                                         pla         ;load status
                                         eor_flag \3
                                         cmp \2,x    ;test flags
                                         trap_ne
                                         endm
                             
                             tst_zx      macro       ;testing result in zp,x & flags
                                         php         ;save flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   15
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                         lda zpt,x
                                         cmp \1,x    ;test result
                                         trap_ne
                                         pla         ;load status
                                         eor_flag \3
                                         cmp \2,x    ;test flags
                                         trap_ne
                                         endm
                             
                             tst_abs     macro       ;indexed testing result in memory & flags
                                         php         ;save flags
                                         lda abst
                                         cmp \1,x    ;test result
                                         trap_ne
                                         pla         ;load status
                                         eor_flag \3
                                         cmp \2,x    ;test flags
                                         trap_ne
                                         endm
                             
                             tst_absx    macro       ;testing result in abs,x & flags
                                         php         ;save flags
                                         lda abst,x
                                         cmp \1,x    ;test result
                                         trap_ne
                                         pla         ;load status
                                         eor_flag \3
                                         cmp \2,x    ;test flags
                                         trap_ne
                                         endm
                                         
                             ; RAM integrity test
                             ;   verifies that none of the previous tests has altered RAM outside of the
                             ;   designated write areas.
                             ;   uses zpt word as indirect pointer, zpt+2 word as checksum
                                     if ram_top > -1
                             check_ram   macro 
                                         cld
                                         lda #0
                                         sta zpt         ;set low byte of indirect pointer
                                         sta zpt+3       ;checksum high byte
                                         sta range_adr   ;reset self modifying code
                                         sta tandi1
                                         sta tandi2
                                         sta teori1
                                         sta teori2
                                         sta torai1
                                         sta torai2
                                         sta chkdadi  
                                         sta chkdsbi
                                         sta chkadi
                                         sta chksbi
                                         clc
                                         ldx #zp_bss-zero_page ;zeropage - write test area
                             ccs3\?      adc zero_page,x
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   16
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                         bcc ccs2\?
                                         inc zpt+3       ;carry to high byte
                                         clc
                             ccs2\?      inx
                                         bne ccs3\?
                                         ldx #hi(data_segment) ;set high byte of indirect pointer
                                         stx zpt+1
                                         ldy #lo(data_bss) ;data after write test area
                             ccs5\?      adc (zpt),y
                                         bcc ccs4\?
                                         inc zpt+3       ;carry to high byte
                                         clc
                             ccs4\?      iny
                                         bne ccs5\?
                                         inx             ;advance RAM high address
                                         stx zpt+1
                                         cpx #ram_top
                                         bne ccs5\?
                                         sta zpt+2       ;checksum low is
                                         cmp ram_chksm   ;checksum low expected
                                         trap_ne         ;checksum mismatch
                                         lda zpt+3       ;checksum high is
                                         cmp ram_chksm+1 ;checksum high expected
                                         trap_ne         ;checksum mismatch
                                         endm            
                                     else
                             check_ram   macro
                                         ;RAM check disabled - RAM size not set
                                         endm
                                     endif
                             
                             next_test   macro           ;make sure, tests don't jump the fence
                                         lda test_case   ;previous test
                                         cmp #test_num
                                         trap_ne         ;test is out of sequence
                             test_num = test_num + 1
                                         lda #test_num   ;*** this tests' number
                                         sta test_case
                                         ;check_ram       ;uncomment to find altered RAM after each test
                                         endm
                             
                                 if load_data_direct = 1
                                     data
                                 else
                                     bss                 ;uninitialized segment, copy of data at end of code!
                                 endif
                             ;
                             ;        org zero_page
0000 =                               org 0
0000 : 00000000000000..              ds  zero_page
                             ;break test interrupt save
000a : 00                    irq_a   ds  1               ;a register
000b : 00                    irq_x   ds  1               ;x register
                                 if I_flag = 2
                             ;masking for I bit in status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   17
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             flag_I_on   ds  1           ;or mask to load flags   
                             flag_I_off  ds  1           ;and mask to load flags
                                 endif
000c :                       zpt                         ;5 bytes store/modify test area
                             ;add/subtract operand generation and result/flag prediction
000c : 00                    adfc    ds  1               ;carry flag before op
000d : 00                    ad1     ds  1               ;operand 1 - accumulator
000e : 00                    ad2     ds  1               ;operand 2 - memory / immediate
000f : 00                    adrl    ds  1               ;expected result bits 0-7
0010 : 00                    adrh    ds  1               ;expected result bit 8 (carry)
0011 : 00                    adrf    ds  1               ;expected flags NV0000ZC (-V in decimal mode)
0012 : 00                    sb2     ds  1               ;operand 2 complemented for subtract
0013 :                       zp_bss
0013 : c3824100              zp1     db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
0017 : 7f                    zp7f    db  $7f             ;test pattern for compare  
                             ;logical zeropage operands
0018 : 001f7180              zpOR    db  0,$1f,$71,$80   ;test pattern for OR
001c : 0fff7f80              zpAN    db  $0f,$ff,$7f,$80 ;test pattern for AND
0020 : ff0f8f8f              zpEO    db  $ff,$0f,$8f,$8f ;test pattern for EOR
                             ;indirect addressing pointers
0024 : 0802                  ind1    dw  abs1            ;indirect pointer to pattern in absolute memory
0026 : 0902                          dw  abs1+1
0028 : 0a02                          dw  abs1+2
002a : 0b02                          dw  abs1+3
002c : 0c02                          dw  abs7f
002e : 1001                  inw1    dw  abs1-$f8        ;indirect pointer for wrap-test pattern
0030 : 0302                  indt    dw  abst            ;indirect pointer to store area in absolute memory
0032 : 0402                          dw  abst+1
0034 : 0502                          dw  abst+2
0036 : 0602                          dw  abst+3
0038 : 0b01                  inwt    dw  abst-$f8        ;indirect pointer for wrap-test store
003a : 3f02                  indAN   dw  absAN           ;indirect pointer to AND pattern in absolute memory
003c : 4002                          dw  absAN+1
003e : 4102                          dw  absAN+2
0040 : 4202                          dw  absAN+3
0042 : 4302                  indEO   dw  absEO           ;indirect pointer to EOR pattern in absolute memory
0044 : 4402                          dw  absEO+1
0046 : 4502                          dw  absEO+2
0048 : 4602                          dw  absEO+3
004a : 3b02                  indOR   dw  absOR           ;indirect pointer to OR pattern in absolute memory
004c : 3c02                          dw  absOR+1
004e : 3d02                          dw  absOR+2
0050 : 3e02                          dw  absOR+3
                             ;add/subtract indirect pointers
0052 : 0302                  adi2    dw  ada2            ;indirect pointer to operand 2 in absolute memory
0054 : 0402                  sbi2    dw  sba2            ;indirect pointer to complemented operand 2 (SBC)
0056 : 0401                  adiy2   dw  ada2-$ff        ;with offset for indirect indexed
0058 : 0501                  sbiy2   dw  sba2-$ff
005a :                       zp_bss_end
                                
0200 =                               org data_segment
0200 : 00                    test_case   ds  1           ;current test number
0201 : 0000                  ram_chksm   ds  2           ;checksum for RAM integrity test
                             ;add/subtract operand copy - abs tests write area
0203 :                       abst                        ;5 bytes store/modify test area
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   18
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0203 : 00                    ada2    ds  1               ;operand 2
0204 : 00                    sba2    ds  1               ;operand 2 complemented for subtract
0205 : 000000                        ds  3               ;fill remaining bytes
0208 :                       data_bss
0208 : c3824100              abs1    db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
020c : 7f                    abs7f   db  $7f             ;test pattern for compare
                             ;loads
020d : 80800002              fLDx    db  fn,fn,0,fz      ;expected flags for load
                             ;shifts
0211 :                       rASL                        ;expected result ASL & ROL -carry  
0211 : 86048200              rROL    db  $86,$04,$82,0   ; "
0215 : 87058301              rROLc   db  $87,$05,$83,1   ;expected result ROL +carry
0219 :                       rLSR                        ;expected result LSR & ROR -carry
0219 : 61412000              rROR    db  $61,$41,$20,0   ; "
021d : e1c1a080              rRORc   db  $e1,$c1,$a0,$80 ;expected result ROR +carry
0221 :                       fASL                        ;expected flags for shifts
0221 : 81018002              fROL    db  fnc,fc,fn,fz    ;no carry in
0225 : 81018000              fROLc   db  fnc,fc,fn,0     ;carry in
0229 :                       fLSR
0229 : 01000102              fROR    db  fc,0,fc,fz      ;no carry in
022d : 81808180              fRORc   db  fnc,fn,fnc,fn   ;carry in
                             ;increments (decrements)
0231 : 7f80ff0001            rINC    db  $7f,$80,$ff,0,1 ;expected result for INC/DEC
0236 : 0080800200            fINC    db  0,fn,fn,fz,0    ;expected flags for INC/DEC
                             ;logical memory operand
023b : 001f7180              absOR   db  0,$1f,$71,$80   ;test pattern for OR
023f : 0fff7f80              absAN   db  $0f,$ff,$7f,$80 ;test pattern for AND
0243 : ff0f8f8f              absEO   db  $ff,$0f,$8f,$8f ;test pattern for EOR
                             ;logical accu operand
0247 : 00f11f00              absORa  db  0,$f1,$1f,0     ;test pattern for OR
024b : f0ffffff              absANa  db  $f0,$ff,$ff,$ff ;test pattern for AND
024f : fff0f00f              absEOa  db  $ff,$f0,$f0,$0f ;test pattern for EOR
                             ;logical results
0253 : 00ff7f80              absrlo  db  0,$ff,$7f,$80
0257 : 02800080              absflo  db  fz,fn,0,fn
025b :                       data_bss_end
                             
                             
                                     code
0400 =                               org code_segment
0400 : d8               [ 2] start   cld
0401 : a900             [ 2]         lda #0          ;*** test 0 = initialize
0403 : 8d0002           [ 4]         sta test_case
0000 =                       test_num = 0
                             
                             ;stop interrupts before initializing BSS
                                 if I_flag = 1
                                     sei
                                 endif
                                 
                             ;initialize BSS segment
                                 if load_data_direct != 1
                                     ldx #zp_end-zp_init-1
                             ld_zp   lda zp_init,x
                                     sta zp_bss,x
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   19
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     dex
                                     bpl ld_zp
                                     ldx #data_end-data_init-1
                             ld_data lda data_init,x
                                     sta data_bss,x
                                     dex
                                     bpl ld_data
                                   if ROM_vectors = 1
                                     ldx #5
                             ld_vect lda vec_init,x
                                     sta vec_bss,x
                                     dex
                                     bpl ld_vect
                                   endif
                                 endif
                             
                             ;retain status of interrupt flag
                                 if I_flag = 2
                                     php
                                     pla
                                     and #4          ;isolate flag
                                     sta flag_I_on   ;or mask
                                     eor #lo(~4)     ;reverse
                                     sta flag_I_off  ;and mask
                                 endif
                                     
                             ;generate checksum for RAM integrity test
                                 if ram_top > -1
                                     lda #0 
                                     sta zpt         ;set low byte of indirect pointer
                                     sta ram_chksm+1 ;checksum high byte
                                     sta range_adr   ;reset self modifying code
                                     sta tandi1
                                     sta tandi2
                                     sta teori1
                                     sta teori2
                                     sta torai1
                                     sta torai2
                                     sta chkdadi  
                                     sta chkdsbi
                                     sta chkadi
                                     sta chksbi
                                     clc
                                     ldx #zp_bss-zero_page ;zeropage - write test area
                             gcs3    adc zero_page,x
                                     bcc gcs2
                                     inc ram_chksm+1 ;carry to high byte
                                     clc
                             gcs2    inx
                                     bne gcs3
                                     ldx #hi(data_segment) ;set high byte of indirect pointer
                                     stx zpt+1
                                     ldy #lo(data_bss) ;data after write test area
                             gcs5    adc (zpt),y
                                     bcc gcs4
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   20
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     inc ram_chksm+1 ;carry to high byte
                                     clc
                             gcs4    iny
                                     bne gcs5
                                     inx             ;advance RAM high address
                                     stx zpt+1
                                     cpx #ram_top
                                     bne gcs5
                                     sta ram_chksm   ;checksum complete
                                 endif
                             
                                 if skip_part_1 = 1
                                     jmp  bin_test
                                 endif
                                 
                                     next_test            
0406 : ad0002           [ 4]>            lda test_case   ;previous test
0409 : c900             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
040b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0001 =                      >test_num = test_num + 1
040d : a901             [ 2]>            lda #test_num   ;*** this tests' number
040f : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                 
                             ;testing relative addressing with BEQ
0412 : a0fe             [ 2]         ldy #$fe        ;testing maximum range, not -1/-2 (invalid/self adr)
0414 :                       range_loop
0414 : 88               [ 2]         dey             ;next relative address
0415 : 98               [ 2]         tya
0416 : aa               [ 2]         tax             ;precharge count to end of loop
0417 : 1003             [ 3]         bpl range_fw    ;calculate relative address
0419 : 18               [ 2]         clc             ;avoid branch self or to relative address of branch
041a : 6902             [ 2]         adc #2
041c :                       range_fw
041c : 497f             [ 2]         eor #$7f        ;complement except sign
041e : 8da504           [ 4]         sta range_adr   ;load into test target
0421 : a900             [ 2]         lda #0          ;should set zero flag in status register
0423 : 4ca404           [ 3]         jmp range_op
                                     
                                     ;relative address target field with branch under test in the middle                       
0426 : ca               [ 2]         dex             ;-128 - max backward
0427 : ca               [ 2]         dex
0428 : ca               [ 2]         dex
0429 : ca               [ 2]         dex
042a : ca               [ 2]         dex
042b : ca               [ 2]         dex
042c : ca               [ 2]         dex
042d : ca               [ 2]         dex
042e : ca               [ 2]         dex             ;-120
042f : ca               [ 2]         dex
0430 : ca               [ 2]         dex
0431 : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   21
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0432 : ca               [ 2]         dex
0433 : ca               [ 2]         dex
0434 : ca               [ 2]         dex
0435 : ca               [ 2]         dex
0436 : ca               [ 2]         dex
0437 : ca               [ 2]         dex
0438 : ca               [ 2]         dex             ;-110
0439 : ca               [ 2]         dex
043a : ca               [ 2]         dex
043b : ca               [ 2]         dex
043c : ca               [ 2]         dex
043d : ca               [ 2]         dex
043e : ca               [ 2]         dex
043f : ca               [ 2]         dex
0440 : ca               [ 2]         dex
0441 : ca               [ 2]         dex
0442 : ca               [ 2]         dex             ;-100
0443 : ca               [ 2]         dex
0444 : ca               [ 2]         dex
0445 : ca               [ 2]         dex
0446 : ca               [ 2]         dex
0447 : ca               [ 2]         dex
0448 : ca               [ 2]         dex
0449 : ca               [ 2]         dex
044a : ca               [ 2]         dex
044b : ca               [ 2]         dex
044c : ca               [ 2]         dex             ;-90
044d : ca               [ 2]         dex
044e : ca               [ 2]         dex
044f : ca               [ 2]         dex
0450 : ca               [ 2]         dex
0451 : ca               [ 2]         dex
0452 : ca               [ 2]         dex
0453 : ca               [ 2]         dex
0454 : ca               [ 2]         dex
0455 : ca               [ 2]         dex
0456 : ca               [ 2]         dex             ;-80
0457 : ca               [ 2]         dex
0458 : ca               [ 2]         dex
0459 : ca               [ 2]         dex
045a : ca               [ 2]         dex
045b : ca               [ 2]         dex
045c : ca               [ 2]         dex
045d : ca               [ 2]         dex
045e : ca               [ 2]         dex
045f : ca               [ 2]         dex
0460 : ca               [ 2]         dex             ;-70
0461 : ca               [ 2]         dex
0462 : ca               [ 2]         dex
0463 : ca               [ 2]         dex
0464 : ca               [ 2]         dex
0465 : ca               [ 2]         dex
0466 : ca               [ 2]         dex
0467 : ca               [ 2]         dex
0468 : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   22
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0469 : ca               [ 2]         dex
046a : ca               [ 2]         dex             ;-60
046b : ca               [ 2]         dex
046c : ca               [ 2]         dex
046d : ca               [ 2]         dex
046e : ca               [ 2]         dex
046f : ca               [ 2]         dex
0470 : ca               [ 2]         dex
0471 : ca               [ 2]         dex
0472 : ca               [ 2]         dex
0473 : ca               [ 2]         dex
0474 : ca               [ 2]         dex             ;-50
0475 : ca               [ 2]         dex
0476 : ca               [ 2]         dex
0477 : ca               [ 2]         dex
0478 : ca               [ 2]         dex
0479 : ca               [ 2]         dex
047a : ca               [ 2]         dex
047b : ca               [ 2]         dex
047c : ca               [ 2]         dex
047d : ca               [ 2]         dex
047e : ca               [ 2]         dex             ;-40
047f : ca               [ 2]         dex
0480 : ca               [ 2]         dex
0481 : ca               [ 2]         dex
0482 : ca               [ 2]         dex
0483 : ca               [ 2]         dex
0484 : ca               [ 2]         dex
0485 : ca               [ 2]         dex
0486 : ca               [ 2]         dex
0487 : ca               [ 2]         dex
0488 : ca               [ 2]         dex             ;-30
0489 : ca               [ 2]         dex
048a : ca               [ 2]         dex
048b : ca               [ 2]         dex
048c : ca               [ 2]         dex
048d : ca               [ 2]         dex
048e : ca               [ 2]         dex
048f : ca               [ 2]         dex
0490 : ca               [ 2]         dex
0491 : ca               [ 2]         dex
0492 : ca               [ 2]         dex             ;-20
0493 : ca               [ 2]         dex
0494 : ca               [ 2]         dex
0495 : ca               [ 2]         dex
0496 : ca               [ 2]         dex
0497 : ca               [ 2]         dex
0498 : ca               [ 2]         dex
0499 : ca               [ 2]         dex
049a : ca               [ 2]         dex
049b : ca               [ 2]         dex
049c : ca               [ 2]         dex             ;-10
049d : ca               [ 2]         dex
049e : ca               [ 2]         dex
049f : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   23
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

04a0 : ca               [ 2]         dex
04a1 : ca               [ 2]         dex
04a2 : ca               [ 2]         dex
04a3 : ca               [ 2]         dex             ;-3
04a4 :                       range_op                ;test target with zero flag=0, z=1 if previous dex
04a5 =                       range_adr   = *+1       ;modifiable relative address
04a4 : f03e             [ 3]         beq *+64        ;if called without modification
04a6 : ca               [ 2]         dex             ;+0
04a7 : ca               [ 2]         dex
04a8 : ca               [ 2]         dex
04a9 : ca               [ 2]         dex
04aa : ca               [ 2]         dex
04ab : ca               [ 2]         dex
04ac : ca               [ 2]         dex
04ad : ca               [ 2]         dex
04ae : ca               [ 2]         dex
04af : ca               [ 2]         dex
04b0 : ca               [ 2]         dex             ;+10
04b1 : ca               [ 2]         dex
04b2 : ca               [ 2]         dex
04b3 : ca               [ 2]         dex
04b4 : ca               [ 2]         dex
04b5 : ca               [ 2]         dex
04b6 : ca               [ 2]         dex
04b7 : ca               [ 2]         dex
04b8 : ca               [ 2]         dex
04b9 : ca               [ 2]         dex
04ba : ca               [ 2]         dex             ;+20
04bb : ca               [ 2]         dex
04bc : ca               [ 2]         dex
04bd : ca               [ 2]         dex
04be : ca               [ 2]         dex
04bf : ca               [ 2]         dex
04c0 : ca               [ 2]         dex
04c1 : ca               [ 2]         dex
04c2 : ca               [ 2]         dex
04c3 : ca               [ 2]         dex
04c4 : ca               [ 2]         dex             ;+30
04c5 : ca               [ 2]         dex
04c6 : ca               [ 2]         dex
04c7 : ca               [ 2]         dex
04c8 : ca               [ 2]         dex
04c9 : ca               [ 2]         dex
04ca : ca               [ 2]         dex
04cb : ca               [ 2]         dex
04cc : ca               [ 2]         dex
04cd : ca               [ 2]         dex
04ce : ca               [ 2]         dex             ;+40
04cf : ca               [ 2]         dex
04d0 : ca               [ 2]         dex
04d1 : ca               [ 2]         dex
04d2 : ca               [ 2]         dex
04d3 : ca               [ 2]         dex
04d4 : ca               [ 2]         dex
04d5 : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   24
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

04d6 : ca               [ 2]         dex
04d7 : ca               [ 2]         dex
04d8 : ca               [ 2]         dex             ;+50
04d9 : ca               [ 2]         dex
04da : ca               [ 2]         dex
04db : ca               [ 2]         dex
04dc : ca               [ 2]         dex
04dd : ca               [ 2]         dex
04de : ca               [ 2]         dex
04df : ca               [ 2]         dex
04e0 : ca               [ 2]         dex
04e1 : ca               [ 2]         dex
04e2 : ca               [ 2]         dex             ;+60
04e3 : ca               [ 2]         dex
04e4 : ca               [ 2]         dex
04e5 : ca               [ 2]         dex
04e6 : ca               [ 2]         dex
04e7 : ca               [ 2]         dex
04e8 : ca               [ 2]         dex
04e9 : ca               [ 2]         dex
04ea : ca               [ 2]         dex
04eb : ca               [ 2]         dex
04ec : ca               [ 2]         dex             ;+70
04ed : ca               [ 2]         dex
04ee : ca               [ 2]         dex
04ef : ca               [ 2]         dex
04f0 : ca               [ 2]         dex
04f1 : ca               [ 2]         dex
04f2 : ca               [ 2]         dex
04f3 : ca               [ 2]         dex
04f4 : ca               [ 2]         dex
04f5 : ca               [ 2]         dex
04f6 : ca               [ 2]         dex             ;+80
04f7 : ca               [ 2]         dex
04f8 : ca               [ 2]         dex
04f9 : ca               [ 2]         dex
04fa : ca               [ 2]         dex
04fb : ca               [ 2]         dex
04fc : ca               [ 2]         dex
04fd : ca               [ 2]         dex
04fe : ca               [ 2]         dex
04ff : ca               [ 2]         dex
0500 : ca               [ 2]         dex             ;+90
0501 : ca               [ 2]         dex
0502 : ca               [ 2]         dex
0503 : ca               [ 2]         dex
0504 : ca               [ 2]         dex
0505 : ca               [ 2]         dex
0506 : ca               [ 2]         dex
0507 : ca               [ 2]         dex
0508 : ca               [ 2]         dex
0509 : ca               [ 2]         dex
050a : ca               [ 2]         dex             ;+100
050b : ca               [ 2]         dex
050c : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   25
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

050d : ca               [ 2]         dex
050e : ca               [ 2]         dex
050f : ca               [ 2]         dex
0510 : ca               [ 2]         dex
0511 : ca               [ 2]         dex
0512 : ca               [ 2]         dex
0513 : ca               [ 2]         dex
0514 : ca               [ 2]         dex             ;+110
0515 : ca               [ 2]         dex
0516 : ca               [ 2]         dex
0517 : ca               [ 2]         dex
0518 : ca               [ 2]         dex
0519 : ca               [ 2]         dex
051a : ca               [ 2]         dex
051b : ca               [ 2]         dex
051c : ca               [ 2]         dex
051d : ca               [ 2]         dex
051e : ca               [ 2]         dex             ;+120
051f : ca               [ 2]         dex
0520 : ca               [ 2]         dex
0521 : ca               [ 2]         dex
0522 : ca               [ 2]         dex
0523 : ca               [ 2]         dex
0524 : ca               [ 2]         dex
0525 : f003             [ 3]         beq range_ok    ;+127 - max forward
                                     trap            ; bad range
0527 : 4c2705           [ 3]>        jmp *           ;failed anyway
                             
052a :                       range_ok
052a : c000             [ 2]         cpy #0
052c : f003             [ 3]         beq range_end   
052e : 4c1404           [ 3]         jmp range_loop
0531 :                       range_end               ;range test successful
                                     next_test
0531 : ad0002           [ 4]>            lda test_case   ;previous test
0534 : c901             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0536 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0002 =                      >test_num = test_num + 1
0538 : a902             [ 2]>            lda #test_num   ;*** this tests' number
053a : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ;partial test BNE & CMP, CPX, CPY immediate
053d : c001             [ 2]         cpy #1          ;testing BNE true
053f : d003             [ 3]         bne test_bne
                                     trap 
0541 : 4c4105           [ 3]>        jmp *           ;failed anyway
                             
0544 :                       test_bne
0544 : a900             [ 2]         lda #0 
0546 : c900             [ 2]         cmp #0          ;test compare immediate 
                                     trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   26
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0548 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     trap_cc
054a : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
                                     trap_mi
054c : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
054e : c901             [ 2]         cmp #1
                                     trap_eq 
0550 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     trap_cs
0552 : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     trap_pl
0554 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
                             
0556 : aa               [ 2]         tax 
0557 : e000             [ 2]         cpx #0          ;test compare x immediate
                                     trap_ne
0559 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     trap_cc
055b : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
                                     trap_mi
055d : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
055f : e001             [ 2]         cpx #1
                                     trap_eq 
0561 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     trap_cs
0563 : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     trap_pl
0565 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
                             
0567 : a8               [ 2]         tay 
0568 : c000             [ 2]         cpy #0          ;test compare y immediate
                                     trap_ne
056a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     trap_cc
056c : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
                                     trap_mi
056e : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
0570 : c001             [ 2]         cpy #1
                                     trap_eq 
0572 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     trap_cs
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   27
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0574 : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     trap_pl
0576 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
                             
                                     next_test
0578 : ad0002           [ 4]>            lda test_case   ;previous test
057b : c902             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
057d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0003 =                      >test_num = test_num + 1
057f : a903             [ 2]>            lda #test_num   ;*** this tests' number
0581 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             ;testing stack operations PHA PHP PLA PLP
                                         
0584 : a2ff             [ 2]         ldx #$ff        ;initialize stack
0586 : 9a               [ 2]         txs
0587 : a955             [ 2]         lda #$55
0589 : 48               [ 3]         pha
058a : a9aa             [ 2]         lda #$aa
058c : 48               [ 3]         pha
058d : cdfe01           [ 4]         cmp $1fe        ;on stack ?
                                     trap_ne
0590 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0592 : ba               [ 2]         tsx
0593 : 8a               [ 2]         txa             ;overwrite accu
0594 : c9fd             [ 2]         cmp #$fd        ;sp decremented?
                                     trap_ne
0596 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0598 : 68               [ 4]         pla
0599 : c9aa             [ 2]         cmp #$aa        ;successful retreived from stack?
                                     trap_ne
059b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
059d : 68               [ 4]         pla
059e : c955             [ 2]         cmp #$55
                                     trap_ne
05a0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
05a2 : cdff01           [ 4]         cmp $1ff        ;remains on stack?
                                     trap_ne
05a5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
05a7 : ba               [ 2]         tsx
05a8 : e0ff             [ 2]         cpx #$ff        ;sp incremented?
                                     trap_ne
05aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     next_test
05ac : ad0002           [ 4]>            lda test_case   ;previous test
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   28
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

05af : c903             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
05b1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0004 =                      >test_num = test_num + 1
05b3 : a904             [ 2]>            lda #test_num   ;*** this tests' number
05b5 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ;testing branch decisions BPL BMI BVC BVS BCC BCS BNE BEQ
                                     set_stat $ff    ;all on
                            >            load_flag $ff    
05b8 : a9ff             [ 2]>            lda #$ff                 ;allow test to change I-flag (no mask)
                            >
05ba : 48               [ 3]>            pha         ;use stack to load status
05bb : 28               [ 4]>            plp
                             
05bc : 101a             [ 3]         bpl nbr1        ;branches should not be taken
05be : 501b             [ 3]         bvc nbr2
05c0 : 901c             [ 3]         bcc nbr3
05c2 : d01d             [ 3]         bne nbr4
05c4 : 3003             [ 3]         bmi br1         ;branches should be taken
                                     trap 
05c6 : 4cc605           [ 3]>        jmp *           ;failed anyway
                             
05c9 : 7003             [ 3] br1     bvs br2
                                     trap 
05cb : 4ccb05           [ 3]>        jmp *           ;failed anyway
                             
05ce : b003             [ 3] br2     bcs br3
                                     trap 
05d0 : 4cd005           [ 3]>        jmp *           ;failed anyway
                             
05d3 : f00f             [ 3] br3     beq br4
                                     trap 
05d5 : 4cd505           [ 3]>        jmp *           ;failed anyway
                             
05d8 :                       nbr1
                                     trap            ;previous bpl taken 
05d8 : 4cd805           [ 3]>        jmp *           ;failed anyway
                             
05db :                       nbr2
                                     trap            ;previous bvc taken
05db : 4cdb05           [ 3]>        jmp *           ;failed anyway
                             
05de :                       nbr3
                                     trap            ;previous bcc taken
05de : 4cde05           [ 3]>        jmp *           ;failed anyway
                             
05e1 :                       nbr4
                                     trap            ;previous bne taken
05e1 : 4ce105           [ 3]>        jmp *           ;failed anyway
                             
05e4 : 08               [ 3] br4     php
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   29
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

05e5 : ba               [ 2]         tsx
05e6 : e0fe             [ 2]         cpx #$fe        ;sp after php?
                                     trap_ne
05e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
05ea : 68               [ 4]         pla
                                     cmp_flag $ff    ;returned all flags on?
05eb : c9ff             [ 2]>            cmp #($ff    |fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
05ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
05ef : ba               [ 2]         tsx
05f0 : e0ff             [ 2]         cpx #$ff        ;sp after php?
                                     trap_ne
05f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0      ;all off
                            >            load_flag 0      
05f4 : a900             [ 2]>            lda #0                   ;allow test to change I-flag (no mask)
                            >
05f6 : 48               [ 3]>            pha         ;use stack to load status
05f7 : 28               [ 4]>            plp
                             
05f8 : 3022             [ 4]         bmi nbr11       ;branches should not be taken
05fa : 7023             [ 4]         bvs nbr12
05fc : b024             [ 4]         bcs nbr13
05fe : f025             [ 4]         beq nbr14
                                     trap_mi  
0600 : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
                                     trap_vs
0602 : 70fe             [ 3]>        bvs *           ;failed overflow set
                             
                                     trap_cs
0604 : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     trap_eq 
0606 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
0608 : 1003             [ 3]         bpl br11        ;branches should be taken
                                     trap 
060a : 4c0a06           [ 3]>        jmp *           ;failed anyway
                             
060d : 5003             [ 3] br11    bvc br12
                                     trap 
060f : 4c0f06           [ 3]>        jmp *           ;failed anyway
                             
0612 : 9003             [ 3] br12    bcc br13
                                     trap 
0614 : 4c1406           [ 3]>        jmp *           ;failed anyway
                             
0617 : d00f             [ 3] br13    bne br14
                                     trap 
0619 : 4c1906           [ 3]>        jmp *           ;failed anyway
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   30
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
061c :                       nbr11
                                     trap            ;previous bmi taken 
061c : 4c1c06           [ 3]>        jmp *           ;failed anyway
                             
061f :                       nbr12
                                     trap            ;previous bvs taken 
061f : 4c1f06           [ 3]>        jmp *           ;failed anyway
                             
0622 :                       nbr13
                                     trap            ;previous bcs taken 
0622 : 4c2206           [ 3]>        jmp *           ;failed anyway
                             
0625 :                       nbr14
                                     trap            ;previous beq taken 
0625 : 4c2506           [ 3]>        jmp *           ;failed anyway
                             
0628 : 08               [ 3] br14    php
0629 : 68               [ 4]         pla
                                     cmp_flag 0      ;flags off except break (pushed by sw) + reserved?
062a : c930             [ 2]>            cmp #(0      |fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
062c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     ;crosscheck flags
                                     set_stat carry
                            >            load_flag carry
062e : a901             [ 2]>            lda #carry             ;allow test to change I-flag (no mask)
                            >
0630 : 48               [ 3]>            pha         ;use stack to load status
0631 : 28               [ 4]>            plp
                             
                                     trap_cc
0632 : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
                                     set_stat zero
                            >            load_flag zero
0634 : a902             [ 2]>            lda #zero             ;allow test to change I-flag (no mask)
                            >
0636 : 48               [ 3]>            pha         ;use stack to load status
0637 : 28               [ 4]>            plp
                             
                                     trap_ne
0638 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat overfl
                            >            load_flag overfl
063a : a940             [ 2]>            lda #overfl             ;allow test to change I-flag (no mask)
                            >
063c : 48               [ 3]>            pha         ;use stack to load status
063d : 28               [ 4]>            plp
                             
                                     trap_vc
063e : 50fe             [ 3]>        bvc *           ;failed overflow clear
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   31
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     set_stat minus
                            >            load_flag minus
0640 : a980             [ 2]>            lda #minus             ;allow test to change I-flag (no mask)
                            >
0642 : 48               [ 3]>            pha         ;use stack to load status
0643 : 28               [ 4]>            plp
                             
                                     trap_pl
0644 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
                             
                                     set_stat $ff-carry
                            >            load_flag $ff-carry
0646 : a9fe             [ 2]>            lda #$ff-carry             ;allow test to change I-flag (no mask)
                            >
0648 : 48               [ 3]>            pha         ;use stack to load status
0649 : 28               [ 4]>            plp
                             
                                     trap_cs
064a : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     set_stat $ff-zero
                            >            load_flag $ff-zero
064c : a9fd             [ 2]>            lda #$ff-zero             ;allow test to change I-flag (no mask)
                            >
064e : 48               [ 3]>            pha         ;use stack to load status
064f : 28               [ 4]>            plp
                             
                                     trap_eq 
0650 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     set_stat $ff-overfl
                            >            load_flag $ff-overfl
0652 : a9bf             [ 2]>            lda #$ff-overfl             ;allow test to change I-flag (no mask)
                            >
0654 : 48               [ 3]>            pha         ;use stack to load status
0655 : 28               [ 4]>            plp
                             
                                     trap_vs
0656 : 70fe             [ 3]>        bvs *           ;failed overflow set
                             
                                     set_stat $ff-minus
                            >            load_flag $ff-minus
0658 : a97f             [ 2]>            lda #$ff-minus             ;allow test to change I-flag (no mask)
                            >
065a : 48               [ 3]>            pha         ;use stack to load status
065b : 28               [ 4]>            plp
                             
                                     trap_mi
065c : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
                                     next_test
065e : ad0002           [ 4]>            lda test_case   ;previous test
0661 : c904             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   32
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0663 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0005 =                      >test_num = test_num + 1
0665 : a905             [ 2]>            lda #test_num   ;*** this tests' number
0667 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; test PHA does not alter flags or accumulator but PLA does
066a : a255             [ 2]         ldx #$55        ;x & y protected
066c : a0aa             [ 2]         ldy #$aa
                                     set_a 1,$ff     ;push
                            >            load_flag $ff     
066e : a9ff             [ 2]>            lda #$ff                  ;allow test to change I-flag (no mask)
                            >
0670 : 48               [ 3]>            pha         ;use stack to load status
0671 : a901             [ 2]>            lda #1     ;precharge accu
0673 : 28               [ 4]>            plp
                             
0674 : 48               [ 3]         pha
                                     tst_a 1,$ff
0675 : 08               [ 3]>            php         ;save flags
0676 : 08               [ 3]>            php
0677 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
0679 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
067b : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff
067c : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
067e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0680 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 0,0
                            >            load_flag 0
0681 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0683 : 48               [ 3]>            pha         ;use stack to load status
0684 : a900             [ 2]>            lda #0     ;precharge accu
0686 : 28               [ 4]>            plp
                             
0687 : 48               [ 3]         pha
                                     tst_a 0,0
0688 : 08               [ 3]>            php         ;save flags
0689 : 08               [ 3]>            php
068a : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
068c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
068e : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
068f : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   33
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                            >            trap_ne
0691 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0693 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $ff,$ff
                            >            load_flag $ff
0694 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0696 : 48               [ 3]>            pha         ;use stack to load status
0697 : a9ff             [ 2]>            lda #$ff     ;precharge accu
0699 : 28               [ 4]>            plp
                             
069a : 48               [ 3]         pha
                                     tst_a $ff,$ff
069b : 08               [ 3]>            php         ;save flags
069c : 08               [ 3]>            php
069d : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
069f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06a1 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff
06a2 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
06a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06a6 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,0
                            >            load_flag 0
06a7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
06a9 : 48               [ 3]>            pha         ;use stack to load status
06aa : a901             [ 2]>            lda #1     ;precharge accu
06ac : 28               [ 4]>            plp
                             
06ad : 48               [ 3]         pha
                                     tst_a 1,0
06ae : 08               [ 3]>            php         ;save flags
06af : 08               [ 3]>            php
06b0 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
06b2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06b4 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
06b5 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
06b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06b9 : 28               [ 4]>            plp         ;restore status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   34
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     set_a 0,$ff
                            >            load_flag $ff
06ba : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
06bc : 48               [ 3]>            pha         ;use stack to load status
06bd : a900             [ 2]>            lda #0     ;precharge accu
06bf : 28               [ 4]>            plp
                             
06c0 : 48               [ 3]         pha
                                     tst_a 0,$ff
06c1 : 08               [ 3]>            php         ;save flags
06c2 : 08               [ 3]>            php
06c3 : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
06c5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06c7 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff
06c8 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
06ca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06cc : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $ff,0
                            >            load_flag 0
06cd : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
06cf : 48               [ 3]>            pha         ;use stack to load status
06d0 : a9ff             [ 2]>            lda #$ff     ;precharge accu
06d2 : 28               [ 4]>            plp
                             
06d3 : 48               [ 3]         pha
                                     tst_a $ff,0
06d4 : 08               [ 3]>            php         ;save flags
06d5 : 08               [ 3]>            php
06d6 : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
06d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06da : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
06db : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
06dd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06df : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 0,$ff     ;pull
                            >            load_flag $ff     
06e0 : a9ff             [ 2]>            lda #$ff                  ;allow test to change I-flag (no mask)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   35
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

06e2 : 48               [ 3]>            pha         ;use stack to load status
06e3 : a900             [ 2]>            lda #0     ;precharge accu
06e5 : 28               [ 4]>            plp
                             
06e6 : 68               [ 4]         pla
                                     tst_a $ff,$ff-zero
06e7 : 08               [ 3]>            php         ;save flags
06e8 : 08               [ 3]>            php
06e9 : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
06eb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06ed : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
06ee : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
06f0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
06f2 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $ff,0
                            >            load_flag 0
06f3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
06f5 : 48               [ 3]>            pha         ;use stack to load status
06f6 : a9ff             [ 2]>            lda #$ff     ;precharge accu
06f8 : 28               [ 4]>            plp
                             
06f9 : 68               [ 4]         pla
                                     tst_a 0,zero
06fa : 08               [ 3]>            php         ;save flags
06fb : 08               [ 3]>            php
06fc : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
06fe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0700 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
0701 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0703 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0705 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $fe,$ff
                            >            load_flag $ff
0706 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0708 : 48               [ 3]>            pha         ;use stack to load status
0709 : a9fe             [ 2]>            lda #$fe     ;precharge accu
070b : 28               [ 4]>            plp
                             
070c : 68               [ 4]         pla
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   36
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     tst_a 1,$ff-zero-minus
070d : 08               [ 3]>            php         ;save flags
070e : 08               [ 3]>            php
070f : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
0711 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0713 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero-minus
0714 : c97d             [ 2]>            cmp #($ff-zero-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0716 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0718 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 0,0
                            >            load_flag 0
0719 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
071b : 48               [ 3]>            pha         ;use stack to load status
071c : a900             [ 2]>            lda #0     ;precharge accu
071e : 28               [ 4]>            plp
                             
071f : 68               [ 4]         pla
                                     tst_a $ff,minus
0720 : 08               [ 3]>            php         ;save flags
0721 : 08               [ 3]>            php
0722 : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
0724 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0726 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
0727 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0729 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
072b : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $ff,$ff
                            >            load_flag $ff
072c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
072e : 48               [ 3]>            pha         ;use stack to load status
072f : a9ff             [ 2]>            lda #$ff     ;precharge accu
0731 : 28               [ 4]>            plp
                             
0732 : 68               [ 4]         pla
                                     tst_a 0,$ff-minus
0733 : 08               [ 3]>            php         ;save flags
0734 : 08               [ 3]>            php
0735 : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   37
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0737 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0739 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
073a : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
073c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
073e : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $fe,0
                            >            load_flag 0
073f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0741 : 48               [ 3]>            pha         ;use stack to load status
0742 : a9fe             [ 2]>            lda #$fe     ;precharge accu
0744 : 28               [ 4]>            plp
                             
0745 : 68               [ 4]         pla
                                     tst_a 1,0
0746 : 08               [ 3]>            php         ;save flags
0747 : 08               [ 3]>            php
0748 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
074a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
074c : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
074d : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
074f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0751 : 28               [ 4]>            plp         ;restore status
                             
0752 : e055             [ 2]         cpx #$55        ;x & y unchanged?
                                     trap_ne
0754 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0756 : c0aa             [ 2]         cpy #$aa
                                     trap_ne
0758 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     next_test
075a : ad0002           [ 4]>            lda test_case   ;previous test
075d : c905             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
075f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0006 =                      >test_num = test_num + 1
0761 : a906             [ 2]>            lda #test_num   ;*** this tests' number
0763 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   38
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                              
                             ; partial pretest EOR #
                                     set_a $3c,0
                            >            load_flag 0
0766 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0768 : 48               [ 3]>            pha         ;use stack to load status
0769 : a93c             [ 2]>            lda #$3c     ;precharge accu
076b : 28               [ 4]>            plp
                             
076c : 49c3             [ 2]         eor #$c3
                                     tst_a $ff,fn
076e : 08               [ 3]>            php         ;save flags
076f : 08               [ 3]>            php
0770 : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
0772 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0774 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
0775 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0777 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0779 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $c3,0
                            >            load_flag 0
077a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
077c : 48               [ 3]>            pha         ;use stack to load status
077d : a9c3             [ 2]>            lda #$c3     ;precharge accu
077f : 28               [ 4]>            plp
                             
0780 : 49c3             [ 2]         eor #$c3
                                     tst_a 0,fz
0782 : 08               [ 3]>            php         ;save flags
0783 : 08               [ 3]>            php
0784 : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
0786 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0788 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fz
0789 : c932             [ 2]>            cmp #(fz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
078b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
078d : 28               [ 4]>            plp         ;restore status
                             
                                     next_test
078e : ad0002           [ 4]>            lda test_case   ;previous test
0791 : c906             [ 2]>            cmp #test_num
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   39
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            trap_ne         ;test is out of sequence
0793 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0007 =                      >test_num = test_num + 1
0795 : a907             [ 2]>            lda #test_num   ;*** this tests' number
0797 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; PC modifying instructions except branches (NOP, JMP, JSR, RTS, BRK, RTI)
                             ; testing NOP
079a : a224             [ 2]         ldx #$24
079c : a042             [ 2]         ldy #$42
                                     set_a $18,0
                            >            load_flag 0
079e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
07a0 : 48               [ 3]>            pha         ;use stack to load status
07a1 : a918             [ 2]>            lda #$18     ;precharge accu
07a3 : 28               [ 4]>            plp
                             
07a4 : ea               [ 2]         nop
                                     tst_a $18,0
07a5 : 08               [ 3]>            php         ;save flags
07a6 : 08               [ 3]>            php
07a7 : c918             [ 2]>            cmp #$18     ;test result
                            >            trap_ne
07a9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
07ab : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
07ac : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
07ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
07b0 : 28               [ 4]>            plp         ;restore status
                             
07b1 : e024             [ 2]         cpx #$24
                                     trap_ne
07b3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
07b5 : c042             [ 2]         cpy #$42
                                     trap_ne
07b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
07b9 : a2db             [ 2]         ldx #$db
07bb : a0bd             [ 2]         ldy #$bd
                                     set_a $e7,$ff
                            >            load_flag $ff
07bd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
07bf : 48               [ 3]>            pha         ;use stack to load status
07c0 : a9e7             [ 2]>            lda #$e7     ;precharge accu
07c2 : 28               [ 4]>            plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   40
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
07c3 : ea               [ 2]         nop
                                     tst_a $e7,$ff
07c4 : 08               [ 3]>            php         ;save flags
07c5 : 08               [ 3]>            php
07c6 : c9e7             [ 2]>            cmp #$e7     ;test result
                            >            trap_ne
07c8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
07ca : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff
07cb : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
07cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
07cf : 28               [ 4]>            plp         ;restore status
                             
07d0 : e0db             [ 2]         cpx #$db
                                     trap_ne
07d2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
07d4 : c0bd             [ 2]         cpy #$bd
                                     trap_ne
07d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     next_test
07d8 : ad0002           [ 4]>            lda test_case   ;previous test
07db : c907             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
07dd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0008 =                      >test_num = test_num + 1
07df : a908             [ 2]>            lda #test_num   ;*** this tests' number
07e1 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                     
                             ; jump absolute
                                     set_stat $0
                            >            load_flag $0
07e4 : a900             [ 2]>            lda #$0             ;allow test to change I-flag (no mask)
                            >
07e6 : 48               [ 3]>            pha         ;use stack to load status
07e7 : 28               [ 4]>            plp
                             
07e8 : a946             [ 2]         lda #'F'
07ea : a241             [ 2]         ldx #'A'
07ec : a052             [ 2]         ldy #'R'        ;N=0, V=0, Z=0, C=0
07ee : 4c4e35           [ 3]         jmp test_far
07f1 : ea               [ 2]         nop
07f2 : ea               [ 2]         nop
                                     trap_ne         ;runover protection
07f3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   41
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

07f5 : e8               [ 2]         inx
07f6 : e8               [ 2]         inx
07f7 :                       far_ret 
                                     trap_eq         ;returned flags OK?
07f7 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     trap_pl
07f9 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
                             
                                     trap_cc
07fb : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
                                     trap_vc
07fd : 50fe             [ 3]>        bvc *           ;failed overflow clear
                             
07ff : c9ec             [ 2]         cmp #('F'^$aa)  ;returned registers OK?
                                     trap_ne
0801 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0803 : e042             [ 2]         cpx #('A'+1)
                                     trap_ne
0805 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0807 : c04f             [ 2]         cpy #('R'-3)
                                     trap_ne
0809 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
080b : ca               [ 2]         dex
080c : c8               [ 2]         iny
080d : c8               [ 2]         iny
080e : c8               [ 2]         iny
080f : 49aa             [ 2]         eor #$aa        ;N=0, V=1, Z=0, C=1
0811 : 4c1a08           [ 3]         jmp test_near
0814 : ea               [ 2]         nop
0815 : ea               [ 2]         nop
                                     trap_ne         ;runover protection
0816 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0818 : e8               [ 2]         inx
0819 : e8               [ 2]         inx
081a :                       test_near
                                     trap_eq         ;passed flags OK?
081a : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     trap_mi
081c : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
                                     trap_cc
081e : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
                                     trap_vc
0820 : 50fe             [ 3]>        bvc *           ;failed overflow clear
                             
0822 : c946             [ 2]         cmp #'F'        ;passed registers OK?
                                     trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   42
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0824 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0826 : e041             [ 2]         cpx #'A'
                                     trap_ne
0828 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
082a : c052             [ 2]         cpy #'R'
                                     trap_ne
082c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     next_test
082e : ad0002           [ 4]>            lda test_case   ;previous test
0831 : c908             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0833 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0009 =                      >test_num = test_num + 1
0835 : a909             [ 2]>            lda #test_num   ;*** this tests' number
0837 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                     
                             ; jump indirect
                                     set_stat 0
                            >            load_flag 0
083a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
083c : 48               [ 3]>            pha         ;use stack to load status
083d : 28               [ 4]>            plp
                             
083e : a949             [ 2]         lda #'I'
0840 : a24e             [ 2]         ldx #'N'
0842 : a044             [ 2]         ldy #'D'        ;N=0, V=0, Z=0, C=0
0844 : 6c7c35           [ 6]         jmp (ptr_tst_ind)
0847 : ea               [ 2]         nop
                                     trap_ne         ;runover protection
0848 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
084a : 88               [ 2]         dey
084b : 88               [ 2]         dey
084c :                       ind_ret 
084c : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
084d : 88               [ 2]         dey
084e : 88               [ 2]         dey
084f : 88               [ 2]         dey
0850 : 28               [ 4]         plp
                                     trap_eq         ;returned flags OK?
0851 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     trap_pl
0853 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
                             
                                     trap_cc
0855 : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   43
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     trap_vc
0857 : 50fe             [ 3]>        bvc *           ;failed overflow clear
                             
0859 : c9e3             [ 2]         cmp #('I'^$aa)  ;returned registers OK?
                                     trap_ne
085b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
085d : e04f             [ 2]         cpx #('N'+1)
                                     trap_ne
085f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0861 : c03e             [ 2]         cpy #('D'-6)
                                     trap_ne
0863 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0865 : ba               [ 2]         tsx             ;SP check
0866 : e0ff             [ 2]         cpx #$ff
                                     trap_ne
0868 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     next_test
086a : ad0002           [ 4]>            lda test_case   ;previous test
086d : c909             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
086f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
000a =                      >test_num = test_num + 1
0871 : a90a             [ 2]>            lda #test_num   ;*** this tests' number
0873 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; jump subroutine & return from subroutine
                                     set_stat 0
                            >            load_flag 0
0876 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0878 : 48               [ 3]>            pha         ;use stack to load status
0879 : 28               [ 4]>            plp
                             
087a : a94a             [ 2]         lda #'J'
087c : a253             [ 2]         ldx #'S'
087e : a052             [ 2]         ldy #'R'        ;N=0, V=0, Z=0, C=0
0880 : 20b835           [ 6]         jsr test_jsr
0882 =                       jsr_ret = *-1           ;last address of jsr = return address
0883 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
0884 : 88               [ 2]         dey
0885 : 88               [ 2]         dey
0886 : 88               [ 2]         dey
0887 : 28               [ 4]         plp
                                     trap_eq         ;returned flags OK?
0888 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
                                     trap_pl
088a : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   44
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     trap_cc
088c : 90fe             [ 3]>        bcc *           ;failed carry clear
                             
                                     trap_vc
088e : 50fe             [ 3]>        bvc *           ;failed overflow clear
                             
0890 : c9e0             [ 2]         cmp #('J'^$aa)  ;returned registers OK?
                                     trap_ne
0892 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0894 : e054             [ 2]         cpx #('S'+1)
                                     trap_ne
0896 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0898 : c04c             [ 2]         cpy #('R'-6)
                                     trap_ne
089a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
089c : ba               [ 2]         tsx             ;sp?
089d : e0ff             [ 2]         cpx #$ff
                                     trap_ne
089f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     next_test
08a1 : ad0002           [ 4]>            lda test_case   ;previous test
08a4 : c90a             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
08a6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
000b =                      >test_num = test_num + 1
08a8 : a90b             [ 2]>            lda #test_num   ;*** this tests' number
08aa : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; break & return from interrupt
                                 if ROM_vectors = 1
                                     set_stat 0
                            >            load_flag 0
08ad : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
08af : 48               [ 3]>            pha         ;use stack to load status
08b0 : 28               [ 4]>            plp
                             
08b1 : a942             [ 2]         lda #'B'
08b3 : a252             [ 2]         ldx #'R'
08b5 : a04b             [ 2]         ldy #'K'        ;N=0, V=0, Z=0, C=0
08b7 : 00               [ 7]         brk
                                 else
                                     lda #hi brk_ret ;emulated break
                                     pha
                                     lda #lo brk_ret
                                     pha
                                     lda #fao        ;set break & unused on stack
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   45
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     pha
                                     set_stat intdis
                                     lda #'B'
                                     ldx #'R'
                                     ldy #'K'        ;N=0, V=0, Z=0, C=0
                                     jmp irq_trap
                                 endif
08b8 : 88               [ 2]         dey             ;should not be executed
08b9 :                       brk_ret                 ;address of break return
08b9 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
08ba : 88               [ 2]         dey
08bb : 88               [ 2]         dey
08bc : 88               [ 2]         dey
08bd : c9e8             [ 2]         cmp #('B'^$aa)  ;returned registers OK?
                                     trap_ne
08bf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
08c1 : e053             [ 2]         cpx #('R'+1)
                                     trap_ne
08c3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
08c5 : c045             [ 2]         cpy #('K'-6)
                                     trap_ne
08c7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
08c9 : 68               [ 4]         pla             ;returned flags OK (unchanged)?
                                     cmp_flag 0
08ca : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
08cc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
08ce : ba               [ 2]         tsx             ;sp?
08cf : e0ff             [ 2]         cpx #$ff
                                     trap_ne
08d1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     next_test
08d3 : ad0002           [ 4]>            lda test_case   ;previous test
08d6 : c90b             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
08d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
000c =                      >test_num = test_num + 1
08da : a90c             [ 2]>            lda #test_num   ;*** this tests' number
08dc : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                              
                             ; test set and clear flags CLC CLI CLD CLV SEC SEI SED
                                     set_stat $ff
                            >            load_flag $ff
08df : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
08e1 : 48               [ 3]>            pha         ;use stack to load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   46
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

08e2 : 28               [ 4]>            plp
                             
08e3 : 18               [ 2]         clc
                                     tst_stat $ff-carry
08e4 : 08               [ 3]>            php         ;save status
08e5 : 08               [ 3]>            php         ;use stack to retrieve status
08e6 : 68               [ 4]>            pla
                            >            cmp_flag $ff-carry
08e7 : c9fe             [ 2]>            cmp #($ff-carry|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
08e9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
08eb : 28               [ 4]>            plp         ;restore status
                             
08ec : 38               [ 2]         sec
                                     tst_stat $ff
08ed : 08               [ 3]>            php         ;save status
08ee : 08               [ 3]>            php         ;use stack to retrieve status
08ef : 68               [ 4]>            pla
                            >            cmp_flag $ff
08f0 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
08f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
08f4 : 28               [ 4]>            plp         ;restore status
                             
                                 if I_flag = 3
08f5 : 58               [ 2]         cli
                                     tst_stat $ff-intdis
08f6 : 08               [ 3]>            php         ;save status
08f7 : 08               [ 3]>            php         ;use stack to retrieve status
08f8 : 68               [ 4]>            pla
                            >            cmp_flag $ff-intdis
08f9 : c9fb             [ 2]>            cmp #($ff-intdis|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
08fb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
08fd : 28               [ 4]>            plp         ;restore status
                             
08fe : 78               [ 2]         sei
                                     tst_stat $ff
08ff : 08               [ 3]>            php         ;save status
0900 : 08               [ 3]>            php         ;use stack to retrieve status
0901 : 68               [ 4]>            pla
                            >            cmp_flag $ff
0902 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0904 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0906 : 28               [ 4]>            plp         ;restore status
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   47
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                 endif
0907 : d8               [ 2]         cld
                                     tst_stat $ff-decmode
0908 : 08               [ 3]>            php         ;save status
0909 : 08               [ 3]>            php         ;use stack to retrieve status
090a : 68               [ 4]>            pla
                            >            cmp_flag $ff-decmode
090b : c9f7             [ 2]>            cmp #($ff-decmode|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
090d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
090f : 28               [ 4]>            plp         ;restore status
                             
0910 : f8               [ 2]         sed
                                     tst_stat $ff
0911 : 08               [ 3]>            php         ;save status
0912 : 08               [ 3]>            php         ;use stack to retrieve status
0913 : 68               [ 4]>            pla
                            >            cmp_flag $ff
0914 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0916 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0918 : 28               [ 4]>            plp         ;restore status
                             
0919 : b8               [ 2]         clv
                                     tst_stat $ff-overfl
091a : 08               [ 3]>            php         ;save status
091b : 08               [ 3]>            php         ;use stack to retrieve status
091c : 68               [ 4]>            pla
                            >            cmp_flag $ff-overfl
091d : c9bf             [ 2]>            cmp #($ff-overfl|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
091f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0921 : 28               [ 4]>            plp         ;restore status
                             
                                     set_stat 0
                            >            load_flag 0
0922 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0924 : 48               [ 3]>            pha         ;use stack to load status
0925 : 28               [ 4]>            plp
                             
                                     tst_stat 0
0926 : 08               [ 3]>            php         ;save status
0927 : 08               [ 3]>            php         ;use stack to retrieve status
0928 : 68               [ 4]>            pla
                            >            cmp_flag 0
0929 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   48
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

092b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
092d : 28               [ 4]>            plp         ;restore status
                             
092e : 38               [ 2]         sec
                                     tst_stat carry
092f : 08               [ 3]>            php         ;save status
0930 : 08               [ 3]>            php         ;use stack to retrieve status
0931 : 68               [ 4]>            pla
                            >            cmp_flag carry
0932 : c931             [ 2]>            cmp #(carry|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0934 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0936 : 28               [ 4]>            plp         ;restore status
                             
0937 : 18               [ 2]         clc
                                     tst_stat 0  
0938 : 08               [ 3]>            php         ;save status
0939 : 08               [ 3]>            php         ;use stack to retrieve status
093a : 68               [ 4]>            pla
                            >            cmp_flag 0  
093b : c930             [ 2]>            cmp #(0  |fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
093d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
093f : 28               [ 4]>            plp         ;restore status
                             
                                 if I_flag = 3
0940 : 78               [ 2]         sei
                                     tst_stat intdis
0941 : 08               [ 3]>            php         ;save status
0942 : 08               [ 3]>            php         ;use stack to retrieve status
0943 : 68               [ 4]>            pla
                            >            cmp_flag intdis
0944 : c934             [ 2]>            cmp #(intdis|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0946 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0948 : 28               [ 4]>            plp         ;restore status
                             
0949 : 58               [ 2]         cli
                                     tst_stat 0
094a : 08               [ 3]>            php         ;save status
094b : 08               [ 3]>            php         ;use stack to retrieve status
094c : 68               [ 4]>            pla
                            >            cmp_flag 0
094d : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
094f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   49
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0951 : 28               [ 4]>            plp         ;restore status
                             
                                 endif  
0952 : f8               [ 2]         sed
                                     tst_stat decmode
0953 : 08               [ 3]>            php         ;save status
0954 : 08               [ 3]>            php         ;use stack to retrieve status
0955 : 68               [ 4]>            pla
                            >            cmp_flag decmode
0956 : c938             [ 2]>            cmp #(decmode|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0958 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
095a : 28               [ 4]>            plp         ;restore status
                             
095b : d8               [ 2]         cld
                                     tst_stat 0  
095c : 08               [ 3]>            php         ;save status
095d : 08               [ 3]>            php         ;use stack to retrieve status
095e : 68               [ 4]>            pla
                            >            cmp_flag 0  
095f : c930             [ 2]>            cmp #(0  |fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0961 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0963 : 28               [ 4]>            plp         ;restore status
                             
                                     set_stat overfl
                            >            load_flag overfl
0964 : a940             [ 2]>            lda #overfl             ;allow test to change I-flag (no mask)
                            >
0966 : 48               [ 3]>            pha         ;use stack to load status
0967 : 28               [ 4]>            plp
                             
                                     tst_stat overfl
0968 : 08               [ 3]>            php         ;save status
0969 : 08               [ 3]>            php         ;use stack to retrieve status
096a : 68               [ 4]>            pla
                            >            cmp_flag overfl
096b : c970             [ 2]>            cmp #(overfl|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
096d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
096f : 28               [ 4]>            plp         ;restore status
                             
0970 : b8               [ 2]         clv
                                     tst_stat 0
0971 : 08               [ 3]>            php         ;save status
0972 : 08               [ 3]>            php         ;use stack to retrieve status
0973 : 68               [ 4]>            pla
                            >            cmp_flag 0
0974 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   50
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                            >            trap_ne
0976 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0978 : 28               [ 4]>            plp         ;restore status
                             
                                     next_test
0979 : ad0002           [ 4]>            lda test_case   ;previous test
097c : c90c             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
097e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
000d =                      >test_num = test_num + 1
0980 : a90d             [ 2]>            lda #test_num   ;*** this tests' number
0982 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             ; testing index register increment/decrement and transfer
                             ; INX INY DEX DEY TAX TXA TAY TYA 
0985 : a2fe             [ 2]         ldx #$fe
                                     set_stat $ff
                            >            load_flag $ff
0987 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0989 : 48               [ 3]>            pha         ;use stack to load status
098a : 28               [ 4]>            plp
                             
098b : e8               [ 2]         inx             ;ff
                                     tst_x $ff,$ff-zero
098c : 08               [ 3]>            php         ;save flags
098d : 08               [ 3]>            php
098e : e0ff             [ 2]>            cpx #$ff     ;test result
                            >            trap_ne
0990 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0992 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
0993 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0995 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0997 : 28               [ 4]>            plp         ;restore status
                             
0998 : e8               [ 2]         inx             ;00
                                     tst_x 0,$ff-minus
0999 : 08               [ 3]>            php         ;save flags
099a : 08               [ 3]>            php
099b : e000             [ 2]>            cpx #0     ;test result
                            >            trap_ne
099d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
099f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
09a0 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   51
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                            >            trap_ne
09a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09a4 : 28               [ 4]>            plp         ;restore status
                             
09a5 : e8               [ 2]         inx             ;01
                                     tst_x 1,$ff-minus-zero
09a6 : 08               [ 3]>            php         ;save flags
09a7 : 08               [ 3]>            php
09a8 : e001             [ 2]>            cpx #1     ;test result
                            >            trap_ne
09aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09ac : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus-zero
09ad : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
09af : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09b1 : 28               [ 4]>            plp         ;restore status
                             
09b2 : ca               [ 2]         dex             ;00
                                     tst_x 0,$ff-minus
09b3 : 08               [ 3]>            php         ;save flags
09b4 : 08               [ 3]>            php
09b5 : e000             [ 2]>            cpx #0     ;test result
                            >            trap_ne
09b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09b9 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
09ba : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
09bc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09be : 28               [ 4]>            plp         ;restore status
                             
09bf : ca               [ 2]         dex             ;ff
                                     tst_x $ff,$ff-zero
09c0 : 08               [ 3]>            php         ;save flags
09c1 : 08               [ 3]>            php
09c2 : e0ff             [ 2]>            cpx #$ff     ;test result
                            >            trap_ne
09c4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09c6 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
09c7 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
09c9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   52
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

09cb : 28               [ 4]>            plp         ;restore status
                             
09cc : ca               [ 2]         dex             ;fe
                                     set_stat 0
                            >            load_flag 0
09cd : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
09cf : 48               [ 3]>            pha         ;use stack to load status
09d0 : 28               [ 4]>            plp
                             
09d1 : e8               [ 2]         inx             ;ff
                                     tst_x $ff,minus
09d2 : 08               [ 3]>            php         ;save flags
09d3 : 08               [ 3]>            php
09d4 : e0ff             [ 2]>            cpx #$ff     ;test result
                            >            trap_ne
09d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09d8 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
09d9 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
09db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09dd : 28               [ 4]>            plp         ;restore status
                             
09de : e8               [ 2]         inx             ;00
                                     tst_x 0,zero
09df : 08               [ 3]>            php         ;save flags
09e0 : 08               [ 3]>            php
09e1 : e000             [ 2]>            cpx #0     ;test result
                            >            trap_ne
09e3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09e5 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
09e6 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
09e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09ea : 28               [ 4]>            plp         ;restore status
                             
09eb : e8               [ 2]         inx             ;01
                                     tst_x 1,0
09ec : 08               [ 3]>            php         ;save flags
09ed : 08               [ 3]>            php
09ee : e001             [ 2]>            cpx #1     ;test result
                            >            trap_ne
09f0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09f2 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
09f3 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   53
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                            >            trap_ne
09f5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09f7 : 28               [ 4]>            plp         ;restore status
                             
09f8 : ca               [ 2]         dex             ;00
                                     tst_x 0,zero
09f9 : 08               [ 3]>            php         ;save flags
09fa : 08               [ 3]>            php
09fb : e000             [ 2]>            cpx #0     ;test result
                            >            trap_ne
09fd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
09ff : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
0a00 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a04 : 28               [ 4]>            plp         ;restore status
                             
0a05 : ca               [ 2]         dex             ;ff
                                     tst_x $ff,minus
0a06 : 08               [ 3]>            php         ;save flags
0a07 : 08               [ 3]>            php
0a08 : e0ff             [ 2]>            cpx #$ff     ;test result
                            >            trap_ne
0a0a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a0c : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
0a0d : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a0f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a11 : 28               [ 4]>            plp         ;restore status
                             
                             
0a12 : a0fe             [ 2]         ldy #$fe
                                     set_stat $ff
                            >            load_flag $ff
0a14 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0a16 : 48               [ 3]>            pha         ;use stack to load status
0a17 : 28               [ 4]>            plp
                             
0a18 : c8               [ 2]         iny             ;ff
                                     tst_y $ff,$ff-zero
0a19 : 08               [ 3]>            php         ;save flags
0a1a : 08               [ 3]>            php
0a1b : c0ff             [ 2]>            cpy #$ff     ;test result
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   54
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0a1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a1f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
0a20 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a24 : 28               [ 4]>            plp         ;restore status
                             
0a25 : c8               [ 2]         iny             ;00
                                     tst_y 0,$ff-minus
0a26 : 08               [ 3]>            php         ;save flags
0a27 : 08               [ 3]>            php
0a28 : c000             [ 2]>            cpy #0     ;test result
                            >            trap_ne
0a2a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a2c : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
0a2d : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a2f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a31 : 28               [ 4]>            plp         ;restore status
                             
0a32 : c8               [ 2]         iny             ;01
                                     tst_y 1,$ff-minus-zero
0a33 : 08               [ 3]>            php         ;save flags
0a34 : 08               [ 3]>            php
0a35 : c001             [ 2]>            cpy #1     ;test result
                            >            trap_ne
0a37 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a39 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus-zero
0a3a : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a3e : 28               [ 4]>            plp         ;restore status
                             
0a3f : 88               [ 2]         dey             ;00
                                     tst_y 0,$ff-minus
0a40 : 08               [ 3]>            php         ;save flags
0a41 : 08               [ 3]>            php
0a42 : c000             [ 2]>            cpy #0     ;test result
                            >            trap_ne
0a44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a46 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   55
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0a47 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a49 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a4b : 28               [ 4]>            plp         ;restore status
                             
0a4c : 88               [ 2]         dey             ;ff
                                     tst_y $ff,$ff-zero
0a4d : 08               [ 3]>            php         ;save flags
0a4e : 08               [ 3]>            php
0a4f : c0ff             [ 2]>            cpy #$ff     ;test result
                            >            trap_ne
0a51 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a53 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
0a54 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a56 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a58 : 28               [ 4]>            plp         ;restore status
                             
0a59 : 88               [ 2]         dey             ;fe
                                     set_stat 0
                            >            load_flag 0
0a5a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0a5c : 48               [ 3]>            pha         ;use stack to load status
0a5d : 28               [ 4]>            plp
                             
0a5e : c8               [ 2]         iny             ;ff
                                     tst_y $ff,0+minus
0a5f : 08               [ 3]>            php         ;save flags
0a60 : 08               [ 3]>            php
0a61 : c0ff             [ 2]>            cpy #$ff     ;test result
                            >            trap_ne
0a63 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a65 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0+minus
0a66 : c9b0             [ 2]>            cmp #(0+minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a68 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a6a : 28               [ 4]>            plp         ;restore status
                             
0a6b : c8               [ 2]         iny             ;00
                                     tst_y 0,zero
0a6c : 08               [ 3]>            php         ;save flags
0a6d : 08               [ 3]>            php
0a6e : c000             [ 2]>            cpy #0     ;test result
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   56
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0a70 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a72 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
0a73 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a75 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a77 : 28               [ 4]>            plp         ;restore status
                             
0a78 : c8               [ 2]         iny             ;01
                                     tst_y 1,0
0a79 : 08               [ 3]>            php         ;save flags
0a7a : 08               [ 3]>            php
0a7b : c001             [ 2]>            cpy #1     ;test result
                            >            trap_ne
0a7d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a7f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
0a80 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a82 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a84 : 28               [ 4]>            plp         ;restore status
                             
0a85 : 88               [ 2]         dey             ;00
                                     tst_y 0,zero
0a86 : 08               [ 3]>            php         ;save flags
0a87 : 08               [ 3]>            php
0a88 : c000             [ 2]>            cpy #0     ;test result
                            >            trap_ne
0a8a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a8c : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
0a8d : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a8f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a91 : 28               [ 4]>            plp         ;restore status
                             
0a92 : 88               [ 2]         dey             ;ff
                                     tst_y $ff,minus
0a93 : 08               [ 3]>            php         ;save flags
0a94 : 08               [ 3]>            php
0a95 : c0ff             [ 2]>            cpy #$ff     ;test result
                            >            trap_ne
0a97 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a99 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   57
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0a9a : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0a9c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0a9e : 28               [ 4]>            plp         ;restore status
                             
                                             
0a9f : a2ff             [ 2]         ldx #$ff
                                     set_stat $ff
                            >            load_flag $ff
0aa1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0aa3 : 48               [ 3]>            pha         ;use stack to load status
0aa4 : 28               [ 4]>            plp
                             
0aa5 : 8a               [ 2]         txa
                                     tst_a $ff,$ff-zero
0aa6 : 08               [ 3]>            php         ;save flags
0aa7 : 08               [ 3]>            php
0aa8 : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
0aaa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0aac : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
0aad : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0aaf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0ab1 : 28               [ 4]>            plp         ;restore status
                             
0ab2 : 08               [ 3]         php
0ab3 : e8               [ 2]         inx             ;00
0ab4 : 28               [ 4]         plp
0ab5 : 8a               [ 2]         txa
                                     tst_a 0,$ff-minus
0ab6 : 08               [ 3]>            php         ;save flags
0ab7 : 08               [ 3]>            php
0ab8 : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
0aba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0abc : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
0abd : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0abf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0ac1 : 28               [ 4]>            plp         ;restore status
                             
0ac2 : 08               [ 3]         php
0ac3 : e8               [ 2]         inx             ;01
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   58
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0ac4 : 28               [ 4]         plp
0ac5 : 8a               [ 2]         txa
                                     tst_a 1,$ff-minus-zero
0ac6 : 08               [ 3]>            php         ;save flags
0ac7 : 08               [ 3]>            php
0ac8 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
0aca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0acc : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus-zero
0acd : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0acf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0ad1 : 28               [ 4]>            plp         ;restore status
                             
                                     set_stat 0
                            >            load_flag 0
0ad2 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0ad4 : 48               [ 3]>            pha         ;use stack to load status
0ad5 : 28               [ 4]>            plp
                             
0ad6 : 8a               [ 2]         txa
                                     tst_a 1,0
0ad7 : 08               [ 3]>            php         ;save flags
0ad8 : 08               [ 3]>            php
0ad9 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
0adb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0add : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
0ade : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0ae0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0ae2 : 28               [ 4]>            plp         ;restore status
                             
0ae3 : 08               [ 3]         php
0ae4 : ca               [ 2]         dex             ;00
0ae5 : 28               [ 4]         plp
0ae6 : 8a               [ 2]         txa
                                     tst_a 0,zero
0ae7 : 08               [ 3]>            php         ;save flags
0ae8 : 08               [ 3]>            php
0ae9 : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
0aeb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0aed : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   59
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0aee : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0af0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0af2 : 28               [ 4]>            plp         ;restore status
                             
0af3 : 08               [ 3]         php
0af4 : ca               [ 2]         dex             ;ff
0af5 : 28               [ 4]         plp
0af6 : 8a               [ 2]         txa
                                     tst_a $ff,minus
0af7 : 08               [ 3]>            php         ;save flags
0af8 : 08               [ 3]>            php
0af9 : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
0afb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0afd : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
0afe : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b00 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b02 : 28               [ 4]>            plp         ;restore status
                             
                                                     
0b03 : a0ff             [ 2]         ldy #$ff
                                     set_stat $ff
                            >            load_flag $ff
0b05 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0b07 : 48               [ 3]>            pha         ;use stack to load status
0b08 : 28               [ 4]>            plp
                             
0b09 : 98               [ 2]         tya
                                     tst_a $ff,$ff-zero
0b0a : 08               [ 3]>            php         ;save flags
0b0b : 08               [ 3]>            php
0b0c : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
0b0e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b10 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
0b11 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b13 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b15 : 28               [ 4]>            plp         ;restore status
                             
0b16 : 08               [ 3]         php
0b17 : c8               [ 2]         iny             ;00
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   60
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0b18 : 28               [ 4]         plp
0b19 : 98               [ 2]         tya
                                     tst_a 0,$ff-minus
0b1a : 08               [ 3]>            php         ;save flags
0b1b : 08               [ 3]>            php
0b1c : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
0b1e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b20 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
0b21 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b23 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b25 : 28               [ 4]>            plp         ;restore status
                             
0b26 : 08               [ 3]         php
0b27 : c8               [ 2]         iny             ;01
0b28 : 28               [ 4]         plp
0b29 : 98               [ 2]         tya
                                     tst_a 1,$ff-minus-zero
0b2a : 08               [ 3]>            php         ;save flags
0b2b : 08               [ 3]>            php
0b2c : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
0b2e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b30 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus-zero
0b31 : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b33 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b35 : 28               [ 4]>            plp         ;restore status
                             
                                     set_stat 0
                            >            load_flag 0
0b36 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0b38 : 48               [ 3]>            pha         ;use stack to load status
0b39 : 28               [ 4]>            plp
                             
0b3a : 98               [ 2]         tya
                                     tst_a 1,0
0b3b : 08               [ 3]>            php         ;save flags
0b3c : 08               [ 3]>            php
0b3d : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
0b3f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b41 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   61
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0b42 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b46 : 28               [ 4]>            plp         ;restore status
                             
0b47 : 08               [ 3]         php
0b48 : 88               [ 2]         dey             ;00
0b49 : 28               [ 4]         plp
0b4a : 98               [ 2]         tya
                                     tst_a 0,zero
0b4b : 08               [ 3]>            php         ;save flags
0b4c : 08               [ 3]>            php
0b4d : c900             [ 2]>            cmp #0     ;test result
                            >            trap_ne
0b4f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b51 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
0b52 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b54 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b56 : 28               [ 4]>            plp         ;restore status
                             
0b57 : 08               [ 3]         php
0b58 : 88               [ 2]         dey             ;ff
0b59 : 28               [ 4]         plp
0b5a : 98               [ 2]         tya
                                     tst_a $ff,minus
0b5b : 08               [ 3]>            php         ;save flags
0b5c : 08               [ 3]>            php
0b5d : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
0b5f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b61 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
0b62 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b64 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b66 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     load_flag $ff
0b67 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                             
0b69 : 48               [ 3]         pha
0b6a : a2ff             [ 2]         ldx #$ff        ;ff
0b6c : 8a               [ 2]         txa
0b6d : 28               [ 4]         plp             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   62
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0b6e : a8               [ 2]         tay
                                     tst_y $ff,$ff-zero
0b6f : 08               [ 3]>            php         ;save flags
0b70 : 08               [ 3]>            php
0b71 : c0ff             [ 2]>            cpy #$ff     ;test result
                            >            trap_ne
0b73 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b75 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
0b76 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b78 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b7a : 28               [ 4]>            plp         ;restore status
                             
0b7b : 08               [ 3]         php
0b7c : e8               [ 2]         inx             ;00
0b7d : 8a               [ 2]         txa
0b7e : 28               [ 4]         plp
0b7f : a8               [ 2]         tay
                                     tst_y 0,$ff-minus
0b80 : 08               [ 3]>            php         ;save flags
0b81 : 08               [ 3]>            php
0b82 : c000             [ 2]>            cpy #0     ;test result
                            >            trap_ne
0b84 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b86 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
0b87 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0b89 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b8b : 28               [ 4]>            plp         ;restore status
                             
0b8c : 08               [ 3]         php
0b8d : e8               [ 2]         inx             ;01
0b8e : 8a               [ 2]         txa
0b8f : 28               [ 4]         plp
0b90 : a8               [ 2]         tay
                                     tst_y 1,$ff-minus-zero
0b91 : 08               [ 3]>            php         ;save flags
0b92 : 08               [ 3]>            php
0b93 : c001             [ 2]>            cpy #1     ;test result
                            >            trap_ne
0b95 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b97 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus-zero
0b98 : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   63
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0b9a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0b9c : 28               [ 4]>            plp         ;restore status
                             
                                     load_flag 0
0b9d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                             
0b9f : 48               [ 3]         pha
0ba0 : a900             [ 2]         lda #0
0ba2 : 8a               [ 2]         txa
0ba3 : 28               [ 4]         plp
0ba4 : a8               [ 2]         tay
                                     tst_y 1,0
0ba5 : 08               [ 3]>            php         ;save flags
0ba6 : 08               [ 3]>            php
0ba7 : c001             [ 2]>            cpy #1     ;test result
                            >            trap_ne
0ba9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bab : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
0bac : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0bae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bb0 : 28               [ 4]>            plp         ;restore status
                             
0bb1 : 08               [ 3]         php
0bb2 : ca               [ 2]         dex             ;00
0bb3 : 8a               [ 2]         txa
0bb4 : 28               [ 4]         plp
0bb5 : a8               [ 2]         tay
                                     tst_y 0,zero
0bb6 : 08               [ 3]>            php         ;save flags
0bb7 : 08               [ 3]>            php
0bb8 : c000             [ 2]>            cpy #0     ;test result
                            >            trap_ne
0bba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bbc : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
0bbd : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0bbf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bc1 : 28               [ 4]>            plp         ;restore status
                             
0bc2 : 08               [ 3]         php
0bc3 : ca               [ 2]         dex             ;ff
0bc4 : 8a               [ 2]         txa
0bc5 : 28               [ 4]         plp
0bc6 : a8               [ 2]         tay
                                     tst_y $ff,minus
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   64
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0bc7 : 08               [ 3]>            php         ;save flags
0bc8 : 08               [ 3]>            php
0bc9 : c0ff             [ 2]>            cpy #$ff     ;test result
                            >            trap_ne
0bcb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bcd : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
0bce : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0bd0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bd2 : 28               [ 4]>            plp         ;restore status
                             
                             
                             
                                     load_flag $ff
0bd3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                             
0bd5 : 48               [ 3]         pha
0bd6 : a0ff             [ 2]         ldy #$ff        ;ff
0bd8 : 98               [ 2]         tya
0bd9 : 28               [ 4]         plp
0bda : aa               [ 2]         tax
                                     tst_x $ff,$ff-zero
0bdb : 08               [ 3]>            php         ;save flags
0bdc : 08               [ 3]>            php
0bdd : e0ff             [ 2]>            cpx #$ff     ;test result
                            >            trap_ne
0bdf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0be1 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-zero
0be2 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0be4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0be6 : 28               [ 4]>            plp         ;restore status
                             
0be7 : 08               [ 3]         php
0be8 : c8               [ 2]         iny             ;00
0be9 : 98               [ 2]         tya
0bea : 28               [ 4]         plp
0beb : aa               [ 2]         tax
                                     tst_x 0,$ff-minus
0bec : 08               [ 3]>            php         ;save flags
0bed : 08               [ 3]>            php
0bee : e000             [ 2]>            cpx #0     ;test result
                            >            trap_ne
0bf0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bf2 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   65
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0bf3 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0bf5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0bf7 : 28               [ 4]>            plp         ;restore status
                             
0bf8 : 08               [ 3]         php
0bf9 : c8               [ 2]         iny             ;01
0bfa : 98               [ 2]         tya
0bfb : 28               [ 4]         plp
0bfc : aa               [ 2]         tax
                                     tst_x 1,$ff-minus-zero
0bfd : 08               [ 3]>            php         ;save flags
0bfe : 08               [ 3]>            php
0bff : e001             [ 2]>            cpx #1     ;test result
                            >            trap_ne
0c01 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c03 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag $ff-minus-zero
0c04 : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0c06 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c08 : 28               [ 4]>            plp         ;restore status
                             
                                     load_flag 0
0c09 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                             
0c0b : 48               [ 3]         pha
0c0c : a900             [ 2]         lda #0          ;preset status
0c0e : 98               [ 2]         tya
0c0f : 28               [ 4]         plp
0c10 : aa               [ 2]         tax
                                     tst_x 1,0
0c11 : 08               [ 3]>            php         ;save flags
0c12 : 08               [ 3]>            php
0c13 : e001             [ 2]>            cpx #1     ;test result
                            >            trap_ne
0c15 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c17 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag 0
0c18 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0c1a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c1c : 28               [ 4]>            plp         ;restore status
                             
0c1d : 08               [ 3]         php
0c1e : 88               [ 2]         dey             ;00
0c1f : 98               [ 2]         tya
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   66
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0c20 : 28               [ 4]         plp
0c21 : aa               [ 2]         tax
                                     tst_x 0,zero
0c22 : 08               [ 3]>            php         ;save flags
0c23 : 08               [ 3]>            php
0c24 : e000             [ 2]>            cpx #0     ;test result
                            >            trap_ne
0c26 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c28 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag zero
0c29 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0c2b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c2d : 28               [ 4]>            plp         ;restore status
                             
0c2e : 08               [ 3]         php
0c2f : 88               [ 2]         dey             ;ff
0c30 : 98               [ 2]         tya
0c31 : 28               [ 4]         plp
0c32 : aa               [ 2]         tax
                                     tst_x $ff,minus
0c33 : 08               [ 3]>            php         ;save flags
0c34 : 08               [ 3]>            php
0c35 : e0ff             [ 2]>            cpx #$ff     ;test result
                            >            trap_ne
0c37 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c39 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag minus
0c3a : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
0c3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0c3e : 28               [ 4]>            plp         ;restore status
                             
                                     next_test
0c3f : ad0002           [ 4]>            lda test_case   ;previous test
0c42 : c90d             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0c44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
000e =                      >test_num = test_num + 1
0c46 : a90e             [ 2]>            lda #test_num   ;*** this tests' number
0c48 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                  
                             ;TSX sets NZ - TXS does not
0c4b : a201             [ 2]         ldx #1          ;01
                                     set_stat $ff
                            >            load_flag $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   67
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0c4d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0c4f : 48               [ 3]>            pha         ;use stack to load status
0c50 : 28               [ 4]>            plp
                             
0c51 : 9a               [ 2]         txs
0c52 : 08               [ 3]         php
0c53 : ad0101           [ 4]         lda $101
                                     cmp_flag $ff
0c56 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0c58 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0c5a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0c5c : 48               [ 3]>            pha         ;use stack to load status
0c5d : 28               [ 4]>            plp
                             
0c5e : 9a               [ 2]         txs
0c5f : 08               [ 3]         php
0c60 : ad0101           [ 4]         lda $101
                                     cmp_flag 0
0c63 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0c65 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0c67 : ca               [ 2]         dex             ;00
                                     set_stat $ff
                            >            load_flag $ff
0c68 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0c6a : 48               [ 3]>            pha         ;use stack to load status
0c6b : 28               [ 4]>            plp
                             
0c6c : 9a               [ 2]         txs
0c6d : 08               [ 3]         php
0c6e : ad0001           [ 4]         lda $100
                                     cmp_flag $ff
0c71 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0c73 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0c75 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0c77 : 48               [ 3]>            pha         ;use stack to load status
0c78 : 28               [ 4]>            plp
                             
0c79 : 9a               [ 2]         txs
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   68
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0c7a : 08               [ 3]         php
0c7b : ad0001           [ 4]         lda $100
                                     cmp_flag 0
0c7e : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0c80 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0c82 : ca               [ 2]         dex             ;ff
                                     set_stat $ff
                            >            load_flag $ff
0c83 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0c85 : 48               [ 3]>            pha         ;use stack to load status
0c86 : 28               [ 4]>            plp
                             
0c87 : 9a               [ 2]         txs
0c88 : 08               [ 3]         php
0c89 : adff01           [ 4]         lda $1ff
                                     cmp_flag $ff
0c8c : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0c8e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0c90 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0c92 : 48               [ 3]>            pha         ;use stack to load status
0c93 : 28               [ 4]>            plp
                             
0c94 : 9a               [ 2]         txs
0c95 : 08               [ 3]         php
0c96 : adff01           [ 4]         lda $1ff
                                     cmp_flag 0
0c99 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                             
                                     
0c9b : a201             [ 2]         ldx #1
0c9d : 9a               [ 2]         txs             ;sp=01
                                     set_stat $ff
                            >            load_flag $ff
0c9e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0ca0 : 48               [ 3]>            pha         ;use stack to load status
0ca1 : 28               [ 4]>            plp
                             
0ca2 : ba               [ 2]         tsx             ;clears Z, N
0ca3 : 08               [ 3]         php             ;sp=00
0ca4 : e001             [ 2]         cpx #1
                                     trap_ne
0ca6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0ca8 : ad0101           [ 4]         lda $101
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   69
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     cmp_flag $ff-minus-zero
0cab : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0cad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
0caf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0cb1 : 48               [ 3]>            pha         ;use stack to load status
0cb2 : 28               [ 4]>            plp
                             
0cb3 : ba               [ 2]         tsx             ;clears N, sets Z
0cb4 : 08               [ 3]         php             ;sp=ff
0cb5 : e000             [ 2]         cpx #0
                                     trap_ne
0cb7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0cb9 : ad0001           [ 4]         lda $100
                                     cmp_flag $ff-minus
0cbc : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0cbe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
0cc0 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0cc2 : 48               [ 3]>            pha         ;use stack to load status
0cc3 : 28               [ 4]>            plp
                             
0cc4 : ba               [ 2]         tsx             ;clears N, sets Z
0cc5 : 08               [ 3]         php             ;sp=fe
0cc6 : e0ff             [ 2]         cpx #$ff
                                     trap_ne
0cc8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0cca : adff01           [ 4]         lda $1ff
                                     cmp_flag $ff-zero
0ccd : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0ccf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     
0cd1 : a201             [ 2]         ldx #1
0cd3 : 9a               [ 2]         txs             ;sp=01
                                     set_stat 0
                            >            load_flag 0
0cd4 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0cd6 : 48               [ 3]>            pha         ;use stack to load status
0cd7 : 28               [ 4]>            plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   70
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
0cd8 : ba               [ 2]         tsx             ;clears Z, N
0cd9 : 08               [ 3]         php             ;sp=00
0cda : e001             [ 2]         cpx #1
                                     trap_ne
0cdc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0cde : ad0101           [ 4]         lda $101
                                     cmp_flag 0
0ce1 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0ce3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0ce5 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0ce7 : 48               [ 3]>            pha         ;use stack to load status
0ce8 : 28               [ 4]>            plp
                             
0ce9 : ba               [ 2]         tsx             ;clears N, sets Z
0cea : 08               [ 3]         php             ;sp=ff
0ceb : e000             [ 2]         cpx #0
                                     trap_ne
0ced : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0cef : ad0001           [ 4]         lda $100
                                     cmp_flag zero
0cf2 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0cf4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0cf6 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0cf8 : 48               [ 3]>            pha         ;use stack to load status
0cf9 : 28               [ 4]>            plp
                             
0cfa : ba               [ 2]         tsx             ;clears N, sets Z
0cfb : 08               [ 3]         php             ;sp=fe
0cfc : e0ff             [ 2]         cpx #$ff
                                     trap_ne
0cfe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d00 : adff01           [ 4]         lda $1ff
                                     cmp_flag minus
0d03 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
                             
                                     trap_ne
0d05 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d07 : 68               [ 4]         pla             ;sp=ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   71
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     next_test
0d08 : ad0002           [ 4]>            lda test_case   ;previous test
0d0b : c90e             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0d0d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
000f =                      >test_num = test_num + 1
0d0f : a90f             [ 2]>            lda #test_num   ;*** this tests' number
0d11 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                     
                             ; testing index register load & store LDY LDX STY STX all addressing modes
                             ; LDX / STX - zp,y / abs,y
0d14 : a003             [ 2]         ldy #3
0d16 :                       tldx    
                                     set_stat 0
                            >            load_flag 0
0d16 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0d18 : 48               [ 3]>            pha         ;use stack to load status
0d19 : 28               [ 4]>            plp
                             
0d1a : b613             [ 4]         ldx zp1,y
0d1c : 08               [ 3]         php         ;test stores do not alter flags
0d1d : 8a               [ 2]         txa
0d1e : 49c3             [ 2]         eor #$c3
0d20 : 28               [ 4]         plp
0d21 : 990302           [ 5]         sta abst,y
0d24 : 08               [ 3]         php         ;flags after load/store sequence
0d25 : 49c3             [ 2]         eor #$c3
0d27 : d90802           [ 4]         cmp abs1,y  ;test result
                                     trap_ne
0d2a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d2c : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0d2d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0d2f : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
0d32 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d34 : 88               [ 2]         dey
0d35 : 10df             [ 3]         bpl tldx                  
                             
0d37 : a003             [ 2]         ldy #3
0d39 :                       tldx1   
                                     set_stat $ff
                            >            load_flag $ff
0d39 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0d3b : 48               [ 3]>            pha         ;use stack to load status
0d3c : 28               [ 4]>            plp
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   72
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0d3d : b613             [ 4]         ldx zp1,y
0d3f : 08               [ 3]         php         ;test stores do not alter flags
0d40 : 8a               [ 2]         txa
0d41 : 49c3             [ 2]         eor #$c3
0d43 : 28               [ 4]         plp
0d44 : 990302           [ 5]         sta abst,y
0d47 : 08               [ 3]         php         ;flags after load/store sequence
0d48 : 49c3             [ 2]         eor #$c3
0d4a : d90802           [ 4]         cmp abs1,y  ;test result
                                     trap_ne
0d4d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d4f : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0d50 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
0d52 : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
0d55 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d57 : 88               [ 2]         dey
0d58 : 10df             [ 3]         bpl tldx1                  
                             
0d5a : a003             [ 2]         ldy #3
0d5c :                       tldx2   
                                     set_stat 0
                            >            load_flag 0
0d5c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0d5e : 48               [ 3]>            pha         ;use stack to load status
0d5f : 28               [ 4]>            plp
                             
0d60 : be0802           [ 4]         ldx abs1,y
0d63 : 08               [ 3]         php         ;test stores do not alter flags
0d64 : 8a               [ 2]         txa
0d65 : 49c3             [ 2]         eor #$c3
0d67 : aa               [ 2]         tax
0d68 : 28               [ 4]         plp
0d69 : 960c             [ 4]         stx zpt,y
0d6b : 08               [ 3]         php         ;flags after load/store sequence
0d6c : 49c3             [ 2]         eor #$c3
0d6e : d91300           [ 4]         cmp zp1,y   ;test result
                                     trap_ne
0d71 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d73 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0d74 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0d76 : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
0d79 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d7b : 88               [ 2]         dey
0d7c : 10de             [ 3]         bpl tldx2                  
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   73
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
0d7e : a003             [ 2]         ldy #3
0d80 :                       tldx3   
                                     set_stat $ff
                            >            load_flag $ff
0d80 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0d82 : 48               [ 3]>            pha         ;use stack to load status
0d83 : 28               [ 4]>            plp
                             
0d84 : be0802           [ 4]         ldx abs1,y
0d87 : 08               [ 3]         php         ;test stores do not alter flags
0d88 : 8a               [ 2]         txa
0d89 : 49c3             [ 2]         eor #$c3
0d8b : aa               [ 2]         tax
0d8c : 28               [ 4]         plp
0d8d : 960c             [ 4]         stx zpt,y
0d8f : 08               [ 3]         php         ;flags after load/store sequence
0d90 : 49c3             [ 2]         eor #$c3
0d92 : d91300           [ 4]         cmp zp1,y   ;test result
                                     trap_ne
0d95 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d97 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0d98 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
0d9a : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
0d9d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0d9f : 88               [ 2]         dey
0da0 : 10de             [ 3]         bpl tldx3
                                     
0da2 : a003             [ 2]         ldy #3      ;testing store result
0da4 : a200             [ 2]         ldx #0
0da6 : b90c00           [ 4] tstx    lda zpt,y
0da9 : 49c3             [ 2]         eor #$c3
0dab : d91300           [ 4]         cmp zp1,y
                                     trap_ne     ;store to zp data
0dae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0db0 : 960c             [ 4]         stx zpt,y   ;clear                
0db2 : b90302           [ 4]         lda abst,y
0db5 : 49c3             [ 2]         eor #$c3
0db7 : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
0dba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0dbc : 8a               [ 2]         txa
0dbd : 990302           [ 5]         sta abst,y  ;clear                
0dc0 : 88               [ 2]         dey
0dc1 : 10e3             [ 3]         bpl tstx
                                     next_test
0dc3 : ad0002           [ 4]>            lda test_case   ;previous test
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   74
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0dc6 : c90f             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0dc8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0010 =                      >test_num = test_num + 1
0dca : a910             [ 2]>            lda #test_num   ;*** this tests' number
0dcc : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                     
                             ; indexed wraparound test (only zp should wrap)
0dcf : a0fd             [ 2]         ldy #3+$fa
0dd1 : b619             [ 4] tldx4   ldx zp1-$fa&$ff,y   ;wrap on indexed zp
0dd3 : 8a               [ 2]         txa
0dd4 : 990901           [ 5]         sta abst-$fa,y      ;no STX abs,y!
0dd7 : 88               [ 2]         dey
0dd8 : c0fa             [ 2]         cpy #$fa
0dda : b0f5             [ 3]         bcs tldx4                  
0ddc : a0fd             [ 2]         ldy #3+$fa
0dde : be0e01           [ 4] tldx5   ldx abs1-$fa,y      ;no wrap on indexed abs
0de1 : 9612             [ 4]         stx zpt-$fa&$ff,y
0de3 : 88               [ 2]         dey
0de4 : c0fa             [ 2]         cpy #$fa
0de6 : b0f6             [ 3]         bcs tldx5                  
0de8 : a003             [ 2]         ldy #3      ;testing wraparound result
0dea : a200             [ 2]         ldx #0
0dec : b90c00           [ 4] tstx1   lda zpt,y
0def : d91300           [ 4]         cmp zp1,y
                                     trap_ne     ;store to zp data
0df2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0df4 : 960c             [ 4]         stx zpt,y   ;clear                
0df6 : b90302           [ 4]         lda abst,y
0df9 : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
0dfc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0dfe : 8a               [ 2]         txa
0dff : 990302           [ 5]         sta abst,y  ;clear                
0e02 : 88               [ 2]         dey
0e03 : 10e7             [ 4]         bpl tstx1
                                     next_test
0e05 : ad0002           [ 4]>            lda test_case   ;previous test
0e08 : c910             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0e0a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0011 =                      >test_num = test_num + 1
0e0c : a911             [ 2]>            lda #test_num   ;*** this tests' number
0e0e : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                     
                             ; LDY / STY - zp,x / abs,x
0e11 : a203             [ 2]         ldx #3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   75
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0e13 :                       tldy    
                                     set_stat 0
                            >            load_flag 0
0e13 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0e15 : 48               [ 3]>            pha         ;use stack to load status
0e16 : 28               [ 4]>            plp
                             
0e17 : b413             [ 4]         ldy zp1,x
0e19 : 08               [ 3]         php         ;test stores do not alter flags
0e1a : 98               [ 2]         tya
0e1b : 49c3             [ 2]         eor #$c3
0e1d : 28               [ 4]         plp
0e1e : 9d0302           [ 5]         sta abst,x
0e21 : 08               [ 3]         php         ;flags after load/store sequence
0e22 : 49c3             [ 2]         eor #$c3
0e24 : dd0802           [ 4]         cmp abs1,x  ;test result
                                     trap_ne
0e27 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e29 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0e2a : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0e2c : dd0d02           [ 4]         cmp fLDx,x  ;test flags
                                     trap_ne
0e2f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e31 : ca               [ 2]         dex
0e32 : 10df             [ 3]         bpl tldy                  
                             
0e34 : a203             [ 2]         ldx #3
0e36 :                       tldy1   
                                     set_stat $ff
                            >            load_flag $ff
0e36 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0e38 : 48               [ 3]>            pha         ;use stack to load status
0e39 : 28               [ 4]>            plp
                             
0e3a : b413             [ 4]         ldy zp1,x
0e3c : 08               [ 3]         php         ;test stores do not alter flags
0e3d : 98               [ 2]         tya
0e3e : 49c3             [ 2]         eor #$c3
0e40 : 28               [ 4]         plp
0e41 : 9d0302           [ 5]         sta abst,x
0e44 : 08               [ 3]         php         ;flags after load/store sequence
0e45 : 49c3             [ 2]         eor #$c3
0e47 : dd0802           [ 4]         cmp abs1,x  ;test result
                                     trap_ne
0e4a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e4c : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0e4d : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   76
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
0e4f : dd0d02           [ 4]         cmp fLDx,x  ;test flags
                                     trap_ne
0e52 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e54 : ca               [ 2]         dex
0e55 : 10df             [ 3]         bpl tldy1                  
                             
0e57 : a203             [ 2]         ldx #3
0e59 :                       tldy2   
                                     set_stat 0
                            >            load_flag 0
0e59 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0e5b : 48               [ 3]>            pha         ;use stack to load status
0e5c : 28               [ 4]>            plp
                             
0e5d : bc0802           [ 4]         ldy abs1,x
0e60 : 08               [ 3]         php         ;test stores do not alter flags
0e61 : 98               [ 2]         tya
0e62 : 49c3             [ 2]         eor #$c3
0e64 : a8               [ 2]         tay
0e65 : 28               [ 4]         plp
0e66 : 940c             [ 4]         sty zpt,x
0e68 : 08               [ 3]         php         ;flags after load/store sequence
0e69 : 49c3             [ 2]         eor #$c3
0e6b : d513             [ 4]         cmp zp1,x   ;test result
                                     trap_ne
0e6d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e6f : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0e70 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0e72 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
                                     trap_ne
0e75 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e77 : ca               [ 2]         dex
0e78 : 10df             [ 3]         bpl tldy2                  
                             
0e7a : a203             [ 2]         ldx #3
0e7c :                       tldy3
                                     set_stat $ff
                            >            load_flag $ff
0e7c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0e7e : 48               [ 3]>            pha         ;use stack to load status
0e7f : 28               [ 4]>            plp
                             
0e80 : bc0802           [ 4]         ldy abs1,x
0e83 : 08               [ 3]         php         ;test stores do not alter flags
0e84 : 98               [ 2]         tya
0e85 : 49c3             [ 2]         eor #$c3
0e87 : a8               [ 2]         tay
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   77
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0e88 : 28               [ 4]         plp
0e89 : 940c             [ 4]         sty zpt,x
0e8b : 08               [ 3]         php         ;flags after load/store sequence
0e8c : 49c3             [ 2]         eor #$c3
0e8e : d513             [ 4]         cmp zp1,x   ;test result
                                     trap_ne
0e90 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e92 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0e93 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
0e95 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
                                     trap_ne
0e98 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0e9a : ca               [ 2]         dex
0e9b : 10df             [ 3]         bpl tldy3
                             
0e9d : a203             [ 2]         ldx #3      ;testing store result
0e9f : a000             [ 2]         ldy #0
0ea1 : b50c             [ 4] tsty    lda zpt,x
0ea3 : 49c3             [ 2]         eor #$c3
0ea5 : d513             [ 4]         cmp zp1,x
                                     trap_ne     ;store to zp,x data
0ea7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0ea9 : 940c             [ 4]         sty zpt,x   ;clear                
0eab : bd0302           [ 4]         lda abst,x
0eae : 49c3             [ 2]         eor #$c3
0eb0 : dd0802           [ 4]         cmp abs1,x
                                     trap_ne     ;store to abs,x data
0eb3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0eb5 : 8a               [ 2]         txa
0eb6 : 9d0302           [ 5]         sta abst,x  ;clear                
0eb9 : ca               [ 2]         dex
0eba : 10e5             [ 3]         bpl tsty
                                     next_test
0ebc : ad0002           [ 4]>            lda test_case   ;previous test
0ebf : c911             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0ec1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0012 =                      >test_num = test_num + 1
0ec3 : a912             [ 2]>            lda #test_num   ;*** this tests' number
0ec5 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; indexed wraparound test (only zp should wrap)
0ec8 : a2fd             [ 2]         ldx #3+$fa
0eca : b419             [ 4] tldy4   ldy zp1-$fa&$ff,x   ;wrap on indexed zp
0ecc : 98               [ 2]         tya
0ecd : 9d0901           [ 5]         sta abst-$fa,x      ;no STX abs,x!
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   78
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0ed0 : ca               [ 2]         dex
0ed1 : e0fa             [ 2]         cpx #$fa
0ed3 : b0f5             [ 3]         bcs tldy4                  
0ed5 : a2fd             [ 2]         ldx #3+$fa
0ed7 : bc0e01           [ 4] tldy5   ldy abs1-$fa,x      ;no wrap on indexed abs
0eda : 9412             [ 4]         sty zpt-$fa&$ff,x
0edc : ca               [ 2]         dex
0edd : e0fa             [ 2]         cpx #$fa
0edf : b0f6             [ 3]         bcs tldy5                  
0ee1 : a203             [ 2]         ldx #3      ;testing wraparound result
0ee3 : a000             [ 2]         ldy #0
0ee5 : b50c             [ 4] tsty1   lda zpt,x
0ee7 : d513             [ 4]         cmp zp1,x
                                     trap_ne     ;store to zp,x data
0ee9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0eeb : 940c             [ 4]         sty zpt,x   ;clear                
0eed : bd0302           [ 4]         lda abst,x
0ef0 : dd0802           [ 4]         cmp abs1,x
                                     trap_ne     ;store to abs,x data
0ef3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0ef5 : 8a               [ 2]         txa
0ef6 : 9d0302           [ 5]         sta abst,x  ;clear                
0ef9 : ca               [ 2]         dex
0efa : 10e9             [ 3]         bpl tsty1
                                     next_test
0efc : ad0002           [ 4]>            lda test_case   ;previous test
0eff : c912             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
0f01 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0013 =                      >test_num = test_num + 1
0f03 : a913             [ 2]>            lda #test_num   ;*** this tests' number
0f05 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; LDX / STX - zp / abs / #
                                     set_stat 0  
                            >            load_flag 0  
0f08 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
                            >
0f0a : 48               [ 3]>            pha         ;use stack to load status
0f0b : 28               [ 4]>            plp
                             
0f0c : a613             [ 3]         ldx zp1
0f0e : 08               [ 3]         php         ;test stores do not alter flags
0f0f : 8a               [ 2]         txa
0f10 : 49c3             [ 2]         eor #$c3
0f12 : aa               [ 2]         tax
0f13 : 28               [ 4]         plp
0f14 : 8e0302           [ 4]         stx abst
0f17 : 08               [ 3]         php         ;flags after load/store sequence
0f18 : 49c3             [ 2]         eor #$c3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   79
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0f1a : aa               [ 2]         tax
0f1b : e0c3             [ 2]         cpx #$c3    ;test result
                                     trap_ne
0f1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0f1f : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0f20 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0f22 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
0f25 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0f27 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0f29 : 48               [ 3]>            pha         ;use stack to load status
0f2a : 28               [ 4]>            plp
                             
0f2b : a614             [ 3]         ldx zp1+1
0f2d : 08               [ 3]         php         ;test stores do not alter flags
0f2e : 8a               [ 2]         txa
0f2f : 49c3             [ 2]         eor #$c3
0f31 : aa               [ 2]         tax
0f32 : 28               [ 4]         plp
0f33 : 8e0402           [ 4]         stx abst+1
0f36 : 08               [ 3]         php         ;flags after load/store sequence
0f37 : 49c3             [ 2]         eor #$c3
0f39 : aa               [ 2]         tax
0f3a : e082             [ 2]         cpx #$82    ;test result
                                     trap_ne
0f3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0f3e : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0f3f : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0f41 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
0f44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0f46 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0f48 : 48               [ 3]>            pha         ;use stack to load status
0f49 : 28               [ 4]>            plp
                             
0f4a : a615             [ 3]         ldx zp1+2
0f4c : 08               [ 3]         php         ;test stores do not alter flags
0f4d : 8a               [ 2]         txa
0f4e : 49c3             [ 2]         eor #$c3
0f50 : aa               [ 2]         tax
0f51 : 28               [ 4]         plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   80
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0f52 : 8e0502           [ 4]         stx abst+2
0f55 : 08               [ 3]         php         ;flags after load/store sequence
0f56 : 49c3             [ 2]         eor #$c3
0f58 : aa               [ 2]         tax
0f59 : e041             [ 2]         cpx #$41    ;test result
                                     trap_ne
0f5b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0f5d : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0f5e : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0f60 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
0f63 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
0f65 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
0f67 : 48               [ 3]>            pha         ;use stack to load status
0f68 : 28               [ 4]>            plp
                             
0f69 : a616             [ 3]         ldx zp1+3
0f6b : 08               [ 3]         php         ;test stores do not alter flags
0f6c : 8a               [ 2]         txa
0f6d : 49c3             [ 2]         eor #$c3
0f6f : aa               [ 2]         tax
0f70 : 28               [ 4]         plp
0f71 : 8e0602           [ 4]         stx abst+3
0f74 : 08               [ 3]         php         ;flags after load/store sequence
0f75 : 49c3             [ 2]         eor #$c3
0f77 : aa               [ 2]         tax
0f78 : e000             [ 2]         cpx #0      ;test result
                                     trap_ne
0f7a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0f7c : 68               [ 4]         pla         ;load status
                                     eor_flag 0
0f7d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
0f7f : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
0f82 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat $ff
                            >            load_flag $ff
0f84 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0f86 : 48               [ 3]>            pha         ;use stack to load status
0f87 : 28               [ 4]>            plp
                             
0f88 : a613             [ 3]         ldx zp1  
0f8a : 08               [ 3]         php         ;test stores do not alter flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   81
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

0f8b : 8a               [ 2]         txa
0f8c : 49c3             [ 2]         eor #$c3
0f8e : aa               [ 2]         tax
0f8f : 28               [ 4]         plp
0f90 : 8e0302           [ 4]         stx abst  
0f93 : 08               [ 3]         php         ;flags after load/store sequence
0f94 : 49c3             [ 2]         eor #$c3
0f96 : aa               [ 2]         tax
0f97 : e0c3             [ 2]         cpx #$c3    ;test result
                                     trap_ne     ;
0f99 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0f9b : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0f9c : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
0f9e : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
0fa1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
0fa3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0fa5 : 48               [ 3]>            pha         ;use stack to load status
0fa6 : 28               [ 4]>            plp
                             
0fa7 : a614             [ 3]         ldx zp1+1
0fa9 : 08               [ 3]         php         ;test stores do not alter flags
0faa : 8a               [ 2]         txa
0fab : 49c3             [ 2]         eor #$c3
0fad : aa               [ 2]         tax
0fae : 28               [ 4]         plp
0faf : 8e0402           [ 4]         stx abst+1
0fb2 : 08               [ 3]         php         ;flags after load/store sequence
0fb3 : 49c3             [ 2]         eor #$c3
0fb5 : aa               [ 2]         tax
0fb6 : e082             [ 2]         cpx #$82    ;test result
                                     trap_ne
0fb8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0fba : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0fbb : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
0fbd : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
0fc0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
0fc2 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0fc4 : 48               [ 3]>            pha         ;use stack to load status
0fc5 : 28               [ 4]>            plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   82
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
0fc6 : a615             [ 3]         ldx zp1+2
0fc8 : 08               [ 3]         php         ;test stores do not alter flags
0fc9 : 8a               [ 2]         txa
0fca : 49c3             [ 2]         eor #$c3
0fcc : aa               [ 2]         tax
0fcd : 28               [ 4]         plp
0fce : 8e0502           [ 4]         stx abst+2
0fd1 : 08               [ 3]         php         ;flags after load/store sequence
0fd2 : 49c3             [ 2]         eor #$c3
0fd4 : aa               [ 2]         tax
0fd5 : e041             [ 2]         cpx #$41    ;test result
                                     trap_ne     ;
0fd7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0fd9 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0fda : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
0fdc : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
0fdf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
0fe1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
0fe3 : 48               [ 3]>            pha         ;use stack to load status
0fe4 : 28               [ 4]>            plp
                             
0fe5 : a616             [ 3]         ldx zp1+3
0fe7 : 08               [ 3]         php         ;test stores do not alter flags
0fe8 : 8a               [ 2]         txa
0fe9 : 49c3             [ 2]         eor #$c3
0feb : aa               [ 2]         tax
0fec : 28               [ 4]         plp
0fed : 8e0602           [ 4]         stx abst+3
0ff0 : 08               [ 3]         php         ;flags after load/store sequence
0ff1 : 49c3             [ 2]         eor #$c3
0ff3 : aa               [ 2]         tax
0ff4 : e000             [ 2]         cpx #0      ;test result
                                     trap_ne
0ff6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
0ff8 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
0ff9 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
0ffb : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
0ffe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat 0
                            >            load_flag 0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   83
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1000 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1002 : 48               [ 3]>            pha         ;use stack to load status
1003 : 28               [ 4]>            plp
                             
1004 : ae0802           [ 4]         ldx abs1  
1007 : 08               [ 3]         php         ;test stores do not alter flags
1008 : 8a               [ 2]         txa
1009 : 49c3             [ 2]         eor #$c3
100b : aa               [ 2]         tax
100c : 28               [ 4]         plp
100d : 860c             [ 3]         stx zpt  
100f : 08               [ 3]         php         ;flags after load/store sequence
1010 : 49c3             [ 2]         eor #$c3
1012 : c513             [ 3]         cmp zp1     ;test result
                                     trap_ne
1014 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1016 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1017 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1019 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
101c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
101e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1020 : 48               [ 3]>            pha         ;use stack to load status
1021 : 28               [ 4]>            plp
                             
1022 : ae0902           [ 4]         ldx abs1+1
1025 : 08               [ 3]         php         ;test stores do not alter flags
1026 : 8a               [ 2]         txa
1027 : 49c3             [ 2]         eor #$c3
1029 : aa               [ 2]         tax
102a : 28               [ 4]         plp
102b : 860d             [ 3]         stx zpt+1
102d : 08               [ 3]         php         ;flags after load/store sequence
102e : 49c3             [ 2]         eor #$c3
1030 : c514             [ 3]         cmp zp1+1   ;test result
                                     trap_ne
1032 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1034 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1035 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1037 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
103a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   84
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag 0
103c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
103e : 48               [ 3]>            pha         ;use stack to load status
103f : 28               [ 4]>            plp
                             
1040 : ae0a02           [ 4]         ldx abs1+2
1043 : 08               [ 3]         php         ;test stores do not alter flags
1044 : 8a               [ 2]         txa
1045 : 49c3             [ 2]         eor #$c3
1047 : aa               [ 2]         tax
1048 : 28               [ 4]         plp
1049 : 860e             [ 3]         stx zpt+2
104b : 08               [ 3]         php         ;flags after load/store sequence
104c : 49c3             [ 2]         eor #$c3
104e : c515             [ 3]         cmp zp1+2   ;test result
                                     trap_ne
1050 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1052 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1053 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1055 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1058 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
105a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
105c : 48               [ 3]>            pha         ;use stack to load status
105d : 28               [ 4]>            plp
                             
105e : ae0b02           [ 4]         ldx abs1+3
1061 : 08               [ 3]         php         ;test stores do not alter flags
1062 : 8a               [ 2]         txa
1063 : 49c3             [ 2]         eor #$c3
1065 : aa               [ 2]         tax
1066 : 28               [ 4]         plp
1067 : 860f             [ 3]         stx zpt+3
1069 : 08               [ 3]         php         ;flags after load/store sequence
106a : 49c3             [ 2]         eor #$c3
106c : c516             [ 3]         cmp zp1+3   ;test result
                                     trap_ne
106e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1070 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1071 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1073 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1076 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   85
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     set_stat $ff
                            >            load_flag $ff
1078 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
107a : 48               [ 3]>            pha         ;use stack to load status
107b : 28               [ 4]>            plp
                             
107c : ae0802           [ 4]         ldx abs1  
107f : 08               [ 3]         php         ;test stores do not alter flags
1080 : 8a               [ 2]         txa
1081 : 49c3             [ 2]         eor #$c3
1083 : aa               [ 2]         tax
1084 : 28               [ 4]         plp
1085 : 860c             [ 3]         stx zpt  
1087 : 08               [ 3]         php         ;flags after load/store sequence
1088 : 49c3             [ 2]         eor #$c3
108a : aa               [ 2]         tax
108b : e413             [ 3]         cpx zp1     ;test result
                                     trap_ne
108d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
108f : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1090 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1092 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1095 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
1097 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1099 : 48               [ 3]>            pha         ;use stack to load status
109a : 28               [ 4]>            plp
                             
109b : ae0902           [ 4]         ldx abs1+1
109e : 08               [ 3]         php         ;test stores do not alter flags
109f : 8a               [ 2]         txa
10a0 : 49c3             [ 2]         eor #$c3
10a2 : aa               [ 2]         tax
10a3 : 28               [ 4]         plp
10a4 : 860d             [ 3]         stx zpt+1
10a6 : 08               [ 3]         php         ;flags after load/store sequence
10a7 : 49c3             [ 2]         eor #$c3
10a9 : aa               [ 2]         tax
10aa : e414             [ 3]         cpx zp1+1   ;test result
                                     trap_ne
10ac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
10ae : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
10af : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   86
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

10b1 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
10b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
10b6 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
10b8 : 48               [ 3]>            pha         ;use stack to load status
10b9 : 28               [ 4]>            plp
                             
10ba : ae0a02           [ 4]         ldx abs1+2
10bd : 08               [ 3]         php         ;test stores do not alter flags
10be : 8a               [ 2]         txa
10bf : 49c3             [ 2]         eor #$c3
10c1 : aa               [ 2]         tax
10c2 : 28               [ 4]         plp
10c3 : 860e             [ 3]         stx zpt+2
10c5 : 08               [ 3]         php         ;flags after load/store sequence
10c6 : 49c3             [ 2]         eor #$c3
10c8 : aa               [ 2]         tax
10c9 : e415             [ 3]         cpx zp1+2   ;test result
                                     trap_ne
10cb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
10cd : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
10ce : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
10d0 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
10d3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
10d5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
10d7 : 48               [ 3]>            pha         ;use stack to load status
10d8 : 28               [ 4]>            plp
                             
10d9 : ae0b02           [ 4]         ldx abs1+3
10dc : 08               [ 3]         php         ;test stores do not alter flags
10dd : 8a               [ 2]         txa
10de : 49c3             [ 2]         eor #$c3
10e0 : aa               [ 2]         tax
10e1 : 28               [ 4]         plp
10e2 : 860f             [ 3]         stx zpt+3
10e4 : 08               [ 3]         php         ;flags after load/store sequence
10e5 : 49c3             [ 2]         eor #$c3
10e7 : aa               [ 2]         tax
10e8 : e416             [ 3]         cpx zp1+3   ;test result
                                     trap_ne
10ea : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
10ec : 68               [ 4]         pla         ;load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   87
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     eor_flag lo~fnz ;mask bits not altered
10ed : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
10ef : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
10f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat 0  
                            >            load_flag 0  
10f4 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
                            >
10f6 : 48               [ 3]>            pha         ;use stack to load status
10f7 : 28               [ 4]>            plp
                             
10f8 : a2c3             [ 2]         ldx #$c3
10fa : 08               [ 3]         php
10fb : ec0802           [ 4]         cpx abs1    ;test result
                                     trap_ne
10fe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1100 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1101 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1103 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1106 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1108 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
110a : 48               [ 3]>            pha         ;use stack to load status
110b : 28               [ 4]>            plp
                             
110c : a282             [ 2]         ldx #$82
110e : 08               [ 3]         php
110f : ec0902           [ 4]         cpx abs1+1  ;test result
                                     trap_ne
1112 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1114 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1115 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1117 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
111a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
111c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
111e : 48               [ 3]>            pha         ;use stack to load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   88
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

111f : 28               [ 4]>            plp
                             
1120 : a241             [ 2]         ldx #$41
1122 : 08               [ 3]         php
1123 : ec0a02           [ 4]         cpx abs1+2  ;test result
                                     trap_ne
1126 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1128 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1129 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
112b : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
112e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1130 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1132 : 48               [ 3]>            pha         ;use stack to load status
1133 : 28               [ 4]>            plp
                             
1134 : a200             [ 2]         ldx #0
1136 : 08               [ 3]         php
1137 : ec0b02           [ 4]         cpx abs1+3  ;test result
                                     trap_ne
113a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
113c : 68               [ 4]         pla         ;load status
                                     eor_flag 0
113d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
113f : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1142 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat $ff
                            >            load_flag $ff
1144 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1146 : 48               [ 3]>            pha         ;use stack to load status
1147 : 28               [ 4]>            plp
                             
1148 : a2c3             [ 2]         ldx #$c3  
114a : 08               [ 3]         php
114b : ec0802           [ 4]         cpx abs1    ;test result
                                     trap_ne
114e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1150 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1151 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   89
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1153 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1156 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
1158 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
115a : 48               [ 3]>            pha         ;use stack to load status
115b : 28               [ 4]>            plp
                             
115c : a282             [ 2]         ldx #$82
115e : 08               [ 3]         php
115f : ec0902           [ 4]         cpx abs1+1  ;test result
                                     trap_ne
1162 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1164 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1165 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1167 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
116a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
116c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
116e : 48               [ 3]>            pha         ;use stack to load status
116f : 28               [ 4]>            plp
                             
1170 : a241             [ 2]         ldx #$41
1172 : 08               [ 3]         php
1173 : ec0a02           [ 4]         cpx abs1+2  ;test result
                                     trap_ne
1176 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1178 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1179 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
117b : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
117e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
1180 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1182 : 48               [ 3]>            pha         ;use stack to load status
1183 : 28               [ 4]>            plp
                             
1184 : a200             [ 2]         ldx #0
1186 : 08               [ 3]         php
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   90
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1187 : ec0b02           [ 4]         cpx abs1+3  ;test result
                                     trap_ne
118a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
118c : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
118d : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
118f : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1192 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
1194 : a200             [ 2]         ldx #0
1196 : a50c             [ 3]         lda zpt  
1198 : 49c3             [ 2]         eor #$c3
119a : c513             [ 3]         cmp zp1  
                                     trap_ne     ;store to zp data
119c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
119e : 860c             [ 3]         stx zpt     ;clear                
11a0 : ad0302           [ 4]         lda abst  
11a3 : 49c3             [ 2]         eor #$c3
11a5 : cd0802           [ 4]         cmp abs1  
                                     trap_ne     ;store to abs data
11a8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
11aa : 8e0302           [ 4]         stx abst    ;clear                
11ad : a50d             [ 3]         lda zpt+1
11af : 49c3             [ 2]         eor #$c3
11b1 : c514             [ 3]         cmp zp1+1
                                     trap_ne     ;store to zp data
11b3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
11b5 : 860d             [ 3]         stx zpt+1   ;clear                
11b7 : ad0402           [ 4]         lda abst+1
11ba : 49c3             [ 2]         eor #$c3
11bc : cd0902           [ 4]         cmp abs1+1
                                     trap_ne     ;store to abs data
11bf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
11c1 : 8e0402           [ 4]         stx abst+1  ;clear                
11c4 : a50e             [ 3]         lda zpt+2
11c6 : 49c3             [ 2]         eor #$c3
11c8 : c515             [ 3]         cmp zp1+2
                                     trap_ne     ;store to zp data
11ca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
11cc : 860e             [ 3]         stx zpt+2   ;clear                
11ce : ad0502           [ 4]         lda abst+2
11d1 : 49c3             [ 2]         eor #$c3
11d3 : cd0a02           [ 4]         cmp abs1+2
                                     trap_ne     ;store to abs data
11d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   91
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

11d8 : 8e0502           [ 4]         stx abst+2  ;clear                
11db : a50f             [ 3]         lda zpt+3
11dd : 49c3             [ 2]         eor #$c3
11df : c516             [ 3]         cmp zp1+3
                                     trap_ne     ;store to zp data
11e1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
11e3 : 860f             [ 3]         stx zpt+3   ;clear                
11e5 : ad0602           [ 4]         lda abst+3
11e8 : 49c3             [ 2]         eor #$c3
11ea : cd0b02           [ 4]         cmp abs1+3
                                     trap_ne     ;store to abs data
11ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
11ef : 8e0602           [ 4]         stx abst+3  ;clear                
                                     next_test
11f2 : ad0002           [ 4]>            lda test_case   ;previous test
11f5 : c913             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
11f7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0014 =                      >test_num = test_num + 1
11f9 : a914             [ 2]>            lda #test_num   ;*** this tests' number
11fb : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; LDY / STY - zp / abs / #
                                     set_stat 0
                            >            load_flag 0
11fe : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1200 : 48               [ 3]>            pha         ;use stack to load status
1201 : 28               [ 4]>            plp
                             
1202 : a413             [ 3]         ldy zp1  
1204 : 08               [ 3]         php         ;test stores do not alter flags
1205 : 98               [ 2]         tya
1206 : 49c3             [ 2]         eor #$c3
1208 : a8               [ 2]         tay
1209 : 28               [ 4]         plp
120a : 8c0302           [ 4]         sty abst  
120d : 08               [ 3]         php         ;flags after load/store sequence
120e : 49c3             [ 2]         eor #$c3
1210 : a8               [ 2]         tay
1211 : c0c3             [ 2]         cpy #$c3    ;test result
                                     trap_ne
1213 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1215 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1216 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1218 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   92
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

121b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
121d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
121f : 48               [ 3]>            pha         ;use stack to load status
1220 : 28               [ 4]>            plp
                             
1221 : a414             [ 3]         ldy zp1+1
1223 : 08               [ 3]         php         ;test stores do not alter flags
1224 : 98               [ 2]         tya
1225 : 49c3             [ 2]         eor #$c3
1227 : a8               [ 2]         tay
1228 : 28               [ 4]         plp
1229 : 8c0402           [ 4]         sty abst+1
122c : 08               [ 3]         php         ;flags after load/store sequence
122d : 49c3             [ 2]         eor #$c3
122f : a8               [ 2]         tay
1230 : c082             [ 2]         cpy #$82    ;test result
                                     trap_ne
1232 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1234 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1235 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1237 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
123a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
123c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
123e : 48               [ 3]>            pha         ;use stack to load status
123f : 28               [ 4]>            plp
                             
1240 : a415             [ 3]         ldy zp1+2
1242 : 08               [ 3]         php         ;test stores do not alter flags
1243 : 98               [ 2]         tya
1244 : 49c3             [ 2]         eor #$c3
1246 : a8               [ 2]         tay
1247 : 28               [ 4]         plp
1248 : 8c0502           [ 4]         sty abst+2
124b : 08               [ 3]         php         ;flags after load/store sequence
124c : 49c3             [ 2]         eor #$c3
124e : a8               [ 2]         tay
124f : c041             [ 2]         cpy #$41    ;test result
                                     trap_ne
1251 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1253 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1254 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   93
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
1256 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1259 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
125b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
125d : 48               [ 3]>            pha         ;use stack to load status
125e : 28               [ 4]>            plp
                             
125f : a416             [ 3]         ldy zp1+3
1261 : 08               [ 3]         php         ;test stores do not alter flags
1262 : 98               [ 2]         tya
1263 : 49c3             [ 2]         eor #$c3
1265 : a8               [ 2]         tay
1266 : 28               [ 4]         plp
1267 : 8c0602           [ 4]         sty abst+3
126a : 08               [ 3]         php         ;flags after load/store sequence
126b : 49c3             [ 2]         eor #$c3
126d : a8               [ 2]         tay
126e : c000             [ 2]         cpy #0      ;test result
                                     trap_ne
1270 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1272 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1273 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1275 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1278 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat $ff
                            >            load_flag $ff
127a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
127c : 48               [ 3]>            pha         ;use stack to load status
127d : 28               [ 4]>            plp
                             
127e : a413             [ 3]         ldy zp1  
1280 : 08               [ 3]         php         ;test stores do not alter flags
1281 : 98               [ 2]         tya
1282 : 49c3             [ 2]         eor #$c3
1284 : a8               [ 2]         tay
1285 : 28               [ 4]         plp
1286 : 8c0302           [ 4]         sty abst  
1289 : 08               [ 3]         php         ;flags after load/store sequence
128a : 49c3             [ 2]         eor #$c3
128c : a8               [ 2]         tay
128d : c0c3             [ 2]         cpy #$c3    ;test result
                                     trap_ne
128f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   94
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
1291 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1292 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1294 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1297 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
1299 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
129b : 48               [ 3]>            pha         ;use stack to load status
129c : 28               [ 4]>            plp
                             
129d : a414             [ 3]         ldy zp1+1
129f : 08               [ 3]         php         ;test stores do not alter flags
12a0 : 98               [ 2]         tya
12a1 : 49c3             [ 2]         eor #$c3
12a3 : a8               [ 2]         tay
12a4 : 28               [ 4]         plp
12a5 : 8c0402           [ 4]         sty abst+1
12a8 : 08               [ 3]         php         ;flags after load/store sequence
12a9 : 49c3             [ 2]         eor #$c3
12ab : a8               [ 2]         tay
12ac : c082             [ 2]         cpy #$82   ;test result
                                     trap_ne
12ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
12b0 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
12b1 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
12b3 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
12b6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
12b8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
12ba : 48               [ 3]>            pha         ;use stack to load status
12bb : 28               [ 4]>            plp
                             
12bc : a415             [ 3]         ldy zp1+2
12be : 08               [ 3]         php         ;test stores do not alter flags
12bf : 98               [ 2]         tya
12c0 : 49c3             [ 2]         eor #$c3
12c2 : a8               [ 2]         tay
12c3 : 28               [ 4]         plp
12c4 : 8c0502           [ 4]         sty abst+2
12c7 : 08               [ 3]         php         ;flags after load/store sequence
12c8 : 49c3             [ 2]         eor #$c3
12ca : a8               [ 2]         tay
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   95
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

12cb : c041             [ 2]         cpy #$41    ;test result
                                     trap_ne
12cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
12cf : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
12d0 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
12d2 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
12d5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
12d7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
12d9 : 48               [ 3]>            pha         ;use stack to load status
12da : 28               [ 4]>            plp
                             
12db : a416             [ 3]         ldy zp1+3
12dd : 08               [ 3]         php         ;test stores do not alter flags
12de : 98               [ 2]         tya
12df : 49c3             [ 2]         eor #$c3
12e1 : a8               [ 2]         tay
12e2 : 28               [ 4]         plp
12e3 : 8c0602           [ 4]         sty abst+3
12e6 : 08               [ 3]         php         ;flags after load/store sequence
12e7 : 49c3             [ 2]         eor #$c3
12e9 : a8               [ 2]         tay
12ea : c000             [ 2]         cpy #0      ;test result
                                     trap_ne
12ec : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
12ee : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
12ef : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
12f1 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
12f4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     
                                     set_stat 0
                            >            load_flag 0
12f6 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
12f8 : 48               [ 3]>            pha         ;use stack to load status
12f9 : 28               [ 4]>            plp
                             
12fa : ac0802           [ 4]         ldy abs1  
12fd : 08               [ 3]         php         ;test stores do not alter flags
12fe : 98               [ 2]         tya
12ff : 49c3             [ 2]         eor #$c3
1301 : a8               [ 2]         tay
1302 : 28               [ 4]         plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   96
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1303 : 840c             [ 3]         sty zpt  
1305 : 08               [ 3]         php         ;flags after load/store sequence
1306 : 49c3             [ 2]         eor #$c3
1308 : a8               [ 2]         tay
1309 : c413             [ 3]         cpy zp1     ;test result
                                     trap_ne
130b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
130d : 68               [ 4]         pla         ;load status
                                     eor_flag 0
130e : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1310 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1313 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1315 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1317 : 48               [ 3]>            pha         ;use stack to load status
1318 : 28               [ 4]>            plp
                             
1319 : ac0902           [ 4]         ldy abs1+1
131c : 08               [ 3]         php         ;test stores do not alter flags
131d : 98               [ 2]         tya
131e : 49c3             [ 2]         eor #$c3
1320 : a8               [ 2]         tay
1321 : 28               [ 4]         plp
1322 : 840d             [ 3]         sty zpt+1
1324 : 08               [ 3]         php         ;flags after load/store sequence
1325 : 49c3             [ 2]         eor #$c3
1327 : a8               [ 2]         tay
1328 : c414             [ 3]         cpy zp1+1   ;test result
                                     trap_ne
132a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
132c : 68               [ 4]         pla         ;load status
                                     eor_flag 0
132d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
132f : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
1332 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1334 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1336 : 48               [ 3]>            pha         ;use stack to load status
1337 : 28               [ 4]>            plp
                             
1338 : ac0a02           [ 4]         ldy abs1+2
133b : 08               [ 3]         php         ;test stores do not alter flags
133c : 98               [ 2]         tya
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   97
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

133d : 49c3             [ 2]         eor #$c3
133f : a8               [ 2]         tay
1340 : 28               [ 4]         plp
1341 : 840e             [ 3]         sty zpt+2
1343 : 08               [ 3]         php         ;flags after load/store sequence
1344 : 49c3             [ 2]         eor #$c3
1346 : a8               [ 2]         tay
1347 : c415             [ 3]         cpy zp1+2   ;test result
                                     trap_ne
1349 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
134b : 68               [ 4]         pla         ;load status
                                     eor_flag 0
134c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
134e : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1351 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1353 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1355 : 48               [ 3]>            pha         ;use stack to load status
1356 : 28               [ 4]>            plp
                             
1357 : ac0b02           [ 4]         ldy abs1+3
135a : 08               [ 3]         php         ;test stores do not alter flags
135b : 98               [ 2]         tya
135c : 49c3             [ 2]         eor #$c3
135e : a8               [ 2]         tay
135f : 28               [ 4]         plp
1360 : 840f             [ 3]         sty zpt+3
1362 : 08               [ 3]         php         ;flags after load/store sequence
1363 : 49c3             [ 2]         eor #$c3
1365 : a8               [ 2]         tay
1366 : c416             [ 3]         cpy zp1+3   ;test result
                                     trap_ne
1368 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
136a : 68               [ 4]         pla         ;load status
                                     eor_flag 0
136b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
136d : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1370 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat $ff
                            >            load_flag $ff
1372 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1374 : 48               [ 3]>            pha         ;use stack to load status
1375 : 28               [ 4]>            plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   98
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
1376 : ac0802           [ 4]         ldy abs1  
1379 : 08               [ 3]         php         ;test stores do not alter flags
137a : 98               [ 2]         tya
137b : 49c3             [ 2]         eor #$c3
137d : a8               [ 2]         tay
137e : 28               [ 4]         plp
137f : 840c             [ 3]         sty zpt  
1381 : 08               [ 3]         php         ;flags after load/store sequence
1382 : 49c3             [ 2]         eor #$c3
1384 : a8               [ 2]         tay
1385 : c513             [ 3]         cmp zp1     ;test result
                                     trap_ne
1387 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1389 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
138a : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
138c : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
138f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
1391 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1393 : 48               [ 3]>            pha         ;use stack to load status
1394 : 28               [ 4]>            plp
                             
1395 : ac0902           [ 4]         ldy abs1+1
1398 : 08               [ 3]         php         ;test stores do not alter flags
1399 : 98               [ 2]         tya
139a : 49c3             [ 2]         eor #$c3
139c : a8               [ 2]         tay
139d : 28               [ 4]         plp
139e : 840d             [ 3]         sty zpt+1
13a0 : 08               [ 3]         php         ;flags after load/store sequence
13a1 : 49c3             [ 2]         eor #$c3
13a3 : a8               [ 2]         tay
13a4 : c514             [ 3]         cmp zp1+1   ;test result
                                     trap_ne
13a6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
13a8 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
13a9 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
13ab : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
13ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
13b0 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   99
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
13b2 : 48               [ 3]>            pha         ;use stack to load status
13b3 : 28               [ 4]>            plp
                             
13b4 : ac0a02           [ 4]         ldy abs1+2
13b7 : 08               [ 3]         php         ;test stores do not alter flags
13b8 : 98               [ 2]         tya
13b9 : 49c3             [ 2]         eor #$c3
13bb : a8               [ 2]         tay
13bc : 28               [ 4]         plp
13bd : 840e             [ 3]         sty zpt+2
13bf : 08               [ 3]         php         ;flags after load/store sequence
13c0 : 49c3             [ 2]         eor #$c3
13c2 : a8               [ 2]         tay
13c3 : c515             [ 3]         cmp zp1+2   ;test result
                                     trap_ne
13c5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
13c7 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
13c8 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
13ca : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
13cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
13cf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
13d1 : 48               [ 3]>            pha         ;use stack to load status
13d2 : 28               [ 4]>            plp
                             
13d3 : ac0b02           [ 4]         ldy abs1+3
13d6 : 08               [ 3]         php         ;test stores do not alter flags
13d7 : 98               [ 2]         tya
13d8 : 49c3             [ 2]         eor #$c3
13da : a8               [ 2]         tay
13db : 28               [ 4]         plp
13dc : 840f             [ 3]         sty zpt+3
13de : 08               [ 3]         php         ;flags after load/store sequence
13df : 49c3             [ 2]         eor #$c3
13e1 : a8               [ 2]         tay
13e2 : c516             [ 3]         cmp zp1+3   ;test result
                                     trap_ne
13e4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
13e6 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
13e7 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
13e9 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
13ec : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  100
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                             
                                     set_stat 0
                            >            load_flag 0
13ee : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
13f0 : 48               [ 3]>            pha         ;use stack to load status
13f1 : 28               [ 4]>            plp
                             
13f2 : a0c3             [ 2]         ldy #$c3  
13f4 : 08               [ 3]         php
13f5 : cc0802           [ 4]         cpy abs1    ;test result
                                     trap_ne
13f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
13fa : 68               [ 4]         pla         ;load status
                                     eor_flag 0
13fb : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
13fd : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1400 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1402 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1404 : 48               [ 3]>            pha         ;use stack to load status
1405 : 28               [ 4]>            plp
                             
1406 : a082             [ 2]         ldy #$82
1408 : 08               [ 3]         php
1409 : cc0902           [ 4]         cpy abs1+1  ;test result
                                     trap_ne
140c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
140e : 68               [ 4]         pla         ;load status
                                     eor_flag 0
140f : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1411 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
1414 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1416 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1418 : 48               [ 3]>            pha         ;use stack to load status
1419 : 28               [ 4]>            plp
                             
141a : a041             [ 2]         ldy #$41
141c : 08               [ 3]         php
141d : cc0a02           [ 4]         cpy abs1+2  ;test result
                                     trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  101
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1420 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1422 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1423 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1425 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1428 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
142a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
142c : 48               [ 3]>            pha         ;use stack to load status
142d : 28               [ 4]>            plp
                             
142e : a000             [ 2]         ldy #0
1430 : 08               [ 3]         php
1431 : cc0b02           [ 4]         cpy abs1+3  ;test result
                                     trap_ne
1434 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1436 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1437 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1439 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
143c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat $ff
                            >            load_flag $ff
143e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1440 : 48               [ 3]>            pha         ;use stack to load status
1441 : 28               [ 4]>            plp
                             
1442 : a0c3             [ 2]         ldy #$c3  
1444 : 08               [ 3]         php
1445 : cc0802           [ 4]         cpy abs1    ;test result
                                     trap_ne
1448 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
144a : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
144b : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
144d : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1450 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  102
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1452 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1454 : 48               [ 3]>            pha         ;use stack to load status
1455 : 28               [ 4]>            plp
                             
1456 : a082             [ 2]         ldy #$82
1458 : 08               [ 3]         php
1459 : cc0902           [ 4]         cpy abs1+1  ;test result
                                     trap_ne
145c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
145e : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
145f : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1461 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
1464 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
1466 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1468 : 48               [ 3]>            pha         ;use stack to load status
1469 : 28               [ 4]>            plp
                             
146a : a041             [ 2]         ldy #$41
146c : 08               [ 3]         php
146d : cc0a02           [ 4]         cpy abs1+2   ;test result
                                     trap_ne
1470 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1472 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1473 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1475 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1478 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
147a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
147c : 48               [ 3]>            pha         ;use stack to load status
147d : 28               [ 4]>            plp
                             
147e : a000             [ 2]         ldy #0
1480 : 08               [ 3]         php
1481 : cc0b02           [ 4]         cpy abs1+3  ;test result
                                     trap_ne
1484 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1486 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  103
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1487 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1489 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
148c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     
148e : a000             [ 2]         ldy #0
1490 : a50c             [ 3]         lda zpt  
1492 : 49c3             [ 2]         eor #$c3
1494 : c513             [ 3]         cmp zp1  
                                     trap_ne     ;store to zp   data
1496 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1498 : 840c             [ 3]         sty zpt     ;clear                
149a : ad0302           [ 4]         lda abst  
149d : 49c3             [ 2]         eor #$c3
149f : cd0802           [ 4]         cmp abs1  
                                     trap_ne     ;store to abs   data
14a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
14a4 : 8c0302           [ 4]         sty abst    ;clear                
14a7 : a50d             [ 3]         lda zpt+1
14a9 : 49c3             [ 2]         eor #$c3
14ab : c514             [ 3]         cmp zp1+1
                                     trap_ne     ;store to zp+1 data
14ad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
14af : 840d             [ 3]         sty zpt+1   ;clear                
14b1 : ad0402           [ 4]         lda abst+1
14b4 : 49c3             [ 2]         eor #$c3
14b6 : cd0902           [ 4]         cmp abs1+1
                                     trap_ne     ;store to abs+1 data
14b9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
14bb : 8c0402           [ 4]         sty abst+1  ;clear                
14be : a50e             [ 3]         lda zpt+2
14c0 : 49c3             [ 2]         eor #$c3
14c2 : c515             [ 3]         cmp zp1+2
                                     trap_ne     ;store to zp+2 data
14c4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
14c6 : 840e             [ 3]         sty zpt+2   ;clear                
14c8 : ad0502           [ 4]         lda abst+2
14cb : 49c3             [ 2]         eor #$c3
14cd : cd0a02           [ 4]         cmp abs1+2
                                     trap_ne     ;store to abs+2 data
14d0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
14d2 : 8c0502           [ 4]         sty abst+2  ;clear                
14d5 : a50f             [ 3]         lda zpt+3
14d7 : 49c3             [ 2]         eor #$c3
14d9 : c516             [ 3]         cmp zp1+3
                                     trap_ne     ;store to zp+3 data
14db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  104
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
14dd : 840f             [ 3]         sty zpt+3   ;clear                
14df : ad0602           [ 4]         lda abst+3
14e2 : 49c3             [ 2]         eor #$c3
14e4 : cd0b02           [ 4]         cmp abs1+3
                                     trap_ne     ;store to abs+3 data
14e7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
14e9 : 8c0602           [ 4]         sty abst+3  ;clear                
                                     next_test
14ec : ad0002           [ 4]>            lda test_case   ;previous test
14ef : c914             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
14f1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0015 =                      >test_num = test_num + 1
14f3 : a915             [ 2]>            lda #test_num   ;*** this tests' number
14f5 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; testing load / store accumulator LDA / STA all addressing modes
                             ; LDA / STA - zp,x / abs,x
14f8 : a203             [ 2]         ldx #3
14fa :                       tldax    
                                     set_stat 0
                            >            load_flag 0
14fa : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
14fc : 48               [ 3]>            pha         ;use stack to load status
14fd : 28               [ 4]>            plp
                             
14fe : b513             [ 4]         lda zp1,x
1500 : 08               [ 3]         php         ;test stores do not alter flags
1501 : 49c3             [ 2]         eor #$c3
1503 : 28               [ 4]         plp
1504 : 9d0302           [ 5]         sta abst,x
1507 : 08               [ 3]         php         ;flags after load/store sequence
1508 : 49c3             [ 2]         eor #$c3
150a : dd0802           [ 4]         cmp abs1,x  ;test result
                                     trap_ne
150d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
150f : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1510 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1512 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
                                     trap_ne
1515 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1517 : ca               [ 2]         dex
1518 : 10e0             [ 4]         bpl tldax                  
                             
151a : a203             [ 2]         ldx #3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  105
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

151c :                       tldax1   
                                     set_stat $ff
                            >            load_flag $ff
151c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
151e : 48               [ 3]>            pha         ;use stack to load status
151f : 28               [ 4]>            plp
                             
1520 : b513             [ 4]         lda zp1,x
1522 : 08               [ 3]         php         ;test stores do not alter flags
1523 : 49c3             [ 2]         eor #$c3
1525 : 28               [ 4]         plp
1526 : 9d0302           [ 5]         sta abst,x
1529 : 08               [ 3]         php         ;flags after load/store sequence
152a : 49c3             [ 2]         eor #$c3
152c : dd0802           [ 4]         cmp abs1,x   ;test result
                                     trap_ne
152f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1531 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1532 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1534 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
                                     trap_ne
1537 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1539 : ca               [ 2]         dex
153a : 10e0             [ 3]         bpl tldax1                  
                             
153c : a203             [ 2]         ldx #3
153e :                       tldax2   
                                     set_stat 0
                            >            load_flag 0
153e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1540 : 48               [ 3]>            pha         ;use stack to load status
1541 : 28               [ 4]>            plp
                             
1542 : bd0802           [ 4]         lda abs1,x
1545 : 08               [ 3]         php         ;test stores do not alter flags
1546 : 49c3             [ 2]         eor #$c3
1548 : 28               [ 4]         plp
1549 : 950c             [ 4]         sta zpt,x
154b : 08               [ 3]         php         ;flags after load/store sequence
154c : 49c3             [ 2]         eor #$c3
154e : d513             [ 4]         cmp zp1,x   ;test result
                                     trap_ne
1550 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1552 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1553 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1555 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  106
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     trap_ne
1558 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
155a : ca               [ 2]         dex
155b : 10e1             [ 3]         bpl tldax2                  
                             
155d : a203             [ 2]         ldx #3
155f :                       tldax3
                                     set_stat $ff
                            >            load_flag $ff
155f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1561 : 48               [ 3]>            pha         ;use stack to load status
1562 : 28               [ 4]>            plp
                             
1563 : bd0802           [ 4]         lda abs1,x
1566 : 08               [ 3]         php         ;test stores do not alter flags
1567 : 49c3             [ 2]         eor #$c3
1569 : 28               [ 4]         plp
156a : 950c             [ 4]         sta zpt,x
156c : 08               [ 3]         php         ;flags after load/store sequence
156d : 49c3             [ 2]         eor #$c3
156f : d513             [ 4]         cmp zp1,x   ;test result
                                     trap_ne
1571 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1573 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1574 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1576 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
                                     trap_ne
1579 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
157b : ca               [ 2]         dex
157c : 10e1             [ 3]         bpl tldax3
                             
157e : a203             [ 2]         ldx #3      ;testing store result
1580 : a000             [ 2]         ldy #0
1582 : b50c             [ 4] tstax   lda zpt,x
1584 : 49c3             [ 2]         eor #$c3
1586 : d513             [ 4]         cmp zp1,x
                                     trap_ne     ;store to zp,x data
1588 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
158a : 940c             [ 4]         sty zpt,x   ;clear                
158c : bd0302           [ 4]         lda abst,x
158f : 49c3             [ 2]         eor #$c3
1591 : dd0802           [ 4]         cmp abs1,x
                                     trap_ne     ;store to abs,x data
1594 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1596 : 8a               [ 2]         txa
1597 : 9d0302           [ 5]         sta abst,x  ;clear                
159a : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  107
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

159b : 10e5             [ 3]         bpl tstax
                                     next_test
159d : ad0002           [ 4]>            lda test_case   ;previous test
15a0 : c915             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
15a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0016 =                      >test_num = test_num + 1
15a4 : a916             [ 2]>            lda #test_num   ;*** this tests' number
15a6 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; LDA / STA - (zp),y / abs,y / (zp,x)
15a9 : a003             [ 2]         ldy #3
15ab :                       tlday    
                                     set_stat 0
                            >            load_flag 0
15ab : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
15ad : 48               [ 3]>            pha         ;use stack to load status
15ae : 28               [ 4]>            plp
                             
15af : b124             [ 5]         lda (ind1),y
15b1 : 08               [ 3]         php         ;test stores do not alter flags
15b2 : 49c3             [ 2]         eor #$c3
15b4 : 28               [ 4]         plp
15b5 : 990302           [ 5]         sta abst,y
15b8 : 08               [ 3]         php         ;flags after load/store sequence
15b9 : 49c3             [ 2]         eor #$c3
15bb : d90802           [ 4]         cmp abs1,y  ;test result
                                     trap_ne
15be : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
15c0 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
15c1 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
15c3 : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
15c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
15c8 : 88               [ 2]         dey
15c9 : 10e0             [ 3]         bpl tlday                  
                             
15cb : a003             [ 2]         ldy #3
15cd :                       tlday1   
                                     set_stat $ff
                            >            load_flag $ff
15cd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
15cf : 48               [ 3]>            pha         ;use stack to load status
15d0 : 28               [ 4]>            plp
                             
15d1 : b124             [ 5]         lda (ind1),y
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  108
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

15d3 : 08               [ 3]         php         ;test stores do not alter flags
15d4 : 49c3             [ 2]         eor #$c3
15d6 : 28               [ 4]         plp
15d7 : 990302           [ 5]         sta abst,y
15da : 08               [ 3]         php         ;flags after load/store sequence
15db : 49c3             [ 2]         eor #$c3
15dd : d90802           [ 4]         cmp abs1,y  ;test result
                                     trap_ne
15e0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
15e2 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
15e3 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
15e5 : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
15e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
15ea : 88               [ 2]         dey
15eb : 10e0             [ 3]         bpl tlday1                  
                             
15ed : a003             [ 2]         ldy #3      ;testing store result
15ef : a200             [ 2]         ldx #0
15f1 : b90302           [ 4] tstay   lda abst,y
15f4 : 49c3             [ 2]         eor #$c3
15f6 : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
15f9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
15fb : 8a               [ 2]         txa
15fc : 990302           [ 5]         sta abst,y  ;clear                
15ff : 88               [ 2]         dey
1600 : 10ef             [ 4]         bpl tstay
                             
1602 : a003             [ 2]         ldy #3
1604 :                       tlday2   
                                     set_stat 0
                            >            load_flag 0
1604 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1606 : 48               [ 3]>            pha         ;use stack to load status
1607 : 28               [ 4]>            plp
                             
1608 : b90802           [ 4]         lda abs1,y
160b : 08               [ 3]         php         ;test stores do not alter flags
160c : 49c3             [ 2]         eor #$c3
160e : 28               [ 4]         plp
160f : 9130             [ 5]         sta (indt),y
1611 : 08               [ 3]         php         ;flags after load/store sequence
1612 : 49c3             [ 2]         eor #$c3
1614 : d124             [ 5]         cmp (ind1),y    ;test result
                                     trap_ne
1616 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1618 : 68               [ 4]         pla         ;load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  109
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     eor_flag 0
1619 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
161b : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
161e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1620 : 88               [ 2]         dey
1621 : 10e1             [ 3]         bpl tlday2                  
                             
1623 : a003             [ 2]         ldy #3
1625 :                       tlday3   
                                     set_stat $ff
                            >            load_flag $ff
1625 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1627 : 48               [ 3]>            pha         ;use stack to load status
1628 : 28               [ 4]>            plp
                             
1629 : b90802           [ 4]         lda abs1,y
162c : 08               [ 3]         php         ;test stores do not alter flags
162d : 49c3             [ 2]         eor #$c3
162f : 28               [ 4]         plp
1630 : 9130             [ 5]         sta (indt),y
1632 : 08               [ 3]         php         ;flags after load/store sequence
1633 : 49c3             [ 2]         eor #$c3
1635 : d124             [ 5]         cmp (ind1),y   ;test result
                                     trap_ne
1637 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1639 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
163a : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
163c : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
163f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1641 : 88               [ 2]         dey
1642 : 10e1             [ 3]         bpl tlday3
                                     
1644 : a003             [ 2]         ldy #3      ;testing store result
1646 : a200             [ 2]         ldx #0
1648 : b90302           [ 4] tstay1  lda abst,y
164b : 49c3             [ 2]         eor #$c3
164d : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
1650 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1652 : 8a               [ 2]         txa
1653 : 990302           [ 5]         sta abst,y  ;clear                
1656 : 88               [ 2]         dey
1657 : 10ef             [ 3]         bpl tstay1
                                     
1659 : a206             [ 2]         ldx #6
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  110
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

165b : a003             [ 2]         ldy #3
165d :                       tldax4   
                                     set_stat 0
                            >            load_flag 0
165d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
165f : 48               [ 3]>            pha         ;use stack to load status
1660 : 28               [ 4]>            plp
                             
1661 : a124             [ 6]         lda (ind1,x)
1663 : 08               [ 3]         php         ;test stores do not alter flags
1664 : 49c3             [ 2]         eor #$c3
1666 : 28               [ 4]         plp
1667 : 8130             [ 6]         sta (indt,x)
1669 : 08               [ 3]         php         ;flags after load/store sequence
166a : 49c3             [ 2]         eor #$c3
166c : d90802           [ 4]         cmp abs1,y  ;test result
                                     trap_ne
166f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1671 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1672 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1674 : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
1677 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1679 : ca               [ 2]         dex
167a : ca               [ 2]         dex
167b : 88               [ 2]         dey
167c : 10df             [ 3]         bpl tldax4                  
                             
167e : a206             [ 2]         ldx #6
1680 : a003             [ 2]         ldy #3
1682 :                       tldax5
                                     set_stat $ff
                            >            load_flag $ff
1682 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1684 : 48               [ 3]>            pha         ;use stack to load status
1685 : 28               [ 4]>            plp
                             
1686 : a124             [ 6]         lda (ind1,x)
1688 : 08               [ 3]         php         ;test stores do not alter flags
1689 : 49c3             [ 2]         eor #$c3
168b : 28               [ 4]         plp
168c : 8130             [ 6]         sta (indt,x)
168e : 08               [ 3]         php         ;flags after load/store sequence
168f : 49c3             [ 2]         eor #$c3
1691 : d90802           [ 4]         cmp abs1,y  ;test result
                                     trap_ne
1694 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1696 : 68               [ 4]         pla         ;load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  111
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     eor_flag lo~fnz ;mask bits not altered
1697 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1699 : d90d02           [ 4]         cmp fLDx,y  ;test flags
                                     trap_ne
169c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
169e : ca               [ 2]         dex
169f : ca               [ 2]         dex
16a0 : 88               [ 2]         dey
16a1 : 10df             [ 3]         bpl tldax5
                             
16a3 : a003             [ 2]         ldy #3      ;testing store result
16a5 : a200             [ 2]         ldx #0
16a7 : b90302           [ 4] tstay2  lda abst,y
16aa : 49c3             [ 2]         eor #$c3
16ac : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
16af : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
16b1 : 8a               [ 2]         txa
16b2 : 990302           [ 5]         sta abst,y  ;clear                
16b5 : 88               [ 2]         dey
16b6 : 10ef             [ 3]         bpl tstay2
                                     next_test
16b8 : ad0002           [ 4]>            lda test_case   ;previous test
16bb : c916             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
16bd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0017 =                      >test_num = test_num + 1
16bf : a917             [ 2]>            lda #test_num   ;*** this tests' number
16c1 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; indexed wraparound test (only zp should wrap)
16c4 : a2fd             [ 2]         ldx #3+$fa
16c6 : b519             [ 4] tldax6  lda zp1-$fa&$ff,x   ;wrap on indexed zp
16c8 : 9d0901           [ 5]         sta abst-$fa,x      ;no STX abs,x!
16cb : ca               [ 2]         dex
16cc : e0fa             [ 2]         cpx #$fa
16ce : b0f6             [ 3]         bcs tldax6                  
16d0 : a2fd             [ 2]         ldx #3+$fa
16d2 : bd0e01           [ 4] tldax7  lda abs1-$fa,x      ;no wrap on indexed abs
16d5 : 9512             [ 4]         sta zpt-$fa&$ff,x
16d7 : ca               [ 2]         dex
16d8 : e0fa             [ 2]         cpx #$fa
16da : b0f6             [ 3]         bcs tldax7
                                                       
16dc : a203             [ 2]         ldx #3      ;testing wraparound result
16de : a000             [ 2]         ldy #0
16e0 : b50c             [ 4] tstax1  lda zpt,x
16e2 : d513             [ 4]         cmp zp1,x
                                     trap_ne     ;store to zp,x data
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  112
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

16e4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
16e6 : 940c             [ 4]         sty zpt,x   ;clear                
16e8 : bd0302           [ 4]         lda abst,x
16eb : dd0802           [ 4]         cmp abs1,x
                                     trap_ne     ;store to abs,x data
16ee : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
16f0 : 8a               [ 2]         txa
16f1 : 9d0302           [ 5]         sta abst,x  ;clear                
16f4 : ca               [ 2]         dex
16f5 : 10e9             [ 3]         bpl tstax1
                             
16f7 : a0fb             [ 2]         ldy #3+$f8
16f9 : a2fe             [ 2]         ldx #6+$f8
16fb : a12c             [ 6] tlday4  lda (ind1-$f8&$ff,x) ;wrap on indexed zp indirect
16fd : 990b01           [ 5]         sta abst-$f8,y
1700 : ca               [ 2]         dex
1701 : ca               [ 2]         dex
1702 : 88               [ 2]         dey
1703 : c0f8             [ 2]         cpy #$f8
1705 : b0f4             [ 4]         bcs tlday4
1707 : a003             [ 2]         ldy #3      ;testing wraparound result
1709 : a200             [ 2]         ldx #0
170b : b90302           [ 4] tstay4  lda abst,y
170e : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
1711 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1713 : 8a               [ 2]         txa
1714 : 990302           [ 5]         sta abst,y  ;clear                
1717 : 88               [ 2]         dey
1718 : 10f1             [ 3]         bpl tstay4
                                     
171a : a0fb             [ 2]         ldy #3+$f8
171c : b91001           [ 4] tlday5  lda abs1-$f8,y  ;no wrap on indexed abs
171f : 9138             [ 5]         sta (inwt),y
1721 : 88               [ 2]         dey
1722 : c0f8             [ 2]         cpy #$f8
1724 : b0f6             [ 3]         bcs tlday5                  
1726 : a003             [ 2]         ldy #3      ;testing wraparound result
1728 : a200             [ 2]         ldx #0
172a : b90302           [ 4] tstay5  lda abst,y
172d : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
1730 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1732 : 8a               [ 2]         txa
1733 : 990302           [ 5]         sta abst,y  ;clear                
1736 : 88               [ 2]         dey
1737 : 10f1             [ 3]         bpl tstay5
                             
1739 : a0fb             [ 2]         ldy #3+$f8
173b : a2fe             [ 2]         ldx #6+$f8
173d : b12e             [ 5] tlday6  lda (inw1),y    ;no wrap on zp indirect indexed 
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  113
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

173f : 8138             [ 6]         sta (indt-$f8&$ff,x)
1741 : ca               [ 2]         dex
1742 : ca               [ 2]         dex
1743 : 88               [ 2]         dey
1744 : c0f8             [ 2]         cpy #$f8
1746 : b0f5             [ 3]         bcs tlday6
1748 : a003             [ 2]         ldy #3      ;testing wraparound result
174a : a200             [ 2]         ldx #0
174c : b90302           [ 4] tstay6  lda abst,y
174f : d90802           [ 4]         cmp abs1,y
                                     trap_ne     ;store to abs data
1752 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1754 : 8a               [ 2]         txa
1755 : 990302           [ 5]         sta abst,y  ;clear                
1758 : 88               [ 2]         dey
1759 : 10f1             [ 3]         bpl tstay6
                                     next_test
175b : ad0002           [ 4]>            lda test_case   ;previous test
175e : c917             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
1760 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0018 =                      >test_num = test_num + 1
1762 : a918             [ 2]>            lda #test_num   ;*** this tests' number
1764 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; LDA / STA - zp / abs / #
                                     set_stat 0  
                            >            load_flag 0  
1767 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
                            >
1769 : 48               [ 3]>            pha         ;use stack to load status
176a : 28               [ 4]>            plp
                             
176b : a513             [ 3]         lda zp1
176d : 08               [ 3]         php         ;test stores do not alter flags
176e : 49c3             [ 2]         eor #$c3
1770 : 28               [ 4]         plp
1771 : 8d0302           [ 4]         sta abst
1774 : 08               [ 3]         php         ;flags after load/store sequence
1775 : 49c3             [ 2]         eor #$c3
1777 : c9c3             [ 2]         cmp #$c3    ;test result
                                     trap_ne
1779 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
177b : 68               [ 4]         pla         ;load status
                                     eor_flag 0
177c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
177e : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1781 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  114
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     set_stat 0
                            >            load_flag 0
1783 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1785 : 48               [ 3]>            pha         ;use stack to load status
1786 : 28               [ 4]>            plp
                             
1787 : a514             [ 3]         lda zp1+1
1789 : 08               [ 3]         php         ;test stores do not alter flags
178a : 49c3             [ 2]         eor #$c3
178c : 28               [ 4]         plp
178d : 8d0402           [ 4]         sta abst+1
1790 : 08               [ 3]         php         ;flags after load/store sequence
1791 : 49c3             [ 2]         eor #$c3
1793 : c982             [ 2]         cmp #$82    ;test result
                                     trap_ne
1795 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1797 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1798 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
179a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
179d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
179f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
17a1 : 48               [ 3]>            pha         ;use stack to load status
17a2 : 28               [ 4]>            plp
                             
17a3 : a515             [ 3]         lda zp1+2
17a5 : 08               [ 3]         php         ;test stores do not alter flags
17a6 : 49c3             [ 2]         eor #$c3
17a8 : 28               [ 4]         plp
17a9 : 8d0502           [ 4]         sta abst+2
17ac : 08               [ 3]         php         ;flags after load/store sequence
17ad : 49c3             [ 2]         eor #$c3
17af : c941             [ 2]         cmp #$41    ;test result
                                     trap_ne
17b1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
17b3 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
17b4 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
17b6 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
17b9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  115
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

17bb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
17bd : 48               [ 3]>            pha         ;use stack to load status
17be : 28               [ 4]>            plp
                             
17bf : a516             [ 3]         lda zp1+3
17c1 : 08               [ 3]         php         ;test stores do not alter flags
17c2 : 49c3             [ 2]         eor #$c3
17c4 : 28               [ 4]         plp
17c5 : 8d0602           [ 4]         sta abst+3
17c8 : 08               [ 3]         php         ;flags after load/store sequence
17c9 : 49c3             [ 2]         eor #$c3
17cb : c900             [ 2]         cmp #0      ;test result
                                     trap_ne
17cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
17cf : 68               [ 4]         pla         ;load status
                                     eor_flag 0
17d0 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
17d2 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
17d5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
17d7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
17d9 : 48               [ 3]>            pha         ;use stack to load status
17da : 28               [ 4]>            plp
                             
17db : a513             [ 3]         lda zp1  
17dd : 08               [ 3]         php         ;test stores do not alter flags
17de : 49c3             [ 2]         eor #$c3
17e0 : 28               [ 4]         plp
17e1 : 8d0302           [ 4]         sta abst  
17e4 : 08               [ 3]         php         ;flags after load/store sequence
17e5 : 49c3             [ 2]         eor #$c3
17e7 : c9c3             [ 2]         cmp #$c3    ;test result
                                     trap_ne
17e9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
17eb : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
17ec : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
17ee : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
17f1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
17f3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
17f5 : 48               [ 3]>            pha         ;use stack to load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  116
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

17f6 : 28               [ 4]>            plp
                             
17f7 : a514             [ 3]         lda zp1+1
17f9 : 08               [ 3]         php         ;test stores do not alter flags
17fa : 49c3             [ 2]         eor #$c3
17fc : 28               [ 4]         plp
17fd : 8d0402           [ 4]         sta abst+1
1800 : 08               [ 3]         php         ;flags after load/store sequence
1801 : 49c3             [ 2]         eor #$c3
1803 : c982             [ 2]         cmp #$82    ;test result
                                     trap_ne
1805 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1807 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1808 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
180a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
180d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
180f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1811 : 48               [ 3]>            pha         ;use stack to load status
1812 : 28               [ 4]>            plp
                             
1813 : a515             [ 3]         lda zp1+2
1815 : 08               [ 3]         php         ;test stores do not alter flags
1816 : 49c3             [ 2]         eor #$c3
1818 : 28               [ 4]         plp
1819 : 8d0502           [ 4]         sta abst+2
181c : 08               [ 3]         php         ;flags after load/store sequence
181d : 49c3             [ 2]         eor #$c3
181f : c941             [ 2]         cmp #$41    ;test result
                                     trap_ne
1821 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1823 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1824 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1826 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1829 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
182b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
182d : 48               [ 3]>            pha         ;use stack to load status
182e : 28               [ 4]>            plp
                             
182f : a516             [ 3]         lda zp1+3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  117
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1831 : 08               [ 3]         php         ;test stores do not alter flags
1832 : 49c3             [ 2]         eor #$c3
1834 : 28               [ 4]         plp
1835 : 8d0602           [ 4]         sta abst+3
1838 : 08               [ 3]         php         ;flags after load/store sequence
1839 : 49c3             [ 2]         eor #$c3
183b : c900             [ 2]         cmp #0      ;test result
                                     trap_ne
183d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
183f : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1840 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1842 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1845 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1847 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1849 : 48               [ 3]>            pha         ;use stack to load status
184a : 28               [ 4]>            plp
                             
184b : ad0802           [ 4]         lda abs1  
184e : 08               [ 3]         php         ;test stores do not alter flags
184f : 49c3             [ 2]         eor #$c3
1851 : 28               [ 4]         plp
1852 : 850c             [ 3]         sta zpt  
1854 : 08               [ 3]         php         ;flags after load/store sequence
1855 : 49c3             [ 2]         eor #$c3
1857 : c513             [ 3]         cmp zp1     ;test result
                                     trap_ne
1859 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
185b : 68               [ 4]         pla         ;load status
                                     eor_flag 0
185c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
185e : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1861 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1863 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1865 : 48               [ 3]>            pha         ;use stack to load status
1866 : 28               [ 4]>            plp
                             
1867 : ad0902           [ 4]         lda abs1+1
186a : 08               [ 3]         php         ;test stores do not alter flags
186b : 49c3             [ 2]         eor #$c3
186d : 28               [ 4]         plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  118
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

186e : 850d             [ 3]         sta zpt+1
1870 : 08               [ 3]         php         ;flags after load/store sequence
1871 : 49c3             [ 2]         eor #$c3
1873 : c514             [ 3]         cmp zp1+1   ;test result
                                     trap_ne
1875 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1877 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1878 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
187a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
187d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
187f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1881 : 48               [ 3]>            pha         ;use stack to load status
1882 : 28               [ 4]>            plp
                             
1883 : ad0a02           [ 4]         lda abs1+2
1886 : 08               [ 3]         php         ;test stores do not alter flags
1887 : 49c3             [ 2]         eor #$c3
1889 : 28               [ 4]         plp
188a : 850e             [ 3]         sta zpt+2
188c : 08               [ 3]         php         ;flags after load/store sequence
188d : 49c3             [ 2]         eor #$c3
188f : c515             [ 3]         cmp zp1+2   ;test result
                                     trap_ne
1891 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1893 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1894 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1896 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1899 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
189b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
189d : 48               [ 3]>            pha         ;use stack to load status
189e : 28               [ 4]>            plp
                             
189f : ad0b02           [ 4]         lda abs1+3
18a2 : 08               [ 3]         php         ;test stores do not alter flags
18a3 : 49c3             [ 2]         eor #$c3
18a5 : 28               [ 4]         plp
18a6 : 850f             [ 3]         sta zpt+3
18a8 : 08               [ 3]         php         ;flags after load/store sequence
18a9 : 49c3             [ 2]         eor #$c3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  119
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

18ab : c516             [ 3]         cmp zp1+3   ;test result
                                     trap_ne
18ad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
18af : 68               [ 4]         pla         ;load status
                                     eor_flag 0
18b0 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
18b2 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
18b5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
18b7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
18b9 : 48               [ 3]>            pha         ;use stack to load status
18ba : 28               [ 4]>            plp
                             
18bb : ad0802           [ 4]         lda abs1  
18be : 08               [ 3]         php         ;test stores do not alter flags
18bf : 49c3             [ 2]         eor #$c3
18c1 : 28               [ 4]         plp
18c2 : 850c             [ 3]         sta zpt  
18c4 : 08               [ 3]         php         ;flags after load/store sequence
18c5 : 49c3             [ 2]         eor #$c3
18c7 : c513             [ 3]         cmp zp1     ;test result
                                     trap_ne
18c9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
18cb : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
18cc : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
18ce : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
18d1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
18d3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
18d5 : 48               [ 3]>            pha         ;use stack to load status
18d6 : 28               [ 4]>            plp
                             
18d7 : ad0902           [ 4]         lda abs1+1
18da : 08               [ 3]         php         ;test stores do not alter flags
18db : 49c3             [ 2]         eor #$c3
18dd : 28               [ 4]         plp
18de : 850d             [ 3]         sta zpt+1
18e0 : 08               [ 3]         php         ;flags after load/store sequence
18e1 : 49c3             [ 2]         eor #$c3
18e3 : c514             [ 3]         cmp zp1+1   ;test result
                                     trap_ne
18e5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  120
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
18e7 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
18e8 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
18ea : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
18ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
18ef : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
18f1 : 48               [ 3]>            pha         ;use stack to load status
18f2 : 28               [ 4]>            plp
                             
18f3 : ad0a02           [ 4]         lda abs1+2
18f6 : 08               [ 3]         php         ;test stores do not alter flags
18f7 : 49c3             [ 2]         eor #$c3
18f9 : 28               [ 4]         plp
18fa : 850e             [ 3]         sta zpt+2
18fc : 08               [ 3]         php         ;flags after load/store sequence
18fd : 49c3             [ 2]         eor #$c3
18ff : c515             [ 3]         cmp zp1+2   ;test result
                                     trap_ne
1901 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1903 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1904 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1906 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1909 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
190b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
190d : 48               [ 3]>            pha         ;use stack to load status
190e : 28               [ 4]>            plp
                             
190f : ad0b02           [ 4]         lda abs1+3
1912 : 08               [ 3]         php         ;test stores do not alter flags
1913 : 49c3             [ 2]         eor #$c3
1915 : 28               [ 4]         plp
1916 : 850f             [ 3]         sta zpt+3
1918 : 08               [ 3]         php         ;flags after load/store sequence
1919 : 49c3             [ 2]         eor #$c3
191b : c516             [ 3]         cmp zp1+3   ;test result
                                     trap_ne
191d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
191f : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  121
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1920 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1922 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1925 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0  
                            >            load_flag 0  
1927 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
                            >
1929 : 48               [ 3]>            pha         ;use stack to load status
192a : 28               [ 4]>            plp
                             
192b : a9c3             [ 2]         lda #$c3
192d : 08               [ 3]         php
192e : cd0802           [ 4]         cmp abs1    ;test result
                                     trap_ne
1931 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1933 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1934 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1936 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
1939 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
193b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
193d : 48               [ 3]>            pha         ;use stack to load status
193e : 28               [ 4]>            plp
                             
193f : a982             [ 2]         lda #$82
1941 : 08               [ 3]         php
1942 : cd0902           [ 4]         cmp abs1+1  ;test result
                                     trap_ne
1945 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1947 : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1948 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
194a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
194d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
194f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1951 : 48               [ 3]>            pha         ;use stack to load status
1952 : 28               [ 4]>            plp
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  122
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1953 : a941             [ 2]         lda #$41
1955 : 08               [ 3]         php
1956 : cd0a02           [ 4]         cmp abs1+2  ;test result
                                     trap_ne
1959 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
195b : 68               [ 4]         pla         ;load status
                                     eor_flag 0
195c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
195e : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
1961 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat 0
                            >            load_flag 0
1963 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1965 : 48               [ 3]>            pha         ;use stack to load status
1966 : 28               [ 4]>            plp
                             
1967 : a900             [ 2]         lda #0
1969 : 08               [ 3]         php
196a : cd0b02           [ 4]         cmp abs1+3  ;test result
                                     trap_ne
196d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
196f : 68               [ 4]         pla         ;load status
                                     eor_flag 0
1970 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                             
1972 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
1975 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
                                     set_stat $ff
                            >            load_flag $ff
1977 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1979 : 48               [ 3]>            pha         ;use stack to load status
197a : 28               [ 4]>            plp
                             
197b : a9c3             [ 2]         lda #$c3  
197d : 08               [ 3]         php
197e : cd0802           [ 4]         cmp abs1    ;test result
                                     trap_ne
1981 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1983 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1984 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
1986 : cd0d02           [ 4]         cmp fLDx    ;test flags
                                     trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  123
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1989 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
198b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
198d : 48               [ 3]>            pha         ;use stack to load status
198e : 28               [ 4]>            plp
                             
198f : a982             [ 2]         lda #$82
1991 : 08               [ 3]         php
1992 : cd0902           [ 4]         cmp abs1+1  ;test result
                                     trap_ne
1995 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1997 : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
1998 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
199a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
                                     trap_ne
199d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
199f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
19a1 : 48               [ 3]>            pha         ;use stack to load status
19a2 : 28               [ 4]>            plp
                             
19a3 : a941             [ 2]         lda #$41
19a5 : 08               [ 3]         php
19a6 : cd0a02           [ 4]         cmp abs1+2  ;test result
                                     trap_ne
19a9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
19ab : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
19ac : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
19ae : cd0f02           [ 4]         cmp fLDx+2  ;test flags
                                     trap_ne
19b1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
19b3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
19b5 : 48               [ 3]>            pha         ;use stack to load status
19b6 : 28               [ 4]>            plp
                             
19b7 : a900             [ 2]         lda #0
19b9 : 08               [ 3]         php
19ba : cd0b02           [ 4]         cmp abs1+3  ;test result
                                     trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  124
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

19bd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
19bf : 68               [ 4]         pla         ;load status
                                     eor_flag lo~fnz ;mask bits not altered
19c0 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
                             
19c2 : cd1002           [ 4]         cmp fLDx+3  ;test flags
                                     trap_ne
19c5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                             
19c7 : a200             [ 2]         ldx #0
19c9 : a50c             [ 3]         lda zpt  
19cb : 49c3             [ 2]         eor #$c3
19cd : c513             [ 3]         cmp zp1  
                                     trap_ne     ;store to zp data
19cf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
19d1 : 860c             [ 3]         stx zpt     ;clear                
19d3 : ad0302           [ 4]         lda abst  
19d6 : 49c3             [ 2]         eor #$c3
19d8 : cd0802           [ 4]         cmp abs1  
                                     trap_ne     ;store to abs data
19db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
19dd : 8e0302           [ 4]         stx abst    ;clear                
19e0 : a50d             [ 3]         lda zpt+1
19e2 : 49c3             [ 2]         eor #$c3
19e4 : c514             [ 3]         cmp zp1+1
                                     trap_ne     ;store to zp data
19e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
19e8 : 860d             [ 3]         stx zpt+1   ;clear                
19ea : ad0402           [ 4]         lda abst+1
19ed : 49c3             [ 2]         eor #$c3
19ef : cd0902           [ 4]         cmp abs1+1
                                     trap_ne     ;store to abs data
19f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
19f4 : 8e0402           [ 4]         stx abst+1  ;clear                
19f7 : a50e             [ 3]         lda zpt+2
19f9 : 49c3             [ 2]         eor #$c3
19fb : c515             [ 3]         cmp zp1+2
                                     trap_ne     ;store to zp data
19fd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
19ff : 860e             [ 3]         stx zpt+2   ;clear                
1a01 : ad0502           [ 4]         lda abst+2
1a04 : 49c3             [ 2]         eor #$c3
1a06 : cd0a02           [ 4]         cmp abs1+2
                                     trap_ne     ;store to abs data
1a09 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1a0b : 8e0502           [ 4]         stx abst+2  ;clear                
1a0e : a50f             [ 3]         lda zpt+3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  125
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1a10 : 49c3             [ 2]         eor #$c3
1a12 : c516             [ 3]         cmp zp1+3
                                     trap_ne     ;store to zp data
1a14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1a16 : 860f             [ 3]         stx zpt+3   ;clear                
1a18 : ad0602           [ 4]         lda abst+3
1a1b : 49c3             [ 2]         eor #$c3
1a1d : cd0b02           [ 4]         cmp abs1+3
                                     trap_ne     ;store to abs data
1a20 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
1a22 : 8e0602           [ 4]         stx abst+3  ;clear                
                                     next_test
1a25 : ad0002           [ 4]>            lda test_case   ;previous test
1a28 : c918             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
1a2a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0019 =                      >test_num = test_num + 1
1a2c : a919             [ 2]>            lda #test_num   ;*** this tests' number
1a2e : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; testing bit test & compares BIT CPX CPY CMP all addressing modes
                             ; BIT - zp / abs
                                     set_a $ff,0
                            >            load_flag 0
1a31 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1a33 : 48               [ 3]>            pha         ;use stack to load status
1a34 : a9ff             [ 2]>            lda #$ff     ;precharge accu
1a36 : 28               [ 4]>            plp
                             
1a37 : 2416             [ 3]         bit zp1+3   ;00 - should set Z / clear  NV
                                     tst_a $ff,fz 
1a39 : 08               [ 3]>            php         ;save flags
1a3a : 08               [ 3]>            php
1a3b : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
1a3d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a3f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fz 
1a40 : c932             [ 2]>            cmp #(fz |fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1a42 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a44 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,0
                            >            load_flag 0
1a45 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  126
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
1a47 : 48               [ 3]>            pha         ;use stack to load status
1a48 : a901             [ 2]>            lda #1     ;precharge accu
1a4a : 28               [ 4]>            plp
                             
1a4b : 2415             [ 3]         bit zp1+2   ;41 - should set V (M6) / clear NZ
                                     tst_a 1,fv
1a4d : 08               [ 3]>            php         ;save flags
1a4e : 08               [ 3]>            php
1a4f : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1a51 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a53 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fv
1a54 : c970             [ 2]>            cmp #(fv|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1a56 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a58 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,0
                            >            load_flag 0
1a59 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1a5b : 48               [ 3]>            pha         ;use stack to load status
1a5c : a901             [ 2]>            lda #1     ;precharge accu
1a5e : 28               [ 4]>            plp
                             
1a5f : 2414             [ 3]         bit zp1+1   ;82 - should set N (M7) & Z / clear V
                                     tst_a 1,fnz
1a61 : 08               [ 3]>            php         ;save flags
1a62 : 08               [ 3]>            php
1a63 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1a65 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a67 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fnz
1a68 : c9b2             [ 2]>            cmp #(fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1a6a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a6c : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,0
                            >            load_flag 0
1a6d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1a6f : 48               [ 3]>            pha         ;use stack to load status
1a70 : a901             [ 2]>            lda #1     ;precharge accu
1a72 : 28               [ 4]>            plp
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  127
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1a73 : 2413             [ 3]         bit zp1     ;c3 - should set N (M7) & V (M6) / clear Z
                                     tst_a 1,fnv
1a75 : 08               [ 3]>            php         ;save flags
1a76 : 08               [ 3]>            php
1a77 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1a79 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a7b : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fnv
1a7c : c9f0             [ 2]>            cmp #(fnv|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1a7e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a80 : 28               [ 4]>            plp         ;restore status
                             
                                     
                                     set_a $ff,$ff
                            >            load_flag $ff
1a81 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1a83 : 48               [ 3]>            pha         ;use stack to load status
1a84 : a9ff             [ 2]>            lda #$ff     ;precharge accu
1a86 : 28               [ 4]>            plp
                             
1a87 : 2416             [ 3]         bit zp1+3   ;00 - should set Z / clear  NV
                                     tst_a $ff,~fnv 
1a89 : 08               [ 3]>            php         ;save flags
1a8a : 08               [ 3]>            php
1a8b : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
1a8d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a8f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnv 
1a90 : c93f             [ 2]>            cmp #(~fnv |fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1a92 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1a94 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,$ff
                            >            load_flag $ff
1a95 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1a97 : 48               [ 3]>            pha         ;use stack to load status
1a98 : a901             [ 2]>            lda #1     ;precharge accu
1a9a : 28               [ 4]>            plp
                             
1a9b : 2415             [ 3]         bit zp1+2   ;41 - should set V (M6) / clear NZ
                                     tst_a 1,~fnz
1a9d : 08               [ 3]>            php         ;save flags
1a9e : 08               [ 3]>            php
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  128
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1a9f : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1aa1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1aa3 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
1aa4 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1aa6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1aa8 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,$ff
                            >            load_flag $ff
1aa9 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1aab : 48               [ 3]>            pha         ;use stack to load status
1aac : a901             [ 2]>            lda #1     ;precharge accu
1aae : 28               [ 4]>            plp
                             
1aaf : 2414             [ 3]         bit zp1+1   ;82 - should set N (M7) & Z / clear V
                                     tst_a 1,~fv
1ab1 : 08               [ 3]>            php         ;save flags
1ab2 : 08               [ 3]>            php
1ab3 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1ab5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ab7 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fv
1ab8 : c9bf             [ 2]>            cmp #(~fv|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1aba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1abc : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,$ff
                            >            load_flag $ff
1abd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1abf : 48               [ 3]>            pha         ;use stack to load status
1ac0 : a901             [ 2]>            lda #1     ;precharge accu
1ac2 : 28               [ 4]>            plp
                             
1ac3 : 2413             [ 3]         bit zp1     ;c3 - should set N (M7) & V (M6) / clear Z
                                     tst_a 1,~fz
1ac5 : 08               [ 3]>            php         ;save flags
1ac6 : 08               [ 3]>            php
1ac7 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1ac9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1acb : 68               [ 4]>            pla         ;load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  129
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            cmp_flag ~fz
1acc : c9fd             [ 2]>            cmp #(~fz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ace : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ad0 : 28               [ 4]>            plp         ;restore status
                             
                                     
                                     set_a $ff,0
                            >            load_flag 0
1ad1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1ad3 : 48               [ 3]>            pha         ;use stack to load status
1ad4 : a9ff             [ 2]>            lda #$ff     ;precharge accu
1ad6 : 28               [ 4]>            plp
                             
1ad7 : 2c0b02           [ 4]         bit abs1+3  ;00 - should set Z / clear  NV
                                     tst_a $ff,fz 
1ada : 08               [ 3]>            php         ;save flags
1adb : 08               [ 3]>            php
1adc : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
1ade : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ae0 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fz 
1ae1 : c932             [ 2]>            cmp #(fz |fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ae3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ae5 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,0
                            >            load_flag 0
1ae6 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1ae8 : 48               [ 3]>            pha         ;use stack to load status
1ae9 : a901             [ 2]>            lda #1     ;precharge accu
1aeb : 28               [ 4]>            plp
                             
1aec : 2c0a02           [ 4]         bit abs1+2  ;41 - should set V (M6) / clear NZ
                                     tst_a 1,fv
1aef : 08               [ 3]>            php         ;save flags
1af0 : 08               [ 3]>            php
1af1 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1af3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1af5 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fv
1af6 : c970             [ 2]>            cmp #(fv|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  130
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1af8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1afa : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,0
                            >            load_flag 0
1afb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1afd : 48               [ 3]>            pha         ;use stack to load status
1afe : a901             [ 2]>            lda #1     ;precharge accu
1b00 : 28               [ 4]>            plp
                             
1b01 : 2c0902           [ 4]         bit abs1+1  ;82 - should set N (M7) & Z / clear V
                                     tst_a 1,fnz
1b04 : 08               [ 3]>            php         ;save flags
1b05 : 08               [ 3]>            php
1b06 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1b08 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b0a : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fnz
1b0b : c9b2             [ 2]>            cmp #(fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b0d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b0f : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,0
                            >            load_flag 0
1b10 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1b12 : 48               [ 3]>            pha         ;use stack to load status
1b13 : a901             [ 2]>            lda #1     ;precharge accu
1b15 : 28               [ 4]>            plp
                             
1b16 : 2c0802           [ 4]         bit abs1    ;c3 - should set N (M7) & V (M6) / clear Z
                                     tst_a 1,fnv
1b19 : 08               [ 3]>            php         ;save flags
1b1a : 08               [ 3]>            php
1b1b : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1b1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b1f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fnv
1b20 : c9f0             [ 2]>            cmp #(fnv|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b24 : 28               [ 4]>            plp         ;restore status
                             
                                     
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  131
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     set_a $ff,$ff
                            >            load_flag $ff
1b25 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1b27 : 48               [ 3]>            pha         ;use stack to load status
1b28 : a9ff             [ 2]>            lda #$ff     ;precharge accu
1b2a : 28               [ 4]>            plp
                             
1b2b : 2c0b02           [ 4]         bit abs1+3  ;00 - should set Z / clear  NV
                                     tst_a $ff,~fnv 
1b2e : 08               [ 3]>            php         ;save flags
1b2f : 08               [ 3]>            php
1b30 : c9ff             [ 2]>            cmp #$ff     ;test result
                            >            trap_ne
1b32 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b34 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnv 
1b35 : c93f             [ 2]>            cmp #(~fnv |fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b37 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b39 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,$ff
                            >            load_flag $ff
1b3a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1b3c : 48               [ 3]>            pha         ;use stack to load status
1b3d : a901             [ 2]>            lda #1     ;precharge accu
1b3f : 28               [ 4]>            plp
                             
1b40 : 2c0a02           [ 4]         bit abs1+2  ;41 - should set V (M6) / clear NZ
                                     tst_a 1,~fnz
1b43 : 08               [ 3]>            php         ;save flags
1b44 : 08               [ 3]>            php
1b45 : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1b47 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b49 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
1b4a : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b4c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b4e : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,$ff
                            >            load_flag $ff
1b4f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1b51 : 48               [ 3]>            pha         ;use stack to load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  132
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1b52 : a901             [ 2]>            lda #1     ;precharge accu
1b54 : 28               [ 4]>            plp
                             
1b55 : 2c0902           [ 4]         bit abs1+1  ;82 - should set N (M7) & Z / clear V
                                     tst_a 1,~fv
1b58 : 08               [ 3]>            php         ;save flags
1b59 : 08               [ 3]>            php
1b5a : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1b5c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b5e : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fv
1b5f : c9bf             [ 2]>            cmp #(~fv|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b61 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b63 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a 1,$ff
                            >            load_flag $ff
1b64 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1b66 : 48               [ 3]>            pha         ;use stack to load status
1b67 : a901             [ 2]>            lda #1     ;precharge accu
1b69 : 28               [ 4]>            plp
                             
1b6a : 2c0802           [ 4]         bit abs1    ;c3 - should set N (M7) & V (M6) / clear Z
                                     tst_a 1,~fz
1b6d : 08               [ 3]>            php         ;save flags
1b6e : 08               [ 3]>            php
1b6f : c901             [ 2]>            cmp #1     ;test result
                            >            trap_ne
1b71 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b73 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fz
1b74 : c9fd             [ 2]>            cmp #(~fz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b76 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b78 : 28               [ 4]>            plp         ;restore status
                             
                                     next_test
1b79 : ad0002           [ 4]>            lda test_case   ;previous test
1b7c : c919             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
1b7e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
001a =                      >test_num = test_num + 1
1b80 : a91a             [ 2]>            lda #test_num   ;*** this tests' number
1b82 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  133
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     
                             ; CPX - zp / abs / #         
                                     set_x $80,0
                            >            load_flag 0
1b85 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1b87 : 48               [ 3]>            pha         ;use stack to load status
1b88 : a280             [ 2]>            ldx #$80     ;precharge index x
1b8a : 28               [ 4]>            plp
                             
1b8b : e417             [ 3]         cpx zp7f
                                     tst_stat fc
1b8d : 08               [ 3]>            php         ;save status
1b8e : 08               [ 3]>            php         ;use stack to retrieve status
1b8f : 68               [ 4]>            pla
                            >            cmp_flag fc
1b90 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b92 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b94 : 28               [ 4]>            plp         ;restore status
                             
1b95 : ca               [ 2]         dex
1b96 : e417             [ 3]         cpx zp7f
                                     tst_stat fzc
1b98 : 08               [ 3]>            php         ;save status
1b99 : 08               [ 3]>            php         ;use stack to retrieve status
1b9a : 68               [ 4]>            pla
                            >            cmp_flag fzc
1b9b : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1b9d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1b9f : 28               [ 4]>            plp         ;restore status
                             
1ba0 : ca               [ 2]         dex
1ba1 : e417             [ 3]         cpx zp7f
                                     tst_x $7e,fn
1ba3 : 08               [ 3]>            php         ;save flags
1ba4 : 08               [ 3]>            php
1ba5 : e07e             [ 2]>            cpx #$7e     ;test result
                            >            trap_ne
1ba7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ba9 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1baa : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1bac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1bae : 28               [ 4]>            plp         ;restore status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  134
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     set_x $80,$ff
                            >            load_flag $ff
1baf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1bb1 : 48               [ 3]>            pha         ;use stack to load status
1bb2 : a280             [ 2]>            ldx #$80     ;precharge index x
1bb4 : 28               [ 4]>            plp
                             
1bb5 : e417             [ 3]         cpx zp7f
                                     tst_stat ~fnz
1bb7 : 08               [ 3]>            php         ;save status
1bb8 : 08               [ 3]>            php         ;use stack to retrieve status
1bb9 : 68               [ 4]>            pla
                            >            cmp_flag ~fnz
1bba : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1bbc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1bbe : 28               [ 4]>            plp         ;restore status
                             
1bbf : ca               [ 2]         dex
1bc0 : e417             [ 3]         cpx zp7f
                                     tst_stat ~fn
1bc2 : 08               [ 3]>            php         ;save status
1bc3 : 08               [ 3]>            php         ;use stack to retrieve status
1bc4 : 68               [ 4]>            pla
                            >            cmp_flag ~fn
1bc5 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1bc7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1bc9 : 28               [ 4]>            plp         ;restore status
                             
1bca : ca               [ 2]         dex
1bcb : e417             [ 3]         cpx zp7f
                                     tst_x $7e,~fzc
1bcd : 08               [ 3]>            php         ;save flags
1bce : 08               [ 3]>            php
1bcf : e07e             [ 2]>            cpx #$7e     ;test result
                            >            trap_ne
1bd1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1bd3 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1bd4 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1bd6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1bd8 : 28               [ 4]>            plp         ;restore status
                             
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  135
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     set_x $80,0
                            >            load_flag 0
1bd9 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1bdb : 48               [ 3]>            pha         ;use stack to load status
1bdc : a280             [ 2]>            ldx #$80     ;precharge index x
1bde : 28               [ 4]>            plp
                             
1bdf : ec0c02           [ 4]         cpx abs7f
                                     tst_stat fc
1be2 : 08               [ 3]>            php         ;save status
1be3 : 08               [ 3]>            php         ;use stack to retrieve status
1be4 : 68               [ 4]>            pla
                            >            cmp_flag fc
1be5 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1be7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1be9 : 28               [ 4]>            plp         ;restore status
                             
1bea : ca               [ 2]         dex
1beb : ec0c02           [ 4]         cpx abs7f
                                     tst_stat fzc
1bee : 08               [ 3]>            php         ;save status
1bef : 08               [ 3]>            php         ;use stack to retrieve status
1bf0 : 68               [ 4]>            pla
                            >            cmp_flag fzc
1bf1 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1bf3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1bf5 : 28               [ 4]>            plp         ;restore status
                             
1bf6 : ca               [ 2]         dex
1bf7 : ec0c02           [ 4]         cpx abs7f
                                     tst_x $7e,fn
1bfa : 08               [ 3]>            php         ;save flags
1bfb : 08               [ 3]>            php
1bfc : e07e             [ 2]>            cpx #$7e     ;test result
                            >            trap_ne
1bfe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c00 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1c01 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c03 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c05 : 28               [ 4]>            plp         ;restore status
                             
                                     set_x $80,$ff
                            >            load_flag $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  136
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1c06 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1c08 : 48               [ 3]>            pha         ;use stack to load status
1c09 : a280             [ 2]>            ldx #$80     ;precharge index x
1c0b : 28               [ 4]>            plp
                             
1c0c : ec0c02           [ 4]         cpx abs7f
                                     tst_stat ~fnz
1c0f : 08               [ 3]>            php         ;save status
1c10 : 08               [ 3]>            php         ;use stack to retrieve status
1c11 : 68               [ 4]>            pla
                            >            cmp_flag ~fnz
1c12 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c16 : 28               [ 4]>            plp         ;restore status
                             
1c17 : ca               [ 2]         dex
1c18 : ec0c02           [ 4]         cpx abs7f
                                     tst_stat ~fn
1c1b : 08               [ 3]>            php         ;save status
1c1c : 08               [ 3]>            php         ;use stack to retrieve status
1c1d : 68               [ 4]>            pla
                            >            cmp_flag ~fn
1c1e : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c20 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c22 : 28               [ 4]>            plp         ;restore status
                             
1c23 : ca               [ 2]         dex
1c24 : ec0c02           [ 4]         cpx abs7f
                                     tst_x $7e,~fzc
1c27 : 08               [ 3]>            php         ;save flags
1c28 : 08               [ 3]>            php
1c29 : e07e             [ 2]>            cpx #$7e     ;test result
                            >            trap_ne
1c2b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c2d : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1c2e : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c30 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c32 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     set_x $80,0
                            >            load_flag 0
1c33 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  137
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
1c35 : 48               [ 3]>            pha         ;use stack to load status
1c36 : a280             [ 2]>            ldx #$80     ;precharge index x
1c38 : 28               [ 4]>            plp
                             
1c39 : e07f             [ 2]         cpx #$7f
                                     tst_stat fc
1c3b : 08               [ 3]>            php         ;save status
1c3c : 08               [ 3]>            php         ;use stack to retrieve status
1c3d : 68               [ 4]>            pla
                            >            cmp_flag fc
1c3e : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c40 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c42 : 28               [ 4]>            plp         ;restore status
                             
1c43 : ca               [ 2]         dex
1c44 : e07f             [ 2]         cpx #$7f
                                     tst_stat fzc
1c46 : 08               [ 3]>            php         ;save status
1c47 : 08               [ 3]>            php         ;use stack to retrieve status
1c48 : 68               [ 4]>            pla
                            >            cmp_flag fzc
1c49 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c4b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c4d : 28               [ 4]>            plp         ;restore status
                             
1c4e : ca               [ 2]         dex
1c4f : e07f             [ 2]         cpx #$7f
                                     tst_x $7e,fn
1c51 : 08               [ 3]>            php         ;save flags
1c52 : 08               [ 3]>            php
1c53 : e07e             [ 2]>            cpx #$7e     ;test result
                            >            trap_ne
1c55 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c57 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1c58 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c5a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c5c : 28               [ 4]>            plp         ;restore status
                             
                                     set_x $80,$ff
                            >            load_flag $ff
1c5d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1c5f : 48               [ 3]>            pha         ;use stack to load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  138
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1c60 : a280             [ 2]>            ldx #$80     ;precharge index x
1c62 : 28               [ 4]>            plp
                             
1c63 : e07f             [ 2]         cpx #$7f
                                     tst_stat ~fnz
1c65 : 08               [ 3]>            php         ;save status
1c66 : 08               [ 3]>            php         ;use stack to retrieve status
1c67 : 68               [ 4]>            pla
                            >            cmp_flag ~fnz
1c68 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c6a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c6c : 28               [ 4]>            plp         ;restore status
                             
1c6d : ca               [ 2]         dex
1c6e : e07f             [ 2]         cpx #$7f
                                     tst_stat ~fn
1c70 : 08               [ 3]>            php         ;save status
1c71 : 08               [ 3]>            php         ;use stack to retrieve status
1c72 : 68               [ 4]>            pla
                            >            cmp_flag ~fn
1c73 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c75 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c77 : 28               [ 4]>            plp         ;restore status
                             
1c78 : ca               [ 2]         dex
1c79 : e07f             [ 2]         cpx #$7f
                                     tst_x $7e,~fzc
1c7b : 08               [ 3]>            php         ;save flags
1c7c : 08               [ 3]>            php
1c7d : e07e             [ 2]>            cpx #$7e     ;test result
                            >            trap_ne
1c7f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c81 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1c82 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1c84 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1c86 : 28               [ 4]>            plp         ;restore status
                             
                                     next_test
1c87 : ad0002           [ 4]>            lda test_case   ;previous test
1c8a : c91a             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
1c8c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
001b =                      >test_num = test_num + 1
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  139
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1c8e : a91b             [ 2]>            lda #test_num   ;*** this tests' number
1c90 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; CPY - zp / abs / #         
                                     set_y $80,0
                            >            load_flag 0
1c93 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1c95 : 48               [ 3]>            pha         ;use stack to load status
1c96 : a080             [ 2]>            ldy #$80     ;precharge index y
1c98 : 28               [ 4]>            plp
                             
1c99 : c417             [ 3]         cpy zp7f
                                     tst_stat fc
1c9b : 08               [ 3]>            php         ;save status
1c9c : 08               [ 3]>            php         ;use stack to retrieve status
1c9d : 68               [ 4]>            pla
                            >            cmp_flag fc
1c9e : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ca0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ca2 : 28               [ 4]>            plp         ;restore status
                             
1ca3 : 88               [ 2]         dey
1ca4 : c417             [ 3]         cpy zp7f
                                     tst_stat fzc
1ca6 : 08               [ 3]>            php         ;save status
1ca7 : 08               [ 3]>            php         ;use stack to retrieve status
1ca8 : 68               [ 4]>            pla
                            >            cmp_flag fzc
1ca9 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1cab : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1cad : 28               [ 4]>            plp         ;restore status
                             
1cae : 88               [ 2]         dey
1caf : c417             [ 3]         cpy zp7f
                                     tst_y $7e,fn
1cb1 : 08               [ 3]>            php         ;save flags
1cb2 : 08               [ 3]>            php
1cb3 : c07e             [ 2]>            cpy #$7e     ;test result
                            >            trap_ne
1cb5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1cb7 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1cb8 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  140
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1cba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1cbc : 28               [ 4]>            plp         ;restore status
                             
                                     set_y $80,$ff
                            >            load_flag $ff
1cbd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1cbf : 48               [ 3]>            pha         ;use stack to load status
1cc0 : a080             [ 2]>            ldy #$80     ;precharge index y
1cc2 : 28               [ 4]>            plp
                             
1cc3 : c417             [ 3]         cpy zp7f
                                     tst_stat ~fnz
1cc5 : 08               [ 3]>            php         ;save status
1cc6 : 08               [ 3]>            php         ;use stack to retrieve status
1cc7 : 68               [ 4]>            pla
                            >            cmp_flag ~fnz
1cc8 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1cca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ccc : 28               [ 4]>            plp         ;restore status
                             
1ccd : 88               [ 2]         dey
1cce : c417             [ 3]         cpy zp7f
                                     tst_stat ~fn
1cd0 : 08               [ 3]>            php         ;save status
1cd1 : 08               [ 3]>            php         ;use stack to retrieve status
1cd2 : 68               [ 4]>            pla
                            >            cmp_flag ~fn
1cd3 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1cd5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1cd7 : 28               [ 4]>            plp         ;restore status
                             
1cd8 : 88               [ 2]         dey
1cd9 : c417             [ 3]         cpy zp7f
                                     tst_y $7e,~fzc
1cdb : 08               [ 3]>            php         ;save flags
1cdc : 08               [ 3]>            php
1cdd : c07e             [ 2]>            cpy #$7e     ;test result
                            >            trap_ne
1cdf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ce1 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1ce2 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ce4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  141
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1ce6 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     set_y $80,0
                            >            load_flag 0
1ce7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1ce9 : 48               [ 3]>            pha         ;use stack to load status
1cea : a080             [ 2]>            ldy #$80     ;precharge index y
1cec : 28               [ 4]>            plp
                             
1ced : cc0c02           [ 4]         cpy abs7f
                                     tst_stat fc
1cf0 : 08               [ 3]>            php         ;save status
1cf1 : 08               [ 3]>            php         ;use stack to retrieve status
1cf2 : 68               [ 4]>            pla
                            >            cmp_flag fc
1cf3 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1cf5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1cf7 : 28               [ 4]>            plp         ;restore status
                             
1cf8 : 88               [ 2]         dey
1cf9 : cc0c02           [ 4]         cpy abs7f
                                     tst_stat fzc
1cfc : 08               [ 3]>            php         ;save status
1cfd : 08               [ 3]>            php         ;use stack to retrieve status
1cfe : 68               [ 4]>            pla
                            >            cmp_flag fzc
1cff : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d01 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d03 : 28               [ 4]>            plp         ;restore status
                             
1d04 : 88               [ 2]         dey
1d05 : cc0c02           [ 4]         cpy abs7f
                                     tst_y $7e,fn
1d08 : 08               [ 3]>            php         ;save flags
1d09 : 08               [ 3]>            php
1d0a : c07e             [ 2]>            cpy #$7e     ;test result
                            >            trap_ne
1d0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d0e : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1d0f : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d11 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d13 : 28               [ 4]>            plp         ;restore status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  142
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     set_y $80,$ff
                            >            load_flag $ff
1d14 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1d16 : 48               [ 3]>            pha         ;use stack to load status
1d17 : a080             [ 2]>            ldy #$80     ;precharge index y
1d19 : 28               [ 4]>            plp
                             
1d1a : cc0c02           [ 4]         cpy abs7f
                                     tst_stat ~fnz
1d1d : 08               [ 3]>            php         ;save status
1d1e : 08               [ 3]>            php         ;use stack to retrieve status
1d1f : 68               [ 4]>            pla
                            >            cmp_flag ~fnz
1d20 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d24 : 28               [ 4]>            plp         ;restore status
                             
1d25 : 88               [ 2]         dey
1d26 : cc0c02           [ 4]         cpy abs7f
                                     tst_stat ~fn
1d29 : 08               [ 3]>            php         ;save status
1d2a : 08               [ 3]>            php         ;use stack to retrieve status
1d2b : 68               [ 4]>            pla
                            >            cmp_flag ~fn
1d2c : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d2e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d30 : 28               [ 4]>            plp         ;restore status
                             
1d31 : 88               [ 2]         dey
1d32 : cc0c02           [ 4]         cpy abs7f
                                     tst_y $7e,~fzc
1d35 : 08               [ 3]>            php         ;save flags
1d36 : 08               [ 3]>            php
1d37 : c07e             [ 2]>            cpy #$7e     ;test result
                            >            trap_ne
1d39 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d3b : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1d3c : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d3e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d40 : 28               [ 4]>            plp         ;restore status
                             
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  143
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     set_y $80,0
                            >            load_flag 0
1d41 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1d43 : 48               [ 3]>            pha         ;use stack to load status
1d44 : a080             [ 2]>            ldy #$80     ;precharge index y
1d46 : 28               [ 4]>            plp
                             
1d47 : c07f             [ 2]         cpy #$7f
                                     tst_stat fc
1d49 : 08               [ 3]>            php         ;save status
1d4a : 08               [ 3]>            php         ;use stack to retrieve status
1d4b : 68               [ 4]>            pla
                            >            cmp_flag fc
1d4c : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d4e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d50 : 28               [ 4]>            plp         ;restore status
                             
1d51 : 88               [ 2]         dey
1d52 : c07f             [ 2]         cpy #$7f
                                     tst_stat fzc
1d54 : 08               [ 3]>            php         ;save status
1d55 : 08               [ 3]>            php         ;use stack to retrieve status
1d56 : 68               [ 4]>            pla
                            >            cmp_flag fzc
1d57 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d59 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d5b : 28               [ 4]>            plp         ;restore status
                             
1d5c : 88               [ 2]         dey
1d5d : c07f             [ 2]         cpy #$7f
                                     tst_y $7e,fn
1d5f : 08               [ 3]>            php         ;save flags
1d60 : 08               [ 3]>            php
1d61 : c07e             [ 2]>            cpy #$7e     ;test result
                            >            trap_ne
1d63 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d65 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1d66 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d68 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d6a : 28               [ 4]>            plp         ;restore status
                             
                                     set_y $80,$ff
                            >            load_flag $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  144
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1d6b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1d6d : 48               [ 3]>            pha         ;use stack to load status
1d6e : a080             [ 2]>            ldy #$80     ;precharge index y
1d70 : 28               [ 4]>            plp
                             
1d71 : c07f             [ 2]         cpy #$7f
                                     tst_stat ~fnz
1d73 : 08               [ 3]>            php         ;save status
1d74 : 08               [ 3]>            php         ;use stack to retrieve status
1d75 : 68               [ 4]>            pla
                            >            cmp_flag ~fnz
1d76 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d78 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d7a : 28               [ 4]>            plp         ;restore status
                             
1d7b : 88               [ 2]         dey
1d7c : c07f             [ 2]         cpy #$7f
                                     tst_stat ~fn
1d7e : 08               [ 3]>            php         ;save status
1d7f : 08               [ 3]>            php         ;use stack to retrieve status
1d80 : 68               [ 4]>            pla
                            >            cmp_flag ~fn
1d81 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d83 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d85 : 28               [ 4]>            plp         ;restore status
                             
1d86 : 88               [ 2]         dey
1d87 : c07f             [ 2]         cpy #$7f
                                     tst_y $7e,~fzc
1d89 : 08               [ 3]>            php         ;save flags
1d8a : 08               [ 3]>            php
1d8b : c07e             [ 2]>            cpy #$7e     ;test result
                            >            trap_ne
1d8d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d8f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1d90 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1d92 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1d94 : 28               [ 4]>            plp         ;restore status
                             
                                     next_test
1d95 : ad0002           [ 4]>            lda test_case   ;previous test
1d98 : c91b             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  145
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1d9a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
001c =                      >test_num = test_num + 1
1d9c : a91c             [ 2]>            lda #test_num   ;*** this tests' number
1d9e : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; CMP - zp / abs / #         
                                     set_a $80,0
                            >            load_flag 0
1da1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1da3 : 48               [ 3]>            pha         ;use stack to load status
1da4 : a980             [ 2]>            lda #$80     ;precharge accu
1da6 : 28               [ 4]>            plp
                             
1da7 : c517             [ 3]         cmp zp7f
                                     tst_a $80,fc
1da9 : 08               [ 3]>            php         ;save flags
1daa : 08               [ 3]>            php
1dab : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1dad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1daf : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fc
1db0 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1db2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1db4 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
1db5 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1db7 : 48               [ 3]>            pha         ;use stack to load status
1db8 : a97f             [ 2]>            lda #$7f     ;precharge accu
1dba : 28               [ 4]>            plp
                             
1dbb : c517             [ 3]         cmp zp7f
                                     tst_a $7f,fzc
1dbd : 08               [ 3]>            php         ;save flags
1dbe : 08               [ 3]>            php
1dbf : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1dc1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1dc3 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
1dc4 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  146
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1dc6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1dc8 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
1dc9 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1dcb : 48               [ 3]>            pha         ;use stack to load status
1dcc : a97e             [ 2]>            lda #$7e     ;precharge accu
1dce : 28               [ 4]>            plp
                             
1dcf : c517             [ 3]         cmp zp7f
                                     tst_a $7e,fn
1dd1 : 08               [ 3]>            php         ;save flags
1dd2 : 08               [ 3]>            php
1dd3 : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1dd5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1dd7 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1dd8 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1dda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ddc : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $80,$ff
                            >            load_flag $ff
1ddd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1ddf : 48               [ 3]>            pha         ;use stack to load status
1de0 : a980             [ 2]>            lda #$80     ;precharge accu
1de2 : 28               [ 4]>            plp
                             
1de3 : c517             [ 3]         cmp zp7f
                                     tst_a $80,~fnz
1de5 : 08               [ 3]>            php         ;save flags
1de6 : 08               [ 3]>            php
1de7 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1de9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1deb : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
1dec : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1dee : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1df0 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  147
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag $ff
1df1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1df3 : 48               [ 3]>            pha         ;use stack to load status
1df4 : a97f             [ 2]>            lda #$7f     ;precharge accu
1df6 : 28               [ 4]>            plp
                             
1df7 : c517             [ 3]         cmp zp7f
                                     tst_a $7f,~fn
1df9 : 08               [ 3]>            php         ;save flags
1dfa : 08               [ 3]>            php
1dfb : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1dfd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1dff : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
1e00 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e04 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
1e05 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1e07 : 48               [ 3]>            pha         ;use stack to load status
1e08 : a97e             [ 2]>            lda #$7e     ;precharge accu
1e0a : 28               [ 4]>            plp
                             
1e0b : c517             [ 3]         cmp zp7f
                                     tst_a $7e,~fzc
1e0d : 08               [ 3]>            php         ;save flags
1e0e : 08               [ 3]>            php
1e0f : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1e11 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e13 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1e14 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e16 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e18 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     set_a $80,0
                            >            load_flag 0
1e19 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1e1b : 48               [ 3]>            pha         ;use stack to load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  148
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1e1c : a980             [ 2]>            lda #$80     ;precharge accu
1e1e : 28               [ 4]>            plp
                             
1e1f : cd0c02           [ 4]         cmp abs7f
                                     tst_a $80,fc
1e22 : 08               [ 3]>            php         ;save flags
1e23 : 08               [ 3]>            php
1e24 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1e26 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e28 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fc
1e29 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e2b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e2d : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
1e2e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1e30 : 48               [ 3]>            pha         ;use stack to load status
1e31 : a97f             [ 2]>            lda #$7f     ;precharge accu
1e33 : 28               [ 4]>            plp
                             
1e34 : cd0c02           [ 4]         cmp abs7f
                                     tst_a $7f,fzc
1e37 : 08               [ 3]>            php         ;save flags
1e38 : 08               [ 3]>            php
1e39 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1e3b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e3d : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
1e3e : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e40 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e42 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
1e43 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1e45 : 48               [ 3]>            pha         ;use stack to load status
1e46 : a97e             [ 2]>            lda #$7e     ;precharge accu
1e48 : 28               [ 4]>            plp
                             
1e49 : cd0c02           [ 4]         cmp abs7f
                                     tst_a $7e,fn
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  149
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1e4c : 08               [ 3]>            php         ;save flags
1e4d : 08               [ 3]>            php
1e4e : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1e50 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e52 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1e53 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e55 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e57 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $80,$ff
                            >            load_flag $ff
1e58 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1e5a : 48               [ 3]>            pha         ;use stack to load status
1e5b : a980             [ 2]>            lda #$80     ;precharge accu
1e5d : 28               [ 4]>            plp
                             
1e5e : cd0c02           [ 4]         cmp abs7f
                                     tst_a $80,~fnz
1e61 : 08               [ 3]>            php         ;save flags
1e62 : 08               [ 3]>            php
1e63 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1e65 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e67 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
1e68 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e6a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e6c : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
                            >            load_flag $ff
1e6d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1e6f : 48               [ 3]>            pha         ;use stack to load status
1e70 : a97f             [ 2]>            lda #$7f     ;precharge accu
1e72 : 28               [ 4]>            plp
                             
1e73 : cd0c02           [ 4]         cmp abs7f
                                     tst_a $7f,~fn
1e76 : 08               [ 3]>            php         ;save flags
1e77 : 08               [ 3]>            php
1e78 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1e7a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  150
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
1e7c : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
1e7d : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e7f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e81 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
1e82 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1e84 : 48               [ 3]>            pha         ;use stack to load status
1e85 : a97e             [ 2]>            lda #$7e     ;precharge accu
1e87 : 28               [ 4]>            plp
                             
1e88 : cd0c02           [ 4]         cmp abs7f
                                     tst_a $7e,~fzc
1e8b : 08               [ 3]>            php         ;save flags
1e8c : 08               [ 3]>            php
1e8d : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1e8f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e91 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1e92 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1e94 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1e96 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     set_a $80,0
                            >            load_flag 0
1e97 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1e99 : 48               [ 3]>            pha         ;use stack to load status
1e9a : a980             [ 2]>            lda #$80     ;precharge accu
1e9c : 28               [ 4]>            plp
                             
1e9d : c97f             [ 2]         cmp #$7f
                                     tst_a $80,fc
1e9f : 08               [ 3]>            php         ;save flags
1ea0 : 08               [ 3]>            php
1ea1 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1ea3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ea5 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fc
1ea6 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  151
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                            >            trap_ne
1ea8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1eaa : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
1eab : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1ead : 48               [ 3]>            pha         ;use stack to load status
1eae : a97f             [ 2]>            lda #$7f     ;precharge accu
1eb0 : 28               [ 4]>            plp
                             
1eb1 : c97f             [ 2]         cmp #$7f
                                     tst_a $7f,fzc
1eb3 : 08               [ 3]>            php         ;save flags
1eb4 : 08               [ 3]>            php
1eb5 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1eb7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1eb9 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
1eba : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ebc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ebe : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
1ebf : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1ec1 : 48               [ 3]>            pha         ;use stack to load status
1ec2 : a97e             [ 2]>            lda #$7e     ;precharge accu
1ec4 : 28               [ 4]>            plp
                             
1ec5 : c97f             [ 2]         cmp #$7f
                                     tst_a $7e,fn
1ec7 : 08               [ 3]>            php         ;save flags
1ec8 : 08               [ 3]>            php
1ec9 : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1ecb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ecd : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1ece : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ed0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ed2 : 28               [ 4]>            plp         ;restore status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  152
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     set_a $80,$ff
                            >            load_flag $ff
1ed3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1ed5 : 48               [ 3]>            pha         ;use stack to load status
1ed6 : a980             [ 2]>            lda #$80     ;precharge accu
1ed8 : 28               [ 4]>            plp
                             
1ed9 : c97f             [ 2]         cmp #$7f
                                     tst_a $80,~fnz
1edb : 08               [ 3]>            php         ;save flags
1edc : 08               [ 3]>            php
1edd : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1edf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ee1 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
1ee2 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ee4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ee6 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
                            >            load_flag $ff
1ee7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1ee9 : 48               [ 3]>            pha         ;use stack to load status
1eea : a97f             [ 2]>            lda #$7f     ;precharge accu
1eec : 28               [ 4]>            plp
                             
1eed : c97f             [ 2]         cmp #$7f
                                     tst_a $7f,~fn
1eef : 08               [ 3]>            php         ;save flags
1ef0 : 08               [ 3]>            php
1ef1 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1ef3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ef5 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
1ef6 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1ef8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1efa : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
1efb : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  153
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1efd : 48               [ 3]>            pha         ;use stack to load status
1efe : a97e             [ 2]>            lda #$7e     ;precharge accu
1f00 : 28               [ 4]>            plp
                             
1f01 : c97f             [ 2]         cmp #$7f
                                     tst_a $7e,~fzc
1f03 : 08               [ 3]>            php         ;save flags
1f04 : 08               [ 3]>            php
1f05 : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1f07 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f09 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
1f0a : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f0e : 28               [ 4]>            plp         ;restore status
                             
                             
1f0f : a204             [ 2]         ldx #4          ;with indexing by X
                                     set_a $80,0
                            >            load_flag 0
1f11 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1f13 : 48               [ 3]>            pha         ;use stack to load status
1f14 : a980             [ 2]>            lda #$80     ;precharge accu
1f16 : 28               [ 4]>            plp
                             
1f17 : d513             [ 4]         cmp zp1,x
                                     tst_a $80,fc
1f19 : 08               [ 3]>            php         ;save flags
1f1a : 08               [ 3]>            php
1f1b : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1f1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f1f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fc
1f20 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f24 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
1f25 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1f27 : 48               [ 3]>            pha         ;use stack to load status
1f28 : a97f             [ 2]>            lda #$7f     ;precharge accu
1f2a : 28               [ 4]>            plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  154
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
1f2b : d513             [ 4]         cmp zp1,x
                                     tst_a $7f,fzc
1f2d : 08               [ 3]>            php         ;save flags
1f2e : 08               [ 3]>            php
1f2f : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1f31 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f33 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
1f34 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f36 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f38 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
1f39 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1f3b : 48               [ 3]>            pha         ;use stack to load status
1f3c : a97e             [ 2]>            lda #$7e     ;precharge accu
1f3e : 28               [ 4]>            plp
                             
1f3f : d513             [ 4]         cmp zp1,x
                                     tst_a $7e,fn
1f41 : 08               [ 3]>            php         ;save flags
1f42 : 08               [ 3]>            php
1f43 : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1f45 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f47 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1f48 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f4a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f4c : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $80,$ff
                            >            load_flag $ff
1f4d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1f4f : 48               [ 3]>            pha         ;use stack to load status
1f50 : a980             [ 2]>            lda #$80     ;precharge accu
1f52 : 28               [ 4]>            plp
                             
1f53 : d513             [ 4]         cmp zp1,x
                                     tst_a $80,~fnz
1f55 : 08               [ 3]>            php         ;save flags
1f56 : 08               [ 3]>            php
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  155
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1f57 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1f59 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f5b : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
1f5c : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f5e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f60 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
                            >            load_flag $ff
1f61 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1f63 : 48               [ 3]>            pha         ;use stack to load status
1f64 : a97f             [ 2]>            lda #$7f     ;precharge accu
1f66 : 28               [ 4]>            plp
                             
1f67 : d513             [ 4]         cmp zp1,x
                                     tst_a $7f,~fn
1f69 : 08               [ 3]>            php         ;save flags
1f6a : 08               [ 3]>            php
1f6b : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1f6d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f6f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
1f70 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f72 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f74 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
1f75 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1f77 : 48               [ 3]>            pha         ;use stack to load status
1f78 : a97e             [ 2]>            lda #$7e     ;precharge accu
1f7a : 28               [ 4]>            plp
                             
1f7b : d513             [ 4]         cmp zp1,x
                                     tst_a $7e,~fzc
1f7d : 08               [ 3]>            php         ;save flags
1f7e : 08               [ 3]>            php
1f7f : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1f81 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f83 : 68               [ 4]>            pla         ;load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  156
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            cmp_flag ~fzc
1f84 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f86 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f88 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     set_a $80,0
                            >            load_flag 0
1f89 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1f8b : 48               [ 3]>            pha         ;use stack to load status
1f8c : a980             [ 2]>            lda #$80     ;precharge accu
1f8e : 28               [ 4]>            plp
                             
1f8f : dd0802           [ 4]         cmp abs1,x
                                     tst_a $80,fc
1f92 : 08               [ 3]>            php         ;save flags
1f93 : 08               [ 3]>            php
1f94 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1f96 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f98 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fc
1f99 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1f9b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1f9d : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
1f9e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1fa0 : 48               [ 3]>            pha         ;use stack to load status
1fa1 : a97f             [ 2]>            lda #$7f     ;precharge accu
1fa3 : 28               [ 4]>            plp
                             
1fa4 : dd0802           [ 4]         cmp abs1,x
                                     tst_a $7f,fzc
1fa7 : 08               [ 3]>            php         ;save flags
1fa8 : 08               [ 3]>            php
1fa9 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1fab : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1fad : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
1fae : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  157
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

1fb0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1fb2 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
1fb3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
1fb5 : 48               [ 3]>            pha         ;use stack to load status
1fb6 : a97e             [ 2]>            lda #$7e     ;precharge accu
1fb8 : 28               [ 4]>            plp
                             
1fb9 : dd0802           [ 4]         cmp abs1,x
                                     tst_a $7e,fn
1fbc : 08               [ 3]>            php         ;save flags
1fbd : 08               [ 3]>            php
1fbe : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1fc0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1fc2 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
1fc3 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1fc5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1fc7 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $80,$ff
                            >            load_flag $ff
1fc8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1fca : 48               [ 3]>            pha         ;use stack to load status
1fcb : a980             [ 2]>            lda #$80     ;precharge accu
1fcd : 28               [ 4]>            plp
                             
1fce : dd0802           [ 4]         cmp abs1,x
                                     tst_a $80,~fnz
1fd1 : 08               [ 3]>            php         ;save flags
1fd2 : 08               [ 3]>            php
1fd3 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
1fd5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1fd7 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
1fd8 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1fda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1fdc : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  158
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag $ff
1fdd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1fdf : 48               [ 3]>            pha         ;use stack to load status
1fe0 : a97f             [ 2]>            lda #$7f     ;precharge accu
1fe2 : 28               [ 4]>            plp
                             
1fe3 : dd0802           [ 4]         cmp abs1,x
                                     tst_a $7f,~fn
1fe6 : 08               [ 3]>            php         ;save flags
1fe7 : 08               [ 3]>            php
1fe8 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
1fea : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1fec : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
1fed : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
1fef : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
1ff1 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
1ff2 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
1ff4 : 48               [ 3]>            pha         ;use stack to load status
1ff5 : a97e             [ 2]>            lda #$7e     ;precharge accu
1ff7 : 28               [ 4]>            plp
                             
1ff8 : dd0802           [ 4]         cmp abs1,x
                                     tst_a $7e,~fzc
1ffb : 08               [ 3]>            php         ;save flags
1ffc : 08               [ 3]>            php
1ffd : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
1fff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2001 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
2002 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2004 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2006 : 28               [ 4]>            plp         ;restore status
                             
                             
2007 : a004             [ 2]         ldy #4          ;with indexing by Y
2009 : a208             [ 2]         ldx #8          ;with indexed indirect
                                     set_a $80,0
                            >            load_flag 0
200b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  159
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
200d : 48               [ 3]>            pha         ;use stack to load status
200e : a980             [ 2]>            lda #$80     ;precharge accu
2010 : 28               [ 4]>            plp
                             
2011 : d90802           [ 4]         cmp abs1,y
                                     tst_a $80,fc
2014 : 08               [ 3]>            php         ;save flags
2015 : 08               [ 3]>            php
2016 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
2018 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
201a : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fc
201b : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
201d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
201f : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
2020 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2022 : 48               [ 3]>            pha         ;use stack to load status
2023 : a97f             [ 2]>            lda #$7f     ;precharge accu
2025 : 28               [ 4]>            plp
                             
2026 : d90802           [ 4]         cmp abs1,y
                                     tst_a $7f,fzc
2029 : 08               [ 3]>            php         ;save flags
202a : 08               [ 3]>            php
202b : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
202d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
202f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
2030 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2032 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2034 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
2035 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2037 : 48               [ 3]>            pha         ;use stack to load status
2038 : a97e             [ 2]>            lda #$7e     ;precharge accu
203a : 28               [ 4]>            plp
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  160
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

203b : d90802           [ 4]         cmp abs1,y
                                     tst_a $7e,fn
203e : 08               [ 3]>            php         ;save flags
203f : 08               [ 3]>            php
2040 : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
2042 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2044 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
2045 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2047 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2049 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $80,$ff
                            >            load_flag $ff
204a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
204c : 48               [ 3]>            pha         ;use stack to load status
204d : a980             [ 2]>            lda #$80     ;precharge accu
204f : 28               [ 4]>            plp
                             
2050 : d90802           [ 4]         cmp abs1,y
                                     tst_a $80,~fnz
2053 : 08               [ 3]>            php         ;save flags
2054 : 08               [ 3]>            php
2055 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
2057 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2059 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
205a : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
205c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
205e : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
                            >            load_flag $ff
205f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2061 : 48               [ 3]>            pha         ;use stack to load status
2062 : a97f             [ 2]>            lda #$7f     ;precharge accu
2064 : 28               [ 4]>            plp
                             
2065 : d90802           [ 4]         cmp abs1,y
                                     tst_a $7f,~fn
2068 : 08               [ 3]>            php         ;save flags
2069 : 08               [ 3]>            php
206a : c97f             [ 2]>            cmp #$7f     ;test result
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  161
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            trap_ne
206c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
206e : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
206f : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2071 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2073 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
2074 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2076 : 48               [ 3]>            pha         ;use stack to load status
2077 : a97e             [ 2]>            lda #$7e     ;precharge accu
2079 : 28               [ 4]>            plp
                             
207a : d90802           [ 4]         cmp abs1,y
                                     tst_a $7e,~fzc
207d : 08               [ 3]>            php         ;save flags
207e : 08               [ 3]>            php
207f : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
2081 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2083 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
2084 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2086 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2088 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     set_a $80,0
                            >            load_flag 0
2089 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
208b : 48               [ 3]>            pha         ;use stack to load status
208c : a980             [ 2]>            lda #$80     ;precharge accu
208e : 28               [ 4]>            plp
                             
208f : c124             [ 6]         cmp (ind1,x)
                                     tst_a $80,fc
2091 : 08               [ 3]>            php         ;save flags
2092 : 08               [ 3]>            php
2093 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
2095 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2097 : 68               [ 4]>            pla         ;load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  162
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            cmp_flag fc
2098 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
209a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
209c : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
209d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
209f : 48               [ 3]>            pha         ;use stack to load status
20a0 : a97f             [ 2]>            lda #$7f     ;precharge accu
20a2 : 28               [ 4]>            plp
                             
20a3 : c124             [ 6]         cmp (ind1,x)
                                     tst_a $7f,fzc
20a5 : 08               [ 3]>            php         ;save flags
20a6 : 08               [ 3]>            php
20a7 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
20a9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20ab : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
20ac : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
20ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20b0 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
20b1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
20b3 : 48               [ 3]>            pha         ;use stack to load status
20b4 : a97e             [ 2]>            lda #$7e     ;precharge accu
20b6 : 28               [ 4]>            plp
                             
20b7 : c124             [ 6]         cmp (ind1,x)
                                     tst_a $7e,fn
20b9 : 08               [ 3]>            php         ;save flags
20ba : 08               [ 3]>            php
20bb : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
20bd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20bf : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
20c0 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
20c2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  163
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
20c4 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $80,$ff
                            >            load_flag $ff
20c5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
20c7 : 48               [ 3]>            pha         ;use stack to load status
20c8 : a980             [ 2]>            lda #$80     ;precharge accu
20ca : 28               [ 4]>            plp
                             
20cb : c124             [ 6]         cmp (ind1,x)
                                     tst_a $80,~fnz
20cd : 08               [ 3]>            php         ;save flags
20ce : 08               [ 3]>            php
20cf : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
20d1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20d3 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
20d4 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
20d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20d8 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
                            >            load_flag $ff
20d9 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
20db : 48               [ 3]>            pha         ;use stack to load status
20dc : a97f             [ 2]>            lda #$7f     ;precharge accu
20de : 28               [ 4]>            plp
                             
20df : c124             [ 6]         cmp (ind1,x)
                                     tst_a $7f,~fn
20e1 : 08               [ 3]>            php         ;save flags
20e2 : 08               [ 3]>            php
20e3 : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
20e5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20e7 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
20e8 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
20ea : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20ec : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  164
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

20ed : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
20ef : 48               [ 3]>            pha         ;use stack to load status
20f0 : a97e             [ 2]>            lda #$7e     ;precharge accu
20f2 : 28               [ 4]>            plp
                             
20f3 : c124             [ 6]         cmp (ind1,x)
                                     tst_a $7e,~fzc
20f5 : 08               [ 3]>            php         ;save flags
20f6 : 08               [ 3]>            php
20f7 : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
20f9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
20fb : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
20fc : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
20fe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2100 : 28               [ 4]>            plp         ;restore status
                             
                             
                                     set_a $80,0
                            >            load_flag 0
2101 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2103 : 48               [ 3]>            pha         ;use stack to load status
2104 : a980             [ 2]>            lda #$80     ;precharge accu
2106 : 28               [ 4]>            plp
                             
2107 : d124             [ 5]         cmp (ind1),y
                                     tst_a $80,fc
2109 : 08               [ 3]>            php         ;save flags
210a : 08               [ 3]>            php
210b : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
210d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
210f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fc
2110 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2112 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2114 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,0
                            >            load_flag 0
2115 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2117 : 48               [ 3]>            pha         ;use stack to load status
2118 : a97f             [ 2]>            lda #$7f     ;precharge accu
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  165
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

211a : 28               [ 4]>            plp
                             
211b : d124             [ 5]         cmp (ind1),y
                                     tst_a $7f,fzc
211d : 08               [ 3]>            php         ;save flags
211e : 08               [ 3]>            php
211f : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
2121 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2123 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fzc
2124 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2126 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2128 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,0
                            >            load_flag 0
2129 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
212b : 48               [ 3]>            pha         ;use stack to load status
212c : a97e             [ 2]>            lda #$7e     ;precharge accu
212e : 28               [ 4]>            plp
                             
212f : d124             [ 5]         cmp (ind1),y
                                     tst_a $7e,fn
2131 : 08               [ 3]>            php         ;save flags
2132 : 08               [ 3]>            php
2133 : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
2135 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2137 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag fn
2138 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
213a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
213c : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $80,$ff
                            >            load_flag $ff
213d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
213f : 48               [ 3]>            pha         ;use stack to load status
2140 : a980             [ 2]>            lda #$80     ;precharge accu
2142 : 28               [ 4]>            plp
                             
2143 : d124             [ 5]         cmp (ind1),y
                                     tst_a $80,~fnz
2145 : 08               [ 3]>            php         ;save flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  166
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2146 : 08               [ 3]>            php
2147 : c980             [ 2]>            cmp #$80     ;test result
                            >            trap_ne
2149 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
214b : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fnz
214c : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
214e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2150 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7f,$ff
                            >            load_flag $ff
2151 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2153 : 48               [ 3]>            pha         ;use stack to load status
2154 : a97f             [ 2]>            lda #$7f     ;precharge accu
2156 : 28               [ 4]>            plp
                             
2157 : d124             [ 5]         cmp (ind1),y
                                     tst_a $7f,~fn
2159 : 08               [ 3]>            php         ;save flags
215a : 08               [ 3]>            php
215b : c97f             [ 2]>            cmp #$7f     ;test result
                            >            trap_ne
215d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
215f : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fn
2160 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2162 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2164 : 28               [ 4]>            plp         ;restore status
                             
                                     set_a $7e,$ff
                            >            load_flag $ff
2165 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2167 : 48               [ 3]>            pha         ;use stack to load status
2168 : a97e             [ 2]>            lda #$7e     ;precharge accu
216a : 28               [ 4]>            plp
                             
216b : d124             [ 5]         cmp (ind1),y
                                     tst_a $7e,~fzc
216d : 08               [ 3]>            php         ;save flags
216e : 08               [ 3]>            php
216f : c97e             [ 2]>            cmp #$7e     ;test result
                            >            trap_ne
2171 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  167
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2173 : 68               [ 4]>            pla         ;load status
                            >            cmp_flag ~fzc
2174 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
                            >
                            >            trap_ne
2176 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2178 : 28               [ 4]>            plp         ;restore status
                             
                                     next_test
2179 : ad0002           [ 4]>            lda test_case   ;previous test
217c : c91c             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
217e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
001d =                      >test_num = test_num + 1
2180 : a91d             [ 2]>            lda #test_num   ;*** this tests' number
2182 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; testing shifts - ASL LSR ROL ROR all addressing modes
                             ; shifts - accumulator
2185 : a203             [ 2]         ldx #3
2187 :                       tasl
                                     set_ax zp1,0
                            >            load_flag 0
2187 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2189 : 48               [ 3]>            pha         ;use stack to load status
218a : b513             [ 4]>            lda zp1,x    ;precharge accu
218c : 28               [ 4]>            plp
                             
218d : 0a               [ 2]         asl a
                                     tst_ax rASL,fASL,0
218e : 08               [ 3]>            php         ;save flags
218f : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
2192 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2194 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2195 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2197 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne     ;
219a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
219c : ca               [ 2]         dex
219d : 10e8             [ 3]         bpl tasl
219f : a203             [ 2]         ldx #3
21a1 :                       tasl1
                                     set_ax zp1,$ff
                            >            load_flag $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  168
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

21a1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
21a3 : 48               [ 3]>            pha         ;use stack to load status
21a4 : b513             [ 4]>            lda zp1,x    ;precharge accu
21a6 : 28               [ 4]>            plp
                             
21a7 : 0a               [ 2]         asl a
                                     tst_ax rASL,fASL,$ff-fnzc
21a8 : 08               [ 3]>            php         ;save flags
21a9 : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
21ac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
21ae : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
21af : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
21b1 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne     ;
21b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
21b6 : ca               [ 2]         dex
21b7 : 10e8             [ 3]         bpl tasl1
                             
21b9 : a203             [ 2]         ldx #3
21bb :                       tlsr
                                     set_ax zp1,0
                            >            load_flag 0
21bb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
21bd : 48               [ 3]>            pha         ;use stack to load status
21be : b513             [ 4]>            lda zp1,x    ;precharge accu
21c0 : 28               [ 4]>            plp
                             
21c1 : 4a               [ 2]         lsr a
                                     tst_ax rLSR,fLSR,0
21c2 : 08               [ 3]>            php         ;save flags
21c3 : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
21c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
21c8 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
21c9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
21cb : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne     ;
21ce : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
21d0 : ca               [ 2]         dex
21d1 : 10e8             [ 3]         bpl tlsr
21d3 : a203             [ 2]         ldx #3
21d5 :                       tlsr1
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  169
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     set_ax zp1,$ff
                            >            load_flag $ff
21d5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
21d7 : 48               [ 3]>            pha         ;use stack to load status
21d8 : b513             [ 4]>            lda zp1,x    ;precharge accu
21da : 28               [ 4]>            plp
                             
21db : 4a               [ 2]         lsr a
                                     tst_ax rLSR,fLSR,$ff-fnzc
21dc : 08               [ 3]>            php         ;save flags
21dd : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
21e0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
21e2 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
21e3 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
21e5 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne     ;
21e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
21ea : ca               [ 2]         dex
21eb : 10e8             [ 3]         bpl tlsr1
                             
21ed : a203             [ 2]         ldx #3
21ef :                       trol
                                     set_ax zp1,0
                            >            load_flag 0
21ef : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
21f1 : 48               [ 3]>            pha         ;use stack to load status
21f2 : b513             [ 4]>            lda zp1,x    ;precharge accu
21f4 : 28               [ 4]>            plp
                             
21f5 : 2a               [ 2]         rol a
                                     tst_ax rROL,fROL,0
21f6 : 08               [ 3]>            php         ;save flags
21f7 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
21fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
21fc : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
21fd : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
21ff : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne     ;
2202 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2204 : ca               [ 2]         dex
2205 : 10e8             [ 4]         bpl trol
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  170
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2207 : a203             [ 2]         ldx #3
2209 :                       trol1
                                     set_ax zp1,$ff-fc
                            >            load_flag $ff-fc
2209 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
220b : 48               [ 3]>            pha         ;use stack to load status
220c : b513             [ 4]>            lda zp1,x    ;precharge accu
220e : 28               [ 4]>            plp
                             
220f : 2a               [ 2]         rol a
                                     tst_ax rROL,fROL,$ff-fnzc
2210 : 08               [ 3]>            php         ;save flags
2211 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
2214 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2216 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2217 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2219 : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne     ;
221c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
221e : ca               [ 2]         dex
221f : 10e8             [ 3]         bpl trol1
                             
2221 : a203             [ 2]         ldx #3
2223 :                       trolc
                                     set_ax zp1,fc
                            >            load_flag fc
2223 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
2225 : 48               [ 3]>            pha         ;use stack to load status
2226 : b513             [ 4]>            lda zp1,x    ;precharge accu
2228 : 28               [ 4]>            plp
                             
2229 : 2a               [ 2]         rol a
                                     tst_ax rROLc,fROLc,0
222a : 08               [ 3]>            php         ;save flags
222b : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
222e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2230 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2231 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2233 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne     ;
2236 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  171
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2238 : ca               [ 2]         dex
2239 : 10e8             [ 3]         bpl trolc
223b : a203             [ 2]         ldx #3
223d :                       trolc1
                                     set_ax zp1,$ff
                            >            load_flag $ff
223d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
223f : 48               [ 3]>            pha         ;use stack to load status
2240 : b513             [ 4]>            lda zp1,x    ;precharge accu
2242 : 28               [ 4]>            plp
                             
2243 : 2a               [ 2]         rol a
                                     tst_ax rROLc,fROLc,$ff-fnzc
2244 : 08               [ 3]>            php         ;save flags
2245 : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
2248 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
224a : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
224b : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
224d : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne     ;
2250 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2252 : ca               [ 2]         dex
2253 : 10e8             [ 3]         bpl trolc1
                             
2255 : a203             [ 2]         ldx #3
2257 :                       tror
                                     set_ax zp1,0
                            >            load_flag 0
2257 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2259 : 48               [ 3]>            pha         ;use stack to load status
225a : b513             [ 4]>            lda zp1,x    ;precharge accu
225c : 28               [ 4]>            plp
                             
225d : 6a               [ 2]         ror a
                                     tst_ax rROR,fROR,0
225e : 08               [ 3]>            php         ;save flags
225f : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
2262 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2264 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2265 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2267 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne     ;
226a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  172
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                             
226c : ca               [ 2]         dex
226d : 10e8             [ 3]         bpl tror
226f : a203             [ 2]         ldx #3
2271 :                       tror1
                                     set_ax zp1,$ff-fc
                            >            load_flag $ff-fc
2271 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
2273 : 48               [ 3]>            pha         ;use stack to load status
2274 : b513             [ 4]>            lda zp1,x    ;precharge accu
2276 : 28               [ 4]>            plp
                             
2277 : 6a               [ 2]         ror a
                                     tst_ax rROR,fROR,$ff-fnzc
2278 : 08               [ 3]>            php         ;save flags
2279 : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
227c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
227e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
227f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2281 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne     ;
2284 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2286 : ca               [ 2]         dex
2287 : 10e8             [ 3]         bpl tror1
                             
2289 : a203             [ 2]         ldx #3
228b :                       trorc
                                     set_ax zp1,fc
                            >            load_flag fc
228b : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
228d : 48               [ 3]>            pha         ;use stack to load status
228e : b513             [ 4]>            lda zp1,x    ;precharge accu
2290 : 28               [ 4]>            plp
                             
2291 : 6a               [ 2]         ror a
                                     tst_ax rRORc,fRORc,0
2292 : 08               [ 3]>            php         ;save flags
2293 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
2296 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2298 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2299 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
229b : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  173
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            trap_ne     ;
229e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
22a0 : ca               [ 2]         dex
22a1 : 10e8             [ 3]         bpl trorc
22a3 : a203             [ 2]         ldx #3
22a5 :                       trorc1
                                     set_ax zp1,$ff
                            >            load_flag $ff
22a5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
22a7 : 48               [ 3]>            pha         ;use stack to load status
22a8 : b513             [ 4]>            lda zp1,x    ;precharge accu
22aa : 28               [ 4]>            plp
                             
22ab : 6a               [ 2]         ror a
                                     tst_ax rRORc,fRORc,$ff-fnzc
22ac : 08               [ 3]>            php         ;save flags
22ad : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
22b0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
22b2 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
22b3 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
22b5 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne     ;
22b8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
22ba : ca               [ 2]         dex
22bb : 10e8             [ 3]         bpl trorc1
                                     next_test
22bd : ad0002           [ 4]>            lda test_case   ;previous test
22c0 : c91d             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
22c2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
001e =                      >test_num = test_num + 1
22c4 : a91e             [ 2]>            lda #test_num   ;*** this tests' number
22c6 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; shifts - zeropage
22c9 : a203             [ 2]         ldx #3
22cb :                       tasl2
                                     set_z zp1,0
                            >            load_flag 0
22cb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
22cd : 48               [ 3]>            pha         ;use stack to load status
22ce : b513             [ 4]>            lda zp1,x    ;load to zeropage
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  174
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

22d0 : 850c             [ 3]>            sta zpt
22d2 : 28               [ 4]>            plp
                             
22d3 : 060c             [ 5]         asl zpt
                                     tst_z rASL,fASL,0
22d5 : 08               [ 3]>            php         ;save flags
22d6 : a50c             [ 3]>            lda zpt
22d8 : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
22db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
22dd : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
22de : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
22e0 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
22e3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
22e5 : ca               [ 2]         dex
22e6 : 10e3             [ 3]         bpl tasl2
22e8 : a203             [ 2]         ldx #3
22ea :                       tasl3
                                     set_z zp1,$ff
                            >            load_flag $ff
22ea : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
22ec : 48               [ 3]>            pha         ;use stack to load status
22ed : b513             [ 4]>            lda zp1,x    ;load to zeropage
22ef : 850c             [ 3]>            sta zpt
22f1 : 28               [ 4]>            plp
                             
22f2 : 060c             [ 5]         asl zpt
                                     tst_z rASL,fASL,$ff-fnzc
22f4 : 08               [ 3]>            php         ;save flags
22f5 : a50c             [ 3]>            lda zpt
22f7 : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
22fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
22fc : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
22fd : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
22ff : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
2302 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2304 : ca               [ 2]         dex
2305 : 10e3             [ 4]         bpl tasl3
                             
2307 : a203             [ 2]         ldx #3
2309 :                       tlsr2
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  175
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     set_z zp1,0
                            >            load_flag 0
2309 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
230b : 48               [ 3]>            pha         ;use stack to load status
230c : b513             [ 4]>            lda zp1,x    ;load to zeropage
230e : 850c             [ 3]>            sta zpt
2310 : 28               [ 4]>            plp
                             
2311 : 460c             [ 5]         lsr zpt
                                     tst_z rLSR,fLSR,0
2313 : 08               [ 3]>            php         ;save flags
2314 : a50c             [ 3]>            lda zpt
2316 : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
2319 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
231b : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
231c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
231e : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
2321 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2323 : ca               [ 2]         dex
2324 : 10e3             [ 3]         bpl tlsr2
2326 : a203             [ 2]         ldx #3
2328 :                       tlsr3
                                     set_z zp1,$ff
                            >            load_flag $ff
2328 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
232a : 48               [ 3]>            pha         ;use stack to load status
232b : b513             [ 4]>            lda zp1,x    ;load to zeropage
232d : 850c             [ 3]>            sta zpt
232f : 28               [ 4]>            plp
                             
2330 : 460c             [ 5]         lsr zpt
                                     tst_z rLSR,fLSR,$ff-fnzc
2332 : 08               [ 3]>            php         ;save flags
2333 : a50c             [ 3]>            lda zpt
2335 : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
2338 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
233a : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
233b : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
233d : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
2340 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  176
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
2342 : ca               [ 2]         dex
2343 : 10e3             [ 3]         bpl tlsr3
                             
2345 : a203             [ 2]         ldx #3
2347 :                       trol2
                                     set_z zp1,0
                            >            load_flag 0
2347 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2349 : 48               [ 3]>            pha         ;use stack to load status
234a : b513             [ 4]>            lda zp1,x    ;load to zeropage
234c : 850c             [ 3]>            sta zpt
234e : 28               [ 4]>            plp
                             
234f : 260c             [ 5]         rol zpt
                                     tst_z rROL,fROL,0
2351 : 08               [ 3]>            php         ;save flags
2352 : a50c             [ 3]>            lda zpt
2354 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
2357 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2359 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
235a : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
235c : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
235f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2361 : ca               [ 2]         dex
2362 : 10e3             [ 3]         bpl trol2
2364 : a203             [ 2]         ldx #3
2366 :                       trol3
                                     set_z zp1,$ff-fc
                            >            load_flag $ff-fc
2366 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
2368 : 48               [ 3]>            pha         ;use stack to load status
2369 : b513             [ 4]>            lda zp1,x    ;load to zeropage
236b : 850c             [ 3]>            sta zpt
236d : 28               [ 4]>            plp
                             
236e : 260c             [ 5]         rol zpt
                                     tst_z rROL,fROL,$ff-fnzc
2370 : 08               [ 3]>            php         ;save flags
2371 : a50c             [ 3]>            lda zpt
2373 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
2376 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2378 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  177
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2379 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
237b : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
237e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2380 : ca               [ 2]         dex
2381 : 10e3             [ 3]         bpl trol3
                             
2383 : a203             [ 2]         ldx #3
2385 :                       trolc2
                                     set_z zp1,fc
                            >            load_flag fc
2385 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
2387 : 48               [ 3]>            pha         ;use stack to load status
2388 : b513             [ 4]>            lda zp1,x    ;load to zeropage
238a : 850c             [ 3]>            sta zpt
238c : 28               [ 4]>            plp
                             
238d : 260c             [ 5]         rol zpt
                                     tst_z rROLc,fROLc,0
238f : 08               [ 3]>            php         ;save flags
2390 : a50c             [ 3]>            lda zpt
2392 : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
2395 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2397 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2398 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
239a : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
239d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
239f : ca               [ 2]         dex
23a0 : 10e3             [ 3]         bpl trolc2
23a2 : a203             [ 2]         ldx #3
23a4 :                       trolc3
                                     set_z zp1,$ff
                            >            load_flag $ff
23a4 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
23a6 : 48               [ 3]>            pha         ;use stack to load status
23a7 : b513             [ 4]>            lda zp1,x    ;load to zeropage
23a9 : 850c             [ 3]>            sta zpt
23ab : 28               [ 4]>            plp
                             
23ac : 260c             [ 5]         rol zpt
                                     tst_z rROLc,fROLc,$ff-fnzc
23ae : 08               [ 3]>            php         ;save flags
23af : a50c             [ 3]>            lda zpt
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  178
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

23b1 : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
23b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
23b6 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
23b7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
23b9 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
23bc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
23be : ca               [ 2]         dex
23bf : 10e3             [ 3]         bpl trolc3
                             
23c1 : a203             [ 2]         ldx #3
23c3 :                       tror2
                                     set_z zp1,0
                            >            load_flag 0
23c3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
23c5 : 48               [ 3]>            pha         ;use stack to load status
23c6 : b513             [ 4]>            lda zp1,x    ;load to zeropage
23c8 : 850c             [ 3]>            sta zpt
23ca : 28               [ 4]>            plp
                             
23cb : 660c             [ 5]         ror zpt
                                     tst_z rROR,fROR,0
23cd : 08               [ 3]>            php         ;save flags
23ce : a50c             [ 3]>            lda zpt
23d0 : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
23d3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
23d5 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
23d6 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
23d8 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
23db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
23dd : ca               [ 2]         dex
23de : 10e3             [ 3]         bpl tror2
23e0 : a203             [ 2]         ldx #3
23e2 :                       tror3
                                     set_z zp1,$ff-fc
                            >            load_flag $ff-fc
23e2 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
23e4 : 48               [ 3]>            pha         ;use stack to load status
23e5 : b513             [ 4]>            lda zp1,x    ;load to zeropage
23e7 : 850c             [ 3]>            sta zpt
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  179
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

23e9 : 28               [ 4]>            plp
                             
23ea : 660c             [ 5]         ror zpt
                                     tst_z rROR,fROR,$ff-fnzc
23ec : 08               [ 3]>            php         ;save flags
23ed : a50c             [ 3]>            lda zpt
23ef : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
23f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
23f4 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
23f5 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
23f7 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
23fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
23fc : ca               [ 2]         dex
23fd : 10e3             [ 3]         bpl tror3
                             
23ff : a203             [ 2]         ldx #3
2401 :                       trorc2
                                     set_z zp1,fc
                            >            load_flag fc
2401 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
2403 : 48               [ 3]>            pha         ;use stack to load status
2404 : b513             [ 4]>            lda zp1,x    ;load to zeropage
2406 : 850c             [ 3]>            sta zpt
2408 : 28               [ 4]>            plp
                             
2409 : 660c             [ 5]         ror zpt
                                     tst_z rRORc,fRORc,0
240b : 08               [ 3]>            php         ;save flags
240c : a50c             [ 3]>            lda zpt
240e : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
2411 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2413 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2414 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2416 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne
2419 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
241b : ca               [ 2]         dex
241c : 10e3             [ 3]         bpl trorc2
241e : a203             [ 2]         ldx #3
2420 :                       trorc3
                                     set_z zp1,$ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  180
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag $ff
2420 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2422 : 48               [ 3]>            pha         ;use stack to load status
2423 : b513             [ 4]>            lda zp1,x    ;load to zeropage
2425 : 850c             [ 3]>            sta zpt
2427 : 28               [ 4]>            plp
                             
2428 : 660c             [ 5]         ror zpt
                                     tst_z rRORc,fRORc,$ff-fnzc
242a : 08               [ 3]>            php         ;save flags
242b : a50c             [ 3]>            lda zpt
242d : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
2430 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2432 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2433 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2435 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne
2438 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
243a : ca               [ 2]         dex
243b : 10e3             [ 3]         bpl trorc3
                                     next_test
243d : ad0002           [ 4]>            lda test_case   ;previous test
2440 : c91e             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
2442 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
001f =                      >test_num = test_num + 1
2444 : a91f             [ 2]>            lda #test_num   ;*** this tests' number
2446 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; shifts - absolute
2449 : a203             [ 2]         ldx #3
244b :                       tasl4
                                     set_abs zp1,0
                            >            load_flag 0
244b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
244d : 48               [ 3]>            pha         ;use stack to load status
244e : b513             [ 4]>            lda zp1,x    ;load to memory
2450 : 8d0302           [ 4]>            sta abst
2453 : 28               [ 4]>            plp
                             
2454 : 0e0302           [ 6]         asl abst
                                     tst_abs rASL,fASL,0
2457 : 08               [ 3]>            php         ;save flags
2458 : ad0302           [ 4]>            lda abst
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  181
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

245b : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
245e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2460 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2461 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2463 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
2466 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2468 : ca               [ 2]         dex
2469 : 10e0             [ 3]         bpl tasl4
246b : a203             [ 2]         ldx #3
246d :                       tasl5
                                     set_abs zp1,$ff
                            >            load_flag $ff
246d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
246f : 48               [ 3]>            pha         ;use stack to load status
2470 : b513             [ 4]>            lda zp1,x    ;load to memory
2472 : 8d0302           [ 4]>            sta abst
2475 : 28               [ 4]>            plp
                             
2476 : 0e0302           [ 6]         asl abst
                                     tst_abs rASL,fASL,$ff-fnzc
2479 : 08               [ 3]>            php         ;save flags
247a : ad0302           [ 4]>            lda abst
247d : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
2480 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2482 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2483 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2485 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
2488 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
248a : ca               [ 2]         dex
248b : 10e0             [ 3]         bpl tasl5
                             
248d : a203             [ 2]         ldx #3
248f :                       tlsr4
                                     set_abs zp1,0
                            >            load_flag 0
248f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2491 : 48               [ 3]>            pha         ;use stack to load status
2492 : b513             [ 4]>            lda zp1,x    ;load to memory
2494 : 8d0302           [ 4]>            sta abst
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  182
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2497 : 28               [ 4]>            plp
                             
2498 : 4e0302           [ 6]         lsr abst
                                     tst_abs rLSR,fLSR,0
249b : 08               [ 3]>            php         ;save flags
249c : ad0302           [ 4]>            lda abst
249f : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
24a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
24a4 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
24a5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
24a7 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
24aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
24ac : ca               [ 2]         dex
24ad : 10e0             [ 3]         bpl tlsr4
24af : a203             [ 2]         ldx #3
24b1 :                       tlsr5
                                     set_abs zp1,$ff
                            >            load_flag $ff
24b1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
24b3 : 48               [ 3]>            pha         ;use stack to load status
24b4 : b513             [ 4]>            lda zp1,x    ;load to memory
24b6 : 8d0302           [ 4]>            sta abst
24b9 : 28               [ 4]>            plp
                             
24ba : 4e0302           [ 6]         lsr abst
                                     tst_abs rLSR,fLSR,$ff-fnzc
24bd : 08               [ 3]>            php         ;save flags
24be : ad0302           [ 4]>            lda abst
24c1 : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
24c4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
24c6 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
24c7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
24c9 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
24cc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
24ce : ca               [ 2]         dex
24cf : 10e0             [ 3]         bpl tlsr5
                             
24d1 : a203             [ 2]         ldx #3
24d3 :                       trol4
                                     set_abs zp1,0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  183
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag 0
24d3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
24d5 : 48               [ 3]>            pha         ;use stack to load status
24d6 : b513             [ 4]>            lda zp1,x    ;load to memory
24d8 : 8d0302           [ 4]>            sta abst
24db : 28               [ 4]>            plp
                             
24dc : 2e0302           [ 6]         rol abst
                                     tst_abs rROL,fROL,0
24df : 08               [ 3]>            php         ;save flags
24e0 : ad0302           [ 4]>            lda abst
24e3 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
24e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
24e8 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
24e9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
24eb : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
24ee : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
24f0 : ca               [ 2]         dex
24f1 : 10e0             [ 3]         bpl trol4
24f3 : a203             [ 2]         ldx #3
24f5 :                       trol5
                                     set_abs zp1,$ff-fc
                            >            load_flag $ff-fc
24f5 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
24f7 : 48               [ 3]>            pha         ;use stack to load status
24f8 : b513             [ 4]>            lda zp1,x    ;load to memory
24fa : 8d0302           [ 4]>            sta abst
24fd : 28               [ 4]>            plp
                             
24fe : 2e0302           [ 6]         rol abst
                                     tst_abs rROL,fROL,$ff-fnzc
2501 : 08               [ 3]>            php         ;save flags
2502 : ad0302           [ 4]>            lda abst
2505 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
2508 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
250a : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
250b : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
250d : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
2510 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  184
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2512 : ca               [ 2]         dex
2513 : 10e0             [ 4]         bpl trol5
                             
2515 : a203             [ 2]         ldx #3
2517 :                       trolc4
                                     set_abs zp1,fc
                            >            load_flag fc
2517 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
2519 : 48               [ 3]>            pha         ;use stack to load status
251a : b513             [ 4]>            lda zp1,x    ;load to memory
251c : 8d0302           [ 4]>            sta abst
251f : 28               [ 4]>            plp
                             
2520 : 2e0302           [ 6]         rol abst
                                     tst_abs rROLc,fROLc,0
2523 : 08               [ 3]>            php         ;save flags
2524 : ad0302           [ 4]>            lda abst
2527 : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
252a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
252c : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
252d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
252f : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
2532 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2534 : ca               [ 2]         dex
2535 : 10e0             [ 3]         bpl trolc4
2537 : a203             [ 2]         ldx #3
2539 :                       trolc5
                                     set_abs zp1,$ff
                            >            load_flag $ff
2539 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
253b : 48               [ 3]>            pha         ;use stack to load status
253c : b513             [ 4]>            lda zp1,x    ;load to memory
253e : 8d0302           [ 4]>            sta abst
2541 : 28               [ 4]>            plp
                             
2542 : 2e0302           [ 6]         rol abst
                                     tst_abs rROLc,fROLc,$ff-fnzc
2545 : 08               [ 3]>            php         ;save flags
2546 : ad0302           [ 4]>            lda abst
2549 : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
254c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
254e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
254f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  185
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
2551 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
2554 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2556 : ca               [ 2]         dex
2557 : 10e0             [ 3]         bpl trolc5
                             
2559 : a203             [ 2]         ldx #3
255b :                       tror4
                                     set_abs zp1,0
                            >            load_flag 0
255b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
255d : 48               [ 3]>            pha         ;use stack to load status
255e : b513             [ 4]>            lda zp1,x    ;load to memory
2560 : 8d0302           [ 4]>            sta abst
2563 : 28               [ 4]>            plp
                             
2564 : 6e0302           [ 6]         ror abst
                                     tst_abs rROR,fROR,0
2567 : 08               [ 3]>            php         ;save flags
2568 : ad0302           [ 4]>            lda abst
256b : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
256e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2570 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2571 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2573 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
2576 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2578 : ca               [ 2]         dex
2579 : 10e0             [ 3]         bpl tror4
257b : a203             [ 2]         ldx #3
257d :                       tror5
                                     set_abs zp1,$ff-fc
                            >            load_flag $ff-fc
257d : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
257f : 48               [ 3]>            pha         ;use stack to load status
2580 : b513             [ 4]>            lda zp1,x    ;load to memory
2582 : 8d0302           [ 4]>            sta abst
2585 : 28               [ 4]>            plp
                             
2586 : 6e0302           [ 6]         ror abst
                                     tst_abs rROR,fROR,$ff-fnzc
2589 : 08               [ 3]>            php         ;save flags
258a : ad0302           [ 4]>            lda abst
258d : dd1902           [ 4]>            cmp rROR,x    ;test result
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  186
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            trap_ne
2590 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2592 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2593 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2595 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
2598 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
259a : ca               [ 2]         dex
259b : 10e0             [ 3]         bpl tror5
                             
259d : a203             [ 2]         ldx #3
259f :                       trorc4
                                     set_abs zp1,fc
                            >            load_flag fc
259f : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
25a1 : 48               [ 3]>            pha         ;use stack to load status
25a2 : b513             [ 4]>            lda zp1,x    ;load to memory
25a4 : 8d0302           [ 4]>            sta abst
25a7 : 28               [ 4]>            plp
                             
25a8 : 6e0302           [ 6]         ror abst
                                     tst_abs rRORc,fRORc,0
25ab : 08               [ 3]>            php         ;save flags
25ac : ad0302           [ 4]>            lda abst
25af : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
25b2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
25b4 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
25b5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
25b7 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne
25ba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
25bc : ca               [ 2]         dex
25bd : 10e0             [ 3]         bpl trorc4
25bf : a203             [ 2]         ldx #3
25c1 :                       trorc5
                                     set_abs zp1,$ff
                            >            load_flag $ff
25c1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
25c3 : 48               [ 3]>            pha         ;use stack to load status
25c4 : b513             [ 4]>            lda zp1,x    ;load to memory
25c6 : 8d0302           [ 4]>            sta abst
25c9 : 28               [ 4]>            plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  187
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
25ca : 6e0302           [ 6]         ror abst
                                     tst_abs rRORc,fRORc,$ff-fnzc
25cd : 08               [ 3]>            php         ;save flags
25ce : ad0302           [ 4]>            lda abst
25d1 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
25d4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
25d6 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
25d7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
25d9 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne
25dc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
25de : ca               [ 2]         dex
25df : 10e0             [ 3]         bpl trorc5
                                     next_test
25e1 : ad0002           [ 4]>            lda test_case   ;previous test
25e4 : c91f             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
25e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0020 =                      >test_num = test_num + 1
25e8 : a920             [ 2]>            lda #test_num   ;*** this tests' number
25ea : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; shifts - zp indexed
25ed : a203             [ 2]         ldx #3
25ef :                       tasl6
                                     set_zx zp1,0
                            >            load_flag 0
25ef : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
25f1 : 48               [ 3]>            pha         ;use stack to load status
25f2 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
25f4 : 950c             [ 4]>            sta zpt,x
25f6 : 28               [ 4]>            plp
                             
25f7 : 160c             [ 6]         asl zpt,x
                                     tst_zx rASL,fASL,0
25f9 : 08               [ 3]>            php         ;save flags
25fa : b50c             [ 4]>            lda zpt,x
25fc : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
25ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2601 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2602 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  188
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
2604 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
2607 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2609 : ca               [ 2]         dex
260a : 10e3             [ 4]         bpl tasl6
260c : a203             [ 2]         ldx #3
260e :                       tasl7
                                     set_zx zp1,$ff
                            >            load_flag $ff
260e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2610 : 48               [ 3]>            pha         ;use stack to load status
2611 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
2613 : 950c             [ 4]>            sta zpt,x
2615 : 28               [ 4]>            plp
                             
2616 : 160c             [ 6]         asl zpt,x
                                     tst_zx rASL,fASL,$ff-fnzc
2618 : 08               [ 3]>            php         ;save flags
2619 : b50c             [ 4]>            lda zpt,x
261b : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
261e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2620 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2621 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2623 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
2626 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2628 : ca               [ 2]         dex
2629 : 10e3             [ 3]         bpl tasl7
                             
262b : a203             [ 2]         ldx #3
262d :                       tlsr6
                                     set_zx zp1,0
                            >            load_flag 0
262d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
262f : 48               [ 3]>            pha         ;use stack to load status
2630 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
2632 : 950c             [ 4]>            sta zpt,x
2634 : 28               [ 4]>            plp
                             
2635 : 560c             [ 6]         lsr zpt,x
                                     tst_zx rLSR,fLSR,0
2637 : 08               [ 3]>            php         ;save flags
2638 : b50c             [ 4]>            lda zpt,x
263a : dd1902           [ 4]>            cmp rLSR,x    ;test result
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  189
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            trap_ne
263d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
263f : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2640 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2642 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
2645 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2647 : ca               [ 2]         dex
2648 : 10e3             [ 3]         bpl tlsr6
264a : a203             [ 2]         ldx #3
264c :                       tlsr7
                                     set_zx zp1,$ff
                            >            load_flag $ff
264c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
264e : 48               [ 3]>            pha         ;use stack to load status
264f : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
2651 : 950c             [ 4]>            sta zpt,x
2653 : 28               [ 4]>            plp
                             
2654 : 560c             [ 6]         lsr zpt,x
                                     tst_zx rLSR,fLSR,$ff-fnzc
2656 : 08               [ 3]>            php         ;save flags
2657 : b50c             [ 4]>            lda zpt,x
2659 : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
265c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
265e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
265f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2661 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
2664 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2666 : ca               [ 2]         dex
2667 : 10e3             [ 3]         bpl tlsr7
                             
2669 : a203             [ 2]         ldx #3
266b :                       trol6
                                     set_zx zp1,0
                            >            load_flag 0
266b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
266d : 48               [ 3]>            pha         ;use stack to load status
266e : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
2670 : 950c             [ 4]>            sta zpt,x
2672 : 28               [ 4]>            plp
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  190
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
2673 : 360c             [ 6]         rol zpt,x
                                     tst_zx rROL,fROL,0
2675 : 08               [ 3]>            php         ;save flags
2676 : b50c             [ 4]>            lda zpt,x
2678 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
267b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
267d : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
267e : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2680 : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
2683 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2685 : ca               [ 2]         dex
2686 : 10e3             [ 3]         bpl trol6
2688 : a203             [ 2]         ldx #3
268a :                       trol7
                                     set_zx zp1,$ff-fc
                            >            load_flag $ff-fc
268a : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
268c : 48               [ 3]>            pha         ;use stack to load status
268d : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
268f : 950c             [ 4]>            sta zpt,x
2691 : 28               [ 4]>            plp
                             
2692 : 360c             [ 6]         rol zpt,x
                                     tst_zx rROL,fROL,$ff-fnzc
2694 : 08               [ 3]>            php         ;save flags
2695 : b50c             [ 4]>            lda zpt,x
2697 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
269a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
269c : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
269d : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
269f : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
26a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
26a4 : ca               [ 2]         dex
26a5 : 10e3             [ 3]         bpl trol7
                             
26a7 : a203             [ 2]         ldx #3
26a9 :                       trolc6
                                     set_zx zp1,fc
                            >            load_flag fc
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  191
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

26a9 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
26ab : 48               [ 3]>            pha         ;use stack to load status
26ac : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
26ae : 950c             [ 4]>            sta zpt,x
26b0 : 28               [ 4]>            plp
                             
26b1 : 360c             [ 6]         rol zpt,x
                                     tst_zx rROLc,fROLc,0
26b3 : 08               [ 3]>            php         ;save flags
26b4 : b50c             [ 4]>            lda zpt,x
26b6 : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
26b9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
26bb : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
26bc : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
26be : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
26c1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
26c3 : ca               [ 2]         dex
26c4 : 10e3             [ 3]         bpl trolc6
26c6 : a203             [ 2]         ldx #3
26c8 :                       trolc7
                                     set_zx zp1,$ff
                            >            load_flag $ff
26c8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
26ca : 48               [ 3]>            pha         ;use stack to load status
26cb : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
26cd : 950c             [ 4]>            sta zpt,x
26cf : 28               [ 4]>            plp
                             
26d0 : 360c             [ 6]         rol zpt,x
                                     tst_zx rROLc,fROLc,$ff-fnzc
26d2 : 08               [ 3]>            php         ;save flags
26d3 : b50c             [ 4]>            lda zpt,x
26d5 : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
26d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
26da : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
26db : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
26dd : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
26e0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
26e2 : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  192
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

26e3 : 10e3             [ 3]         bpl trolc7
                             
26e5 : a203             [ 2]         ldx #3
26e7 :                       tror6
                                     set_zx zp1,0
                            >            load_flag 0
26e7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
26e9 : 48               [ 3]>            pha         ;use stack to load status
26ea : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
26ec : 950c             [ 4]>            sta zpt,x
26ee : 28               [ 4]>            plp
                             
26ef : 760c             [ 6]         ror zpt,x
                                     tst_zx rROR,fROR,0
26f1 : 08               [ 3]>            php         ;save flags
26f2 : b50c             [ 4]>            lda zpt,x
26f4 : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
26f7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
26f9 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
26fa : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
26fc : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
26ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2701 : ca               [ 2]         dex
2702 : 10e3             [ 4]         bpl tror6
2704 : a203             [ 2]         ldx #3
2706 :                       tror7
                                     set_zx zp1,$ff-fc
                            >            load_flag $ff-fc
2706 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
2708 : 48               [ 3]>            pha         ;use stack to load status
2709 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
270b : 950c             [ 4]>            sta zpt,x
270d : 28               [ 4]>            plp
                             
270e : 760c             [ 6]         ror zpt,x
                                     tst_zx rROR,fROR,$ff-fnzc
2710 : 08               [ 3]>            php         ;save flags
2711 : b50c             [ 4]>            lda zpt,x
2713 : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
2716 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2718 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2719 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  193
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

271b : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
271e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2720 : ca               [ 2]         dex
2721 : 10e3             [ 3]         bpl tror7
                             
2723 : a203             [ 2]         ldx #3
2725 :                       trorc6
                                     set_zx zp1,fc
                            >            load_flag fc
2725 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
2727 : 48               [ 3]>            pha         ;use stack to load status
2728 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
272a : 950c             [ 4]>            sta zpt,x
272c : 28               [ 4]>            plp
                             
272d : 760c             [ 6]         ror zpt,x
                                     tst_zx rRORc,fRORc,0
272f : 08               [ 3]>            php         ;save flags
2730 : b50c             [ 4]>            lda zpt,x
2732 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
2735 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2737 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2738 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
273a : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne
273d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
273f : ca               [ 2]         dex
2740 : 10e3             [ 3]         bpl trorc6
2742 : a203             [ 2]         ldx #3
2744 :                       trorc7
                                     set_zx zp1,$ff
                            >            load_flag $ff
2744 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2746 : 48               [ 3]>            pha         ;use stack to load status
2747 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
2749 : 950c             [ 4]>            sta zpt,x
274b : 28               [ 4]>            plp
                             
274c : 760c             [ 6]         ror zpt,x
                                     tst_zx rRORc,fRORc,$ff-fnzc
274e : 08               [ 3]>            php         ;save flags
274f : b50c             [ 4]>            lda zpt,x
2751 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  194
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2754 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2756 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2757 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2759 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne
275c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
275e : ca               [ 2]         dex
275f : 10e3             [ 3]         bpl trorc7
                                     next_test
2761 : ad0002           [ 4]>            lda test_case   ;previous test
2764 : c920             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
2766 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0021 =                      >test_num = test_num + 1
2768 : a921             [ 2]>            lda #test_num   ;*** this tests' number
276a : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                                     
                             ; shifts - abs indexed
276d : a203             [ 2]         ldx #3
276f :                       tasl8
                                     set_absx zp1,0
                            >            load_flag 0
276f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2771 : 48               [ 3]>            pha         ;use stack to load status
2772 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
2774 : 9d0302           [ 5]>            sta abst,x
2777 : 28               [ 4]>            plp
                             
2778 : 1e0302           [ 6]         asl abst,x
                                     tst_absx rASL,fASL,0
277b : 08               [ 3]>            php         ;save flags
277c : bd0302           [ 4]>            lda abst,x
277f : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
2782 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2784 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2785 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2787 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
278a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
278c : ca               [ 2]         dex
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  195
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

278d : 10e0             [ 3]         bpl tasl8
278f : a203             [ 2]         ldx #3
2791 :                       tasl9
                                     set_absx zp1,$ff
                            >            load_flag $ff
2791 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2793 : 48               [ 3]>            pha         ;use stack to load status
2794 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
2796 : 9d0302           [ 5]>            sta abst,x
2799 : 28               [ 4]>            plp
                             
279a : 1e0302           [ 6]         asl abst,x
                                     tst_absx rASL,fASL,$ff-fnzc
279d : 08               [ 3]>            php         ;save flags
279e : bd0302           [ 4]>            lda abst,x
27a1 : dd1102           [ 4]>            cmp rASL,x    ;test result
                            >            trap_ne
27a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
27a6 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
27a7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
27a9 : dd2102           [ 4]>            cmp fASL,x    ;test flags
                            >            trap_ne
27ac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
27ae : ca               [ 2]         dex
27af : 10e0             [ 3]         bpl tasl9
                             
27b1 : a203             [ 2]         ldx #3
27b3 :                       tlsr8
                                     set_absx zp1,0
                            >            load_flag 0
27b3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
27b5 : 48               [ 3]>            pha         ;use stack to load status
27b6 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
27b8 : 9d0302           [ 5]>            sta abst,x
27bb : 28               [ 4]>            plp
                             
27bc : 5e0302           [ 6]         lsr abst,x
                                     tst_absx rLSR,fLSR,0
27bf : 08               [ 3]>            php         ;save flags
27c0 : bd0302           [ 4]>            lda abst,x
27c3 : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
27c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
27c8 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
27c9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  196
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

27cb : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
27ce : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
27d0 : ca               [ 2]         dex
27d1 : 10e0             [ 3]         bpl tlsr8
27d3 : a203             [ 2]         ldx #3
27d5 :                       tlsr9
                                     set_absx zp1,$ff
                            >            load_flag $ff
27d5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
27d7 : 48               [ 3]>            pha         ;use stack to load status
27d8 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
27da : 9d0302           [ 5]>            sta abst,x
27dd : 28               [ 4]>            plp
                             
27de : 5e0302           [ 6]         lsr abst,x
                                     tst_absx rLSR,fLSR,$ff-fnzc
27e1 : 08               [ 3]>            php         ;save flags
27e2 : bd0302           [ 4]>            lda abst,x
27e5 : dd1902           [ 4]>            cmp rLSR,x    ;test result
                            >            trap_ne
27e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
27ea : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
27eb : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
27ed : dd2902           [ 4]>            cmp fLSR,x    ;test flags
                            >            trap_ne
27f0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
27f2 : ca               [ 2]         dex
27f3 : 10e0             [ 3]         bpl tlsr9
                             
27f5 : a203             [ 2]         ldx #3
27f7 :                       trol8
                                     set_absx zp1,0
                            >            load_flag 0
27f7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
27f9 : 48               [ 3]>            pha         ;use stack to load status
27fa : b513             [ 4]>            lda zp1,x    ;load to indexed memory
27fc : 9d0302           [ 5]>            sta abst,x
27ff : 28               [ 4]>            plp
                             
2800 : 3e0302           [ 6]         rol abst,x
                                     tst_absx rROL,fROL,0
2803 : 08               [ 3]>            php         ;save flags
2804 : bd0302           [ 4]>            lda abst,x
2807 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  197
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

280a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
280c : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
280d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
280f : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
2812 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2814 : ca               [ 2]         dex
2815 : 10e0             [ 4]         bpl trol8
2817 : a203             [ 2]         ldx #3
2819 :                       trol9
                                     set_absx zp1,$ff-fc
                            >            load_flag $ff-fc
2819 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
281b : 48               [ 3]>            pha         ;use stack to load status
281c : b513             [ 4]>            lda zp1,x    ;load to indexed memory
281e : 9d0302           [ 5]>            sta abst,x
2821 : 28               [ 4]>            plp
                             
2822 : 3e0302           [ 6]         rol abst,x
                                     tst_absx rROL,fROL,$ff-fnzc
2825 : 08               [ 3]>            php         ;save flags
2826 : bd0302           [ 4]>            lda abst,x
2829 : dd1102           [ 4]>            cmp rROL,x    ;test result
                            >            trap_ne
282c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
282e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
282f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2831 : dd2102           [ 4]>            cmp fROL,x    ;test flags
                            >            trap_ne
2834 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2836 : ca               [ 2]         dex
2837 : 10e0             [ 3]         bpl trol9
                             
2839 : a203             [ 2]         ldx #3
283b :                       trolc8
                                     set_absx zp1,fc
                            >            load_flag fc
283b : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
283d : 48               [ 3]>            pha         ;use stack to load status
283e : b513             [ 4]>            lda zp1,x    ;load to indexed memory
2840 : 9d0302           [ 5]>            sta abst,x
2843 : 28               [ 4]>            plp
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  198
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2844 : 3e0302           [ 6]         rol abst,x
                                     tst_absx rROLc,fROLc,0
2847 : 08               [ 3]>            php         ;save flags
2848 : bd0302           [ 4]>            lda abst,x
284b : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
284e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2850 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2851 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2853 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
2856 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2858 : ca               [ 2]         dex
2859 : 10e0             [ 3]         bpl trolc8
285b : a203             [ 2]         ldx #3
285d :                       trolc9
                                     set_absx zp1,$ff
                            >            load_flag $ff
285d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
285f : 48               [ 3]>            pha         ;use stack to load status
2860 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
2862 : 9d0302           [ 5]>            sta abst,x
2865 : 28               [ 4]>            plp
                             
2866 : 3e0302           [ 6]         rol abst,x
                                     tst_absx rROLc,fROLc,$ff-fnzc
2869 : 08               [ 3]>            php         ;save flags
286a : bd0302           [ 4]>            lda abst,x
286d : dd1502           [ 4]>            cmp rROLc,x    ;test result
                            >            trap_ne
2870 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2872 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
2873 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
2875 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
                            >            trap_ne
2878 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
287a : ca               [ 2]         dex
287b : 10e0             [ 3]         bpl trolc9
                             
287d : a203             [ 2]         ldx #3
287f :                       tror8
                                     set_absx zp1,0
                            >            load_flag 0
287f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  199
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
2881 : 48               [ 3]>            pha         ;use stack to load status
2882 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
2884 : 9d0302           [ 5]>            sta abst,x
2887 : 28               [ 4]>            plp
                             
2888 : 7e0302           [ 6]         ror abst,x
                                     tst_absx rROR,fROR,0
288b : 08               [ 3]>            php         ;save flags
288c : bd0302           [ 4]>            lda abst,x
288f : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
2892 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2894 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2895 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2897 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
289a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
289c : ca               [ 2]         dex
289d : 10e0             [ 3]         bpl tror8
289f : a203             [ 2]         ldx #3
28a1 :                       tror9
                                     set_absx zp1,$ff-fc
                            >            load_flag $ff-fc
28a1 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
                            >
28a3 : 48               [ 3]>            pha         ;use stack to load status
28a4 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
28a6 : 9d0302           [ 5]>            sta abst,x
28a9 : 28               [ 4]>            plp
                             
28aa : 7e0302           [ 6]         ror abst,x
                                     tst_absx rROR,fROR,$ff-fnzc
28ad : 08               [ 3]>            php         ;save flags
28ae : bd0302           [ 4]>            lda abst,x
28b1 : dd1902           [ 4]>            cmp rROR,x    ;test result
                            >            trap_ne
28b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
28b6 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
28b7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
28b9 : dd2902           [ 4]>            cmp fROR,x    ;test flags
                            >            trap_ne
28bc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
28be : ca               [ 2]         dex
28bf : 10e0             [ 3]         bpl tror9
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  200
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
28c1 : a203             [ 2]         ldx #3
28c3 :                       trorc8
                                     set_absx zp1,fc
                            >            load_flag fc
28c3 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
                            >
28c5 : 48               [ 3]>            pha         ;use stack to load status
28c6 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
28c8 : 9d0302           [ 5]>            sta abst,x
28cb : 28               [ 4]>            plp
                             
28cc : 7e0302           [ 6]         ror abst,x
                                     tst_absx rRORc,fRORc,0
28cf : 08               [ 3]>            php         ;save flags
28d0 : bd0302           [ 4]>            lda abst,x
28d3 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
28d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
28d8 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
28d9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
28db : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
                            >            trap_ne
28de : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
28e0 : ca               [ 2]         dex
28e1 : 10e0             [ 3]         bpl trorc8
28e3 : a203             [ 2]         ldx #3
28e5 :                       trorc9
                                     set_absx zp1,$ff
                            >            load_flag $ff
28e5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
28e7 : 48               [ 3]>            pha         ;use stack to load status
28e8 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
28ea : 9d0302           [ 5]>            sta abst,x
28ed : 28               [ 4]>            plp
                             
28ee : 7e0302           [ 6]         ror abst,x
                                     tst_absx rRORc,fRORc,$ff-fnzc
28f1 : 08               [ 3]>            php         ;save flags
28f2 : bd0302           [ 4]>            lda abst,x
28f5 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
                            >            trap_ne
28f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
28fa : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnzc
28fb : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
                            >
28fd : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  201
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            trap_ne
2900 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2902 : ca               [ 2]         dex
2903 : 10e0             [ 4]         bpl trorc9
                                     next_test
2905 : ad0002           [ 4]>            lda test_case   ;previous test
2908 : c921             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
290a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0022 =                      >test_num = test_num + 1
290c : a922             [ 2]>            lda #test_num   ;*** this tests' number
290e : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; testing memory increment/decrement - INC DEC all addressing modes
                             ; zeropage
2911 : a200             [ 2]         ldx #0
2913 : a97e             [ 2]         lda #$7e
2915 : 850c             [ 3]         sta zpt
2917 :                       tinc    
                                     set_stat 0
                            >            load_flag 0
2917 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2919 : 48               [ 3]>            pha         ;use stack to load status
291a : 28               [ 4]>            plp
                             
291b : e60c             [ 5]         inc zpt
                                     tst_z rINC,fINC,0
291d : 08               [ 3]>            php         ;save flags
291e : a50c             [ 3]>            lda zpt
2920 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2923 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2925 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2926 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2928 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
292b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
292d : e8               [ 2]         inx
292e : e002             [ 2]         cpx #2
2930 : d004             [ 3]         bne tinc1
2932 : a9fe             [ 2]         lda #$fe
2934 : 850c             [ 3]         sta zpt
2936 : e005             [ 2] tinc1   cpx #5
2938 : d0dd             [ 3]         bne tinc
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  202
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

293a : ca               [ 2]         dex
293b : e60c             [ 5]         inc zpt
293d :                       tdec    
                                     set_stat 0
                            >            load_flag 0
293d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
293f : 48               [ 3]>            pha         ;use stack to load status
2940 : 28               [ 4]>            plp
                             
2941 : c60c             [ 5]         dec zpt
                                     tst_z rINC,fINC,0
2943 : 08               [ 3]>            php         ;save flags
2944 : a50c             [ 3]>            lda zpt
2946 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2949 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
294b : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
294c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
294e : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2951 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2953 : ca               [ 2]         dex
2954 : 300a             [ 3]         bmi tdec1
2956 : e001             [ 2]         cpx #1
2958 : d0e3             [ 3]         bne tdec
295a : a981             [ 2]         lda #$81
295c : 850c             [ 3]         sta zpt
295e : d0dd             [ 3]         bne tdec
2960 :                       tdec1
2960 : a200             [ 2]         ldx #0
2962 : a97e             [ 2]         lda #$7e
2964 : 850c             [ 3]         sta zpt
2966 :                       tinc10    
                                     set_stat $ff
                            >            load_flag $ff
2966 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2968 : 48               [ 3]>            pha         ;use stack to load status
2969 : 28               [ 4]>            plp
                             
296a : e60c             [ 5]         inc zpt
                                     tst_z rINC,fINC,$ff-fnz
296c : 08               [ 3]>            php         ;save flags
296d : a50c             [ 3]>            lda zpt
296f : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2972 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2974 : 68               [ 4]>            pla         ;load status
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  203
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            eor_flag $ff-fnz
2975 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2977 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
297a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
297c : e8               [ 2]         inx
297d : e002             [ 2]         cpx #2
297f : d004             [ 3]         bne tinc11
2981 : a9fe             [ 2]         lda #$fe
2983 : 850c             [ 3]         sta zpt
2985 : e005             [ 2] tinc11  cpx #5
2987 : d0dd             [ 3]         bne tinc10
2989 : ca               [ 2]         dex
298a : e60c             [ 5]         inc zpt
298c :                       tdec10    
                                     set_stat $ff
                            >            load_flag $ff
298c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
298e : 48               [ 3]>            pha         ;use stack to load status
298f : 28               [ 4]>            plp
                             
2990 : c60c             [ 5]         dec zpt
                                     tst_z rINC,fINC,$ff-fnz
2992 : 08               [ 3]>            php         ;save flags
2993 : a50c             [ 3]>            lda zpt
2995 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2998 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
299a : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
299b : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
299d : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
29a0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
29a2 : ca               [ 2]         dex
29a3 : 300a             [ 3]         bmi tdec11
29a5 : e001             [ 2]         cpx #1
29a7 : d0e3             [ 3]         bne tdec10
29a9 : a981             [ 2]         lda #$81
29ab : 850c             [ 3]         sta zpt
29ad : d0dd             [ 3]         bne tdec10
29af :                       tdec11
                                     next_test
29af : ad0002           [ 4]>            lda test_case   ;previous test
29b2 : c922             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
29b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  204
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
0023 =                      >test_num = test_num + 1
29b6 : a923             [ 2]>            lda #test_num   ;*** this tests' number
29b8 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; absolute memory
29bb : a200             [ 2]         ldx #0
29bd : a97e             [ 2]         lda #$7e
29bf : 8d0302           [ 4]         sta abst
29c2 :                       tinc2    
                                     set_stat 0
                            >            load_flag 0
29c2 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
29c4 : 48               [ 3]>            pha         ;use stack to load status
29c5 : 28               [ 4]>            plp
                             
29c6 : ee0302           [ 6]         inc abst
                                     tst_abs rINC,fINC,0
29c9 : 08               [ 3]>            php         ;save flags
29ca : ad0302           [ 4]>            lda abst
29cd : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
29d0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
29d2 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
29d3 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
29d5 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
29d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
29da : e8               [ 2]         inx
29db : e002             [ 2]         cpx #2
29dd : d005             [ 3]         bne tinc3
29df : a9fe             [ 2]         lda #$fe
29e1 : 8d0302           [ 4]         sta abst
29e4 : e005             [ 2] tinc3   cpx #5
29e6 : d0da             [ 3]         bne tinc2
29e8 : ca               [ 2]         dex
29e9 : ee0302           [ 6]         inc abst
29ec :                       tdec2    
                                     set_stat 0
                            >            load_flag 0
29ec : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
29ee : 48               [ 3]>            pha         ;use stack to load status
29ef : 28               [ 4]>            plp
                             
29f0 : ce0302           [ 6]         dec abst
                                     tst_abs rINC,fINC,0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  205
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

29f3 : 08               [ 3]>            php         ;save flags
29f4 : ad0302           [ 4]>            lda abst
29f7 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
29fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
29fc : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
29fd : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
29ff : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2a02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2a04 : ca               [ 2]         dex
2a05 : 300b             [ 3]         bmi tdec3
2a07 : e001             [ 2]         cpx #1
2a09 : d0e1             [ 4]         bne tdec2
2a0b : a981             [ 2]         lda #$81
2a0d : 8d0302           [ 4]         sta abst
2a10 : d0da             [ 4]         bne tdec2
2a12 :                       tdec3
2a12 : a200             [ 2]         ldx #0
2a14 : a97e             [ 2]         lda #$7e
2a16 : 8d0302           [ 4]         sta abst
2a19 :                       tinc12    
                                     set_stat $ff
                            >            load_flag $ff
2a19 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2a1b : 48               [ 3]>            pha         ;use stack to load status
2a1c : 28               [ 4]>            plp
                             
2a1d : ee0302           [ 6]         inc abst
                                     tst_abs rINC,fINC,$ff-fnz
2a20 : 08               [ 3]>            php         ;save flags
2a21 : ad0302           [ 4]>            lda abst
2a24 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2a27 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2a29 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2a2a : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2a2c : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2a2f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2a31 : e8               [ 2]         inx
2a32 : e002             [ 2]         cpx #2
2a34 : d005             [ 3]         bne tinc13
2a36 : a9fe             [ 2]         lda #$fe
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  206
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2a38 : 8d0302           [ 4]         sta abst
2a3b : e005             [ 2] tinc13   cpx #5
2a3d : d0da             [ 3]         bne tinc12
2a3f : ca               [ 2]         dex
2a40 : ee0302           [ 6]         inc abst
2a43 :                       tdec12    
                                     set_stat $ff
                            >            load_flag $ff
2a43 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2a45 : 48               [ 3]>            pha         ;use stack to load status
2a46 : 28               [ 4]>            plp
                             
2a47 : ce0302           [ 6]         dec abst
                                     tst_abs rINC,fINC,$ff-fnz
2a4a : 08               [ 3]>            php         ;save flags
2a4b : ad0302           [ 4]>            lda abst
2a4e : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2a51 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2a53 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2a54 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2a56 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2a59 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2a5b : ca               [ 2]         dex
2a5c : 300b             [ 3]         bmi tdec13
2a5e : e001             [ 2]         cpx #1
2a60 : d0e1             [ 3]         bne tdec12
2a62 : a981             [ 2]         lda #$81
2a64 : 8d0302           [ 4]         sta abst
2a67 : d0da             [ 3]         bne tdec12
2a69 :                       tdec13
                                     next_test
2a69 : ad0002           [ 4]>            lda test_case   ;previous test
2a6c : c923             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
2a6e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0024 =                      >test_num = test_num + 1
2a70 : a924             [ 2]>            lda #test_num   ;*** this tests' number
2a72 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; zeropage indexed
2a75 : a200             [ 2]         ldx #0
2a77 : a97e             [ 2]         lda #$7e
2a79 : 950c             [ 4] tinc4   sta zpt,x
                                     set_stat 0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  207
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag 0
2a7b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2a7d : 48               [ 3]>            pha         ;use stack to load status
2a7e : 28               [ 4]>            plp
                             
2a7f : f60c             [ 6]         inc zpt,x
                                     tst_zx rINC,fINC,0
2a81 : 08               [ 3]>            php         ;save flags
2a82 : b50c             [ 4]>            lda zpt,x
2a84 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2a87 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2a89 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2a8a : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2a8c : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2a8f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2a91 : b50c             [ 4]         lda zpt,x
2a93 : e8               [ 2]         inx
2a94 : e002             [ 2]         cpx #2
2a96 : d002             [ 3]         bne tinc5
2a98 : a9fe             [ 2]         lda #$fe
2a9a : e005             [ 2] tinc5   cpx #5
2a9c : d0db             [ 3]         bne tinc4
2a9e : ca               [ 2]         dex
2a9f : a902             [ 2]         lda #2
2aa1 : 950c             [ 4] tdec4   sta zpt,x 
                                     set_stat 0
                            >            load_flag 0
2aa3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2aa5 : 48               [ 3]>            pha         ;use stack to load status
2aa6 : 28               [ 4]>            plp
                             
2aa7 : d60c             [ 6]         dec zpt,x
                                     tst_zx rINC,fINC,0
2aa9 : 08               [ 3]>            php         ;save flags
2aaa : b50c             [ 4]>            lda zpt,x
2aac : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2aaf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2ab1 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2ab2 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2ab4 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2ab7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  208
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                             
2ab9 : b50c             [ 4]         lda zpt,x
2abb : ca               [ 2]         dex
2abc : 3008             [ 3]         bmi tdec5
2abe : e001             [ 2]         cpx #1
2ac0 : d0df             [ 3]         bne tdec4
2ac2 : a981             [ 2]         lda #$81
2ac4 : d0db             [ 3]         bne tdec4
2ac6 :                       tdec5
2ac6 : a200             [ 2]         ldx #0
2ac8 : a97e             [ 2]         lda #$7e
2aca : 950c             [ 4] tinc14  sta zpt,x
                                     set_stat $ff
                            >            load_flag $ff
2acc : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2ace : 48               [ 3]>            pha         ;use stack to load status
2acf : 28               [ 4]>            plp
                             
2ad0 : f60c             [ 6]         inc zpt,x
                                     tst_zx rINC,fINC,$ff-fnz
2ad2 : 08               [ 3]>            php         ;save flags
2ad3 : b50c             [ 4]>            lda zpt,x
2ad5 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2ad8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2ada : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2adb : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2add : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2ae0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2ae2 : b50c             [ 4]         lda zpt,x
2ae4 : e8               [ 2]         inx
2ae5 : e002             [ 2]         cpx #2
2ae7 : d002             [ 3]         bne tinc15
2ae9 : a9fe             [ 2]         lda #$fe
2aeb : e005             [ 2] tinc15  cpx #5
2aed : d0db             [ 3]         bne tinc14
2aef : ca               [ 2]         dex
2af0 : a902             [ 2]         lda #2
2af2 : 950c             [ 4] tdec14  sta zpt,x 
                                     set_stat $ff
                            >            load_flag $ff
2af4 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2af6 : 48               [ 3]>            pha         ;use stack to load status
2af7 : 28               [ 4]>            plp
                             
2af8 : d60c             [ 6]         dec zpt,x
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  209
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     tst_zx rINC,fINC,$ff-fnz
2afa : 08               [ 3]>            php         ;save flags
2afb : b50c             [ 4]>            lda zpt,x
2afd : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2b00 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2b02 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2b03 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2b05 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2b08 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2b0a : b50c             [ 4]         lda zpt,x
2b0c : ca               [ 2]         dex
2b0d : 3008             [ 3]         bmi tdec15
2b0f : e001             [ 2]         cpx #1
2b11 : d0df             [ 4]         bne tdec14
2b13 : a981             [ 2]         lda #$81
2b15 : d0db             [ 4]         bne tdec14
2b17 :                       tdec15
                                     next_test
2b17 : ad0002           [ 4]>            lda test_case   ;previous test
2b1a : c924             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
2b1c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0025 =                      >test_num = test_num + 1
2b1e : a925             [ 2]>            lda #test_num   ;*** this tests' number
2b20 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; memory indexed
2b23 : a200             [ 2]         ldx #0
2b25 : a97e             [ 2]         lda #$7e
2b27 : 9d0302           [ 5] tinc6   sta abst,x
                                     set_stat 0
                            >            load_flag 0
2b2a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2b2c : 48               [ 3]>            pha         ;use stack to load status
2b2d : 28               [ 4]>            plp
                             
2b2e : fe0302           [ 6]         inc abst,x
                                     tst_absx rINC,fINC,0
2b31 : 08               [ 3]>            php         ;save flags
2b32 : bd0302           [ 4]>            lda abst,x
2b35 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2b38 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  210
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2b3a : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2b3b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2b3d : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2b40 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2b42 : bd0302           [ 4]         lda abst,x
2b45 : e8               [ 2]         inx
2b46 : e002             [ 2]         cpx #2
2b48 : d002             [ 3]         bne tinc7
2b4a : a9fe             [ 2]         lda #$fe
2b4c : e005             [ 2] tinc7   cpx #5
2b4e : d0d7             [ 3]         bne tinc6
2b50 : ca               [ 2]         dex
2b51 : a902             [ 2]         lda #2
2b53 : 9d0302           [ 5] tdec6   sta abst,x 
                                     set_stat 0
                            >            load_flag 0
2b56 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2b58 : 48               [ 3]>            pha         ;use stack to load status
2b59 : 28               [ 4]>            plp
                             
2b5a : de0302           [ 6]         dec abst,x
                                     tst_absx rINC,fINC,0
2b5d : 08               [ 3]>            php         ;save flags
2b5e : bd0302           [ 4]>            lda abst,x
2b61 : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2b64 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2b66 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2b67 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2b69 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2b6c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2b6e : bd0302           [ 4]         lda abst,x
2b71 : ca               [ 2]         dex
2b72 : 3008             [ 3]         bmi tdec7
2b74 : e001             [ 2]         cpx #1
2b76 : d0db             [ 3]         bne tdec6
2b78 : a981             [ 2]         lda #$81
2b7a : d0d7             [ 3]         bne tdec6
2b7c :                       tdec7
2b7c : a200             [ 2]         ldx #0
2b7e : a97e             [ 2]         lda #$7e
2b80 : 9d0302           [ 5] tinc16  sta abst,x
                                     set_stat $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  211
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag $ff
2b83 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2b85 : 48               [ 3]>            pha         ;use stack to load status
2b86 : 28               [ 4]>            plp
                             
2b87 : fe0302           [ 6]         inc abst,x
                                     tst_absx rINC,fINC,$ff-fnz
2b8a : 08               [ 3]>            php         ;save flags
2b8b : bd0302           [ 4]>            lda abst,x
2b8e : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2b91 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2b93 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2b94 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2b96 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2b99 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2b9b : bd0302           [ 4]         lda abst,x
2b9e : e8               [ 2]         inx
2b9f : e002             [ 2]         cpx #2
2ba1 : d002             [ 3]         bne tinc17
2ba3 : a9fe             [ 2]         lda #$fe
2ba5 : e005             [ 2] tinc17  cpx #5
2ba7 : d0d7             [ 3]         bne tinc16
2ba9 : ca               [ 2]         dex
2baa : a902             [ 2]         lda #2
2bac : 9d0302           [ 5] tdec16  sta abst,x 
                                     set_stat $ff
                            >            load_flag $ff
2baf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2bb1 : 48               [ 3]>            pha         ;use stack to load status
2bb2 : 28               [ 4]>            plp
                             
2bb3 : de0302           [ 6]         dec abst,x
                                     tst_absx rINC,fINC,$ff-fnz
2bb6 : 08               [ 3]>            php         ;save flags
2bb7 : bd0302           [ 4]>            lda abst,x
2bba : dd3102           [ 4]>            cmp rINC,x    ;test result
                            >            trap_ne
2bbd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2bbf : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2bc0 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2bc2 : dd3602           [ 4]>            cmp fINC,x    ;test flags
                            >            trap_ne
2bc5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  212
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                             
2bc7 : bd0302           [ 4]         lda abst,x
2bca : ca               [ 2]         dex
2bcb : 3008             [ 3]         bmi tdec17
2bcd : e001             [ 2]         cpx #1
2bcf : d0db             [ 3]         bne tdec16
2bd1 : a981             [ 2]         lda #$81
2bd3 : d0d7             [ 3]         bne tdec16
2bd5 :                       tdec17
                                     next_test
2bd5 : ad0002           [ 4]>            lda test_case   ;previous test
2bd8 : c925             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
2bda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0026 =                      >test_num = test_num + 1
2bdc : a926             [ 2]>            lda #test_num   ;*** this tests' number
2bde : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; testing logical instructions - AND EOR ORA all addressing modes
                             ; AND
2be1 : a203             [ 2]         ldx #3      ;immediate - self modifying code
2be3 : b51c             [ 4] tand    lda zpAN,x
2be5 : 8df02b           [ 4]         sta tandi1
                                     set_ax  absANa,0
                            >            load_flag 0
2be8 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2bea : 48               [ 3]>            pha         ;use stack to load status
2beb : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2bee : 28               [ 4]>            plp
                             
2bf0 =                       tandi1  equ *+1     ;target for immediate operand
2bef : 2963             [ 2]         and #99
                                     tst_ax  absrlo,absflo,0
2bf1 : 08               [ 3]>            php         ;save flags
2bf2 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2bf5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2bf7 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2bf8 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2bfa : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2bfd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2bff : ca               [ 2]         dex
2c00 : 10e1             [ 4]         bpl tand
2c02 : a203             [ 2]         ldx #3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  213
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2c04 : b51c             [ 4] tand1   lda zpAN,x
2c06 : 8d112c           [ 4]         sta tandi2
                                     set_ax  absANa,$ff
                            >            load_flag $ff
2c09 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2c0b : 48               [ 3]>            pha         ;use stack to load status
2c0c : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2c0f : 28               [ 4]>            plp
                             
2c11 =                       tandi2  equ *+1     ;target for immediate operand
2c10 : 2963             [ 2]         and #99
                                     tst_ax  absrlo,absflo,$ff-fnz
2c12 : 08               [ 3]>            php         ;save flags
2c13 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2c16 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2c18 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2c19 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2c1b : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2c1e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2c20 : ca               [ 2]         dex
2c21 : 10e1             [ 3]         bpl tand1
                             
2c23 : a203             [ 2]         ldx #3      ;zp
2c25 : b51c             [ 4] tand2    lda zpAN,x
2c27 : 850c             [ 3]         sta zpt
                                     set_ax  absANa,0
                            >            load_flag 0
2c29 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2c2b : 48               [ 3]>            pha         ;use stack to load status
2c2c : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2c2f : 28               [ 4]>            plp
                             
2c30 : 250c             [ 3]         and zpt
                                     tst_ax  absrlo,absflo,0
2c32 : 08               [ 3]>            php         ;save flags
2c33 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2c36 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2c38 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2c39 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2c3b : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2c3e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  214
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
                             
2c40 : ca               [ 2]         dex
2c41 : 10e2             [ 3]         bpl tand2
2c43 : a203             [ 2]         ldx #3
2c45 : b51c             [ 4] tand3   lda zpAN,x
2c47 : 850c             [ 3]         sta zpt
                                     set_ax  absANa,$ff
                            >            load_flag $ff
2c49 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2c4b : 48               [ 3]>            pha         ;use stack to load status
2c4c : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2c4f : 28               [ 4]>            plp
                             
2c50 : 250c             [ 3]         and zpt
                                     tst_ax  absrlo,absflo,$ff-fnz
2c52 : 08               [ 3]>            php         ;save flags
2c53 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2c56 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2c58 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2c59 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2c5b : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2c5e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2c60 : ca               [ 2]         dex
2c61 : 10e2             [ 3]         bpl tand3
                             
2c63 : a203             [ 2]         ldx #3      ;abs
2c65 : b51c             [ 4] tand4   lda zpAN,x
2c67 : 8d0302           [ 4]         sta abst
                                     set_ax  absANa,0
                            >            load_flag 0
2c6a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2c6c : 48               [ 3]>            pha         ;use stack to load status
2c6d : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2c70 : 28               [ 4]>            plp
                             
2c71 : 2d0302           [ 4]         and abst
                                     tst_ax  absrlo,absflo,0
2c74 : 08               [ 3]>            php         ;save flags
2c75 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2c78 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2c7a : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2c7b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  215
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
2c7d : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2c80 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2c82 : ca               [ 2]         dex
2c83 : 10e0             [ 3]         bpl tand4
2c85 : a203             [ 2]         ldx #3
2c87 : b51c             [ 4] tand5   lda zpAN,x
2c89 : 8d0302           [ 4]         sta abst
                                     set_ax  absANa,$ff
                            >            load_flag $ff
2c8c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2c8e : 48               [ 3]>            pha         ;use stack to load status
2c8f : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2c92 : 28               [ 4]>            plp
                             
2c93 : 2d0302           [ 4]         and abst
                                     tst_ax  absrlo,absflo,$ff-fnz
2c96 : 08               [ 3]>            php         ;save flags
2c97 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2c9a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2c9c : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2c9d : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2c9f : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2ca2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2ca4 : ca               [ 2]         dex
2ca5 : 1002             [ 3]         bpl tand6
                             
2ca7 : a203             [ 2]         ldx #3      ;zp,x
2ca9 :                       tand6
                                     set_ax  absANa,0
                            >            load_flag 0
2ca9 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2cab : 48               [ 3]>            pha         ;use stack to load status
2cac : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2caf : 28               [ 4]>            plp
                             
2cb0 : 351c             [ 4]         and zpAN,x
                                     tst_ax  absrlo,absflo,0
2cb2 : 08               [ 3]>            php         ;save flags
2cb3 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2cb6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  216
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2cb8 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2cb9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2cbb : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2cbe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2cc0 : ca               [ 2]         dex
2cc1 : 10e6             [ 3]         bpl tand6
2cc3 : a203             [ 2]         ldx #3
2cc5 :                       tand7
                                     set_ax  absANa,$ff
                            >            load_flag $ff
2cc5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2cc7 : 48               [ 3]>            pha         ;use stack to load status
2cc8 : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2ccb : 28               [ 4]>            plp
                             
2ccc : 351c             [ 4]         and zpAN,x
                                     tst_ax  absrlo,absflo,$ff-fnz
2cce : 08               [ 3]>            php         ;save flags
2ccf : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2cd2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2cd4 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2cd5 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2cd7 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2cda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2cdc : ca               [ 2]         dex
2cdd : 10e6             [ 3]         bpl tand7
                             
2cdf : a203             [ 2]         ldx #3      ;abs,x
2ce1 :                       tand8
                                     set_ax  absANa,0
                            >            load_flag 0
2ce1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2ce3 : 48               [ 3]>            pha         ;use stack to load status
2ce4 : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2ce7 : 28               [ 4]>            plp
                             
2ce8 : 3d3f02           [ 4]         and absAN,x
                                     tst_ax  absrlo,absflo,0
2ceb : 08               [ 3]>            php         ;save flags
2cec : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  217
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2cef : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2cf1 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2cf2 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2cf4 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2cf7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2cf9 : ca               [ 2]         dex
2cfa : 10e5             [ 3]         bpl tand8
2cfc : a203             [ 2]         ldx #3
2cfe :                       tand9
                                     set_ax  absANa,$ff
                            >            load_flag $ff
2cfe : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2d00 : 48               [ 3]>            pha         ;use stack to load status
2d01 : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
2d04 : 28               [ 4]>            plp
                             
2d05 : 3d3f02           [ 4]         and absAN,x
                                     tst_ax  absrlo,absflo,$ff-fnz
2d08 : 08               [ 3]>            php         ;save flags
2d09 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2d0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2d0e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2d0f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2d11 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2d14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2d16 : ca               [ 2]         dex
2d17 : 10e5             [ 4]         bpl tand9
                             
2d19 : a003             [ 2]         ldy #3      ;abs,y
2d1b :                       tand10
                                     set_ay  absANa,0
                            >            load_flag 0
2d1b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2d1d : 48               [ 3]>            pha         ;use stack to load status
2d1e : b94b02           [ 4]>            lda absANa,y    ;precharge accu
2d21 : 28               [ 4]>            plp
                             
2d22 : 393f02           [ 4]         and absAN,y
                                     tst_ay  absrlo,absflo,0
2d25 : 08               [ 3]>            php         ;save flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  218
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2d26 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2d29 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2d2b : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2d2c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2d2e : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2d31 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2d33 : 88               [ 2]         dey
2d34 : 10e5             [ 3]         bpl tand10
2d36 : a003             [ 2]         ldy #3
2d38 :                       tand11
                                     set_ay  absANa,$ff
                            >            load_flag $ff
2d38 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2d3a : 48               [ 3]>            pha         ;use stack to load status
2d3b : b94b02           [ 4]>            lda absANa,y    ;precharge accu
2d3e : 28               [ 4]>            plp
                             
2d3f : 393f02           [ 4]         and absAN,y
                                     tst_ay  absrlo,absflo,$ff-fnz
2d42 : 08               [ 3]>            php         ;save flags
2d43 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2d46 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2d48 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2d49 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2d4b : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2d4e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2d50 : 88               [ 2]         dey
2d51 : 10e5             [ 3]         bpl tand11
                             
2d53 : a206             [ 2]         ldx #6      ;(zp,x)
2d55 : a003             [ 2]         ldy #3
2d57 :                       tand12
                                     set_ay  absANa,0
                            >            load_flag 0
2d57 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2d59 : 48               [ 3]>            pha         ;use stack to load status
2d5a : b94b02           [ 4]>            lda absANa,y    ;precharge accu
2d5d : 28               [ 4]>            plp
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  219
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2d5e : 213a             [ 6]         and (indAN,x)
                                     tst_ay  absrlo,absflo,0
2d60 : 08               [ 3]>            php         ;save flags
2d61 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2d64 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2d66 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2d67 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2d69 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2d6c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2d6e : ca               [ 2]         dex
2d6f : ca               [ 2]         dex
2d70 : 88               [ 2]         dey
2d71 : 10e4             [ 3]         bpl tand12
2d73 : a206             [ 2]         ldx #6
2d75 : a003             [ 2]         ldy #3
2d77 :                       tand13
                                     set_ay  absANa,$ff
                            >            load_flag $ff
2d77 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2d79 : 48               [ 3]>            pha         ;use stack to load status
2d7a : b94b02           [ 4]>            lda absANa,y    ;precharge accu
2d7d : 28               [ 4]>            plp
                             
2d7e : 213a             [ 6]         and (indAN,x)
                                     tst_ay  absrlo,absflo,$ff-fnz
2d80 : 08               [ 3]>            php         ;save flags
2d81 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2d84 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2d86 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2d87 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2d89 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2d8c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2d8e : ca               [ 2]         dex
2d8f : ca               [ 2]         dex
2d90 : 88               [ 2]         dey
2d91 : 10e4             [ 3]         bpl tand13
                             
2d93 : a003             [ 2]         ldy #3      ;(zp),y
2d95 :                       tand14
                                     set_ay  absANa,0
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  220
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >            load_flag 0
2d95 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2d97 : 48               [ 3]>            pha         ;use stack to load status
2d98 : b94b02           [ 4]>            lda absANa,y    ;precharge accu
2d9b : 28               [ 4]>            plp
                             
2d9c : 313a             [ 5]         and (indAN),y
                                     tst_ay  absrlo,absflo,0
2d9e : 08               [ 3]>            php         ;save flags
2d9f : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2da2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2da4 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2da5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2da7 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2daa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2dac : 88               [ 2]         dey
2dad : 10e6             [ 3]         bpl tand14
2daf : a003             [ 2]         ldy #3
2db1 :                       tand15
                                     set_ay  absANa,$ff
                            >            load_flag $ff
2db1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2db3 : 48               [ 3]>            pha         ;use stack to load status
2db4 : b94b02           [ 4]>            lda absANa,y    ;precharge accu
2db7 : 28               [ 4]>            plp
                             
2db8 : 313a             [ 5]         and (indAN),y
                                     tst_ay  absrlo,absflo,$ff-fnz
2dba : 08               [ 3]>            php         ;save flags
2dbb : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2dbe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2dc0 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2dc1 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2dc3 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2dc6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2dc8 : 88               [ 2]         dey
2dc9 : 10e6             [ 3]         bpl tand15
                                     next_test
2dcb : ad0002           [ 4]>            lda test_case   ;previous test
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  221
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2dce : c926             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
2dd0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0027 =                      >test_num = test_num + 1
2dd2 : a927             [ 2]>            lda #test_num   ;*** this tests' number
2dd4 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; EOR
2dd7 : a203             [ 2]         ldx #3      ;immediate - self modifying code
2dd9 : b520             [ 4] teor    lda zpEO,x
2ddb : 8de62d           [ 4]         sta teori1
                                     set_ax  absEOa,0
                            >            load_flag 0
2dde : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2de0 : 48               [ 3]>            pha         ;use stack to load status
2de1 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2de4 : 28               [ 4]>            plp
                             
2de6 =                       teori1  equ *+1     ;target for immediate operand
2de5 : 4963             [ 2]         eor #99
                                     tst_ax  absrlo,absflo,0
2de7 : 08               [ 3]>            php         ;save flags
2de8 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2deb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2ded : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2dee : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2df0 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2df3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2df5 : ca               [ 2]         dex
2df6 : 10e1             [ 3]         bpl teor
2df8 : a203             [ 2]         ldx #3
2dfa : b520             [ 4] teor1   lda zpEO,x
2dfc : 8d072e           [ 4]         sta teori2
                                     set_ax  absEOa,$ff
                            >            load_flag $ff
2dff : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2e01 : 48               [ 3]>            pha         ;use stack to load status
2e02 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2e05 : 28               [ 4]>            plp
                             
2e07 =                       teori2  equ *+1     ;target for immediate operand
2e06 : 4963             [ 2]         eor #99
                                     tst_ax  absrlo,absflo,$ff-fnz
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  222
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2e08 : 08               [ 3]>            php         ;save flags
2e09 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2e0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2e0e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2e0f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2e11 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2e14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2e16 : ca               [ 2]         dex
2e17 : 10e1             [ 4]         bpl teor1
                             
2e19 : a203             [ 2]         ldx #3      ;zp
2e1b : b520             [ 4] teor2    lda zpEO,x
2e1d : 850c             [ 3]         sta zpt
                                     set_ax  absEOa,0
                            >            load_flag 0
2e1f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2e21 : 48               [ 3]>            pha         ;use stack to load status
2e22 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2e25 : 28               [ 4]>            plp
                             
2e26 : 450c             [ 3]         eor zpt
                                     tst_ax  absrlo,absflo,0
2e28 : 08               [ 3]>            php         ;save flags
2e29 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2e2c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2e2e : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2e2f : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2e31 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2e34 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2e36 : ca               [ 2]         dex
2e37 : 10e2             [ 3]         bpl teor2
2e39 : a203             [ 2]         ldx #3
2e3b : b520             [ 4] teor3   lda zpEO,x
2e3d : 850c             [ 3]         sta zpt
                                     set_ax  absEOa,$ff
                            >            load_flag $ff
2e3f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2e41 : 48               [ 3]>            pha         ;use stack to load status
2e42 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  223
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2e45 : 28               [ 4]>            plp
                             
2e46 : 450c             [ 3]         eor zpt
                                     tst_ax  absrlo,absflo,$ff-fnz
2e48 : 08               [ 3]>            php         ;save flags
2e49 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2e4c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2e4e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2e4f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2e51 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2e54 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2e56 : ca               [ 2]         dex
2e57 : 10e2             [ 3]         bpl teor3
                             
2e59 : a203             [ 2]         ldx #3      ;abs
2e5b : b520             [ 4] teor4   lda zpEO,x
2e5d : 8d0302           [ 4]         sta abst
                                     set_ax  absEOa,0
                            >            load_flag 0
2e60 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2e62 : 48               [ 3]>            pha         ;use stack to load status
2e63 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2e66 : 28               [ 4]>            plp
                             
2e67 : 4d0302           [ 4]         eor abst
                                     tst_ax  absrlo,absflo,0
2e6a : 08               [ 3]>            php         ;save flags
2e6b : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2e6e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2e70 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2e71 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2e73 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2e76 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2e78 : ca               [ 2]         dex
2e79 : 10e0             [ 3]         bpl teor4
2e7b : a203             [ 2]         ldx #3
2e7d : b520             [ 4] teor5   lda zpEO,x
2e7f : 8d0302           [ 4]         sta abst
                                     set_ax  absEOa,$ff
                            >            load_flag $ff
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  224
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2e82 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2e84 : 48               [ 3]>            pha         ;use stack to load status
2e85 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2e88 : 28               [ 4]>            plp
                             
2e89 : 4d0302           [ 4]         eor abst
                                     tst_ax  absrlo,absflo,$ff-fnz
2e8c : 08               [ 3]>            php         ;save flags
2e8d : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2e90 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2e92 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2e93 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2e95 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2e98 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2e9a : ca               [ 2]         dex
2e9b : 1002             [ 3]         bpl teor6
                             
2e9d : a203             [ 2]         ldx #3      ;zp,x
2e9f :                       teor6
                                     set_ax  absEOa,0
                            >            load_flag 0
2e9f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2ea1 : 48               [ 3]>            pha         ;use stack to load status
2ea2 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2ea5 : 28               [ 4]>            plp
                             
2ea6 : 5520             [ 4]         eor zpEO,x
                                     tst_ax  absrlo,absflo,0
2ea8 : 08               [ 3]>            php         ;save flags
2ea9 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2eac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2eae : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2eaf : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2eb1 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2eb4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2eb6 : ca               [ 2]         dex
2eb7 : 10e6             [ 3]         bpl teor6
2eb9 : a203             [ 2]         ldx #3
2ebb :                       teor7
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  225
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     set_ax  absEOa,$ff
                            >            load_flag $ff
2ebb : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2ebd : 48               [ 3]>            pha         ;use stack to load status
2ebe : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2ec1 : 28               [ 4]>            plp
                             
2ec2 : 5520             [ 4]         eor zpEO,x
                                     tst_ax  absrlo,absflo,$ff-fnz
2ec4 : 08               [ 3]>            php         ;save flags
2ec5 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2ec8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2eca : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2ecb : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2ecd : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2ed0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2ed2 : ca               [ 2]         dex
2ed3 : 10e6             [ 3]         bpl teor7
                             
2ed5 : a203             [ 2]         ldx #3      ;abs,x
2ed7 :                       teor8
                                     set_ax  absEOa,0
                            >            load_flag 0
2ed7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2ed9 : 48               [ 3]>            pha         ;use stack to load status
2eda : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2edd : 28               [ 4]>            plp
                             
2ede : 5d4302           [ 4]         eor absEO,x
                                     tst_ax  absrlo,absflo,0
2ee1 : 08               [ 3]>            php         ;save flags
2ee2 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2ee5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2ee7 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2ee8 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2eea : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2eed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2eef : ca               [ 2]         dex
2ef0 : 10e5             [ 3]         bpl teor8
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  226
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2ef2 : a203             [ 2]         ldx #3
2ef4 :                       teor9
                                     set_ax  absEOa,$ff
                            >            load_flag $ff
2ef4 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2ef6 : 48               [ 3]>            pha         ;use stack to load status
2ef7 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
2efa : 28               [ 4]>            plp
                             
2efb : 5d4302           [ 4]         eor absEO,x
                                     tst_ax  absrlo,absflo,$ff-fnz
2efe : 08               [ 3]>            php         ;save flags
2eff : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2f02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2f04 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2f05 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2f07 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2f0a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2f0c : ca               [ 2]         dex
2f0d : 10e5             [ 4]         bpl teor9
                             
2f0f : a003             [ 2]         ldy #3      ;abs,y
2f11 :                       teor10
                                     set_ay  absEOa,0
                            >            load_flag 0
2f11 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2f13 : 48               [ 3]>            pha         ;use stack to load status
2f14 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
2f17 : 28               [ 4]>            plp
                             
2f18 : 594302           [ 4]         eor absEO,y
                                     tst_ay  absrlo,absflo,0
2f1b : 08               [ 3]>            php         ;save flags
2f1c : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2f1f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2f21 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2f22 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2f24 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2f27 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  227
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2f29 : 88               [ 2]         dey
2f2a : 10e5             [ 3]         bpl teor10
2f2c : a003             [ 2]         ldy #3
2f2e :                       teor11
                                     set_ay  absEOa,$ff
                            >            load_flag $ff
2f2e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2f30 : 48               [ 3]>            pha         ;use stack to load status
2f31 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
2f34 : 28               [ 4]>            plp
                             
2f35 : 594302           [ 4]         eor absEO,y
                                     tst_ay  absrlo,absflo,$ff-fnz
2f38 : 08               [ 3]>            php         ;save flags
2f39 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2f3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2f3e : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2f3f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2f41 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2f44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2f46 : 88               [ 2]         dey
2f47 : 10e5             [ 3]         bpl teor11
                             
2f49 : a206             [ 2]         ldx #6      ;(zp,x)
2f4b : a003             [ 2]         ldy #3
2f4d :                       teor12
                                     set_ay  absEOa,0
                            >            load_flag 0
2f4d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2f4f : 48               [ 3]>            pha         ;use stack to load status
2f50 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
2f53 : 28               [ 4]>            plp
                             
2f54 : 4142             [ 6]         eor (indEO,x)
                                     tst_ay  absrlo,absflo,0
2f56 : 08               [ 3]>            php         ;save flags
2f57 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2f5a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2f5c : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2f5d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2f5f : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  228
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2f62 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2f64 : ca               [ 2]         dex
2f65 : ca               [ 2]         dex
2f66 : 88               [ 2]         dey
2f67 : 10e4             [ 3]         bpl teor12
2f69 : a206             [ 2]         ldx #6
2f6b : a003             [ 2]         ldy #3
2f6d :                       teor13
                                     set_ay  absEOa,$ff
                            >            load_flag $ff
2f6d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2f6f : 48               [ 3]>            pha         ;use stack to load status
2f70 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
2f73 : 28               [ 4]>            plp
                             
2f74 : 4142             [ 6]         eor (indEO,x)
                                     tst_ay  absrlo,absflo,$ff-fnz
2f76 : 08               [ 3]>            php         ;save flags
2f77 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2f7a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2f7c : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2f7d : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2f7f : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2f82 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2f84 : ca               [ 2]         dex
2f85 : ca               [ 2]         dex
2f86 : 88               [ 2]         dey
2f87 : 10e4             [ 3]         bpl teor13
                             
2f89 : a003             [ 2]         ldy #3      ;(zp),y
2f8b :                       teor14
                                     set_ay  absEOa,0
                            >            load_flag 0
2f8b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2f8d : 48               [ 3]>            pha         ;use stack to load status
2f8e : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
2f91 : 28               [ 4]>            plp
                             
2f92 : 5142             [ 5]         eor (indEO),y
                                     tst_ay  absrlo,absflo,0
2f94 : 08               [ 3]>            php         ;save flags
2f95 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2f98 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  229
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
2f9a : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2f9b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2f9d : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2fa0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2fa2 : 88               [ 2]         dey
2fa3 : 10e6             [ 3]         bpl teor14
2fa5 : a003             [ 2]         ldy #3
2fa7 :                       teor15
                                     set_ay  absEOa,$ff
                            >            load_flag $ff
2fa7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2fa9 : 48               [ 3]>            pha         ;use stack to load status
2faa : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
2fad : 28               [ 4]>            plp
                             
2fae : 5142             [ 5]         eor (indEO),y
                                     tst_ay  absrlo,absflo,$ff-fnz
2fb0 : 08               [ 3]>            php         ;save flags
2fb1 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
2fb4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2fb6 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
2fb7 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
2fb9 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
2fbc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2fbe : 88               [ 2]         dey
2fbf : 10e6             [ 3]         bpl teor15
                                     next_test
2fc1 : ad0002           [ 4]>            lda test_case   ;previous test
2fc4 : c927             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
2fc6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0028 =                      >test_num = test_num + 1
2fc8 : a928             [ 2]>            lda #test_num   ;*** this tests' number
2fca : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; OR
2fcd : a203             [ 2]         ldx #3      ;immediate - self modifying code
2fcf : b518             [ 4] tora    lda zpOR,x
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  230
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

2fd1 : 8ddc2f           [ 4]         sta torai1
                                     set_ax  absORa,0
                            >            load_flag 0
2fd4 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
2fd6 : 48               [ 3]>            pha         ;use stack to load status
2fd7 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
2fda : 28               [ 4]>            plp
                             
2fdc =                       torai1  equ *+1     ;target for immediate operand
2fdb : 0963             [ 2]         ora #99
                                     tst_ax  absrlo,absflo,0
2fdd : 08               [ 3]>            php         ;save flags
2fde : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
2fe1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
2fe3 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
2fe4 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
2fe6 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
2fe9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
2feb : ca               [ 2]         dex
2fec : 10e1             [ 3]         bpl tora
2fee : a203             [ 2]         ldx #3
2ff0 : b518             [ 4] tora1   lda zpOR,x
2ff2 : 8dfd2f           [ 4]         sta torai2
                                     set_ax  absORa,$ff
                            >            load_flag $ff
2ff5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
2ff7 : 48               [ 3]>            pha         ;use stack to load status
2ff8 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
2ffb : 28               [ 4]>            plp
                             
2ffd =                       torai2  equ *+1     ;target for immediate operand
2ffc : 0963             [ 2]         ora #99
                                     tst_ax  absrlo,absflo,$ff-fnz
2ffe : 08               [ 3]>            php         ;save flags
2fff : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
3002 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3004 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
3005 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
3007 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
300a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  231
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
300c : ca               [ 2]         dex
300d : 10e1             [ 4]         bpl tora1
                             
300f : a203             [ 2]         ldx #3      ;zp
3011 : b518             [ 4] tora2    lda zpOR,x
3013 : 850c             [ 3]         sta zpt
                                     set_ax  absORa,0
                            >            load_flag 0
3015 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
3017 : 48               [ 3]>            pha         ;use stack to load status
3018 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
301b : 28               [ 4]>            plp
                             
301c : 050c             [ 3]         ora zpt
                                     tst_ax  absrlo,absflo,0
301e : 08               [ 3]>            php         ;save flags
301f : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
3022 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3024 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
3025 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
3027 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
302a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
302c : ca               [ 2]         dex
302d : 10e2             [ 3]         bpl tora2
302f : a203             [ 2]         ldx #3
3031 : b518             [ 4] tora3   lda zpOR,x
3033 : 850c             [ 3]         sta zpt
                                     set_ax  absORa,$ff
                            >            load_flag $ff
3035 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
3037 : 48               [ 3]>            pha         ;use stack to load status
3038 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
303b : 28               [ 4]>            plp
                             
303c : 050c             [ 3]         ora zpt
                                     tst_ax  absrlo,absflo,$ff-fnz
303e : 08               [ 3]>            php         ;save flags
303f : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
3042 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3044 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
3045 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  232
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

3047 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
304a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
304c : ca               [ 2]         dex
304d : 10e2             [ 3]         bpl tora3
                             
304f : a203             [ 2]         ldx #3      ;abs
3051 : b518             [ 4] tora4   lda zpOR,x
3053 : 8d0302           [ 4]         sta abst
                                     set_ax  absORa,0
                            >            load_flag 0
3056 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
3058 : 48               [ 3]>            pha         ;use stack to load status
3059 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
305c : 28               [ 4]>            plp
                             
305d : 0d0302           [ 4]         ora abst
                                     tst_ax  absrlo,absflo,0
3060 : 08               [ 3]>            php         ;save flags
3061 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
3064 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3066 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
3067 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
3069 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
306c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
306e : ca               [ 2]         dex
306f : 10e0             [ 3]         bpl tora4
3071 : a203             [ 2]         ldx #3
3073 : b518             [ 4] tora5   lda zpOR,x
3075 : 8d0302           [ 4]         sta abst
                                     set_ax  absORa,$ff
                            >            load_flag $ff
3078 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
307a : 48               [ 3]>            pha         ;use stack to load status
307b : bd4702           [ 4]>            lda absORa,x    ;precharge accu
307e : 28               [ 4]>            plp
                             
307f : 0d0302           [ 4]         ora abst
                                     tst_ax  absrlo,absflo,$ff-fnz
3082 : 08               [ 3]>            php         ;save flags
3083 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
3086 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  233
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

3088 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
3089 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
308b : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
308e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
3090 : ca               [ 2]         dex
3091 : 1002             [ 3]         bpl tora6
                             
3093 : a203             [ 2]         ldx #3      ;zp,x
3095 :                       tora6
                                     set_ax  absORa,0
                            >            load_flag 0
3095 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
3097 : 48               [ 3]>            pha         ;use stack to load status
3098 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
309b : 28               [ 4]>            plp
                             
309c : 1518             [ 4]         ora zpOR,x
                                     tst_ax  absrlo,absflo,0
309e : 08               [ 3]>            php         ;save flags
309f : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
30a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
30a4 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
30a5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
30a7 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
30aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
30ac : ca               [ 2]         dex
30ad : 10e6             [ 3]         bpl tora6
30af : a203             [ 2]         ldx #3
30b1 :                       tora7
                                     set_ax  absORa,$ff
                            >            load_flag $ff
30b1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
30b3 : 48               [ 3]>            pha         ;use stack to load status
30b4 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
30b7 : 28               [ 4]>            plp
                             
30b8 : 1518             [ 4]         ora zpOR,x
                                     tst_ax  absrlo,absflo,$ff-fnz
30ba : 08               [ 3]>            php         ;save flags
30bb : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  234
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

30be : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
30c0 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
30c1 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
30c3 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
30c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
30c8 : ca               [ 2]         dex
30c9 : 10e6             [ 3]         bpl tora7
                             
30cb : a203             [ 2]         ldx #3      ;abs,x
30cd :                       tora8
                                     set_ax  absORa,0
                            >            load_flag 0
30cd : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
30cf : 48               [ 3]>            pha         ;use stack to load status
30d0 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
30d3 : 28               [ 4]>            plp
                             
30d4 : 1d3b02           [ 4]         ora absOR,x
                                     tst_ax  absrlo,absflo,0
30d7 : 08               [ 3]>            php         ;save flags
30d8 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
30db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
30dd : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
30de : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
30e0 : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
30e3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
30e5 : ca               [ 2]         dex
30e6 : 10e5             [ 3]         bpl tora8
30e8 : a203             [ 2]         ldx #3
30ea :                       tora9
                                     set_ax  absORa,$ff
                            >            load_flag $ff
30ea : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
30ec : 48               [ 3]>            pha         ;use stack to load status
30ed : bd4702           [ 4]>            lda absORa,x    ;precharge accu
30f0 : 28               [ 4]>            plp
                             
30f1 : 1d3b02           [ 4]         ora absOR,x
                                     tst_ax  absrlo,absflo,$ff-fnz
30f4 : 08               [ 3]>            php         ;save flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  235
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

30f5 : dd5302           [ 4]>            cmp absrlo,x    ;test result
                            >            trap_ne
30f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
30fa : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
30fb : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
30fd : dd5702           [ 4]>            cmp absflo,x    ;test flags
                            >            trap_ne     ;
3100 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
3102 : ca               [ 2]         dex
3103 : 10e5             [ 4]         bpl tora9
                             
3105 : a003             [ 2]         ldy #3      ;abs,y
3107 :                       tora10
                                     set_ay  absORa,0
                            >            load_flag 0
3107 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
3109 : 48               [ 3]>            pha         ;use stack to load status
310a : b94702           [ 4]>            lda absORa,y    ;precharge accu
310d : 28               [ 4]>            plp
                             
310e : 193b02           [ 4]         ora absOR,y
                                     tst_ay  absrlo,absflo,0
3111 : 08               [ 3]>            php         ;save flags
3112 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
3115 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3117 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
3118 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
311a : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
311d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
311f : 88               [ 2]         dey
3120 : 10e5             [ 3]         bpl tora10
3122 : a003             [ 2]         ldy #3
3124 :                       tora11
                                     set_ay  absORa,$ff
                            >            load_flag $ff
3124 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
3126 : 48               [ 3]>            pha         ;use stack to load status
3127 : b94702           [ 4]>            lda absORa,y    ;precharge accu
312a : 28               [ 4]>            plp
                             
312b : 193b02           [ 4]         ora absOR,y
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  236
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     tst_ay  absrlo,absflo,$ff-fnz
312e : 08               [ 3]>            php         ;save flags
312f : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
3132 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3134 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
3135 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
3137 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
313a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
313c : 88               [ 2]         dey
313d : 10e5             [ 3]         bpl tora11
                             
313f : a206             [ 2]         ldx #6      ;(zp,x)
3141 : a003             [ 2]         ldy #3
3143 :                       tora12
                                     set_ay  absORa,0
                            >            load_flag 0
3143 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
3145 : 48               [ 3]>            pha         ;use stack to load status
3146 : b94702           [ 4]>            lda absORa,y    ;precharge accu
3149 : 28               [ 4]>            plp
                             
314a : 014a             [ 6]         ora (indOR,x)
                                     tst_ay  absrlo,absflo,0
314c : 08               [ 3]>            php         ;save flags
314d : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
3150 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3152 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
3153 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
3155 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
3158 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
315a : ca               [ 2]         dex
315b : ca               [ 2]         dex
315c : 88               [ 2]         dey
315d : 10e4             [ 3]         bpl tora12
315f : a206             [ 2]         ldx #6
3161 : a003             [ 2]         ldy #3
3163 :                       tora13
                                     set_ay  absORa,$ff
                            >            load_flag $ff
3163 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  237
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                            >
3165 : 48               [ 3]>            pha         ;use stack to load status
3166 : b94702           [ 4]>            lda absORa,y    ;precharge accu
3169 : 28               [ 4]>            plp
                             
316a : 014a             [ 6]         ora (indOR,x)
                                     tst_ay  absrlo,absflo,$ff-fnz
316c : 08               [ 3]>            php         ;save flags
316d : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
3170 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3172 : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
3173 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
3175 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
3178 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
317a : ca               [ 2]         dex
317b : ca               [ 2]         dex
317c : 88               [ 2]         dey
317d : 10e4             [ 3]         bpl tora13
                             
317f : a003             [ 2]         ldy #3      ;(zp),y
3181 :                       tora14
                                     set_ay  absORa,0
                            >            load_flag 0
3181 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
                            >
3183 : 48               [ 3]>            pha         ;use stack to load status
3184 : b94702           [ 4]>            lda absORa,y    ;precharge accu
3187 : 28               [ 4]>            plp
                             
3188 : 114a             [ 5]         ora (indOR),y
                                     tst_ay  absrlo,absflo,0
318a : 08               [ 3]>            php         ;save flags
318b : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
318e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
3190 : 68               [ 4]>            pla         ;load status
                            >            eor_flag 0
3191 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
                            >
3193 : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
3196 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
3198 : 88               [ 2]         dey
3199 : 10e6             [ 3]         bpl tora14
319b : a003             [ 2]         ldy #3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  238
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

319d :                       tora15
                                     set_ay  absORa,$ff
                            >            load_flag $ff
319d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
319f : 48               [ 3]>            pha         ;use stack to load status
31a0 : b94702           [ 4]>            lda absORa,y    ;precharge accu
31a3 : 28               [ 4]>            plp
                             
31a4 : 114a             [ 5]         ora (indOR),y
                                     tst_ay  absrlo,absflo,$ff-fnz
31a6 : 08               [ 3]>            php         ;save flags
31a7 : d95302           [ 4]>            cmp absrlo,y    ;test result
                            >            trap_ne     ;
31aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
31ac : 68               [ 4]>            pla         ;load status
                            >            eor_flag $ff-fnz
31ad : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
                            >
31af : d95702           [ 4]>            cmp absflo,y    ;test flags
                            >            trap_ne
31b2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
                             
31b4 : 88               [ 2]         dey
31b5 : 10e6             [ 3]         bpl tora15
                                 if I_flag = 3
31b7 : 58               [ 2]         cli
                                 endif        
                                 
31b8 :                       bin_test
                                 if skip_bin_test = 1
31b8 : 4c2032           [ 3]         jmp dec_test
                                 else 
                                     lda #test_num
                                     sta test_case       
                                 endif
                             
                                     next_test
31bb : ad0002           [ 4]>            lda test_case   ;previous test
31be : c928             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
31c0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
0029 =                      >test_num = test_num + 1
31c2 : a929             [ 2]>            lda #test_num   ;*** this tests' number
31c4 : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                                 
                             ; full binary add/subtract test
                             ; iterates through all combinations of operands and carry input
                             ; uses increments/decrements to predict result & result flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  239
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

31c7 : d8               [ 2]         cld
31c8 : a20e             [ 2]         ldx #ad2        ;for indexed test
31ca : a0ff             [ 2]         ldy #$ff        ;max range
31cc : a900             [ 2]         lda #0          ;start with adding zeroes & no carry
31ce : 850c             [ 3]         sta adfc        ;carry in - for diag
31d0 : 850d             [ 3]         sta ad1         ;operand 1 - accumulator
31d2 : 850e             [ 3]         sta ad2         ;operand 2 - memory or immediate
31d4 : 8d0302           [ 4]         sta ada2        ;non zp
31d7 : 850f             [ 3]         sta adrl        ;expected result bits 0-7
31d9 : 8510             [ 3]         sta adrh        ;expected result bit 8 (carry out)
31db : a9ff             [ 2]         lda #$ff        ;complemented operand 2 for subtract
31dd : 8512             [ 3]         sta sb2
31df : 8d0402           [ 4]         sta sba2        ;non zp
31e2 : a902             [ 2]         lda #2          ;expected Z-flag
31e4 : 8511             [ 3]         sta adrf
31e6 : 18               [ 2] tadd    clc             ;test with carry clear
31e7 : 200334           [ 6]         jsr chkadd
31ea : e60c             [ 5]         inc adfc        ;now with carry
31ec : e60f             [ 5]         inc adrl        ;result +1
31ee : 08               [ 3]         php             ;save N & Z from low result
31ef : 08               [ 3]         php
31f0 : 68               [ 4]         pla             ;accu holds expected flags
31f1 : 2982             [ 2]         and #$82        ;mask N & Z
31f3 : 28               [ 4]         plp
31f4 : d002             [ 3]         bne tadd1
31f6 : e610             [ 5]         inc adrh        ;result bit 8 - carry
31f8 : 0510             [ 3] tadd1   ora adrh        ;merge C to expected flags
31fa : 8511             [ 3]         sta adrf        ;save expected flags except overflow
31fc : 38               [ 2]         sec             ;test with carry set
31fd : 200334           [ 6]         jsr chkadd
3200 : c60c             [ 5]         dec adfc        ;same for operand +1 but no carry
3202 : e60d             [ 5]         inc ad1
3204 : d0e0             [ 4]         bne tadd        ;iterate op1
3206 : a900             [ 2]         lda #0          ;preset result to op2 when op1 = 0
3208 : 8510             [ 3]         sta adrh
320a : ee0302           [ 6]         inc ada2
320d : e60e             [ 5]         inc ad2
320f : 08               [ 3]         php             ;save NZ as operand 2 becomes the new result
3210 : 68               [ 4]         pla
3211 : 2982             [ 2]         and #$82        ;mask N00000Z0
3213 : 8511             [ 3]         sta adrf        ;no need to check carry as we are adding to 0
3215 : c612             [ 5]         dec sb2         ;complement subtract operand 2
3217 : ce0402           [ 6]         dec sba2
321a : a50e             [ 3]         lda ad2         
321c : 850f             [ 3]         sta adrl
321e : d0c6             [ 4]         bne tadd        ;iterate op2
                             
3220 :                       dec_test
                                 if skip_dec_test = 1
3220 : 4ccf32           [ 3]         jmp success
                                 else
                                     lda #test_num
                                     sta test_case       
                                 endif
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  240
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     next_test
3223 : ad0002           [ 4]>            lda test_case   ;previous test
3226 : c929             [ 2]>            cmp #test_num
                            >            trap_ne         ;test is out of sequence
3228 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                            >
002a =                      >test_num = test_num + 1
322a : a92a             [ 2]>            lda #test_num   ;*** this tests' number
322c : 8d0002           [ 4]>            sta test_case
                            >            ;check_ram       ;uncomment to find altered RAM after each test
                             
                             
                             ; decimal add/subtract test
                             ; *** WARNING - tests documented behavior only! ***
                             ;   only valid BCD operands are tested, N V Z flags are ignored
                             ; iterates through all valid combinations of operands and carry input
                             ; uses increments/decrements to predict result & carry flag
322f : f8               [ 2]         sed 
3230 : a20e             [ 2]         ldx #ad2        ;for indexed test
3232 : a0ff             [ 2]         ldy #$ff        ;max range
3234 : a999             [ 2]         lda #$99        ;start with adding 99 to 99 with carry
3236 : 850d             [ 3]         sta ad1         ;operand 1 - accumulator
3238 : 850e             [ 3]         sta ad2         ;operand 2 - memory or immediate
323a : 8d0302           [ 4]         sta ada2        ;non zp
323d : 850f             [ 3]         sta adrl        ;expected result bits 0-7
323f : a901             [ 2]         lda #1          ;set carry in & out
3241 : 850c             [ 3]         sta adfc        ;carry in - for diag
3243 : 8510             [ 3]         sta adrh        ;expected result bit 8 (carry out)
3245 : a900             [ 2]         lda #0          ;complemented operand 2 for subtract
3247 : 8512             [ 3]         sta sb2
3249 : 8d0402           [ 4]         sta sba2        ;non zp
324c : 38               [ 2] tdad    sec             ;test with carry set
324d : 20d232           [ 6]         jsr chkdad
3250 : c60c             [ 5]         dec adfc        ;now with carry clear
3252 : a50f             [ 3]         lda adrl        ;decimal adjust result
3254 : d008             [ 3]         bne tdad1       ;skip clear carry & preset result 99 (9A-1)
3256 : c610             [ 5]         dec adrh
3258 : a999             [ 2]         lda #$99
325a : 850f             [ 3]         sta adrl
325c : d012             [ 3]         bne tdad3
325e : 290f             [ 2] tdad1   and #$f         ;lower nibble mask
3260 : d00c             [ 3]         bne tdad2       ;no decimal adjust needed
3262 : c60f             [ 5]         dec adrl        ;decimal adjust (?0-6)
3264 : c60f             [ 5]         dec adrl
3266 : c60f             [ 5]         dec adrl
3268 : c60f             [ 5]         dec adrl
326a : c60f             [ 5]         dec adrl
326c : c60f             [ 5]         dec adrl
326e : c60f             [ 5] tdad2   dec adrl        ;result -1
3270 : 18               [ 2] tdad3   clc             ;test with carry clear
3271 : 20d232           [ 6]         jsr chkdad
3274 : e60c             [ 5]         inc adfc        ;same for operand -1 but with carry
3276 : a50d             [ 3]         lda ad1         ;decimal adjust operand 1
3278 : f015             [ 3]         beq tdad5       ;iterate operand 2
327a : 290f             [ 2]         and #$f         ;lower nibble mask
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  241
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

327c : d00c             [ 3]         bne tdad4       ;skip decimal adjust
327e : c60d             [ 5]         dec ad1         ;decimal adjust (?0-6)
3280 : c60d             [ 5]         dec ad1
3282 : c60d             [ 5]         dec ad1
3284 : c60d             [ 5]         dec ad1
3286 : c60d             [ 5]         dec ad1
3288 : c60d             [ 5]         dec ad1
328a : c60d             [ 5] tdad4   dec ad1         ;operand 1 -1
328c : 4c4c32           [ 3]         jmp tdad        ;iterate op1
                             
328f : a999             [ 2] tdad5   lda #$99        ;precharge op1 max
3291 : 850d             [ 3]         sta ad1
3293 : a50e             [ 3]         lda ad2         ;decimal adjust operand 2
3295 : f030             [ 3]         beq tdad7       ;end of iteration
3297 : 290f             [ 2]         and #$f         ;lower nibble mask
3299 : d018             [ 3]         bne tdad6       ;skip decimal adjust
329b : c60e             [ 5]         dec ad2         ;decimal adjust (?0-6)
329d : c60e             [ 5]         dec ad2
329f : c60e             [ 5]         dec ad2
32a1 : c60e             [ 5]         dec ad2
32a3 : c60e             [ 5]         dec ad2
32a5 : c60e             [ 5]         dec ad2
32a7 : e612             [ 5]         inc sb2         ;complemented decimal adjust for subtract (?9+6)
32a9 : e612             [ 5]         inc sb2
32ab : e612             [ 5]         inc sb2
32ad : e612             [ 5]         inc sb2
32af : e612             [ 5]         inc sb2
32b1 : e612             [ 5]         inc sb2
32b3 : c60e             [ 5] tdad6   dec ad2         ;operand 2 -1
32b5 : e612             [ 5]         inc sb2         ;complemented operand for subtract
32b7 : a512             [ 3]         lda sb2
32b9 : 8d0402           [ 4]         sta sba2        ;copy as non zp operand
32bc : a50e             [ 3]         lda ad2
32be : 8d0302           [ 4]         sta ada2        ;copy as non zp operand
32c1 : 850f             [ 3]         sta adrl        ;new result since op1+carry=00+carry +op2=op2
32c3 : e610             [ 5]         inc adrh        ;result carry
32c5 : d085             [ 3]         bne tdad        ;iterate op2
32c7 : d8               [ 2] tdad7   cld
                             
32c8 : ad0002           [ 4]         lda test_case
32cb : c92a             [ 2]         cmp #test_num
                                     trap_ne         ;test is out of sequence
32cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     
                             ; final RAM integrity test
                             ;   verifies that none of the previous tests has altered RAM outside of the
                             ;   designated write areas.
                                     check_ram
                            >            ;RAM check disabled - RAM size not set
                             
                             ; *** DEBUG INFO ***
                             ; to debug checksum errors uncomment check_ram in the next_test macro to 
                             ; narrow down the responsible opcode.
                             ; may give false errors when monitor, OS or other background activity is
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  242
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             ; allowed during previous tests.
                             
                             
                             
                             ; S U C C E S S ************************************************       
                             ; -------------       
32cf : 4c0004           [ 3] success jmp start       ;if you get here everything went well
                             ; -------------       
                             ; S U C C E S S ************************************************       
                             
                             ; core subroutine of the decimal add/subtract test
                             ; *** WARNING - tests documented behavior only! ***
                             ;   only valid BCD operands are tested, N V Z flags are ignored
                             ; iterates through all valid combinations of operands and carry input
                             ; uses increments/decrements to predict result & carry flag
32d2 :                       chkdad
                             ; decimal ADC / SBC zp
32d2 : 08               [ 3]         php             ;save carry for subtract
32d3 : a50d             [ 3]         lda ad1
32d5 : 650e             [ 3]         adc ad2         ;perform add
32d7 : 08               [ 3]         php          
32d8 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
32da : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
32dc : 68               [ 4]         pla             ;check flags
32dd : 2901             [ 2]         and #1          ;mask carry
32df : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
32e1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
32e3 : 28               [ 4]         plp
32e4 : 08               [ 3]         php             ;save carry for next add
32e5 : a50d             [ 3]         lda ad1
32e7 : e512             [ 3]         sbc sb2         ;perform subtract
32e9 : 08               [ 3]         php          
32ea : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
32ec : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
32ee : 68               [ 4]         pla             ;check flags
32ef : 2901             [ 2]         and #1          ;mask carry
32f1 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad flags
32f3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
32f5 : 28               [ 4]         plp
                             ; decimal ADC / SBC abs
32f6 : 08               [ 3]         php             ;save carry for subtract
32f7 : a50d             [ 3]         lda ad1
32f9 : 6d0302           [ 4]         adc ada2        ;perform add
32fc : 08               [ 3]         php          
32fd : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
32ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  243
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
3301 : 68               [ 4]         pla             ;check flags
3302 : 2901             [ 2]         and #1          ;mask carry
3304 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
3306 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3308 : 28               [ 4]         plp
3309 : 08               [ 3]         php             ;save carry for next add
330a : a50d             [ 3]         lda ad1
330c : ed0402           [ 4]         sbc sba2        ;perform subtract
330f : 08               [ 3]         php          
3310 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3312 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3314 : 68               [ 4]         pla             ;check flags
3315 : 2901             [ 2]         and #1          ;mask carry
3317 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
3319 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
331b : 28               [ 4]         plp
                             ; decimal ADC / SBC #
331c : 08               [ 3]         php             ;save carry for subtract
331d : a50e             [ 3]         lda ad2
331f : 8d2533           [ 4]         sta chkdadi     ;self modify immediate
3322 : a50d             [ 3]         lda ad1
3325 =                       chkdadi = * + 1         ;operand of the immediate ADC
3324 : 6900             [ 2]         adc #0          ;perform add
3326 : 08               [ 3]         php          
3327 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3329 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
332b : 68               [ 4]         pla             ;check flags
332c : 2901             [ 2]         and #1          ;mask carry
332e : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
3330 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3332 : 28               [ 4]         plp
3333 : 08               [ 3]         php             ;save carry for next add
3334 : a512             [ 3]         lda sb2
3336 : 8d3c33           [ 4]         sta chkdsbi     ;self modify immediate
3339 : a50d             [ 3]         lda ad1
333c =                       chkdsbi = * + 1         ;operand of the immediate SBC
333b : e900             [ 2]         sbc #0          ;perform subtract
333d : 08               [ 3]         php          
333e : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3340 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3342 : 68               [ 4]         pla             ;check flags
3343 : 2901             [ 2]         and #1          ;mask carry
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  244
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

3345 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
3347 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3349 : 28               [ 4]         plp
                             ; decimal ADC / SBC zp,x
334a : 08               [ 3]         php             ;save carry for subtract
334b : a50d             [ 3]         lda ad1
334d : 7500             [ 4]         adc 0,x         ;perform add
334f : 08               [ 3]         php          
3350 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3352 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3354 : 68               [ 4]         pla             ;check flags
3355 : 2901             [ 2]         and #1          ;mask carry
3357 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
3359 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
335b : 28               [ 4]         plp
335c : 08               [ 3]         php             ;save carry for next add
335d : a50d             [ 3]         lda ad1
335f : f504             [ 4]         sbc sb2-ad2,x   ;perform subtract
3361 : 08               [ 3]         php          
3362 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3364 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3366 : 68               [ 4]         pla             ;check flags
3367 : 2901             [ 2]         and #1          ;mask carry
3369 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
336b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
336d : 28               [ 4]         plp
                             ; decimal ADC / SBC abs,x
336e : 08               [ 3]         php             ;save carry for subtract
336f : a50d             [ 3]         lda ad1
3371 : 7df501           [ 4]         adc ada2-ad2,x  ;perform add
3374 : 08               [ 3]         php          
3375 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3377 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3379 : 68               [ 4]         pla             ;check flags
337a : 2901             [ 2]         and #1          ;mask carry
337c : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
337e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3380 : 28               [ 4]         plp
3381 : 08               [ 3]         php             ;save carry for next add
3382 : a50d             [ 3]         lda ad1
3384 : fdf601           [ 4]         sbc sba2-ad2,x  ;perform subtract
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  245
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

3387 : 08               [ 3]         php          
3388 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
338a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
338c : 68               [ 4]         pla             ;check flags
338d : 2901             [ 2]         and #1          ;mask carry
338f : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
3391 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3393 : 28               [ 4]         plp
                             ; decimal ADC / SBC abs,y
3394 : 08               [ 3]         php             ;save carry for subtract
3395 : a50d             [ 3]         lda ad1
3397 : 790401           [ 4]         adc ada2-$ff,y  ;perform add
339a : 08               [ 3]         php          
339b : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
339d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
339f : 68               [ 4]         pla             ;check flags
33a0 : 2901             [ 2]         and #1          ;mask carry
33a2 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
33a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33a6 : 28               [ 4]         plp
33a7 : 08               [ 3]         php             ;save carry for next add
33a8 : a50d             [ 3]         lda ad1
33aa : f90501           [ 4]         sbc sba2-$ff,y  ;perform subtract
33ad : 08               [ 3]         php          
33ae : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
33b0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33b2 : 68               [ 4]         pla             ;check flags
33b3 : 2901             [ 2]         and #1          ;mask carry
33b5 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
33b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33b9 : 28               [ 4]         plp
                             ; decimal ADC / SBC (zp,x)
33ba : 08               [ 3]         php             ;save carry for subtract
33bb : a50d             [ 3]         lda ad1
33bd : 6144             [ 6]         adc (lo adi2-ad2,x) ;perform add
33bf : 08               [ 3]         php          
33c0 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
33c2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33c4 : 68               [ 4]         pla             ;check flags
33c5 : 2901             [ 2]         and #1          ;mask carry
33c7 : c510             [ 3]         cmp adrh
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  246
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     trap_ne         ;bad carry
33c9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33cb : 28               [ 4]         plp
33cc : 08               [ 3]         php             ;save carry for next add
33cd : a50d             [ 3]         lda ad1
33cf : e146             [ 6]         sbc (lo sbi2-ad2,x) ;perform subtract
33d1 : 08               [ 3]         php          
33d2 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
33d4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33d6 : 68               [ 4]         pla             ;check flags
33d7 : 2901             [ 2]         and #1          ;mask carry
33d9 : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
33db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33dd : 28               [ 4]         plp
                             ; decimal ADC / SBC (abs),y
33de : 08               [ 3]         php             ;save carry for subtract
33df : a50d             [ 3]         lda ad1
33e1 : 7156             [ 5]         adc (adiy2),y   ;perform add
33e3 : 08               [ 3]         php          
33e4 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
33e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33e8 : 68               [ 4]         pla             ;check flags
33e9 : 2901             [ 2]         and #1          ;mask carry
33eb : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
33ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33ef : 28               [ 4]         plp
33f0 : 08               [ 3]         php             ;save carry for next add
33f1 : a50d             [ 3]         lda ad1
33f3 : f158             [ 5]         sbc (sbiy2),y   ;perform subtract
33f5 : 08               [ 3]         php          
33f6 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
33f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
33fa : 68               [ 4]         pla             ;check flags
33fb : 2901             [ 2]         and #1          ;mask carry
33fd : c510             [ 3]         cmp adrh
                                     trap_ne         ;bad carry
33ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3401 : 28               [ 4]         plp
3402 : 60               [ 6]         rts
                             
                             ; 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
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  247
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

3403 : a511             [ 3] chkadd  lda adrf        ;add V-flag if overflow
3405 : 2983             [ 2]         and #$83        ;keep N-----ZC / clear V
3407 : 48               [ 3]         pha
3408 : a50d             [ 3]         lda ad1         ;test sign unequal between operands
340a : 450e             [ 3]         eor ad2
340c : 300a             [ 3]         bmi ckad1       ;no overflow possible - operands have different sign
340e : a50d             [ 3]         lda ad1         ;test sign equal between operands and result
3410 : 450f             [ 3]         eor adrl
3412 : 1004             [ 3]         bpl ckad1       ;no overflow occured - operand and result have same sign
3414 : 68               [ 4]         pla
3415 : 0940             [ 2]         ora #$40        ;set V
3417 : 48               [ 3]         pha
3418 : 68               [ 4] ckad1   pla
3419 : 8511             [ 3]         sta adrf        ;save expected flags
                             ; binary ADC / SBC zp
341b : 08               [ 3]         php             ;save carry for subtract
341c : a50d             [ 3]         lda ad1
341e : 650e             [ 3]         adc ad2         ;perform add
3420 : 08               [ 3]         php          
3421 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3423 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3425 : 68               [ 4]         pla             ;check flags
3426 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
3428 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
342a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
342c : 28               [ 4]         plp
342d : 08               [ 3]         php             ;save carry for next add
342e : a50d             [ 3]         lda ad1
3430 : e512             [ 3]         sbc sb2         ;perform subtract
3432 : 08               [ 3]         php          
3433 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3435 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3437 : 68               [ 4]         pla             ;check flags
3438 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
343a : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
343c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
343e : 28               [ 4]         plp
                             ; binary ADC / SBC abs
343f : 08               [ 3]         php             ;save carry for subtract
3440 : a50d             [ 3]         lda ad1
3442 : 6d0302           [ 4]         adc ada2        ;perform add
3445 : 08               [ 3]         php          
3446 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3448 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
344a : 68               [ 4]         pla             ;check flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  248
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

344b : 29c3             [ 2]         and #$c3        ;mask NV----ZC
344d : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
344f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3451 : 28               [ 4]         plp
3452 : 08               [ 3]         php             ;save carry for next add
3453 : a50d             [ 3]         lda ad1
3455 : ed0402           [ 4]         sbc sba2        ;perform subtract
3458 : 08               [ 3]         php          
3459 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
345b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
345d : 68               [ 4]         pla             ;check flags
345e : 29c3             [ 2]         and #$c3        ;mask NV----ZC
3460 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
3462 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3464 : 28               [ 4]         plp
                             ; binary ADC / SBC #
3465 : 08               [ 3]         php             ;save carry for subtract
3466 : a50e             [ 3]         lda ad2
3468 : 8d6e34           [ 4]         sta chkadi      ;self modify immediate
346b : a50d             [ 3]         lda ad1
346e =                       chkadi  = * + 1         ;operand of the immediate ADC
346d : 6900             [ 2]         adc #0          ;perform add
346f : 08               [ 3]         php          
3470 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3472 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3474 : 68               [ 4]         pla             ;check flags
3475 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
3477 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
3479 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
347b : 28               [ 4]         plp
347c : 08               [ 3]         php             ;save carry for next add
347d : a512             [ 3]         lda sb2
347f : 8d8534           [ 4]         sta chksbi      ;self modify immediate
3482 : a50d             [ 3]         lda ad1
3485 =                       chksbi  = * + 1         ;operand of the immediate SBC
3484 : e900             [ 2]         sbc #0          ;perform subtract
3486 : 08               [ 3]         php          
3487 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3489 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
348b : 68               [ 4]         pla             ;check flags
348c : 29c3             [ 2]         and #$c3        ;mask NV----ZC
348e : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  249
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

3490 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3492 : 28               [ 4]         plp
                             ; binary ADC / SBC zp,x
3493 : 08               [ 3]         php             ;save carry for subtract
3494 : a50d             [ 3]         lda ad1
3496 : 7500             [ 4]         adc 0,x         ;perform add
3498 : 08               [ 3]         php          
3499 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
349b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
349d : 68               [ 4]         pla             ;check flags
349e : 29c3             [ 2]         and #$c3        ;mask NV----ZC
34a0 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
34a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34a4 : 28               [ 4]         plp
34a5 : 08               [ 3]         php             ;save carry for next add
34a6 : a50d             [ 3]         lda ad1
34a8 : f504             [ 4]         sbc sb2-ad2,x   ;perform subtract
34aa : 08               [ 3]         php          
34ab : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
34ad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34af : 68               [ 4]         pla             ;check flags
34b0 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
34b2 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
34b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34b6 : 28               [ 4]         plp
                             ; binary ADC / SBC abs,x
34b7 : 08               [ 3]         php             ;save carry for subtract
34b8 : a50d             [ 3]         lda ad1
34ba : 7df501           [ 4]         adc ada2-ad2,x  ;perform add
34bd : 08               [ 3]         php          
34be : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
34c0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34c2 : 68               [ 4]         pla             ;check flags
34c3 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
34c5 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
34c7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34c9 : 28               [ 4]         plp
34ca : 08               [ 3]         php             ;save carry for next add
34cb : a50d             [ 3]         lda ad1
34cd : fdf601           [ 4]         sbc sba2-ad2,x  ;perform subtract
34d0 : 08               [ 3]         php          
34d1 : c50f             [ 3]         cmp adrl        ;check result
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  250
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     trap_ne         ;bad result
34d3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34d5 : 68               [ 4]         pla             ;check flags
34d6 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
34d8 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
34da : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34dc : 28               [ 4]         plp
                             ; binary ADC / SBC abs,y
34dd : 08               [ 3]         php             ;save carry for subtract
34de : a50d             [ 3]         lda ad1
34e0 : 790401           [ 4]         adc ada2-$ff,y  ;perform add
34e3 : 08               [ 3]         php          
34e4 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
34e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34e8 : 68               [ 4]         pla             ;check flags
34e9 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
34eb : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
34ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34ef : 28               [ 4]         plp
34f0 : 08               [ 3]         php             ;save carry for next add
34f1 : a50d             [ 3]         lda ad1
34f3 : f90501           [ 4]         sbc sba2-$ff,y  ;perform subtract
34f6 : 08               [ 3]         php          
34f7 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
34f9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
34fb : 68               [ 4]         pla             ;check flags
34fc : 29c3             [ 2]         and #$c3        ;mask NV----ZC
34fe : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
3500 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3502 : 28               [ 4]         plp
                             ; binary ADC / SBC (zp,x)
3503 : 08               [ 3]         php             ;save carry for subtract
3504 : a50d             [ 3]         lda ad1
3506 : 6144             [ 6]         adc (lo adi2-ad2,x) ;perform add
3508 : 08               [ 3]         php          
3509 : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
350b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
350d : 68               [ 4]         pla             ;check flags
350e : 29c3             [ 2]         and #$c3        ;mask NV----ZC
3510 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
3512 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  251
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
3514 : 28               [ 4]         plp
3515 : 08               [ 3]         php             ;save carry for next add
3516 : a50d             [ 3]         lda ad1
3518 : e146             [ 6]         sbc (lo sbi2-ad2,x) ;perform subtract
351a : 08               [ 3]         php          
351b : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
351d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
351f : 68               [ 4]         pla             ;check flags
3520 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
3522 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
3524 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3526 : 28               [ 4]         plp
                             ; binary ADC / SBC (abs),y
3527 : 08               [ 3]         php             ;save carry for subtract
3528 : a50d             [ 3]         lda ad1
352a : 7156             [ 5]         adc (adiy2),y   ;perform add
352c : 08               [ 3]         php          
352d : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
352f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3531 : 68               [ 4]         pla             ;check flags
3532 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
3534 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
3536 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3538 : 28               [ 4]         plp
3539 : 08               [ 3]         php             ;save carry for next add
353a : a50d             [ 3]         lda ad1
353c : f158             [ 5]         sbc (sbiy2),y   ;perform subtract
353e : 08               [ 3]         php          
353f : c50f             [ 3]         cmp adrl        ;check result
                                     trap_ne         ;bad result
3541 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3543 : 68               [ 4]         pla             ;check flags
3544 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
3546 : c511             [ 3]         cmp adrf
                                     trap_ne         ;bad flags
3548 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
354a : 28               [ 4]         plp
354b : 60               [ 6]         rts
                             
                             ; target for the jump absolute test
354c : 88               [ 2]         dey
354d : 88               [ 2]         dey
354e :                       test_far
354e : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  252
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

354f : 88               [ 2]         dey
3550 : 88               [ 2]         dey
3551 : 88               [ 2]         dey
3552 : 28               [ 4]         plp
                                     trap_cs         ;flags loaded?
3553 : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     trap_vs
3555 : 70fe             [ 3]>        bvs *           ;failed overflow set
                             
                                     trap_mi
3557 : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
                                     trap_eq 
3559 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
355b : c946             [ 2]         cmp #'F'        ;registers loaded?
                                     trap_ne
355d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
355f : e041             [ 2]         cpx #'A'
                                     trap_ne        
3561 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3563 : c04f             [ 2]         cpy #('R'-3)
                                     trap_ne
3565 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3567 : 48               [ 3]         pha             ;save a,x
3568 : 8a               [ 2]         txa
3569 : 48               [ 3]         pha
356a : ba               [ 2]         tsx
356b : e0fd             [ 2]         cpx #$fd        ;check SP
                                     trap_ne
356d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
356f : 68               [ 4]         pla             ;restore x
3570 : aa               [ 2]         tax
                                     set_stat $ff
                            >            load_flag $ff
3571 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
3573 : 48               [ 3]>            pha         ;use stack to load status
3574 : 28               [ 4]>            plp
                             
3575 : 68               [ 4]         pla             ;restore a
3576 : e8               [ 2]         inx             ;return registers with modifications
3577 : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1
3579 : 4cf707           [ 3]         jmp far_ret
                                     
                             ; target for the jump indirect test
                                     align
357c : 8535                  ptr_tst_ind dw test_ind
357e : 4c08                  ptr_ind_ret dw ind_ret
                                     trap            ;runover protection
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  253
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

3580 : 4c8035           [ 3]>        jmp *           ;failed anyway
                             
3583 : 88               [ 2]         dey
3584 : 88               [ 2]         dey
3585 :                       test_ind
3585 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
3586 : 88               [ 2]         dey
3587 : 88               [ 2]         dey
3588 : 88               [ 2]         dey
3589 : 28               [ 4]         plp
                                     trap_cs         ;flags loaded?
358a : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     trap_vs
358c : 70fe             [ 3]>        bvs *           ;failed overflow set
                             
                                     trap_mi
358e : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
                                     trap_eq 
3590 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
3592 : c949             [ 2]         cmp #'I'        ;registers loaded?
                                     trap_ne
3594 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3596 : e04e             [ 2]         cpx #'N'
                                     trap_ne        
3598 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
359a : c041             [ 2]         cpy #('D'-3)
                                     trap_ne
359c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
359e : 48               [ 3]         pha             ;save a,x
359f : 8a               [ 2]         txa
35a0 : 48               [ 3]         pha
35a1 : ba               [ 2]         tsx
35a2 : e0fd             [ 2]         cpx #$fd        ;check SP
                                     trap_ne
35a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
35a6 : 68               [ 4]         pla             ;restore x
35a7 : aa               [ 2]         tax
                                     set_stat $ff
                            >            load_flag $ff
35a8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
35aa : 48               [ 3]>            pha         ;use stack to load status
35ab : 28               [ 4]>            plp
                             
35ac : 68               [ 4]         pla             ;restore a
35ad : e8               [ 2]         inx             ;return registers with modifications
35ae : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1
35b0 : 6c7e35           [ 6]         jmp (ptr_ind_ret)
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  254
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     trap            ;runover protection
35b3 : 4cb335           [ 3]>        jmp *           ;failed anyway
                             
                             
                             ; target for the jump subroutine test
35b6 : 88               [ 2]         dey
35b7 : 88               [ 2]         dey
35b8 :                       test_jsr
35b8 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
35b9 : 88               [ 2]         dey
35ba : 88               [ 2]         dey
35bb : 88               [ 2]         dey
35bc : 28               [ 4]         plp
                                     trap_cs         ;flags loaded?
35bd : b0fe             [ 3]>        bcs *           ;failed carry set
                             
                                     trap_vs
35bf : 70fe             [ 3]>        bvs *           ;failed overflow set
                             
                                     trap_mi
35c1 : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
                             
                                     trap_eq 
35c3 : f0fe             [ 3]>        beq *           ;failed equal (zero)
                             
35c5 : c94a             [ 2]         cmp #'J'        ;registers loaded?
                                     trap_ne
35c7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
35c9 : e053             [ 2]         cpx #'S'
                                     trap_ne        
35cb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
35cd : c04f             [ 2]         cpy #('R'-3)
                                     trap_ne
35cf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
35d1 : 48               [ 3]         pha             ;save a,x
35d2 : 8a               [ 2]         txa
35d3 : 48               [ 3]         pha       
35d4 : ba               [ 2]         tsx             ;sp -4? (return addr,a,x)
35d5 : e0fb             [ 2]         cpx #$fb
                                     trap_ne
35d7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
35d9 : adff01           [ 4]         lda $1ff        ;propper return on stack
35dc : c908             [ 2]         cmp #hi(jsr_ret)
                                     trap_ne
35de : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
35e0 : adfe01           [ 4]         lda $1fe
35e3 : c982             [ 2]         cmp #lo(jsr_ret)
                                     trap_ne
35e5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  255
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     set_stat $ff
                            >            load_flag $ff
35e7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
35e9 : 48               [ 3]>            pha         ;use stack to load status
35ea : 28               [ 4]>            plp
                             
35eb : 68               [ 4]         pla             ;pull x,a
35ec : aa               [ 2]         tax
35ed : 68               [ 4]         pla
35ee : e8               [ 2]         inx             ;return registers with modifications
35ef : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1
35f1 : 60               [ 6]         rts
                                     trap            ;runover protection
35f2 : 4cf235           [ 3]>        jmp *           ;failed anyway
                             
                                     
                             ;trap in case of unexpected IRQ, NMI, BRK, RESET - BRK test target
35f5 :                       nmi_trap
                                     trap            ;check stack for conditions at NMI
35f5 : 4cf535           [ 3]>        jmp *           ;failed anyway
                             
35f8 :                       res_trap
                                     trap            ;unexpected RESET
35f8 : 4cf835           [ 3]>        jmp *           ;failed anyway
                             
                                     
35fb : 88               [ 2]         dey
35fc : 88               [ 2]         dey
35fd :                       irq_trap                ;BRK test or unextpected BRK or IRQ
35fd : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
35fe : 88               [ 2]         dey
35ff : 88               [ 2]         dey
3600 : 88               [ 2]         dey
                                     ;next 4 traps could be caused by unexpected BRK or IRQ
                                     ;check stack for BREAK and originating location
                                     ;possible jump/branch into weeds (uninitialized space)
3601 : c942             [ 2]         cmp #'B'        ;registers loaded?
                                     trap_ne
3603 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3605 : e052             [ 2]         cpx #'R'
                                     trap_ne        
3607 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3609 : c048             [ 2]         cpy #('K'-3)
                                     trap_ne
360b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
360d : 850a             [ 3]         sta irq_a       ;save registers during break test
360f : 860b             [ 3]         stx irq_x
3611 : ba               [ 2]         tsx             ;test break on stack
3612 : bd0201           [ 4]         lda $102,x
                                     cmp_flag 0      ;break test should have B=1
3615 : c930             [ 2]>            cmp #(0      |fao)&m8    ;expected flags + always on bits
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  256
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             
                                     trap_ne         ; - no break flag on stack
3617 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3619 : 68               [ 4]         pla
361a : c934             [ 2]         cmp #$34        ;should have added interrupt disable
                                     trap_ne
361c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
361e : ba               [ 2]         tsx
361f : e0fc             [ 2]         cpx #$fc        ;sp -3? (return addr, flags)
                                     trap_ne
3621 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
3623 : adff01           [ 4]         lda $1ff        ;propper return on stack
3626 : c908             [ 2]         cmp #hi(brk_ret)
                                     trap_ne
3628 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
362a : adfe01           [ 4]         lda $1fe
                             ;        cmp #lo(brk_ret)
362d : c9b8             [ 2]         cmp #lo(brk_ret - 1)    ; M65C02 treats JSR and traps (NMI, BRK/IRQ, RST) the same; add one to
                                     trap_ne
362f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
                             
                                     set_stat $ff
                            >            load_flag $ff
3631 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
                            >
3633 : 48               [ 3]>            pha         ;use stack to load status
3634 : 28               [ 4]>            plp
                             
3635 : a60b             [ 3]         ldx irq_x
3637 : e8               [ 2]         inx             ;return registers with modifications
3638 : a50a             [ 3]         lda irq_a
363a : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1 but original flags should be restored
363c : 40               [ 6]         rti
                                     trap            ;runover protection
363d : 4c3d36           [ 3]>        jmp *           ;failed anyway
                             
                                     
                             ;copy of data to initialize BSS segment
                                 if load_data_direct != 1
                             zp_init
                             zp1_    db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
                             zp7f_   db  $7f             ;test pattern for compare  
                             ;logical zeropage operands
                             zpOR_   db  0,$1f,$71,$80   ;test pattern for OR
                             zpAN_   db  $0f,$ff,$7f,$80 ;test pattern for AND
                             zpEO_   db  $ff,$0f,$8f,$8f ;test pattern for EOR
                             ;indirect addressing pointers
                             ind1_   dw  abs1            ;indirect pointer to pattern in absolute memory
                                     dw  abs1+1
                                     dw  abs1+2
                                     dw  abs1+3
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  257
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                                     dw  abs7f
                             inw1_   dw  abs1-$f8        ;indirect pointer for wrap-test pattern
                             indt_   dw  abst            ;indirect pointer to store area in absolute memory
                                     dw  abst+1
                                     dw  abst+2
                                     dw  abst+3
                             inwt_   dw  abst-$f8        ;indirect pointer for wrap-test store
                             indAN_  dw  absAN           ;indirect pointer to AND pattern in absolute memory
                                     dw  absAN+1
                                     dw  absAN+2
                                     dw  absAN+3
                             indEO_  dw  absEO           ;indirect pointer to EOR pattern in absolute memory
                                     dw  absEO+1
                                     dw  absEO+2
                                     dw  absEO+3
                             indOR_  dw  absOR           ;indirect pointer to OR pattern in absolute memory
                                     dw  absOR+1
                                     dw  absOR+2
                                     dw  absOR+3
                             ;add/subtract indirect pointers
                             adi2_   dw  ada2            ;indirect pointer to operand 2 in absolute memory
                             sbi2_   dw  sba2            ;indirect pointer to complemented operand 2 (SBC)
                             adiy2_  dw  ada2-$ff        ;with offset for indirect indexed
                             sbiy2_  dw  sba2-$ff
                             zp_end
                                 if (zp_end - zp_init) != (zp_bss_end - zp_bss)   
                                     ;force assembler error if size is different   
                                     ERROR ERROR ERROR   ;mismatch between bss and zeropage data
                                 endif 
                             data_init
                             abs1_   db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
                             abs7f_  db  $7f             ;test pattern for compare
                             ;loads
                             fLDx_   db  fn,fn,0,fz      ;expected flags for load
                             ;shifts
                             rASL_                       ;expected result ASL & ROL -carry  
                             rROL_   db  $86,$04,$82,0   ; "
                             rROLc_  db  $87,$05,$83,1   ;expected result ROL +carry
                             rLSR_                       ;expected result LSR & ROR -carry
                             rROR_   db  $61,$41,$20,0   ; "
                             rRORc_  db  $e1,$c1,$a0,$80 ;expected result ROR +carry
                             fASL_                       ;expected flags for shifts
                             fROL_   db  fnc,fc,fn,fz    ;no carry in
                             fROLc_  db  fnc,fc,fn,0     ;carry in
                             fLSR_
                             fROR_   db  fc,0,fc,fz      ;no carry in
                             fRORc_  db  fnc,fn,fnc,fn   ;carry in
                             ;increments (decrements)
                             rINC_   db  $7f,$80,$ff,0,1 ;expected result for INC/DEC
                             fINC_   db  0,fn,fn,fz,0    ;expected flags for INC/DEC
                             ;logical memory operand
                             absOR_  db  0,$1f,$71,$80   ;test pattern for OR
                             absAN_  db  $0f,$ff,$7f,$80 ;test pattern for AND
                             absEO_  db  $ff,$0f,$8f,$8f ;test pattern for EOR
                             ;logical accu operand
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  258
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------

                             absORa_ db  0,$f1,$1f,0     ;test pattern for OR
                             absANa_ db  $f0,$ff,$ff,$ff ;test pattern for AND
                             absEOa_ db  $ff,$f0,$f0,$0f ;test pattern for EOR
                             ;logical results
                             absrlo_ db  0,$ff,$7f,$80
                             absflo_ db  fz,fn,0,fn
                             data_end
                                 if (data_end - data_init) != (data_bss_end - data_bss)
                                     ;force assembler error if size is different   
                                     ERROR ERROR ERROR   ;mismatch between bss and data
                                 endif 
                             
                             vec_init
                                     dw  nmi_trap
                                     dw  res_trap
                                     dw  irq_trap
                             vec_bss equ $fffa
                                 endif                   ;end of RAM init data
                                 
                                 if (load_data_direct = 1) & (ROM_vectors = 1)  
fffa =                               org $fffa       ;vectors
fffa : f535                          dw  nmi_trap
fffc : f835                          dw  res_trap
fffe : fd35                          dw  irq_trap
                                 endif
                             
fffa =                               end start
                                         
No errors in pass 2.
Wrote binary from address $0000 through $ffff.
Total size 65536 bytes.
Program start address is at $0400 (1024).


Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.