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

Subversion Repositories m65c02

[/] [m65c02/] [trunk/] [Src/] [M65C02-Test-Programs/] [Klaus2m5_Functional_Tests/] [65c02_ft.lst] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 MichaelA
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    1
2
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3
 
4
---------------------------------------------------------- Symbol Table -----------------------------------------------------------
5
 
6
              Symbol   Value        Decimal
7
 
8
               absAN : $023f            575
9
              absANa : $024b            587
10
               absEO : $0243            579
11
              absEOa : $024f            591
12
              absflo : $0257            599
13
               absOR : $023b            571
14
              absORa : $0247            583
15
              absrlo : $0253            595
16
                abst : $0203            515
17
                abs1 : $0208            520
18
               abs7f : $020c            524
19
                ada2 : $0203            515
20
                adfc : $000c             12
21
               adiy2 : $0056             86
22
                adi2 : $0052             82
23
                adrf : $0011             17
24
                adrh : $0010             16
25
                adrl : $000f             15
26
                 ad1 : $000d             13
27
                 ad2 : $000e             14
28
            bin_test : $31b8          12728
29
               break : $0010             16
30
             brk_ret : $08b9           2233
31
                 br1 : $05c9           1481
32
                br11 : $060d           1549
33
                br12 : $0612           1554
34
                br13 : $0617           1559
35
                br14 : $0628           1576
36
                 br2 : $05ce           1486
37
                 br3 : $05d3           1491
38
                 br4 : $05e4           1508
39
               carry : $0001              1
40
           check_ram : 
41
              chkadd : $3403          13315
42
              chkadi : $346e          13422   *
43
              chkdad : $32d2          13010
44
             chkdadi : $3325          13093   *
45
             chkdsbi : $333c          13116   *
46
              chksbi : $3485          13445   *
47
               ckad1 : $3418          13336
48
            cmp_flag : 
49
        code_segment : $0400           1024   *
50
            data_bss : $0208            520
51
        data_bss_end : $025b            603
52
        data_segment : $0200            512   *
53
             decmode : $0008              8
54
            dec_test : $3220          12832
55
            eor_flag : 
56
                fASL : $0221            545
57
                 fai : $0034             52
58
                 fao : $0030             48
59
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    2
60
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
61
 
62
             far_ret : $07f7           2039
63
                  fc : $0001              1
64
                fINC : $0236            566
65
                fLDx : $020d            525
66
                fLSR : $0229            553
67
                  fn : $0080            128
68
                 fnc : $0081            129
69
                 fnv : $00c0            192
70
                 fnz : $0082            130
71
                fnzc : $0083            131
72
                fROL : $0221            545
73
               fROLc : $0225            549
74
                fROR : $0229            553
75
               fRORc : $022d            557
76
                  fv : $0040             64
77
                 fvz : $0042             66
78
                  fz : $0002              2
79
                 fzc : $0003              3
80
              I_flag : $0003              3   *
81
               indAN : $003a             58
82
               indEO : $0042             66
83
               indOR : $004a             74
84
                indt : $0030             48
85
                ind1 : $0024             36
86
             ind_ret : $084c           2124
87
              intdis : $0004              4
88
                inwt : $0038             56
89
                inw1 : $002e             46
90
               irq_a : $000a             10
91
            irq_trap : $35fd          13821
92
               irq_x : $000b             11
93
             jsr_ret : $0882           2178   *
94
    load_data_direct : $0001              1   *
95
           load_flag : 
96
               minus : $0080            128
97
                  m8 : $00ff            255
98
                 m8i : $00fb            251
99
                nbr1 : $05d8           1496
100
               nbr11 : $061c           1564
101
               nbr12 : $061f           1567
102
               nbr13 : $0622           1570
103
               nbr14 : $0625           1573
104
                nbr2 : $05db           1499
105
                nbr3 : $05de           1502
106
                nbr4 : $05e1           1505
107
           next_test : 
108
            nmi_trap : $35f5          13813
109
              overfl : $0040             64
110
         ptr_ind_ret : $357e          13694
111
         ptr_tst_ind : $357c          13692
112
         ROM_vectors : $0001              1   *
113
                rASL : $0211            529
114
           ram_chksm : $0201            513
115
             ram_top : $ffff             -1   *
116
           range_adr : $04a5           1189   *
117
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    3
118
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
119
 
120
           range_end : $0531           1329
121
            range_fw : $041c           1052
122
          range_loop : $0414           1044
123
            range_ok : $052a           1322
124
            range_op : $04a4           1188
125
              reserv : $0020             32
126
            res_trap : $35f8          13816
127
                rINC : $0231            561
128
                rLSR : $0219            537
129
                rROL : $0211            529
130
               rROLc : $0215            533
131
                rROR : $0219            537
132
               rRORc : $021d            541
133
                sba2 : $0204            516
134
               sbiy2 : $0058             88
135
                sbi2 : $0054             84
136
                 sb2 : $0012             18
137
               set_a : 
138
             set_abs : 
139
            set_absx : 
140
              set_ax : 
141
              set_ay : 
142
            set_stat : 
143
               set_x : 
144
               set_y : 
145
               set_z : 
146
              set_zx : 
147
       skip_bin_test : $0001              1   *
148
       skip_dec_test : $0001              1   *
149
         skip_part_1 : $0000              0   *
150
               start : $0400           1024
151
             success : $32cf          13007
152
                tadd : $31e6          12774
153
               tadd1 : $31f8          12792
154
                tand : $2be3          11235
155
              tandi1 : $2bf0          11248
156
              tandi2 : $2c11          11281
157
               tand1 : $2c04          11268
158
              tand10 : $2d1b          11547
159
              tand11 : $2d38          11576
160
              tand12 : $2d57          11607
161
              tand13 : $2d77          11639
162
              tand14 : $2d95          11669
163
              tand15 : $2db1          11697
164
               tand2 : $2c25          11301
165
               tand3 : $2c45          11333
166
               tand4 : $2c65          11365
167
               tand5 : $2c87          11399
168
               tand6 : $2ca9          11433
169
               tand7 : $2cc5          11461
170
               tand8 : $2ce1          11489
171
               tand9 : $2cfe          11518
172
                tasl : $2187           8583
173
               tasl1 : $21a1           8609
174
               tasl2 : $22cb           8907
175
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    4
176
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
177
 
178
               tasl3 : $22ea           8938
179
               tasl4 : $244b           9291
180
               tasl5 : $246d           9325
181
               tasl6 : $25ef           9711
182
               tasl7 : $260e           9742
183
               tasl8 : $276f          10095
184
               tasl9 : $2791          10129
185
                tdad : $324c          12876
186
               tdad1 : $325e          12894
187
               tdad2 : $326e          12910
188
               tdad3 : $3270          12912
189
               tdad4 : $328a          12938
190
               tdad5 : $328f          12943
191
               tdad6 : $32b3          12979
192
               tdad7 : $32c7          12999
193
                tdec : $293d          10557
194
               tdec1 : $2960          10592
195
              tdec10 : $298c          10636
196
              tdec11 : $29af          10671
197
              tdec12 : $2a43          10819
198
              tdec13 : $2a69          10857
199
              tdec14 : $2af2          10994
200
              tdec15 : $2b17          11031
201
              tdec16 : $2bac          11180
202
              tdec17 : $2bd5          11221
203
               tdec2 : $29ec          10732
204
               tdec3 : $2a12          10770
205
               tdec4 : $2aa1          10913
206
               tdec5 : $2ac6          10950
207
               tdec6 : $2b53          11091
208
               tdec7 : $2b7c          11132
209
                teor : $2dd9          11737
210
              teori1 : $2de6          11750
211
              teori2 : $2e07          11783
212
               teor1 : $2dfa          11770
213
              teor10 : $2f11          12049
214
              teor11 : $2f2e          12078
215
              teor12 : $2f4d          12109
216
              teor13 : $2f6d          12141
217
              teor14 : $2f8b          12171
218
              teor15 : $2fa7          12199
219
               teor2 : $2e1b          11803
220
               teor3 : $2e3b          11835
221
               teor4 : $2e5b          11867
222
               teor5 : $2e7d          11901
223
               teor6 : $2e9f          11935
224
               teor7 : $2ebb          11963
225
               teor8 : $2ed7          11991
226
               teor9 : $2ef4          12020
227
            test_bne : $0544           1348
228
           test_case : $0200            512
229
            test_far : $354e          13646
230
            test_ind : $3585          13701
231
            test_jsr : $35b8          13752
232
           test_near : $081a           2074
233
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    5
234
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
235
 
236
            test_num : $002a             42   *
237
                tinc : $2917          10519
238
               tinc1 : $2936          10550
239
              tinc10 : $2966          10598
240
              tinc11 : $2985          10629
241
              tinc12 : $2a19          10777
242
              tinc13 : $2a3b          10811
243
              tinc14 : $2aca          10954
244
              tinc15 : $2aeb          10987
245
              tinc16 : $2b80          11136
246
              tinc17 : $2ba5          11173
247
               tinc2 : $29c2          10690
248
               tinc3 : $29e4          10724
249
               tinc4 : $2a79          10873
250
               tinc5 : $2a9a          10906
251
               tinc6 : $2b27          11047
252
               tinc7 : $2b4c          11084
253
               tldax : $14fa           5370
254
              tldax1 : $151c           5404
255
              tldax2 : $153e           5438
256
              tldax3 : $155f           5471
257
              tldax4 : $165d           5725
258
              tldax5 : $1682           5762
259
              tldax6 : $16c6           5830
260
              tldax7 : $16d2           5842
261
               tlday : $15ab           5547
262
              tlday1 : $15cd           5581
263
              tlday2 : $1604           5636
264
              tlday3 : $1625           5669
265
              tlday4 : $16fb           5883
266
              tlday5 : $171c           5916
267
              tlday6 : $173d           5949
268
                tldx : $0d16           3350
269
               tldx1 : $0d39           3385
270
               tldx2 : $0d5c           3420
271
               tldx3 : $0d80           3456
272
               tldx4 : $0dd1           3537
273
               tldx5 : $0dde           3550
274
                tldy : $0e13           3603
275
               tldy1 : $0e36           3638
276
               tldy2 : $0e59           3673
277
               tldy3 : $0e7c           3708
278
               tldy4 : $0eca           3786
279
               tldy5 : $0ed7           3799
280
                tlsr : $21bb           8635
281
               tlsr1 : $21d5           8661
282
               tlsr2 : $2309           8969
283
               tlsr3 : $2328           9000
284
               tlsr4 : $248f           9359
285
               tlsr5 : $24b1           9393
286
               tlsr6 : $262d           9773
287
               tlsr7 : $264c           9804
288
               tlsr8 : $27b3          10163
289
               tlsr9 : $27d5          10197
290
                tora : $2fcf          12239
291
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    6
292
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
293
 
294
              torai1 : $2fdc          12252
295
              torai2 : $2ffd          12285
296
               tora1 : $2ff0          12272
297
              tora10 : $3107          12551
298
              tora11 : $3124          12580
299
              tora12 : $3143          12611
300
              tora13 : $3163          12643
301
              tora14 : $3181          12673
302
              tora15 : $319d          12701
303
               tora2 : $3011          12305
304
               tora3 : $3031          12337
305
               tora4 : $3051          12369
306
               tora5 : $3073          12403
307
               tora6 : $3095          12437
308
               tora7 : $30b1          12465
309
               tora8 : $30cd          12493
310
               tora9 : $30ea          12522
311
                trap : 
312
             trap_cc : 
313
             trap_cs : 
314
             trap_eq : 
315
             trap_mi : 
316
             trap_ne : 
317
             trap_pl : 
318
             trap_vc : 
319
             trap_vs : 
320
                trol : $21ef           8687
321
               trolc : $2223           8739
322
              trolc1 : $223d           8765
323
              trolc2 : $2385           9093
324
              trolc3 : $23a4           9124
325
              trolc4 : $2517           9495
326
              trolc5 : $2539           9529
327
              trolc6 : $26a9           9897
328
              trolc7 : $26c8           9928
329
              trolc8 : $283b          10299
330
              trolc9 : $285d          10333
331
               trol1 : $2209           8713
332
               trol2 : $2347           9031
333
               trol3 : $2366           9062
334
               trol4 : $24d3           9427
335
               trol5 : $24f5           9461
336
               trol6 : $266b           9835
337
               trol7 : $268a           9866
338
               trol8 : $27f7          10231
339
               trol9 : $2819          10265
340
                tror : $2257           8791
341
               trorc : $228b           8843
342
              trorc1 : $22a5           8869
343
              trorc2 : $2401           9217
344
              trorc3 : $2420           9248
345
              trorc4 : $259f           9631
346
              trorc5 : $25c1           9665
347
              trorc6 : $2725          10021
348
              trorc7 : $2744          10052
349
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    7
350
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
351
 
352
              trorc8 : $28c3          10435
353
              trorc9 : $28e5          10469
354
               tror1 : $2271           8817
355
               tror2 : $23c3           9155
356
               tror3 : $23e2           9186
357
               tror4 : $255b           9563
358
               tror5 : $257d           9597
359
               tror6 : $26e7           9959
360
               tror7 : $2706           9990
361
               tror8 : $287f          10367
362
               tror9 : $28a1          10401
363
               tstax : $1582           5506
364
              tstax1 : $16e0           5856
365
               tstay : $15f1           5617
366
              tstay1 : $1648           5704
367
              tstay2 : $16a7           5799
368
              tstay4 : $170b           5899
369
              tstay5 : $172a           5930
370
              tstay6 : $174c           5964
371
                tstx : $0da6           3494
372
               tstx1 : $0dec           3564
373
                tsty : $0ea1           3745
374
               tsty1 : $0ee5           3813
375
               tst_a : 
376
             tst_abs : 
377
            tst_absx : 
378
              tst_ax : 
379
              tst_ay : 
380
            tst_stat : 
381
               tst_x : 
382
               tst_y : 
383
               tst_z : 
384
              tst_zx : 
385
                zero : $0002              2
386
           zero_page : $000a             10   *
387
                zpAN : $001c             28
388
                zpEO : $0020             32
389
                zpOR : $0018             24
390
                 zpt : $000c             12
391
                 zp1 : $0013             19
392
                zp7f : $0017             23
393
              zp_bss : $0013             19
394
          zp_bss_end : $005a             90
395
          __65SC02__ : $0001              1
396
 
397
336 labels used
398
 
399
5633 lines read, no errors in pass 1.
400
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    8
401
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
402
 
403
                             ;
404
                             ; 6 5 0 2   F U N C T I O N A L   T E S T
405
                             ;
406
                             ; Copyright (C) 2012-2013  Klaus Dormann
407
                             ;
408
                             ; This program is free software: you can redistribute it and/or modify
409
                             ; it under the terms of the GNU General Public License as published by
410
                             ; the Free Software Foundation, either version 3 of the License, or
411
                             ; (at your option) any later version.
412
                             ;
413
                             ; This program is distributed in the hope that it will be useful,
414
                             ; but WITHOUT ANY WARRANTY; without even the implied warranty of
415
                             ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
416
                             ; GNU General Public License for more details.
417
                             ;
418
                             ; You should have received a copy of the GNU General Public License
419
                             ; along with this program.  If not, see .
420
 
421
 
422
                             ; This program is designed to test all opcodes of a 6502 emulator using all
423
                             ; addressing modes with focus on propper setting of the processor status
424
                             ; register bits.
425
                             ;
426
                             ; version 23-jul-2013
427
                             ; contact info at http://2m5.de or email K@2m5.de
428
                             ;
429
                             ; assembled with AS65 from http://www.kingswood-consulting.co.uk/assemblers/
430
                             ; command line switches: -l -m -s2 -w -h0
431
                             ;                         |  |  |   |  no page headers in listing
432
                             ;                         |  |  |   wide listing (133 char/col)
433
                             ;                         |  |  write intel hex file instead of binary
434
                             ;                         |  expand macros in listing
435
                             ;                         generate pass2 listing
436
                             ;
437
                             ; No IO - should be run from a monitor with access to registers.
438
                             ; To run load intel hex image with a load command, than alter PC to 400 hex
439
                             ; (code_segment) and enter a go command.
440
                             ; Loop on program counter determines error or successful completion of test.
441
                             ; Check listing for relevant traps (jump/branch *).
442
                             ; Please note that in early tests some instructions will have to be used before
443
                             ; they are actually tested!
444
                             ;
445
                             ; RESET, NMI or IRQ should not occur and will be trapped if vectors are enabled.
446
                             ; Tests documented behavior of the original NMOS 6502 only! No unofficial
447
                             ; opcodes. Additional opcodes of newer versions of the CPU (65C02, 65816) will
448
                             ; not be tested. Decimal ops will only be tested with valid BCD operands and
449
                             ; N V Z flags will be ignored.
450
                             ;
451
                             ; Debugging hints:
452
                             ;     Most of the code is written sequentially. if you hit a trap, check the
453
                             ;   immediately preceeding code for the instruction to be tested. Results are
454
                             ;   tested first, flags are checked second by pushing them onto the stack and
455
                             ;   pulling them to the accumulator after the result was checked. The "real"
456
                             ;   flags are no longer valid for the tested instruction at this time!
457
                             ;     If the tested instruction was indexed, the relevant index (X or Y) must
458
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page    9
459
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
460
 
461
                             ;   also be checked. Opposed to the flags, X and Y registers are still valid.
462
                             ;
463
                             ; versions:
464
                             ;   28-jul-2012  1st version distributed for testing
465
                             ;   29-jul-2012  fixed references to location 0, now #0
466
                             ;                added license - GPLv3
467
                             ;   30-jul-2012  added configuration options
468
                             ;   01-aug-2012  added trap macro to allow user to change error handling
469
                             ;   01-dec-2012  fixed trap in branch field must be a branch
470
                             ;   02-mar-2013  fixed PLA flags not tested
471
                             ;   19-jul-2013  allowed ROM vectors to be loaded when load_data_direct = 0
472
                             ;                added test sequence check to detect if tests jump their fence
473
                             ;   23-jul-2013  added RAM integrity check
474
 
475
                             ; C O N F I G U R A T I O N
476
                             ;
477
                             ;ROM_vectors writable (0=no, 1=yes)
478
                             ;if ROM vectors can not be used interrupts will not be trapped
479
                             ;as a consequence BRK can not be tested but will be emulated to test RTI
480
0001 =                       ROM_vectors = 1
481
                             ;load_data_direct (0=move from code segment, 1=load directly)
482
                             ;loading directly is preferred but may not be supported by your platform
483
                             ;0 produces only consecutive object code, 1 is not suitable for a binary image
484
0001 =                       load_data_direct = 1
485
                             ;I_flag behavior (0=force enabled, 1=force disabled, 2=prohibit change, 3=allow
486
                             ;change) 2 requires extra code and is not recommended. SEI & CLI can only be
487
                             ;tested if you allow changing the interrupt status (I_flag = 3)
488
0003 =                       I_flag = 3
489
                             ;configure memory - try to stay away from memory used by the system
490
                             ;zero_page memory start address, $50 (80) consecutive Bytes required
491
                             ;                                add 2 if I_flag = 2
492
000a =                       zero_page = $a
493
                             ;data_segment memory start address, $5B (91) consecutive Bytes required
494
0200 =                       data_segment = $200
495
                                 if (data_segment & $ff) != 0
496
                                     ERROR ERROR ERROR low byte of data_segment MUST be $00 !!
497
                                 endif
498
                             ;code_segment memory start address, 13kB of consecutive space required
499
                             ;                                   add 2.5 kB if I_flag = 2
500
                             ;parts of the code are self modifying and must reside in RAM
501
0400 =                       code_segment = $400
502
                             ;RAM integrity test option. Checks for undesired RAM writes.
503
                             ;set lowest non RAM or RAM mirror address page (-1=disable, 0=64k, $40=16k)
504
                             ;leave disabled if a monitor, OS or background interrupt is allowed to alter RAM
505
ffff =                       ram_top = -1
506
                             ;
507
                             ;Skip to ADC/SBC tests
508
                             ;
509
0000 =                       skip_part_1  = 0
510
                             ;
511
                             ;Skip Binary or Decimal mode ADC/SBC instruction tests
512
                             ;
513
0001 =                       skip_bin_test = 1
514
0001 =                       skip_dec_test = 1
515
 
516
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   10
517
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
518
 
519
                                     noopt       ;do not take shortcuts
520
 
521
                             ;macros for error & success traps to allow user modification
522
                             ;example:
523
                             ;trap    macro
524
                             ;        jsr my_error_handler
525
                             ;        endm
526
                             ;trap_eq macro
527
                             ;        bne skip\?
528
                             ;        trap           ;failed equal (zero)
529
                             ;skip\?
530
                             ;        endm
531
                             ;
532
                             ; my_error_handler should pop the calling address from the stack and report it.
533
                             ; putting larger portions of code (more than 3 bytes) inside the trap macro
534
                             ; may lead to branch range problems for some tests.
535
                             trap    macro
536
                                     jmp *           ;failed anyway
537
                                     endm
538
                             trap_eq macro
539
                                     beq *           ;failed equal (zero)
540
                                     endm
541
                             trap_ne macro
542
                                     bne *           ;failed not equal (non zero)
543
                                     endm
544
                             trap_cs macro
545
                                     bcs *           ;failed carry set
546
                                     endm
547
                             trap_cc macro
548
                                     bcc *           ;failed carry clear
549
                                     endm
550
                             trap_mi macro
551
                                     bmi *           ;failed minus (bit 7 set)
552
                                     endm
553
                             trap_pl macro
554
                                     bpl *           ;failed plus (bit 7 clear)
555
                                     endm
556
                             trap_vs macro
557
                                     bvs *           ;failed overflow set
558
                                     endm
559
                             trap_vc macro
560
                                     bvc *           ;failed overflow clear
561
                                     endm
562
                             success macro
563
                                     jmp *           ;test passed, no errors
564
                                     endm
565
 
566
 
567
0001 =                       carry   equ %00000001   ;flag bits in status
568
0002 =                       zero    equ %00000010
569
0004 =                       intdis  equ %00000100
570
0008 =                       decmode equ %00001000
571
0010 =                       break   equ %00010000
572
0020 =                       reserv  equ %00100000
573
0040 =                       overfl  equ %01000000
574
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   11
575
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
576
 
577
0080 =                       minus   equ %10000000
578
 
579
0001 =                       fc      equ carry
580
0002 =                       fz      equ zero
581
0003 =                       fzc     equ carry+zero
582
0040 =                       fv      equ overfl
583
0042 =                       fvz     equ overfl+zero
584
0080 =                       fn      equ minus
585
0081 =                       fnc     equ minus+carry
586
0082 =                       fnz     equ minus+zero
587
0083 =                       fnzc    equ minus+zero+carry
588
00c0 =                       fnv     equ minus+overfl
589
 
590
0030 =                       fao     equ break+reserv    ;bits always on after PHP, BRK
591
0034 =                       fai     equ fao+intdis      ;+ forced interrupt disable
592
00ff =                       m8      equ $ff             ;8 bit mask
593
00fb =                       m8i     equ $ff&~intdis     ;8 bit mask - interrupt disable
594
 
595
                             ;macros to allow masking of status bits.
596
                             ;masking of interrupt enable/disable on load and compare
597
                             ;masking of always on bits after PHP or BRK (unused & break) on compare
598
                                     if I_flag = 0
599
                             load_flag   macro
600
                                         lda #\1&m8i         ;force enable interrupts (mask I)
601
                                         endm
602
                             cmp_flag    macro
603
                                         cmp #(\1|fao)&m8i   ;I_flag is always enabled + always on bits
604
                                         endm
605
                             eor_flag    macro
606
                                         eor #(\1&m8i|fao)   ;mask I, invert expected flags + always on bits
607
                                         endm
608
                                     endif
609
                                     if I_flag = 1
610
                             load_flag   macro
611
                                         lda #\1|intdis      ;force disable interrupts
612
                                         endm
613
                             cmp_flag    macro
614
                                         cmp #(\1|fai)&m8    ;I_flag is always disabled + always on bits
615
                                         endm
616
                             eor_flag    macro
617
                                         eor #(\1|fai)       ;invert expected flags + always on bits + I
618
                                         endm
619
                                     endif
620
                                     if I_flag = 2
621
                             load_flag   macro
622
                                         lda #\1
623
                                         ora flag_I_on       ;restore I-flag
624
                                         and flag_I_off
625
                                         endm
626
                             cmp_flag    macro
627
                                         eor flag_I_on       ;I_flag is never changed
628
                                         cmp #(\1|fao)&m8i   ;expected flags + always on bits, mask I
629
                                         endm
630
                             eor_flag    macro
631
                                         eor flag_I_on       ;I_flag is never changed
632
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   12
633
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
634
 
635
                                         eor #(\1&m8i|fao)   ;mask I, invert expected flags + always on bits
636
                                         endm
637
                                     endif
638
                                     if I_flag = 3
639
                             load_flag   macro
640
                                         lda #\1             ;allow test to change I-flag (no mask)
641
                                         endm
642
                             cmp_flag    macro
643
                                         cmp #(\1|fao)&m8    ;expected flags + always on bits
644
                                         endm
645
                             eor_flag    macro
646
                                         eor #\1|fao         ;invert expected flags + always on bits
647
                                         endm
648
                                     endif
649
 
650
                             ;macros to set (register|memory|zeropage) & status
651
                             set_stat    macro       ;setting flags in the processor status register
652
                                         load_flag \1
653
                                         pha         ;use stack to load status
654
                                         plp
655
                                         endm
656
 
657
                             set_a       macro       ;precharging accu & status
658
                                         load_flag \2
659
                                         pha         ;use stack to load status
660
                                         lda #\1     ;precharge accu
661
                                         plp
662
                                         endm
663
 
664
                             set_x       macro       ;precharging index & status
665
                                         load_flag \2
666
                                         pha         ;use stack to load status
667
                                         ldx #\1     ;precharge index x
668
                                         plp
669
                                         endm
670
 
671
                             set_y       macro       ;precharging index & status
672
                                         load_flag \2
673
                                         pha         ;use stack to load status
674
                                         ldy #\1     ;precharge index y
675
                                         plp
676
                                         endm
677
 
678
                             set_ax      macro       ;precharging indexed accu & immediate status
679
                                         load_flag \2
680
                                         pha         ;use stack to load status
681
                                         lda \1,x    ;precharge accu
682
                                         plp
683
                                         endm
684
 
685
                             set_ay      macro       ;precharging indexed accu & immediate status
686
                                         load_flag \2
687
                                         pha         ;use stack to load status
688
                                         lda \1,y    ;precharge accu
689
                                         plp
690
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   13
691
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
692
 
693
                                         endm
694
 
695
                             set_z       macro       ;precharging indexed zp & immediate status
696
                                         load_flag \2
697
                                         pha         ;use stack to load status
698
                                         lda \1,x    ;load to zeropage
699
                                         sta zpt
700
                                         plp
701
                                         endm
702
 
703
                             set_zx      macro       ;precharging zp,x & immediate status
704
                                         load_flag \2
705
                                         pha         ;use stack to load status
706
                                         lda \1,x    ;load to indexed zeropage
707
                                         sta zpt,x
708
                                         plp
709
                                         endm
710
 
711
                             set_abs     macro       ;precharging indexed memory & immediate status
712
                                         load_flag \2
713
                                         pha         ;use stack to load status
714
                                         lda \1,x    ;load to memory
715
                                         sta abst
716
                                         plp
717
                                         endm
718
 
719
                             set_absx    macro       ;precharging abs,x & immediate status
720
                                         load_flag \2
721
                                         pha         ;use stack to load status
722
                                         lda \1,x    ;load to indexed memory
723
                                         sta abst,x
724
                                         plp
725
                                         endm
726
 
727
                             ;macros to test (register|memory|zeropage) & status & (mask)
728
                             tst_stat    macro       ;testing flags in the processor status register
729
                                         php         ;save status
730
                                         php         ;use stack to retrieve status
731
                                         pla
732
                                         cmp_flag \1
733
                                         trap_ne
734
                                         plp         ;restore status
735
                                         endm
736
 
737
                             tst_a       macro       ;testing result in accu & flags
738
                                         php         ;save flags
739
                                         php
740
                                         cmp #\1     ;test result
741
                                         trap_ne
742
                                         pla         ;load status
743
                                         cmp_flag \2
744
                                         trap_ne
745
                                         plp         ;restore status
746
                                         endm
747
 
748
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   14
749
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
750
 
751
                             tst_x       macro       ;testing result in x index & flags
752
                                         php         ;save flags
753
                                         php
754
                                         cpx #\1     ;test result
755
                                         trap_ne
756
                                         pla         ;load status
757
                                         cmp_flag \2
758
                                         trap_ne
759
                                         plp         ;restore status
760
                                         endm
761
 
762
                             tst_y       macro       ;testing result in y index & flags
763
                                         php         ;save flags
764
                                         php
765
                                         cpy #\1     ;test result
766
                                         trap_ne
767
                                         pla         ;load status
768
                                         cmp_flag \2
769
                                         trap_ne
770
                                         plp         ;restore status
771
                                         endm
772
 
773
                             tst_ax      macro       ;indexed testing result in accu & flags
774
                                         php         ;save flags
775
                                         cmp \1,x    ;test result
776
                                         trap_ne
777
                                         pla         ;load status
778
                                         eor_flag \3
779
                                         cmp \2,x    ;test flags
780
                                         trap_ne     ;
781
                                         endm
782
 
783
                             tst_ay      macro       ;indexed testing result in accu & flags
784
                                         php         ;save flags
785
                                         cmp \1,y    ;test result
786
                                         trap_ne     ;
787
                                         pla         ;load status
788
                                         eor_flag \3
789
                                         cmp \2,y    ;test flags
790
                                         trap_ne
791
                                         endm
792
 
793
                             tst_z       macro       ;indexed testing result in zp & flags
794
                                         php         ;save flags
795
                                         lda zpt
796
                                         cmp \1,x    ;test result
797
                                         trap_ne
798
                                         pla         ;load status
799
                                         eor_flag \3
800
                                         cmp \2,x    ;test flags
801
                                         trap_ne
802
                                         endm
803
 
804
                             tst_zx      macro       ;testing result in zp,x & flags
805
                                         php         ;save flags
806
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   15
807
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
808
 
809
                                         lda zpt,x
810
                                         cmp \1,x    ;test result
811
                                         trap_ne
812
                                         pla         ;load status
813
                                         eor_flag \3
814
                                         cmp \2,x    ;test flags
815
                                         trap_ne
816
                                         endm
817
 
818
                             tst_abs     macro       ;indexed testing result in memory & flags
819
                                         php         ;save flags
820
                                         lda abst
821
                                         cmp \1,x    ;test result
822
                                         trap_ne
823
                                         pla         ;load status
824
                                         eor_flag \3
825
                                         cmp \2,x    ;test flags
826
                                         trap_ne
827
                                         endm
828
 
829
                             tst_absx    macro       ;testing result in abs,x & flags
830
                                         php         ;save flags
831
                                         lda abst,x
832
                                         cmp \1,x    ;test result
833
                                         trap_ne
834
                                         pla         ;load status
835
                                         eor_flag \3
836
                                         cmp \2,x    ;test flags
837
                                         trap_ne
838
                                         endm
839
 
840
                             ; RAM integrity test
841
                             ;   verifies that none of the previous tests has altered RAM outside of the
842
                             ;   designated write areas.
843
                             ;   uses zpt word as indirect pointer, zpt+2 word as checksum
844
                                     if ram_top > -1
845
                             check_ram   macro
846
                                         cld
847
                                         lda #0
848
                                         sta zpt         ;set low byte of indirect pointer
849
                                         sta zpt+3       ;checksum high byte
850
                                         sta range_adr   ;reset self modifying code
851
                                         sta tandi1
852
                                         sta tandi2
853
                                         sta teori1
854
                                         sta teori2
855
                                         sta torai1
856
                                         sta torai2
857
                                         sta chkdadi
858
                                         sta chkdsbi
859
                                         sta chkadi
860
                                         sta chksbi
861
                                         clc
862
                                         ldx #zp_bss-zero_page ;zeropage - write test area
863
                             ccs3\?      adc zero_page,x
864
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   16
865
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
866
 
867
                                         bcc ccs2\?
868
                                         inc zpt+3       ;carry to high byte
869
                                         clc
870
                             ccs2\?      inx
871
                                         bne ccs3\?
872
                                         ldx #hi(data_segment) ;set high byte of indirect pointer
873
                                         stx zpt+1
874
                                         ldy #lo(data_bss) ;data after write test area
875
                             ccs5\?      adc (zpt),y
876
                                         bcc ccs4\?
877
                                         inc zpt+3       ;carry to high byte
878
                                         clc
879
                             ccs4\?      iny
880
                                         bne ccs5\?
881
                                         inx             ;advance RAM high address
882
                                         stx zpt+1
883
                                         cpx #ram_top
884
                                         bne ccs5\?
885
                                         sta zpt+2       ;checksum low is
886
                                         cmp ram_chksm   ;checksum low expected
887
                                         trap_ne         ;checksum mismatch
888
                                         lda zpt+3       ;checksum high is
889
                                         cmp ram_chksm+1 ;checksum high expected
890
                                         trap_ne         ;checksum mismatch
891
                                         endm
892
                                     else
893
                             check_ram   macro
894
                                         ;RAM check disabled - RAM size not set
895
                                         endm
896
                                     endif
897
 
898
                             next_test   macro           ;make sure, tests don't jump the fence
899
                                         lda test_case   ;previous test
900
                                         cmp #test_num
901
                                         trap_ne         ;test is out of sequence
902
                             test_num = test_num + 1
903
                                         lda #test_num   ;*** this tests' number
904
                                         sta test_case
905
                                         ;check_ram       ;uncomment to find altered RAM after each test
906
                                         endm
907
 
908
                                 if load_data_direct = 1
909
                                     data
910
                                 else
911
                                     bss                 ;uninitialized segment, copy of data at end of code!
912
                                 endif
913
                             ;
914
                             ;        org zero_page
915
0000 =                               org 0
916
0000 : 00000000000000..              ds  zero_page
917
                             ;break test interrupt save
918
000a : 00                    irq_a   ds  1               ;a register
919
000b : 00                    irq_x   ds  1               ;x register
920
                                 if I_flag = 2
921
                             ;masking for I bit in status
922
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   17
923
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
924
 
925
                             flag_I_on   ds  1           ;or mask to load flags
926
                             flag_I_off  ds  1           ;and mask to load flags
927
                                 endif
928
000c :                       zpt                         ;5 bytes store/modify test area
929
                             ;add/subtract operand generation and result/flag prediction
930
000c : 00                    adfc    ds  1               ;carry flag before op
931
000d : 00                    ad1     ds  1               ;operand 1 - accumulator
932
000e : 00                    ad2     ds  1               ;operand 2 - memory / immediate
933
000f : 00                    adrl    ds  1               ;expected result bits 0-7
934
0010 : 00                    adrh    ds  1               ;expected result bit 8 (carry)
935
0011 : 00                    adrf    ds  1               ;expected flags NV0000ZC (-V in decimal mode)
936
0012 : 00                    sb2     ds  1               ;operand 2 complemented for subtract
937
0013 :                       zp_bss
938
0013 : c3824100              zp1     db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
939
0017 : 7f                    zp7f    db  $7f             ;test pattern for compare
940
                             ;logical zeropage operands
941
0018 : 001f7180              zpOR    db  0,$1f,$71,$80   ;test pattern for OR
942
001c : 0fff7f80              zpAN    db  $0f,$ff,$7f,$80 ;test pattern for AND
943
0020 : ff0f8f8f              zpEO    db  $ff,$0f,$8f,$8f ;test pattern for EOR
944
                             ;indirect addressing pointers
945
0024 : 0802                  ind1    dw  abs1            ;indirect pointer to pattern in absolute memory
946
0026 : 0902                          dw  abs1+1
947
0028 : 0a02                          dw  abs1+2
948
002a : 0b02                          dw  abs1+3
949
002c : 0c02                          dw  abs7f
950
002e : 1001                  inw1    dw  abs1-$f8        ;indirect pointer for wrap-test pattern
951
0030 : 0302                  indt    dw  abst            ;indirect pointer to store area in absolute memory
952
0032 : 0402                          dw  abst+1
953
0034 : 0502                          dw  abst+2
954
0036 : 0602                          dw  abst+3
955
0038 : 0b01                  inwt    dw  abst-$f8        ;indirect pointer for wrap-test store
956
003a : 3f02                  indAN   dw  absAN           ;indirect pointer to AND pattern in absolute memory
957
003c : 4002                          dw  absAN+1
958
003e : 4102                          dw  absAN+2
959
0040 : 4202                          dw  absAN+3
960
0042 : 4302                  indEO   dw  absEO           ;indirect pointer to EOR pattern in absolute memory
961
0044 : 4402                          dw  absEO+1
962
0046 : 4502                          dw  absEO+2
963
0048 : 4602                          dw  absEO+3
964
004a : 3b02                  indOR   dw  absOR           ;indirect pointer to OR pattern in absolute memory
965
004c : 3c02                          dw  absOR+1
966
004e : 3d02                          dw  absOR+2
967
0050 : 3e02                          dw  absOR+3
968
                             ;add/subtract indirect pointers
969
0052 : 0302                  adi2    dw  ada2            ;indirect pointer to operand 2 in absolute memory
970
0054 : 0402                  sbi2    dw  sba2            ;indirect pointer to complemented operand 2 (SBC)
971
0056 : 0401                  adiy2   dw  ada2-$ff        ;with offset for indirect indexed
972
0058 : 0501                  sbiy2   dw  sba2-$ff
973
005a :                       zp_bss_end
974
 
975
0200 =                               org data_segment
976
0200 : 00                    test_case   ds  1           ;current test number
977
0201 : 0000                  ram_chksm   ds  2           ;checksum for RAM integrity test
978
                             ;add/subtract operand copy - abs tests write area
979
0203 :                       abst                        ;5 bytes store/modify test area
980
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   18
981
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
982
 
983
0203 : 00                    ada2    ds  1               ;operand 2
984
0204 : 00                    sba2    ds  1               ;operand 2 complemented for subtract
985
0205 : 000000                        ds  3               ;fill remaining bytes
986
0208 :                       data_bss
987
0208 : c3824100              abs1    db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
988
020c : 7f                    abs7f   db  $7f             ;test pattern for compare
989
                             ;loads
990
020d : 80800002              fLDx    db  fn,fn,0,fz      ;expected flags for load
991
                             ;shifts
992
0211 :                       rASL                        ;expected result ASL & ROL -carry
993
0211 : 86048200              rROL    db  $86,$04,$82,0   ; "
994
0215 : 87058301              rROLc   db  $87,$05,$83,1   ;expected result ROL +carry
995
0219 :                       rLSR                        ;expected result LSR & ROR -carry
996
0219 : 61412000              rROR    db  $61,$41,$20,0   ; "
997
021d : e1c1a080              rRORc   db  $e1,$c1,$a0,$80 ;expected result ROR +carry
998
0221 :                       fASL                        ;expected flags for shifts
999
0221 : 81018002              fROL    db  fnc,fc,fn,fz    ;no carry in
1000
0225 : 81018000              fROLc   db  fnc,fc,fn,0     ;carry in
1001
0229 :                       fLSR
1002
0229 : 01000102              fROR    db  fc,0,fc,fz      ;no carry in
1003
022d : 81808180              fRORc   db  fnc,fn,fnc,fn   ;carry in
1004
                             ;increments (decrements)
1005
0231 : 7f80ff0001            rINC    db  $7f,$80,$ff,0,1 ;expected result for INC/DEC
1006
0236 : 0080800200            fINC    db  0,fn,fn,fz,0    ;expected flags for INC/DEC
1007
                             ;logical memory operand
1008
023b : 001f7180              absOR   db  0,$1f,$71,$80   ;test pattern for OR
1009
023f : 0fff7f80              absAN   db  $0f,$ff,$7f,$80 ;test pattern for AND
1010
0243 : ff0f8f8f              absEO   db  $ff,$0f,$8f,$8f ;test pattern for EOR
1011
                             ;logical accu operand
1012
0247 : 00f11f00              absORa  db  0,$f1,$1f,0     ;test pattern for OR
1013
024b : f0ffffff              absANa  db  $f0,$ff,$ff,$ff ;test pattern for AND
1014
024f : fff0f00f              absEOa  db  $ff,$f0,$f0,$0f ;test pattern for EOR
1015
                             ;logical results
1016
0253 : 00ff7f80              absrlo  db  0,$ff,$7f,$80
1017
0257 : 02800080              absflo  db  fz,fn,0,fn
1018
025b :                       data_bss_end
1019
 
1020
 
1021
                                     code
1022
0400 =                               org code_segment
1023
0400 : d8               [ 2] start   cld
1024
0401 : a900             [ 2]         lda #0          ;*** test 0 = initialize
1025
0403 : 8d0002           [ 4]         sta test_case
1026
0000 =                       test_num = 0
1027
 
1028
                             ;stop interrupts before initializing BSS
1029
                                 if I_flag = 1
1030
                                     sei
1031
                                 endif
1032
 
1033
                             ;initialize BSS segment
1034
                                 if load_data_direct != 1
1035
                                     ldx #zp_end-zp_init-1
1036
                             ld_zp   lda zp_init,x
1037
                                     sta zp_bss,x
1038
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   19
1039
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1040
 
1041
                                     dex
1042
                                     bpl ld_zp
1043
                                     ldx #data_end-data_init-1
1044
                             ld_data lda data_init,x
1045
                                     sta data_bss,x
1046
                                     dex
1047
                                     bpl ld_data
1048
                                   if ROM_vectors = 1
1049
                                     ldx #5
1050
                             ld_vect lda vec_init,x
1051
                                     sta vec_bss,x
1052
                                     dex
1053
                                     bpl ld_vect
1054
                                   endif
1055
                                 endif
1056
 
1057
                             ;retain status of interrupt flag
1058
                                 if I_flag = 2
1059
                                     php
1060
                                     pla
1061
                                     and #4          ;isolate flag
1062
                                     sta flag_I_on   ;or mask
1063
                                     eor #lo(~4)     ;reverse
1064
                                     sta flag_I_off  ;and mask
1065
                                 endif
1066
 
1067
                             ;generate checksum for RAM integrity test
1068
                                 if ram_top > -1
1069
                                     lda #0
1070
                                     sta zpt         ;set low byte of indirect pointer
1071
                                     sta ram_chksm+1 ;checksum high byte
1072
                                     sta range_adr   ;reset self modifying code
1073
                                     sta tandi1
1074
                                     sta tandi2
1075
                                     sta teori1
1076
                                     sta teori2
1077
                                     sta torai1
1078
                                     sta torai2
1079
                                     sta chkdadi
1080
                                     sta chkdsbi
1081
                                     sta chkadi
1082
                                     sta chksbi
1083
                                     clc
1084
                                     ldx #zp_bss-zero_page ;zeropage - write test area
1085
                             gcs3    adc zero_page,x
1086
                                     bcc gcs2
1087
                                     inc ram_chksm+1 ;carry to high byte
1088
                                     clc
1089
                             gcs2    inx
1090
                                     bne gcs3
1091
                                     ldx #hi(data_segment) ;set high byte of indirect pointer
1092
                                     stx zpt+1
1093
                                     ldy #lo(data_bss) ;data after write test area
1094
                             gcs5    adc (zpt),y
1095
                                     bcc gcs4
1096
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   20
1097
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1098
 
1099
                                     inc ram_chksm+1 ;carry to high byte
1100
                                     clc
1101
                             gcs4    iny
1102
                                     bne gcs5
1103
                                     inx             ;advance RAM high address
1104
                                     stx zpt+1
1105
                                     cpx #ram_top
1106
                                     bne gcs5
1107
                                     sta ram_chksm   ;checksum complete
1108
                                 endif
1109
 
1110
                                 if skip_part_1 = 1
1111
                                     jmp  bin_test
1112
                                 endif
1113
 
1114
                                     next_test
1115
0406 : ad0002           [ 4]>            lda test_case   ;previous test
1116
0409 : c900             [ 2]>            cmp #test_num
1117
                            >            trap_ne         ;test is out of sequence
1118
040b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1119
                            >
1120
0001 =                      >test_num = test_num + 1
1121
040d : a901             [ 2]>            lda #test_num   ;*** this tests' number
1122
040f : 8d0002           [ 4]>            sta test_case
1123
                            >            ;check_ram       ;uncomment to find altered RAM after each test
1124
 
1125
 
1126
                             ;testing relative addressing with BEQ
1127
0412 : a0fe             [ 2]         ldy #$fe        ;testing maximum range, not -1/-2 (invalid/self adr)
1128
0414 :                       range_loop
1129
0414 : 88               [ 2]         dey             ;next relative address
1130
0415 : 98               [ 2]         tya
1131
0416 : aa               [ 2]         tax             ;precharge count to end of loop
1132
0417 : 1003             [ 3]         bpl range_fw    ;calculate relative address
1133
0419 : 18               [ 2]         clc             ;avoid branch self or to relative address of branch
1134
041a : 6902             [ 2]         adc #2
1135
041c :                       range_fw
1136
041c : 497f             [ 2]         eor #$7f        ;complement except sign
1137
041e : 8da504           [ 4]         sta range_adr   ;load into test target
1138
0421 : a900             [ 2]         lda #0          ;should set zero flag in status register
1139
0423 : 4ca404           [ 3]         jmp range_op
1140
 
1141
                                     ;relative address target field with branch under test in the middle
1142
0426 : ca               [ 2]         dex             ;-128 - max backward
1143
0427 : ca               [ 2]         dex
1144
0428 : ca               [ 2]         dex
1145
0429 : ca               [ 2]         dex
1146
042a : ca               [ 2]         dex
1147
042b : ca               [ 2]         dex
1148
042c : ca               [ 2]         dex
1149
042d : ca               [ 2]         dex
1150
042e : ca               [ 2]         dex             ;-120
1151
042f : ca               [ 2]         dex
1152
0430 : ca               [ 2]         dex
1153
0431 : ca               [ 2]         dex
1154
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   21
1155
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1156
 
1157
0432 : ca               [ 2]         dex
1158
0433 : ca               [ 2]         dex
1159
0434 : ca               [ 2]         dex
1160
0435 : ca               [ 2]         dex
1161
0436 : ca               [ 2]         dex
1162
0437 : ca               [ 2]         dex
1163
0438 : ca               [ 2]         dex             ;-110
1164
0439 : ca               [ 2]         dex
1165
043a : ca               [ 2]         dex
1166
043b : ca               [ 2]         dex
1167
043c : ca               [ 2]         dex
1168
043d : ca               [ 2]         dex
1169
043e : ca               [ 2]         dex
1170
043f : ca               [ 2]         dex
1171
0440 : ca               [ 2]         dex
1172
0441 : ca               [ 2]         dex
1173
0442 : ca               [ 2]         dex             ;-100
1174
0443 : ca               [ 2]         dex
1175
0444 : ca               [ 2]         dex
1176
0445 : ca               [ 2]         dex
1177
0446 : ca               [ 2]         dex
1178
0447 : ca               [ 2]         dex
1179
0448 : ca               [ 2]         dex
1180
0449 : ca               [ 2]         dex
1181
044a : ca               [ 2]         dex
1182
044b : ca               [ 2]         dex
1183
044c : ca               [ 2]         dex             ;-90
1184
044d : ca               [ 2]         dex
1185
044e : ca               [ 2]         dex
1186
044f : ca               [ 2]         dex
1187
0450 : ca               [ 2]         dex
1188
0451 : ca               [ 2]         dex
1189
0452 : ca               [ 2]         dex
1190
0453 : ca               [ 2]         dex
1191
0454 : ca               [ 2]         dex
1192
0455 : ca               [ 2]         dex
1193
0456 : ca               [ 2]         dex             ;-80
1194
0457 : ca               [ 2]         dex
1195
0458 : ca               [ 2]         dex
1196
0459 : ca               [ 2]         dex
1197
045a : ca               [ 2]         dex
1198
045b : ca               [ 2]         dex
1199
045c : ca               [ 2]         dex
1200
045d : ca               [ 2]         dex
1201
045e : ca               [ 2]         dex
1202
045f : ca               [ 2]         dex
1203
0460 : ca               [ 2]         dex             ;-70
1204
0461 : ca               [ 2]         dex
1205
0462 : ca               [ 2]         dex
1206
0463 : ca               [ 2]         dex
1207
0464 : ca               [ 2]         dex
1208
0465 : ca               [ 2]         dex
1209
0466 : ca               [ 2]         dex
1210
0467 : ca               [ 2]         dex
1211
0468 : ca               [ 2]         dex
1212
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   22
1213
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1214
 
1215
0469 : ca               [ 2]         dex
1216
046a : ca               [ 2]         dex             ;-60
1217
046b : ca               [ 2]         dex
1218
046c : ca               [ 2]         dex
1219
046d : ca               [ 2]         dex
1220
046e : ca               [ 2]         dex
1221
046f : ca               [ 2]         dex
1222
0470 : ca               [ 2]         dex
1223
0471 : ca               [ 2]         dex
1224
0472 : ca               [ 2]         dex
1225
0473 : ca               [ 2]         dex
1226
0474 : ca               [ 2]         dex             ;-50
1227
0475 : ca               [ 2]         dex
1228
0476 : ca               [ 2]         dex
1229
0477 : ca               [ 2]         dex
1230
0478 : ca               [ 2]         dex
1231
0479 : ca               [ 2]         dex
1232
047a : ca               [ 2]         dex
1233
047b : ca               [ 2]         dex
1234
047c : ca               [ 2]         dex
1235
047d : ca               [ 2]         dex
1236
047e : ca               [ 2]         dex             ;-40
1237
047f : ca               [ 2]         dex
1238
0480 : ca               [ 2]         dex
1239
0481 : ca               [ 2]         dex
1240
0482 : ca               [ 2]         dex
1241
0483 : ca               [ 2]         dex
1242
0484 : ca               [ 2]         dex
1243
0485 : ca               [ 2]         dex
1244
0486 : ca               [ 2]         dex
1245
0487 : ca               [ 2]         dex
1246
0488 : ca               [ 2]         dex             ;-30
1247
0489 : ca               [ 2]         dex
1248
048a : ca               [ 2]         dex
1249
048b : ca               [ 2]         dex
1250
048c : ca               [ 2]         dex
1251
048d : ca               [ 2]         dex
1252
048e : ca               [ 2]         dex
1253
048f : ca               [ 2]         dex
1254
0490 : ca               [ 2]         dex
1255
0491 : ca               [ 2]         dex
1256
0492 : ca               [ 2]         dex             ;-20
1257
0493 : ca               [ 2]         dex
1258
0494 : ca               [ 2]         dex
1259
0495 : ca               [ 2]         dex
1260
0496 : ca               [ 2]         dex
1261
0497 : ca               [ 2]         dex
1262
0498 : ca               [ 2]         dex
1263
0499 : ca               [ 2]         dex
1264
049a : ca               [ 2]         dex
1265
049b : ca               [ 2]         dex
1266
049c : ca               [ 2]         dex             ;-10
1267
049d : ca               [ 2]         dex
1268
049e : ca               [ 2]         dex
1269
049f : ca               [ 2]         dex
1270
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   23
1271
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1272
 
1273
04a0 : ca               [ 2]         dex
1274
04a1 : ca               [ 2]         dex
1275
04a2 : ca               [ 2]         dex
1276
04a3 : ca               [ 2]         dex             ;-3
1277
04a4 :                       range_op                ;test target with zero flag=0, z=1 if previous dex
1278
04a5 =                       range_adr   = *+1       ;modifiable relative address
1279
04a4 : f03e             [ 3]         beq *+64        ;if called without modification
1280
04a6 : ca               [ 2]         dex             ;+0
1281
04a7 : ca               [ 2]         dex
1282
04a8 : ca               [ 2]         dex
1283
04a9 : ca               [ 2]         dex
1284
04aa : ca               [ 2]         dex
1285
04ab : ca               [ 2]         dex
1286
04ac : ca               [ 2]         dex
1287
04ad : ca               [ 2]         dex
1288
04ae : ca               [ 2]         dex
1289
04af : ca               [ 2]         dex
1290
04b0 : ca               [ 2]         dex             ;+10
1291
04b1 : ca               [ 2]         dex
1292
04b2 : ca               [ 2]         dex
1293
04b3 : ca               [ 2]         dex
1294
04b4 : ca               [ 2]         dex
1295
04b5 : ca               [ 2]         dex
1296
04b6 : ca               [ 2]         dex
1297
04b7 : ca               [ 2]         dex
1298
04b8 : ca               [ 2]         dex
1299
04b9 : ca               [ 2]         dex
1300
04ba : ca               [ 2]         dex             ;+20
1301
04bb : ca               [ 2]         dex
1302
04bc : ca               [ 2]         dex
1303
04bd : ca               [ 2]         dex
1304
04be : ca               [ 2]         dex
1305
04bf : ca               [ 2]         dex
1306
04c0 : ca               [ 2]         dex
1307
04c1 : ca               [ 2]         dex
1308
04c2 : ca               [ 2]         dex
1309
04c3 : ca               [ 2]         dex
1310
04c4 : ca               [ 2]         dex             ;+30
1311
04c5 : ca               [ 2]         dex
1312
04c6 : ca               [ 2]         dex
1313
04c7 : ca               [ 2]         dex
1314
04c8 : ca               [ 2]         dex
1315
04c9 : ca               [ 2]         dex
1316
04ca : ca               [ 2]         dex
1317
04cb : ca               [ 2]         dex
1318
04cc : ca               [ 2]         dex
1319
04cd : ca               [ 2]         dex
1320
04ce : ca               [ 2]         dex             ;+40
1321
04cf : ca               [ 2]         dex
1322
04d0 : ca               [ 2]         dex
1323
04d1 : ca               [ 2]         dex
1324
04d2 : ca               [ 2]         dex
1325
04d3 : ca               [ 2]         dex
1326
04d4 : ca               [ 2]         dex
1327
04d5 : ca               [ 2]         dex
1328
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   24
1329
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1330
 
1331
04d6 : ca               [ 2]         dex
1332
04d7 : ca               [ 2]         dex
1333
04d8 : ca               [ 2]         dex             ;+50
1334
04d9 : ca               [ 2]         dex
1335
04da : ca               [ 2]         dex
1336
04db : ca               [ 2]         dex
1337
04dc : ca               [ 2]         dex
1338
04dd : ca               [ 2]         dex
1339
04de : ca               [ 2]         dex
1340
04df : ca               [ 2]         dex
1341
04e0 : ca               [ 2]         dex
1342
04e1 : ca               [ 2]         dex
1343
04e2 : ca               [ 2]         dex             ;+60
1344
04e3 : ca               [ 2]         dex
1345
04e4 : ca               [ 2]         dex
1346
04e5 : ca               [ 2]         dex
1347
04e6 : ca               [ 2]         dex
1348
04e7 : ca               [ 2]         dex
1349
04e8 : ca               [ 2]         dex
1350
04e9 : ca               [ 2]         dex
1351
04ea : ca               [ 2]         dex
1352
04eb : ca               [ 2]         dex
1353
04ec : ca               [ 2]         dex             ;+70
1354
04ed : ca               [ 2]         dex
1355
04ee : ca               [ 2]         dex
1356
04ef : ca               [ 2]         dex
1357
04f0 : ca               [ 2]         dex
1358
04f1 : ca               [ 2]         dex
1359
04f2 : ca               [ 2]         dex
1360
04f3 : ca               [ 2]         dex
1361
04f4 : ca               [ 2]         dex
1362
04f5 : ca               [ 2]         dex
1363
04f6 : ca               [ 2]         dex             ;+80
1364
04f7 : ca               [ 2]         dex
1365
04f8 : ca               [ 2]         dex
1366
04f9 : ca               [ 2]         dex
1367
04fa : ca               [ 2]         dex
1368
04fb : ca               [ 2]         dex
1369
04fc : ca               [ 2]         dex
1370
04fd : ca               [ 2]         dex
1371
04fe : ca               [ 2]         dex
1372
04ff : ca               [ 2]         dex
1373
0500 : ca               [ 2]         dex             ;+90
1374
0501 : ca               [ 2]         dex
1375
0502 : ca               [ 2]         dex
1376
0503 : ca               [ 2]         dex
1377
0504 : ca               [ 2]         dex
1378
0505 : ca               [ 2]         dex
1379
0506 : ca               [ 2]         dex
1380
0507 : ca               [ 2]         dex
1381
0508 : ca               [ 2]         dex
1382
0509 : ca               [ 2]         dex
1383
050a : ca               [ 2]         dex             ;+100
1384
050b : ca               [ 2]         dex
1385
050c : ca               [ 2]         dex
1386
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   25
1387
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1388
 
1389
050d : ca               [ 2]         dex
1390
050e : ca               [ 2]         dex
1391
050f : ca               [ 2]         dex
1392
0510 : ca               [ 2]         dex
1393
0511 : ca               [ 2]         dex
1394
0512 : ca               [ 2]         dex
1395
0513 : ca               [ 2]         dex
1396
0514 : ca               [ 2]         dex             ;+110
1397
0515 : ca               [ 2]         dex
1398
0516 : ca               [ 2]         dex
1399
0517 : ca               [ 2]         dex
1400
0518 : ca               [ 2]         dex
1401
0519 : ca               [ 2]         dex
1402
051a : ca               [ 2]         dex
1403
051b : ca               [ 2]         dex
1404
051c : ca               [ 2]         dex
1405
051d : ca               [ 2]         dex
1406
051e : ca               [ 2]         dex             ;+120
1407
051f : ca               [ 2]         dex
1408
0520 : ca               [ 2]         dex
1409
0521 : ca               [ 2]         dex
1410
0522 : ca               [ 2]         dex
1411
0523 : ca               [ 2]         dex
1412
0524 : ca               [ 2]         dex
1413
0525 : f003             [ 3]         beq range_ok    ;+127 - max forward
1414
                                     trap            ; bad range
1415
0527 : 4c2705           [ 3]>        jmp *           ;failed anyway
1416
 
1417
052a :                       range_ok
1418
052a : c000             [ 2]         cpy #0
1419
052c : f003             [ 3]         beq range_end
1420
052e : 4c1404           [ 3]         jmp range_loop
1421
0531 :                       range_end               ;range test successful
1422
                                     next_test
1423
0531 : ad0002           [ 4]>            lda test_case   ;previous test
1424
0534 : c901             [ 2]>            cmp #test_num
1425
                            >            trap_ne         ;test is out of sequence
1426
0536 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1427
                            >
1428
0002 =                      >test_num = test_num + 1
1429
0538 : a902             [ 2]>            lda #test_num   ;*** this tests' number
1430
053a : 8d0002           [ 4]>            sta test_case
1431
                            >            ;check_ram       ;uncomment to find altered RAM after each test
1432
 
1433
 
1434
                             ;partial test BNE & CMP, CPX, CPY immediate
1435
053d : c001             [ 2]         cpy #1          ;testing BNE true
1436
053f : d003             [ 3]         bne test_bne
1437
                                     trap
1438
0541 : 4c4105           [ 3]>        jmp *           ;failed anyway
1439
 
1440
0544 :                       test_bne
1441
0544 : a900             [ 2]         lda #0
1442
0546 : c900             [ 2]         cmp #0          ;test compare immediate
1443
                                     trap_ne
1444
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   26
1445
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1446
 
1447
0548 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1448
 
1449
                                     trap_cc
1450
054a : 90fe             [ 3]>        bcc *           ;failed carry clear
1451
 
1452
                                     trap_mi
1453
054c : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
1454
 
1455
054e : c901             [ 2]         cmp #1
1456
                                     trap_eq
1457
0550 : f0fe             [ 3]>        beq *           ;failed equal (zero)
1458
 
1459
                                     trap_cs
1460
0552 : b0fe             [ 3]>        bcs *           ;failed carry set
1461
 
1462
                                     trap_pl
1463
0554 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
1464
 
1465
0556 : aa               [ 2]         tax
1466
0557 : e000             [ 2]         cpx #0          ;test compare x immediate
1467
                                     trap_ne
1468
0559 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1469
 
1470
                                     trap_cc
1471
055b : 90fe             [ 3]>        bcc *           ;failed carry clear
1472
 
1473
                                     trap_mi
1474
055d : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
1475
 
1476
055f : e001             [ 2]         cpx #1
1477
                                     trap_eq
1478
0561 : f0fe             [ 3]>        beq *           ;failed equal (zero)
1479
 
1480
                                     trap_cs
1481
0563 : b0fe             [ 3]>        bcs *           ;failed carry set
1482
 
1483
                                     trap_pl
1484
0565 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
1485
 
1486
0567 : a8               [ 2]         tay
1487
0568 : c000             [ 2]         cpy #0          ;test compare y immediate
1488
                                     trap_ne
1489
056a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1490
 
1491
                                     trap_cc
1492
056c : 90fe             [ 3]>        bcc *           ;failed carry clear
1493
 
1494
                                     trap_mi
1495
056e : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
1496
 
1497
0570 : c001             [ 2]         cpy #1
1498
                                     trap_eq
1499
0572 : f0fe             [ 3]>        beq *           ;failed equal (zero)
1500
 
1501
                                     trap_cs
1502
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   27
1503
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1504
 
1505
0574 : b0fe             [ 3]>        bcs *           ;failed carry set
1506
 
1507
                                     trap_pl
1508
0576 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
1509
 
1510
                                     next_test
1511
0578 : ad0002           [ 4]>            lda test_case   ;previous test
1512
057b : c902             [ 2]>            cmp #test_num
1513
                            >            trap_ne         ;test is out of sequence
1514
057d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1515
                            >
1516
0003 =                      >test_num = test_num + 1
1517
057f : a903             [ 2]>            lda #test_num   ;*** this tests' number
1518
0581 : 8d0002           [ 4]>            sta test_case
1519
                            >            ;check_ram       ;uncomment to find altered RAM after each test
1520
 
1521
                             ;testing stack operations PHA PHP PLA PLP
1522
 
1523
0584 : a2ff             [ 2]         ldx #$ff        ;initialize stack
1524
0586 : 9a               [ 2]         txs
1525
0587 : a955             [ 2]         lda #$55
1526
0589 : 48               [ 3]         pha
1527
058a : a9aa             [ 2]         lda #$aa
1528
058c : 48               [ 3]         pha
1529
058d : cdfe01           [ 4]         cmp $1fe        ;on stack ?
1530
                                     trap_ne
1531
0590 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1532
 
1533
0592 : ba               [ 2]         tsx
1534
0593 : 8a               [ 2]         txa             ;overwrite accu
1535
0594 : c9fd             [ 2]         cmp #$fd        ;sp decremented?
1536
                                     trap_ne
1537
0596 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1538
 
1539
0598 : 68               [ 4]         pla
1540
0599 : c9aa             [ 2]         cmp #$aa        ;successful retreived from stack?
1541
                                     trap_ne
1542
059b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1543
 
1544
059d : 68               [ 4]         pla
1545
059e : c955             [ 2]         cmp #$55
1546
                                     trap_ne
1547
05a0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1548
 
1549
05a2 : cdff01           [ 4]         cmp $1ff        ;remains on stack?
1550
                                     trap_ne
1551
05a5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1552
 
1553
05a7 : ba               [ 2]         tsx
1554
05a8 : e0ff             [ 2]         cpx #$ff        ;sp incremented?
1555
                                     trap_ne
1556
05aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1557
 
1558
                                     next_test
1559
05ac : ad0002           [ 4]>            lda test_case   ;previous test
1560
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   28
1561
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1562
 
1563
05af : c903             [ 2]>            cmp #test_num
1564
                            >            trap_ne         ;test is out of sequence
1565
05b1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1566
                            >
1567
0004 =                      >test_num = test_num + 1
1568
05b3 : a904             [ 2]>            lda #test_num   ;*** this tests' number
1569
05b5 : 8d0002           [ 4]>            sta test_case
1570
                            >            ;check_ram       ;uncomment to find altered RAM after each test
1571
 
1572
 
1573
                             ;testing branch decisions BPL BMI BVC BVS BCC BCS BNE BEQ
1574
                                     set_stat $ff    ;all on
1575
                            >            load_flag $ff
1576
05b8 : a9ff             [ 2]>            lda #$ff                 ;allow test to change I-flag (no mask)
1577
                            >
1578
05ba : 48               [ 3]>            pha         ;use stack to load status
1579
05bb : 28               [ 4]>            plp
1580
 
1581
05bc : 101a             [ 3]         bpl nbr1        ;branches should not be taken
1582
05be : 501b             [ 3]         bvc nbr2
1583
05c0 : 901c             [ 3]         bcc nbr3
1584
05c2 : d01d             [ 3]         bne nbr4
1585
05c4 : 3003             [ 3]         bmi br1         ;branches should be taken
1586
                                     trap
1587
05c6 : 4cc605           [ 3]>        jmp *           ;failed anyway
1588
 
1589
05c9 : 7003             [ 3] br1     bvs br2
1590
                                     trap
1591
05cb : 4ccb05           [ 3]>        jmp *           ;failed anyway
1592
 
1593
05ce : b003             [ 3] br2     bcs br3
1594
                                     trap
1595
05d0 : 4cd005           [ 3]>        jmp *           ;failed anyway
1596
 
1597
05d3 : f00f             [ 3] br3     beq br4
1598
                                     trap
1599
05d5 : 4cd505           [ 3]>        jmp *           ;failed anyway
1600
 
1601
05d8 :                       nbr1
1602
                                     trap            ;previous bpl taken
1603
05d8 : 4cd805           [ 3]>        jmp *           ;failed anyway
1604
 
1605
05db :                       nbr2
1606
                                     trap            ;previous bvc taken
1607
05db : 4cdb05           [ 3]>        jmp *           ;failed anyway
1608
 
1609
05de :                       nbr3
1610
                                     trap            ;previous bcc taken
1611
05de : 4cde05           [ 3]>        jmp *           ;failed anyway
1612
 
1613
05e1 :                       nbr4
1614
                                     trap            ;previous bne taken
1615
05e1 : 4ce105           [ 3]>        jmp *           ;failed anyway
1616
 
1617
05e4 : 08               [ 3] br4     php
1618
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   29
1619
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1620
 
1621
05e5 : ba               [ 2]         tsx
1622
05e6 : e0fe             [ 2]         cpx #$fe        ;sp after php?
1623
                                     trap_ne
1624
05e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1625
 
1626
05ea : 68               [ 4]         pla
1627
                                     cmp_flag $ff    ;returned all flags on?
1628
05eb : c9ff             [ 2]>            cmp #($ff    |fao)&m8    ;expected flags + always on bits
1629
 
1630
                                     trap_ne
1631
05ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1632
 
1633
05ef : ba               [ 2]         tsx
1634
05f0 : e0ff             [ 2]         cpx #$ff        ;sp after php?
1635
                                     trap_ne
1636
05f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1637
 
1638
                                     set_stat 0      ;all off
1639
                            >            load_flag 0
1640
05f4 : a900             [ 2]>            lda #0                   ;allow test to change I-flag (no mask)
1641
                            >
1642
05f6 : 48               [ 3]>            pha         ;use stack to load status
1643
05f7 : 28               [ 4]>            plp
1644
 
1645
05f8 : 3022             [ 4]         bmi nbr11       ;branches should not be taken
1646
05fa : 7023             [ 4]         bvs nbr12
1647
05fc : b024             [ 4]         bcs nbr13
1648
05fe : f025             [ 4]         beq nbr14
1649
                                     trap_mi
1650
0600 : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
1651
 
1652
                                     trap_vs
1653
0602 : 70fe             [ 3]>        bvs *           ;failed overflow set
1654
 
1655
                                     trap_cs
1656
0604 : b0fe             [ 3]>        bcs *           ;failed carry set
1657
 
1658
                                     trap_eq
1659
0606 : f0fe             [ 3]>        beq *           ;failed equal (zero)
1660
 
1661
0608 : 1003             [ 3]         bpl br11        ;branches should be taken
1662
                                     trap
1663
060a : 4c0a06           [ 3]>        jmp *           ;failed anyway
1664
 
1665
060d : 5003             [ 3] br11    bvc br12
1666
                                     trap
1667
060f : 4c0f06           [ 3]>        jmp *           ;failed anyway
1668
 
1669
0612 : 9003             [ 3] br12    bcc br13
1670
                                     trap
1671
0614 : 4c1406           [ 3]>        jmp *           ;failed anyway
1672
 
1673
0617 : d00f             [ 3] br13    bne br14
1674
                                     trap
1675
0619 : 4c1906           [ 3]>        jmp *           ;failed anyway
1676
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   30
1677
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1678
 
1679
 
1680
061c :                       nbr11
1681
                                     trap            ;previous bmi taken
1682
061c : 4c1c06           [ 3]>        jmp *           ;failed anyway
1683
 
1684
061f :                       nbr12
1685
                                     trap            ;previous bvs taken
1686
061f : 4c1f06           [ 3]>        jmp *           ;failed anyway
1687
 
1688
0622 :                       nbr13
1689
                                     trap            ;previous bcs taken
1690
0622 : 4c2206           [ 3]>        jmp *           ;failed anyway
1691
 
1692
0625 :                       nbr14
1693
                                     trap            ;previous beq taken
1694
0625 : 4c2506           [ 3]>        jmp *           ;failed anyway
1695
 
1696
0628 : 08               [ 3] br14    php
1697
0629 : 68               [ 4]         pla
1698
                                     cmp_flag 0      ;flags off except break (pushed by sw) + reserved?
1699
062a : c930             [ 2]>            cmp #(0      |fao)&m8    ;expected flags + always on bits
1700
 
1701
                                     trap_ne
1702
062c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1703
 
1704
                                     ;crosscheck flags
1705
                                     set_stat carry
1706
                            >            load_flag carry
1707
062e : a901             [ 2]>            lda #carry             ;allow test to change I-flag (no mask)
1708
                            >
1709
0630 : 48               [ 3]>            pha         ;use stack to load status
1710
0631 : 28               [ 4]>            plp
1711
 
1712
                                     trap_cc
1713
0632 : 90fe             [ 3]>        bcc *           ;failed carry clear
1714
 
1715
                                     set_stat zero
1716
                            >            load_flag zero
1717
0634 : a902             [ 2]>            lda #zero             ;allow test to change I-flag (no mask)
1718
                            >
1719
0636 : 48               [ 3]>            pha         ;use stack to load status
1720
0637 : 28               [ 4]>            plp
1721
 
1722
                                     trap_ne
1723
0638 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1724
 
1725
                                     set_stat overfl
1726
                            >            load_flag overfl
1727
063a : a940             [ 2]>            lda #overfl             ;allow test to change I-flag (no mask)
1728
                            >
1729
063c : 48               [ 3]>            pha         ;use stack to load status
1730
063d : 28               [ 4]>            plp
1731
 
1732
                                     trap_vc
1733
063e : 50fe             [ 3]>        bvc *           ;failed overflow clear
1734
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   31
1735
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1736
 
1737
 
1738
                                     set_stat minus
1739
                            >            load_flag minus
1740
0640 : a980             [ 2]>            lda #minus             ;allow test to change I-flag (no mask)
1741
                            >
1742
0642 : 48               [ 3]>            pha         ;use stack to load status
1743
0643 : 28               [ 4]>            plp
1744
 
1745
                                     trap_pl
1746
0644 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
1747
 
1748
                                     set_stat $ff-carry
1749
                            >            load_flag $ff-carry
1750
0646 : a9fe             [ 2]>            lda #$ff-carry             ;allow test to change I-flag (no mask)
1751
                            >
1752
0648 : 48               [ 3]>            pha         ;use stack to load status
1753
0649 : 28               [ 4]>            plp
1754
 
1755
                                     trap_cs
1756
064a : b0fe             [ 3]>        bcs *           ;failed carry set
1757
 
1758
                                     set_stat $ff-zero
1759
                            >            load_flag $ff-zero
1760
064c : a9fd             [ 2]>            lda #$ff-zero             ;allow test to change I-flag (no mask)
1761
                            >
1762
064e : 48               [ 3]>            pha         ;use stack to load status
1763
064f : 28               [ 4]>            plp
1764
 
1765
                                     trap_eq
1766
0650 : f0fe             [ 3]>        beq *           ;failed equal (zero)
1767
 
1768
                                     set_stat $ff-overfl
1769
                            >            load_flag $ff-overfl
1770
0652 : a9bf             [ 2]>            lda #$ff-overfl             ;allow test to change I-flag (no mask)
1771
                            >
1772
0654 : 48               [ 3]>            pha         ;use stack to load status
1773
0655 : 28               [ 4]>            plp
1774
 
1775
                                     trap_vs
1776
0656 : 70fe             [ 3]>        bvs *           ;failed overflow set
1777
 
1778
                                     set_stat $ff-minus
1779
                            >            load_flag $ff-minus
1780
0658 : a97f             [ 2]>            lda #$ff-minus             ;allow test to change I-flag (no mask)
1781
                            >
1782
065a : 48               [ 3]>            pha         ;use stack to load status
1783
065b : 28               [ 4]>            plp
1784
 
1785
                                     trap_mi
1786
065c : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
1787
 
1788
                                     next_test
1789
065e : ad0002           [ 4]>            lda test_case   ;previous test
1790
0661 : c904             [ 2]>            cmp #test_num
1791
                            >            trap_ne         ;test is out of sequence
1792
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   32
1793
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1794
 
1795
0663 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1796
                            >
1797
0005 =                      >test_num = test_num + 1
1798
0665 : a905             [ 2]>            lda #test_num   ;*** this tests' number
1799
0667 : 8d0002           [ 4]>            sta test_case
1800
                            >            ;check_ram       ;uncomment to find altered RAM after each test
1801
 
1802
 
1803
                             ; test PHA does not alter flags or accumulator but PLA does
1804
066a : a255             [ 2]         ldx #$55        ;x & y protected
1805
066c : a0aa             [ 2]         ldy #$aa
1806
                                     set_a 1,$ff     ;push
1807
                            >            load_flag $ff
1808
066e : a9ff             [ 2]>            lda #$ff                  ;allow test to change I-flag (no mask)
1809
                            >
1810
0670 : 48               [ 3]>            pha         ;use stack to load status
1811
0671 : a901             [ 2]>            lda #1     ;precharge accu
1812
0673 : 28               [ 4]>            plp
1813
 
1814
0674 : 48               [ 3]         pha
1815
                                     tst_a 1,$ff
1816
0675 : 08               [ 3]>            php         ;save flags
1817
0676 : 08               [ 3]>            php
1818
0677 : c901             [ 2]>            cmp #1     ;test result
1819
                            >            trap_ne
1820
0679 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1821
                            >
1822
067b : 68               [ 4]>            pla         ;load status
1823
                            >            cmp_flag $ff
1824
067c : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
1825
                            >
1826
                            >            trap_ne
1827
067e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1828
                            >
1829
0680 : 28               [ 4]>            plp         ;restore status
1830
 
1831
                                     set_a 0,0
1832
                            >            load_flag 0
1833
0681 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
1834
                            >
1835
0683 : 48               [ 3]>            pha         ;use stack to load status
1836
0684 : a900             [ 2]>            lda #0     ;precharge accu
1837
0686 : 28               [ 4]>            plp
1838
 
1839
0687 : 48               [ 3]         pha
1840
                                     tst_a 0,0
1841
0688 : 08               [ 3]>            php         ;save flags
1842
0689 : 08               [ 3]>            php
1843
068a : c900             [ 2]>            cmp #0     ;test result
1844
                            >            trap_ne
1845
068c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1846
                            >
1847
068e : 68               [ 4]>            pla         ;load status
1848
                            >            cmp_flag 0
1849
068f : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
1850
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   33
1851
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1852
 
1853
                            >
1854
                            >            trap_ne
1855
0691 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1856
                            >
1857
0693 : 28               [ 4]>            plp         ;restore status
1858
 
1859
                                     set_a $ff,$ff
1860
                            >            load_flag $ff
1861
0694 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
1862
                            >
1863
0696 : 48               [ 3]>            pha         ;use stack to load status
1864
0697 : a9ff             [ 2]>            lda #$ff     ;precharge accu
1865
0699 : 28               [ 4]>            plp
1866
 
1867
069a : 48               [ 3]         pha
1868
                                     tst_a $ff,$ff
1869
069b : 08               [ 3]>            php         ;save flags
1870
069c : 08               [ 3]>            php
1871
069d : c9ff             [ 2]>            cmp #$ff     ;test result
1872
                            >            trap_ne
1873
069f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1874
                            >
1875
06a1 : 68               [ 4]>            pla         ;load status
1876
                            >            cmp_flag $ff
1877
06a2 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
1878
                            >
1879
                            >            trap_ne
1880
06a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1881
                            >
1882
06a6 : 28               [ 4]>            plp         ;restore status
1883
 
1884
                                     set_a 1,0
1885
                            >            load_flag 0
1886
06a7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
1887
                            >
1888
06a9 : 48               [ 3]>            pha         ;use stack to load status
1889
06aa : a901             [ 2]>            lda #1     ;precharge accu
1890
06ac : 28               [ 4]>            plp
1891
 
1892
06ad : 48               [ 3]         pha
1893
                                     tst_a 1,0
1894
06ae : 08               [ 3]>            php         ;save flags
1895
06af : 08               [ 3]>            php
1896
06b0 : c901             [ 2]>            cmp #1     ;test result
1897
                            >            trap_ne
1898
06b2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1899
                            >
1900
06b4 : 68               [ 4]>            pla         ;load status
1901
                            >            cmp_flag 0
1902
06b5 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
1903
                            >
1904
                            >            trap_ne
1905
06b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1906
                            >
1907
06b9 : 28               [ 4]>            plp         ;restore status
1908
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   34
1909
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1910
 
1911
 
1912
                                     set_a 0,$ff
1913
                            >            load_flag $ff
1914
06ba : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
1915
                            >
1916
06bc : 48               [ 3]>            pha         ;use stack to load status
1917
06bd : a900             [ 2]>            lda #0     ;precharge accu
1918
06bf : 28               [ 4]>            plp
1919
 
1920
06c0 : 48               [ 3]         pha
1921
                                     tst_a 0,$ff
1922
06c1 : 08               [ 3]>            php         ;save flags
1923
06c2 : 08               [ 3]>            php
1924
06c3 : c900             [ 2]>            cmp #0     ;test result
1925
                            >            trap_ne
1926
06c5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1927
                            >
1928
06c7 : 68               [ 4]>            pla         ;load status
1929
                            >            cmp_flag $ff
1930
06c8 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
1931
                            >
1932
                            >            trap_ne
1933
06ca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1934
                            >
1935
06cc : 28               [ 4]>            plp         ;restore status
1936
 
1937
                                     set_a $ff,0
1938
                            >            load_flag 0
1939
06cd : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
1940
                            >
1941
06cf : 48               [ 3]>            pha         ;use stack to load status
1942
06d0 : a9ff             [ 2]>            lda #$ff     ;precharge accu
1943
06d2 : 28               [ 4]>            plp
1944
 
1945
06d3 : 48               [ 3]         pha
1946
                                     tst_a $ff,0
1947
06d4 : 08               [ 3]>            php         ;save flags
1948
06d5 : 08               [ 3]>            php
1949
06d6 : c9ff             [ 2]>            cmp #$ff     ;test result
1950
                            >            trap_ne
1951
06d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1952
                            >
1953
06da : 68               [ 4]>            pla         ;load status
1954
                            >            cmp_flag 0
1955
06db : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
1956
                            >
1957
                            >            trap_ne
1958
06dd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1959
                            >
1960
06df : 28               [ 4]>            plp         ;restore status
1961
 
1962
                                     set_a 0,$ff     ;pull
1963
                            >            load_flag $ff
1964
06e0 : a9ff             [ 2]>            lda #$ff                  ;allow test to change I-flag (no mask)
1965
                            >
1966
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   35
1967
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
1968
 
1969
06e2 : 48               [ 3]>            pha         ;use stack to load status
1970
06e3 : a900             [ 2]>            lda #0     ;precharge accu
1971
06e5 : 28               [ 4]>            plp
1972
 
1973
06e6 : 68               [ 4]         pla
1974
                                     tst_a $ff,$ff-zero
1975
06e7 : 08               [ 3]>            php         ;save flags
1976
06e8 : 08               [ 3]>            php
1977
06e9 : c9ff             [ 2]>            cmp #$ff     ;test result
1978
                            >            trap_ne
1979
06eb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1980
                            >
1981
06ed : 68               [ 4]>            pla         ;load status
1982
                            >            cmp_flag $ff-zero
1983
06ee : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
1984
                            >
1985
                            >            trap_ne
1986
06f0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
1987
                            >
1988
06f2 : 28               [ 4]>            plp         ;restore status
1989
 
1990
                                     set_a $ff,0
1991
                            >            load_flag 0
1992
06f3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
1993
                            >
1994
06f5 : 48               [ 3]>            pha         ;use stack to load status
1995
06f6 : a9ff             [ 2]>            lda #$ff     ;precharge accu
1996
06f8 : 28               [ 4]>            plp
1997
 
1998
06f9 : 68               [ 4]         pla
1999
                                     tst_a 0,zero
2000
06fa : 08               [ 3]>            php         ;save flags
2001
06fb : 08               [ 3]>            php
2002
06fc : c900             [ 2]>            cmp #0     ;test result
2003
                            >            trap_ne
2004
06fe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2005
                            >
2006
0700 : 68               [ 4]>            pla         ;load status
2007
                            >            cmp_flag zero
2008
0701 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
2009
                            >
2010
                            >            trap_ne
2011
0703 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2012
                            >
2013
0705 : 28               [ 4]>            plp         ;restore status
2014
 
2015
                                     set_a $fe,$ff
2016
                            >            load_flag $ff
2017
0706 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
2018
                            >
2019
0708 : 48               [ 3]>            pha         ;use stack to load status
2020
0709 : a9fe             [ 2]>            lda #$fe     ;precharge accu
2021
070b : 28               [ 4]>            plp
2022
 
2023
070c : 68               [ 4]         pla
2024
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   36
2025
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2026
 
2027
                                     tst_a 1,$ff-zero-minus
2028
070d : 08               [ 3]>            php         ;save flags
2029
070e : 08               [ 3]>            php
2030
070f : c901             [ 2]>            cmp #1     ;test result
2031
                            >            trap_ne
2032
0711 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2033
                            >
2034
0713 : 68               [ 4]>            pla         ;load status
2035
                            >            cmp_flag $ff-zero-minus
2036
0714 : c97d             [ 2]>            cmp #($ff-zero-minus|fao)&m8    ;expected flags + always on bits
2037
                            >
2038
                            >            trap_ne
2039
0716 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2040
                            >
2041
0718 : 28               [ 4]>            plp         ;restore status
2042
 
2043
                                     set_a 0,0
2044
                            >            load_flag 0
2045
0719 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2046
                            >
2047
071b : 48               [ 3]>            pha         ;use stack to load status
2048
071c : a900             [ 2]>            lda #0     ;precharge accu
2049
071e : 28               [ 4]>            plp
2050
 
2051
071f : 68               [ 4]         pla
2052
                                     tst_a $ff,minus
2053
0720 : 08               [ 3]>            php         ;save flags
2054
0721 : 08               [ 3]>            php
2055
0722 : c9ff             [ 2]>            cmp #$ff     ;test result
2056
                            >            trap_ne
2057
0724 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2058
                            >
2059
0726 : 68               [ 4]>            pla         ;load status
2060
                            >            cmp_flag minus
2061
0727 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
2062
                            >
2063
                            >            trap_ne
2064
0729 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2065
                            >
2066
072b : 28               [ 4]>            plp         ;restore status
2067
 
2068
                                     set_a $ff,$ff
2069
                            >            load_flag $ff
2070
072c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
2071
                            >
2072
072e : 48               [ 3]>            pha         ;use stack to load status
2073
072f : a9ff             [ 2]>            lda #$ff     ;precharge accu
2074
0731 : 28               [ 4]>            plp
2075
 
2076
0732 : 68               [ 4]         pla
2077
                                     tst_a 0,$ff-minus
2078
0733 : 08               [ 3]>            php         ;save flags
2079
0734 : 08               [ 3]>            php
2080
0735 : c900             [ 2]>            cmp #0     ;test result
2081
                            >            trap_ne
2082
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   37
2083
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2084
 
2085
0737 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2086
                            >
2087
0739 : 68               [ 4]>            pla         ;load status
2088
                            >            cmp_flag $ff-minus
2089
073a : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
2090
                            >
2091
                            >            trap_ne
2092
073c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2093
                            >
2094
073e : 28               [ 4]>            plp         ;restore status
2095
 
2096
                                     set_a $fe,0
2097
                            >            load_flag 0
2098
073f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2099
                            >
2100
0741 : 48               [ 3]>            pha         ;use stack to load status
2101
0742 : a9fe             [ 2]>            lda #$fe     ;precharge accu
2102
0744 : 28               [ 4]>            plp
2103
 
2104
0745 : 68               [ 4]         pla
2105
                                     tst_a 1,0
2106
0746 : 08               [ 3]>            php         ;save flags
2107
0747 : 08               [ 3]>            php
2108
0748 : c901             [ 2]>            cmp #1     ;test result
2109
                            >            trap_ne
2110
074a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2111
                            >
2112
074c : 68               [ 4]>            pla         ;load status
2113
                            >            cmp_flag 0
2114
074d : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
2115
                            >
2116
                            >            trap_ne
2117
074f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2118
                            >
2119
0751 : 28               [ 4]>            plp         ;restore status
2120
 
2121
0752 : e055             [ 2]         cpx #$55        ;x & y unchanged?
2122
                                     trap_ne
2123
0754 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2124
 
2125
0756 : c0aa             [ 2]         cpy #$aa
2126
                                     trap_ne
2127
0758 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2128
 
2129
                                     next_test
2130
075a : ad0002           [ 4]>            lda test_case   ;previous test
2131
075d : c905             [ 2]>            cmp #test_num
2132
                            >            trap_ne         ;test is out of sequence
2133
075f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2134
                            >
2135
0006 =                      >test_num = test_num + 1
2136
0761 : a906             [ 2]>            lda #test_num   ;*** this tests' number
2137
0763 : 8d0002           [ 4]>            sta test_case
2138
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2139
 
2140
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   38
2141
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2142
 
2143
 
2144
                             ; partial pretest EOR #
2145
                                     set_a $3c,0
2146
                            >            load_flag 0
2147
0766 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2148
                            >
2149
0768 : 48               [ 3]>            pha         ;use stack to load status
2150
0769 : a93c             [ 2]>            lda #$3c     ;precharge accu
2151
076b : 28               [ 4]>            plp
2152
 
2153
076c : 49c3             [ 2]         eor #$c3
2154
                                     tst_a $ff,fn
2155
076e : 08               [ 3]>            php         ;save flags
2156
076f : 08               [ 3]>            php
2157
0770 : c9ff             [ 2]>            cmp #$ff     ;test result
2158
                            >            trap_ne
2159
0772 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2160
                            >
2161
0774 : 68               [ 4]>            pla         ;load status
2162
                            >            cmp_flag fn
2163
0775 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
2164
                            >
2165
                            >            trap_ne
2166
0777 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2167
                            >
2168
0779 : 28               [ 4]>            plp         ;restore status
2169
 
2170
                                     set_a $c3,0
2171
                            >            load_flag 0
2172
077a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2173
                            >
2174
077c : 48               [ 3]>            pha         ;use stack to load status
2175
077d : a9c3             [ 2]>            lda #$c3     ;precharge accu
2176
077f : 28               [ 4]>            plp
2177
 
2178
0780 : 49c3             [ 2]         eor #$c3
2179
                                     tst_a 0,fz
2180
0782 : 08               [ 3]>            php         ;save flags
2181
0783 : 08               [ 3]>            php
2182
0784 : c900             [ 2]>            cmp #0     ;test result
2183
                            >            trap_ne
2184
0786 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2185
                            >
2186
0788 : 68               [ 4]>            pla         ;load status
2187
                            >            cmp_flag fz
2188
0789 : c932             [ 2]>            cmp #(fz|fao)&m8    ;expected flags + always on bits
2189
                            >
2190
                            >            trap_ne
2191
078b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2192
                            >
2193
078d : 28               [ 4]>            plp         ;restore status
2194
 
2195
                                     next_test
2196
078e : ad0002           [ 4]>            lda test_case   ;previous test
2197
0791 : c906             [ 2]>            cmp #test_num
2198
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   39
2199
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2200
 
2201
                            >            trap_ne         ;test is out of sequence
2202
0793 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2203
                            >
2204
0007 =                      >test_num = test_num + 1
2205
0795 : a907             [ 2]>            lda #test_num   ;*** this tests' number
2206
0797 : 8d0002           [ 4]>            sta test_case
2207
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2208
 
2209
 
2210
                             ; PC modifying instructions except branches (NOP, JMP, JSR, RTS, BRK, RTI)
2211
                             ; testing NOP
2212
079a : a224             [ 2]         ldx #$24
2213
079c : a042             [ 2]         ldy #$42
2214
                                     set_a $18,0
2215
                            >            load_flag 0
2216
079e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2217
                            >
2218
07a0 : 48               [ 3]>            pha         ;use stack to load status
2219
07a1 : a918             [ 2]>            lda #$18     ;precharge accu
2220
07a3 : 28               [ 4]>            plp
2221
 
2222
07a4 : ea               [ 2]         nop
2223
                                     tst_a $18,0
2224
07a5 : 08               [ 3]>            php         ;save flags
2225
07a6 : 08               [ 3]>            php
2226
07a7 : c918             [ 2]>            cmp #$18     ;test result
2227
                            >            trap_ne
2228
07a9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2229
                            >
2230
07ab : 68               [ 4]>            pla         ;load status
2231
                            >            cmp_flag 0
2232
07ac : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
2233
                            >
2234
                            >            trap_ne
2235
07ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2236
                            >
2237
07b0 : 28               [ 4]>            plp         ;restore status
2238
 
2239
07b1 : e024             [ 2]         cpx #$24
2240
                                     trap_ne
2241
07b3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2242
 
2243
07b5 : c042             [ 2]         cpy #$42
2244
                                     trap_ne
2245
07b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2246
 
2247
07b9 : a2db             [ 2]         ldx #$db
2248
07bb : a0bd             [ 2]         ldy #$bd
2249
                                     set_a $e7,$ff
2250
                            >            load_flag $ff
2251
07bd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
2252
                            >
2253
07bf : 48               [ 3]>            pha         ;use stack to load status
2254
07c0 : a9e7             [ 2]>            lda #$e7     ;precharge accu
2255
07c2 : 28               [ 4]>            plp
2256
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   40
2257
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2258
 
2259
 
2260
07c3 : ea               [ 2]         nop
2261
                                     tst_a $e7,$ff
2262
07c4 : 08               [ 3]>            php         ;save flags
2263
07c5 : 08               [ 3]>            php
2264
07c6 : c9e7             [ 2]>            cmp #$e7     ;test result
2265
                            >            trap_ne
2266
07c8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2267
                            >
2268
07ca : 68               [ 4]>            pla         ;load status
2269
                            >            cmp_flag $ff
2270
07cb : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
2271
                            >
2272
                            >            trap_ne
2273
07cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2274
                            >
2275
07cf : 28               [ 4]>            plp         ;restore status
2276
 
2277
07d0 : e0db             [ 2]         cpx #$db
2278
                                     trap_ne
2279
07d2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2280
 
2281
07d4 : c0bd             [ 2]         cpy #$bd
2282
                                     trap_ne
2283
07d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2284
 
2285
                                     next_test
2286
07d8 : ad0002           [ 4]>            lda test_case   ;previous test
2287
07db : c907             [ 2]>            cmp #test_num
2288
                            >            trap_ne         ;test is out of sequence
2289
07dd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2290
                            >
2291
0008 =                      >test_num = test_num + 1
2292
07df : a908             [ 2]>            lda #test_num   ;*** this tests' number
2293
07e1 : 8d0002           [ 4]>            sta test_case
2294
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2295
 
2296
 
2297
                             ; jump absolute
2298
                                     set_stat $0
2299
                            >            load_flag $0
2300
07e4 : a900             [ 2]>            lda #$0             ;allow test to change I-flag (no mask)
2301
                            >
2302
07e6 : 48               [ 3]>            pha         ;use stack to load status
2303
07e7 : 28               [ 4]>            plp
2304
 
2305
07e8 : a946             [ 2]         lda #'F'
2306
07ea : a241             [ 2]         ldx #'A'
2307
07ec : a052             [ 2]         ldy #'R'        ;N=0, V=0, Z=0, C=0
2308
07ee : 4c4e35           [ 3]         jmp test_far
2309
07f1 : ea               [ 2]         nop
2310
07f2 : ea               [ 2]         nop
2311
                                     trap_ne         ;runover protection
2312
07f3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2313
 
2314
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   41
2315
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2316
 
2317
07f5 : e8               [ 2]         inx
2318
07f6 : e8               [ 2]         inx
2319
07f7 :                       far_ret
2320
                                     trap_eq         ;returned flags OK?
2321
07f7 : f0fe             [ 3]>        beq *           ;failed equal (zero)
2322
 
2323
                                     trap_pl
2324
07f9 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
2325
 
2326
                                     trap_cc
2327
07fb : 90fe             [ 3]>        bcc *           ;failed carry clear
2328
 
2329
                                     trap_vc
2330
07fd : 50fe             [ 3]>        bvc *           ;failed overflow clear
2331
 
2332
07ff : c9ec             [ 2]         cmp #('F'^$aa)  ;returned registers OK?
2333
                                     trap_ne
2334
0801 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2335
 
2336
0803 : e042             [ 2]         cpx #('A'+1)
2337
                                     trap_ne
2338
0805 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2339
 
2340
0807 : c04f             [ 2]         cpy #('R'-3)
2341
                                     trap_ne
2342
0809 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2343
 
2344
080b : ca               [ 2]         dex
2345
080c : c8               [ 2]         iny
2346
080d : c8               [ 2]         iny
2347
080e : c8               [ 2]         iny
2348
080f : 49aa             [ 2]         eor #$aa        ;N=0, V=1, Z=0, C=1
2349
0811 : 4c1a08           [ 3]         jmp test_near
2350
0814 : ea               [ 2]         nop
2351
0815 : ea               [ 2]         nop
2352
                                     trap_ne         ;runover protection
2353
0816 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2354
 
2355
0818 : e8               [ 2]         inx
2356
0819 : e8               [ 2]         inx
2357
081a :                       test_near
2358
                                     trap_eq         ;passed flags OK?
2359
081a : f0fe             [ 3]>        beq *           ;failed equal (zero)
2360
 
2361
                                     trap_mi
2362
081c : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
2363
 
2364
                                     trap_cc
2365
081e : 90fe             [ 3]>        bcc *           ;failed carry clear
2366
 
2367
                                     trap_vc
2368
0820 : 50fe             [ 3]>        bvc *           ;failed overflow clear
2369
 
2370
0822 : c946             [ 2]         cmp #'F'        ;passed registers OK?
2371
                                     trap_ne
2372
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   42
2373
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2374
 
2375
0824 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2376
 
2377
0826 : e041             [ 2]         cpx #'A'
2378
                                     trap_ne
2379
0828 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2380
 
2381
082a : c052             [ 2]         cpy #'R'
2382
                                     trap_ne
2383
082c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2384
 
2385
                                     next_test
2386
082e : ad0002           [ 4]>            lda test_case   ;previous test
2387
0831 : c908             [ 2]>            cmp #test_num
2388
                            >            trap_ne         ;test is out of sequence
2389
0833 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2390
                            >
2391
0009 =                      >test_num = test_num + 1
2392
0835 : a909             [ 2]>            lda #test_num   ;*** this tests' number
2393
0837 : 8d0002           [ 4]>            sta test_case
2394
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2395
 
2396
 
2397
                             ; jump indirect
2398
                                     set_stat 0
2399
                            >            load_flag 0
2400
083a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2401
                            >
2402
083c : 48               [ 3]>            pha         ;use stack to load status
2403
083d : 28               [ 4]>            plp
2404
 
2405
083e : a949             [ 2]         lda #'I'
2406
0840 : a24e             [ 2]         ldx #'N'
2407
0842 : a044             [ 2]         ldy #'D'        ;N=0, V=0, Z=0, C=0
2408
0844 : 6c7c35           [ 6]         jmp (ptr_tst_ind)
2409
0847 : ea               [ 2]         nop
2410
                                     trap_ne         ;runover protection
2411
0848 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2412
 
2413
084a : 88               [ 2]         dey
2414
084b : 88               [ 2]         dey
2415
084c :                       ind_ret
2416
084c : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
2417
084d : 88               [ 2]         dey
2418
084e : 88               [ 2]         dey
2419
084f : 88               [ 2]         dey
2420
0850 : 28               [ 4]         plp
2421
                                     trap_eq         ;returned flags OK?
2422
0851 : f0fe             [ 3]>        beq *           ;failed equal (zero)
2423
 
2424
                                     trap_pl
2425
0853 : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
2426
 
2427
                                     trap_cc
2428
0855 : 90fe             [ 3]>        bcc *           ;failed carry clear
2429
 
2430
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   43
2431
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2432
 
2433
                                     trap_vc
2434
0857 : 50fe             [ 3]>        bvc *           ;failed overflow clear
2435
 
2436
0859 : c9e3             [ 2]         cmp #('I'^$aa)  ;returned registers OK?
2437
                                     trap_ne
2438
085b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2439
 
2440
085d : e04f             [ 2]         cpx #('N'+1)
2441
                                     trap_ne
2442
085f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2443
 
2444
0861 : c03e             [ 2]         cpy #('D'-6)
2445
                                     trap_ne
2446
0863 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2447
 
2448
0865 : ba               [ 2]         tsx             ;SP check
2449
0866 : e0ff             [ 2]         cpx #$ff
2450
                                     trap_ne
2451
0868 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2452
 
2453
                                     next_test
2454
086a : ad0002           [ 4]>            lda test_case   ;previous test
2455
086d : c909             [ 2]>            cmp #test_num
2456
                            >            trap_ne         ;test is out of sequence
2457
086f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2458
                            >
2459
000a =                      >test_num = test_num + 1
2460
0871 : a90a             [ 2]>            lda #test_num   ;*** this tests' number
2461
0873 : 8d0002           [ 4]>            sta test_case
2462
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2463
 
2464
 
2465
                             ; jump subroutine & return from subroutine
2466
                                     set_stat 0
2467
                            >            load_flag 0
2468
0876 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2469
                            >
2470
0878 : 48               [ 3]>            pha         ;use stack to load status
2471
0879 : 28               [ 4]>            plp
2472
 
2473
087a : a94a             [ 2]         lda #'J'
2474
087c : a253             [ 2]         ldx #'S'
2475
087e : a052             [ 2]         ldy #'R'        ;N=0, V=0, Z=0, C=0
2476
0880 : 20b835           [ 6]         jsr test_jsr
2477
0882 =                       jsr_ret = *-1           ;last address of jsr = return address
2478
0883 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
2479
0884 : 88               [ 2]         dey
2480
0885 : 88               [ 2]         dey
2481
0886 : 88               [ 2]         dey
2482
0887 : 28               [ 4]         plp
2483
                                     trap_eq         ;returned flags OK?
2484
0888 : f0fe             [ 3]>        beq *           ;failed equal (zero)
2485
 
2486
                                     trap_pl
2487
088a : 10fe             [ 3]>        bpl *           ;failed plus (bit 7 clear)
2488
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   44
2489
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2490
 
2491
 
2492
                                     trap_cc
2493
088c : 90fe             [ 3]>        bcc *           ;failed carry clear
2494
 
2495
                                     trap_vc
2496
088e : 50fe             [ 3]>        bvc *           ;failed overflow clear
2497
 
2498
0890 : c9e0             [ 2]         cmp #('J'^$aa)  ;returned registers OK?
2499
                                     trap_ne
2500
0892 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2501
 
2502
0894 : e054             [ 2]         cpx #('S'+1)
2503
                                     trap_ne
2504
0896 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2505
 
2506
0898 : c04c             [ 2]         cpy #('R'-6)
2507
                                     trap_ne
2508
089a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2509
 
2510
089c : ba               [ 2]         tsx             ;sp?
2511
089d : e0ff             [ 2]         cpx #$ff
2512
                                     trap_ne
2513
089f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2514
 
2515
                                     next_test
2516
08a1 : ad0002           [ 4]>            lda test_case   ;previous test
2517
08a4 : c90a             [ 2]>            cmp #test_num
2518
                            >            trap_ne         ;test is out of sequence
2519
08a6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2520
                            >
2521
000b =                      >test_num = test_num + 1
2522
08a8 : a90b             [ 2]>            lda #test_num   ;*** this tests' number
2523
08aa : 8d0002           [ 4]>            sta test_case
2524
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2525
 
2526
 
2527
                             ; break & return from interrupt
2528
                                 if ROM_vectors = 1
2529
                                     set_stat 0
2530
                            >            load_flag 0
2531
08ad : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2532
                            >
2533
08af : 48               [ 3]>            pha         ;use stack to load status
2534
08b0 : 28               [ 4]>            plp
2535
 
2536
08b1 : a942             [ 2]         lda #'B'
2537
08b3 : a252             [ 2]         ldx #'R'
2538
08b5 : a04b             [ 2]         ldy #'K'        ;N=0, V=0, Z=0, C=0
2539
08b7 : 00               [ 7]         brk
2540
                                 else
2541
                                     lda #hi brk_ret ;emulated break
2542
                                     pha
2543
                                     lda #lo brk_ret
2544
                                     pha
2545
                                     lda #fao        ;set break & unused on stack
2546
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   45
2547
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2548
 
2549
                                     pha
2550
                                     set_stat intdis
2551
                                     lda #'B'
2552
                                     ldx #'R'
2553
                                     ldy #'K'        ;N=0, V=0, Z=0, C=0
2554
                                     jmp irq_trap
2555
                                 endif
2556
08b8 : 88               [ 2]         dey             ;should not be executed
2557
08b9 :                       brk_ret                 ;address of break return
2558
08b9 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
2559
08ba : 88               [ 2]         dey
2560
08bb : 88               [ 2]         dey
2561
08bc : 88               [ 2]         dey
2562
08bd : c9e8             [ 2]         cmp #('B'^$aa)  ;returned registers OK?
2563
                                     trap_ne
2564
08bf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2565
 
2566
08c1 : e053             [ 2]         cpx #('R'+1)
2567
                                     trap_ne
2568
08c3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2569
 
2570
08c5 : c045             [ 2]         cpy #('K'-6)
2571
                                     trap_ne
2572
08c7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2573
 
2574
08c9 : 68               [ 4]         pla             ;returned flags OK (unchanged)?
2575
                                     cmp_flag 0
2576
08ca : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
2577
 
2578
                                     trap_ne
2579
08cc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2580
 
2581
08ce : ba               [ 2]         tsx             ;sp?
2582
08cf : e0ff             [ 2]         cpx #$ff
2583
                                     trap_ne
2584
08d1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2585
 
2586
                                     next_test
2587
08d3 : ad0002           [ 4]>            lda test_case   ;previous test
2588
08d6 : c90b             [ 2]>            cmp #test_num
2589
                            >            trap_ne         ;test is out of sequence
2590
08d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2591
                            >
2592
000c =                      >test_num = test_num + 1
2593
08da : a90c             [ 2]>            lda #test_num   ;*** this tests' number
2594
08dc : 8d0002           [ 4]>            sta test_case
2595
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2596
 
2597
 
2598
                             ; test set and clear flags CLC CLI CLD CLV SEC SEI SED
2599
                                     set_stat $ff
2600
                            >            load_flag $ff
2601
08df : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
2602
                            >
2603
08e1 : 48               [ 3]>            pha         ;use stack to load status
2604
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   46
2605
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2606
 
2607
08e2 : 28               [ 4]>            plp
2608
 
2609
08e3 : 18               [ 2]         clc
2610
                                     tst_stat $ff-carry
2611
08e4 : 08               [ 3]>            php         ;save status
2612
08e5 : 08               [ 3]>            php         ;use stack to retrieve status
2613
08e6 : 68               [ 4]>            pla
2614
                            >            cmp_flag $ff-carry
2615
08e7 : c9fe             [ 2]>            cmp #($ff-carry|fao)&m8    ;expected flags + always on bits
2616
                            >
2617
                            >            trap_ne
2618
08e9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2619
                            >
2620
08eb : 28               [ 4]>            plp         ;restore status
2621
 
2622
08ec : 38               [ 2]         sec
2623
                                     tst_stat $ff
2624
08ed : 08               [ 3]>            php         ;save status
2625
08ee : 08               [ 3]>            php         ;use stack to retrieve status
2626
08ef : 68               [ 4]>            pla
2627
                            >            cmp_flag $ff
2628
08f0 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
2629
                            >
2630
                            >            trap_ne
2631
08f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2632
                            >
2633
08f4 : 28               [ 4]>            plp         ;restore status
2634
 
2635
                                 if I_flag = 3
2636
08f5 : 58               [ 2]         cli
2637
                                     tst_stat $ff-intdis
2638
08f6 : 08               [ 3]>            php         ;save status
2639
08f7 : 08               [ 3]>            php         ;use stack to retrieve status
2640
08f8 : 68               [ 4]>            pla
2641
                            >            cmp_flag $ff-intdis
2642
08f9 : c9fb             [ 2]>            cmp #($ff-intdis|fao)&m8    ;expected flags + always on bits
2643
                            >
2644
                            >            trap_ne
2645
08fb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2646
                            >
2647
08fd : 28               [ 4]>            plp         ;restore status
2648
 
2649
08fe : 78               [ 2]         sei
2650
                                     tst_stat $ff
2651
08ff : 08               [ 3]>            php         ;save status
2652
0900 : 08               [ 3]>            php         ;use stack to retrieve status
2653
0901 : 68               [ 4]>            pla
2654
                            >            cmp_flag $ff
2655
0902 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
2656
                            >
2657
                            >            trap_ne
2658
0904 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2659
                            >
2660
0906 : 28               [ 4]>            plp         ;restore status
2661
 
2662
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   47
2663
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2664
 
2665
                                 endif
2666
0907 : d8               [ 2]         cld
2667
                                     tst_stat $ff-decmode
2668
0908 : 08               [ 3]>            php         ;save status
2669
0909 : 08               [ 3]>            php         ;use stack to retrieve status
2670
090a : 68               [ 4]>            pla
2671
                            >            cmp_flag $ff-decmode
2672
090b : c9f7             [ 2]>            cmp #($ff-decmode|fao)&m8    ;expected flags + always on bits
2673
                            >
2674
                            >            trap_ne
2675
090d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2676
                            >
2677
090f : 28               [ 4]>            plp         ;restore status
2678
 
2679
0910 : f8               [ 2]         sed
2680
                                     tst_stat $ff
2681
0911 : 08               [ 3]>            php         ;save status
2682
0912 : 08               [ 3]>            php         ;use stack to retrieve status
2683
0913 : 68               [ 4]>            pla
2684
                            >            cmp_flag $ff
2685
0914 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
2686
                            >
2687
                            >            trap_ne
2688
0916 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2689
                            >
2690
0918 : 28               [ 4]>            plp         ;restore status
2691
 
2692
0919 : b8               [ 2]         clv
2693
                                     tst_stat $ff-overfl
2694
091a : 08               [ 3]>            php         ;save status
2695
091b : 08               [ 3]>            php         ;use stack to retrieve status
2696
091c : 68               [ 4]>            pla
2697
                            >            cmp_flag $ff-overfl
2698
091d : c9bf             [ 2]>            cmp #($ff-overfl|fao)&m8    ;expected flags + always on bits
2699
                            >
2700
                            >            trap_ne
2701
091f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2702
                            >
2703
0921 : 28               [ 4]>            plp         ;restore status
2704
 
2705
                                     set_stat 0
2706
                            >            load_flag 0
2707
0922 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2708
                            >
2709
0924 : 48               [ 3]>            pha         ;use stack to load status
2710
0925 : 28               [ 4]>            plp
2711
 
2712
                                     tst_stat 0
2713
0926 : 08               [ 3]>            php         ;save status
2714
0927 : 08               [ 3]>            php         ;use stack to retrieve status
2715
0928 : 68               [ 4]>            pla
2716
                            >            cmp_flag 0
2717
0929 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
2718
                            >
2719
                            >            trap_ne
2720
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   48
2721
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2722
 
2723
092b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2724
                            >
2725
092d : 28               [ 4]>            plp         ;restore status
2726
 
2727
092e : 38               [ 2]         sec
2728
                                     tst_stat carry
2729
092f : 08               [ 3]>            php         ;save status
2730
0930 : 08               [ 3]>            php         ;use stack to retrieve status
2731
0931 : 68               [ 4]>            pla
2732
                            >            cmp_flag carry
2733
0932 : c931             [ 2]>            cmp #(carry|fao)&m8    ;expected flags + always on bits
2734
                            >
2735
                            >            trap_ne
2736
0934 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2737
                            >
2738
0936 : 28               [ 4]>            plp         ;restore status
2739
 
2740
0937 : 18               [ 2]         clc
2741
                                     tst_stat 0
2742
0938 : 08               [ 3]>            php         ;save status
2743
0939 : 08               [ 3]>            php         ;use stack to retrieve status
2744
093a : 68               [ 4]>            pla
2745
                            >            cmp_flag 0
2746
093b : c930             [ 2]>            cmp #(0  |fao)&m8    ;expected flags + always on bits
2747
                            >
2748
                            >            trap_ne
2749
093d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2750
                            >
2751
093f : 28               [ 4]>            plp         ;restore status
2752
 
2753
                                 if I_flag = 3
2754
0940 : 78               [ 2]         sei
2755
                                     tst_stat intdis
2756
0941 : 08               [ 3]>            php         ;save status
2757
0942 : 08               [ 3]>            php         ;use stack to retrieve status
2758
0943 : 68               [ 4]>            pla
2759
                            >            cmp_flag intdis
2760
0944 : c934             [ 2]>            cmp #(intdis|fao)&m8    ;expected flags + always on bits
2761
                            >
2762
                            >            trap_ne
2763
0946 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2764
                            >
2765
0948 : 28               [ 4]>            plp         ;restore status
2766
 
2767
0949 : 58               [ 2]         cli
2768
                                     tst_stat 0
2769
094a : 08               [ 3]>            php         ;save status
2770
094b : 08               [ 3]>            php         ;use stack to retrieve status
2771
094c : 68               [ 4]>            pla
2772
                            >            cmp_flag 0
2773
094d : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
2774
                            >
2775
                            >            trap_ne
2776
094f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2777
                            >
2778
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   49
2779
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2780
 
2781
0951 : 28               [ 4]>            plp         ;restore status
2782
 
2783
                                 endif
2784
0952 : f8               [ 2]         sed
2785
                                     tst_stat decmode
2786
0953 : 08               [ 3]>            php         ;save status
2787
0954 : 08               [ 3]>            php         ;use stack to retrieve status
2788
0955 : 68               [ 4]>            pla
2789
                            >            cmp_flag decmode
2790
0956 : c938             [ 2]>            cmp #(decmode|fao)&m8    ;expected flags + always on bits
2791
                            >
2792
                            >            trap_ne
2793
0958 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2794
                            >
2795
095a : 28               [ 4]>            plp         ;restore status
2796
 
2797
095b : d8               [ 2]         cld
2798
                                     tst_stat 0
2799
095c : 08               [ 3]>            php         ;save status
2800
095d : 08               [ 3]>            php         ;use stack to retrieve status
2801
095e : 68               [ 4]>            pla
2802
                            >            cmp_flag 0
2803
095f : c930             [ 2]>            cmp #(0  |fao)&m8    ;expected flags + always on bits
2804
                            >
2805
                            >            trap_ne
2806
0961 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2807
                            >
2808
0963 : 28               [ 4]>            plp         ;restore status
2809
 
2810
                                     set_stat overfl
2811
                            >            load_flag overfl
2812
0964 : a940             [ 2]>            lda #overfl             ;allow test to change I-flag (no mask)
2813
                            >
2814
0966 : 48               [ 3]>            pha         ;use stack to load status
2815
0967 : 28               [ 4]>            plp
2816
 
2817
                                     tst_stat overfl
2818
0968 : 08               [ 3]>            php         ;save status
2819
0969 : 08               [ 3]>            php         ;use stack to retrieve status
2820
096a : 68               [ 4]>            pla
2821
                            >            cmp_flag overfl
2822
096b : c970             [ 2]>            cmp #(overfl|fao)&m8    ;expected flags + always on bits
2823
                            >
2824
                            >            trap_ne
2825
096d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2826
                            >
2827
096f : 28               [ 4]>            plp         ;restore status
2828
 
2829
0970 : b8               [ 2]         clv
2830
                                     tst_stat 0
2831
0971 : 08               [ 3]>            php         ;save status
2832
0972 : 08               [ 3]>            php         ;use stack to retrieve status
2833
0973 : 68               [ 4]>            pla
2834
                            >            cmp_flag 0
2835
0974 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
2836
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   50
2837
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2838
 
2839
                            >
2840
                            >            trap_ne
2841
0976 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2842
                            >
2843
0978 : 28               [ 4]>            plp         ;restore status
2844
 
2845
                                     next_test
2846
0979 : ad0002           [ 4]>            lda test_case   ;previous test
2847
097c : c90c             [ 2]>            cmp #test_num
2848
                            >            trap_ne         ;test is out of sequence
2849
097e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2850
                            >
2851
000d =                      >test_num = test_num + 1
2852
0980 : a90d             [ 2]>            lda #test_num   ;*** this tests' number
2853
0982 : 8d0002           [ 4]>            sta test_case
2854
                            >            ;check_ram       ;uncomment to find altered RAM after each test
2855
 
2856
                             ; testing index register increment/decrement and transfer
2857
                             ; INX INY DEX DEY TAX TXA TAY TYA
2858
0985 : a2fe             [ 2]         ldx #$fe
2859
                                     set_stat $ff
2860
                            >            load_flag $ff
2861
0987 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
2862
                            >
2863
0989 : 48               [ 3]>            pha         ;use stack to load status
2864
098a : 28               [ 4]>            plp
2865
 
2866
098b : e8               [ 2]         inx             ;ff
2867
                                     tst_x $ff,$ff-zero
2868
098c : 08               [ 3]>            php         ;save flags
2869
098d : 08               [ 3]>            php
2870
098e : e0ff             [ 2]>            cpx #$ff     ;test result
2871
                            >            trap_ne
2872
0990 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2873
                            >
2874
0992 : 68               [ 4]>            pla         ;load status
2875
                            >            cmp_flag $ff-zero
2876
0993 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
2877
                            >
2878
                            >            trap_ne
2879
0995 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2880
                            >
2881
0997 : 28               [ 4]>            plp         ;restore status
2882
 
2883
0998 : e8               [ 2]         inx             ;00
2884
                                     tst_x 0,$ff-minus
2885
0999 : 08               [ 3]>            php         ;save flags
2886
099a : 08               [ 3]>            php
2887
099b : e000             [ 2]>            cpx #0     ;test result
2888
                            >            trap_ne
2889
099d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2890
                            >
2891
099f : 68               [ 4]>            pla         ;load status
2892
                            >            cmp_flag $ff-minus
2893
09a0 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
2894
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   51
2895
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2896
 
2897
                            >
2898
                            >            trap_ne
2899
09a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2900
                            >
2901
09a4 : 28               [ 4]>            plp         ;restore status
2902
 
2903
09a5 : e8               [ 2]         inx             ;01
2904
                                     tst_x 1,$ff-minus-zero
2905
09a6 : 08               [ 3]>            php         ;save flags
2906
09a7 : 08               [ 3]>            php
2907
09a8 : e001             [ 2]>            cpx #1     ;test result
2908
                            >            trap_ne
2909
09aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2910
                            >
2911
09ac : 68               [ 4]>            pla         ;load status
2912
                            >            cmp_flag $ff-minus-zero
2913
09ad : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
2914
                            >
2915
                            >            trap_ne
2916
09af : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2917
                            >
2918
09b1 : 28               [ 4]>            plp         ;restore status
2919
 
2920
09b2 : ca               [ 2]         dex             ;00
2921
                                     tst_x 0,$ff-minus
2922
09b3 : 08               [ 3]>            php         ;save flags
2923
09b4 : 08               [ 3]>            php
2924
09b5 : e000             [ 2]>            cpx #0     ;test result
2925
                            >            trap_ne
2926
09b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2927
                            >
2928
09b9 : 68               [ 4]>            pla         ;load status
2929
                            >            cmp_flag $ff-minus
2930
09ba : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
2931
                            >
2932
                            >            trap_ne
2933
09bc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2934
                            >
2935
09be : 28               [ 4]>            plp         ;restore status
2936
 
2937
09bf : ca               [ 2]         dex             ;ff
2938
                                     tst_x $ff,$ff-zero
2939
09c0 : 08               [ 3]>            php         ;save flags
2940
09c1 : 08               [ 3]>            php
2941
09c2 : e0ff             [ 2]>            cpx #$ff     ;test result
2942
                            >            trap_ne
2943
09c4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2944
                            >
2945
09c6 : 68               [ 4]>            pla         ;load status
2946
                            >            cmp_flag $ff-zero
2947
09c7 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
2948
                            >
2949
                            >            trap_ne
2950
09c9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2951
                            >
2952
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   52
2953
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
2954
 
2955
09cb : 28               [ 4]>            plp         ;restore status
2956
 
2957
09cc : ca               [ 2]         dex             ;fe
2958
                                     set_stat 0
2959
                            >            load_flag 0
2960
09cd : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
2961
                            >
2962
09cf : 48               [ 3]>            pha         ;use stack to load status
2963
09d0 : 28               [ 4]>            plp
2964
 
2965
09d1 : e8               [ 2]         inx             ;ff
2966
                                     tst_x $ff,minus
2967
09d2 : 08               [ 3]>            php         ;save flags
2968
09d3 : 08               [ 3]>            php
2969
09d4 : e0ff             [ 2]>            cpx #$ff     ;test result
2970
                            >            trap_ne
2971
09d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2972
                            >
2973
09d8 : 68               [ 4]>            pla         ;load status
2974
                            >            cmp_flag minus
2975
09d9 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
2976
                            >
2977
                            >            trap_ne
2978
09db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2979
                            >
2980
09dd : 28               [ 4]>            plp         ;restore status
2981
 
2982
09de : e8               [ 2]         inx             ;00
2983
                                     tst_x 0,zero
2984
09df : 08               [ 3]>            php         ;save flags
2985
09e0 : 08               [ 3]>            php
2986
09e1 : e000             [ 2]>            cpx #0     ;test result
2987
                            >            trap_ne
2988
09e3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2989
                            >
2990
09e5 : 68               [ 4]>            pla         ;load status
2991
                            >            cmp_flag zero
2992
09e6 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
2993
                            >
2994
                            >            trap_ne
2995
09e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
2996
                            >
2997
09ea : 28               [ 4]>            plp         ;restore status
2998
 
2999
09eb : e8               [ 2]         inx             ;01
3000
                                     tst_x 1,0
3001
09ec : 08               [ 3]>            php         ;save flags
3002
09ed : 08               [ 3]>            php
3003
09ee : e001             [ 2]>            cpx #1     ;test result
3004
                            >            trap_ne
3005
09f0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3006
                            >
3007
09f2 : 68               [ 4]>            pla         ;load status
3008
                            >            cmp_flag 0
3009
09f3 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3010
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   53
3011
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3012
 
3013
                            >
3014
                            >            trap_ne
3015
09f5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3016
                            >
3017
09f7 : 28               [ 4]>            plp         ;restore status
3018
 
3019
09f8 : ca               [ 2]         dex             ;00
3020
                                     tst_x 0,zero
3021
09f9 : 08               [ 3]>            php         ;save flags
3022
09fa : 08               [ 3]>            php
3023
09fb : e000             [ 2]>            cpx #0     ;test result
3024
                            >            trap_ne
3025
09fd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3026
                            >
3027
09ff : 68               [ 4]>            pla         ;load status
3028
                            >            cmp_flag zero
3029
0a00 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
3030
                            >
3031
                            >            trap_ne
3032
0a02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3033
                            >
3034
0a04 : 28               [ 4]>            plp         ;restore status
3035
 
3036
0a05 : ca               [ 2]         dex             ;ff
3037
                                     tst_x $ff,minus
3038
0a06 : 08               [ 3]>            php         ;save flags
3039
0a07 : 08               [ 3]>            php
3040
0a08 : e0ff             [ 2]>            cpx #$ff     ;test result
3041
                            >            trap_ne
3042
0a0a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3043
                            >
3044
0a0c : 68               [ 4]>            pla         ;load status
3045
                            >            cmp_flag minus
3046
0a0d : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
3047
                            >
3048
                            >            trap_ne
3049
0a0f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3050
                            >
3051
0a11 : 28               [ 4]>            plp         ;restore status
3052
 
3053
 
3054
0a12 : a0fe             [ 2]         ldy #$fe
3055
                                     set_stat $ff
3056
                            >            load_flag $ff
3057
0a14 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3058
                            >
3059
0a16 : 48               [ 3]>            pha         ;use stack to load status
3060
0a17 : 28               [ 4]>            plp
3061
 
3062
0a18 : c8               [ 2]         iny             ;ff
3063
                                     tst_y $ff,$ff-zero
3064
0a19 : 08               [ 3]>            php         ;save flags
3065
0a1a : 08               [ 3]>            php
3066
0a1b : c0ff             [ 2]>            cpy #$ff     ;test result
3067
                            >            trap_ne
3068
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   54
3069
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3070
 
3071
0a1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3072
                            >
3073
0a1f : 68               [ 4]>            pla         ;load status
3074
                            >            cmp_flag $ff-zero
3075
0a20 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
3076
                            >
3077
                            >            trap_ne
3078
0a22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3079
                            >
3080
0a24 : 28               [ 4]>            plp         ;restore status
3081
 
3082
0a25 : c8               [ 2]         iny             ;00
3083
                                     tst_y 0,$ff-minus
3084
0a26 : 08               [ 3]>            php         ;save flags
3085
0a27 : 08               [ 3]>            php
3086
0a28 : c000             [ 2]>            cpy #0     ;test result
3087
                            >            trap_ne
3088
0a2a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3089
                            >
3090
0a2c : 68               [ 4]>            pla         ;load status
3091
                            >            cmp_flag $ff-minus
3092
0a2d : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
3093
                            >
3094
                            >            trap_ne
3095
0a2f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3096
                            >
3097
0a31 : 28               [ 4]>            plp         ;restore status
3098
 
3099
0a32 : c8               [ 2]         iny             ;01
3100
                                     tst_y 1,$ff-minus-zero
3101
0a33 : 08               [ 3]>            php         ;save flags
3102
0a34 : 08               [ 3]>            php
3103
0a35 : c001             [ 2]>            cpy #1     ;test result
3104
                            >            trap_ne
3105
0a37 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3106
                            >
3107
0a39 : 68               [ 4]>            pla         ;load status
3108
                            >            cmp_flag $ff-minus-zero
3109
0a3a : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
3110
                            >
3111
                            >            trap_ne
3112
0a3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3113
                            >
3114
0a3e : 28               [ 4]>            plp         ;restore status
3115
 
3116
0a3f : 88               [ 2]         dey             ;00
3117
                                     tst_y 0,$ff-minus
3118
0a40 : 08               [ 3]>            php         ;save flags
3119
0a41 : 08               [ 3]>            php
3120
0a42 : c000             [ 2]>            cpy #0     ;test result
3121
                            >            trap_ne
3122
0a44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3123
                            >
3124
0a46 : 68               [ 4]>            pla         ;load status
3125
                            >            cmp_flag $ff-minus
3126
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   55
3127
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3128
 
3129
0a47 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
3130
                            >
3131
                            >            trap_ne
3132
0a49 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3133
                            >
3134
0a4b : 28               [ 4]>            plp         ;restore status
3135
 
3136
0a4c : 88               [ 2]         dey             ;ff
3137
                                     tst_y $ff,$ff-zero
3138
0a4d : 08               [ 3]>            php         ;save flags
3139
0a4e : 08               [ 3]>            php
3140
0a4f : c0ff             [ 2]>            cpy #$ff     ;test result
3141
                            >            trap_ne
3142
0a51 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3143
                            >
3144
0a53 : 68               [ 4]>            pla         ;load status
3145
                            >            cmp_flag $ff-zero
3146
0a54 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
3147
                            >
3148
                            >            trap_ne
3149
0a56 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3150
                            >
3151
0a58 : 28               [ 4]>            plp         ;restore status
3152
 
3153
0a59 : 88               [ 2]         dey             ;fe
3154
                                     set_stat 0
3155
                            >            load_flag 0
3156
0a5a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3157
                            >
3158
0a5c : 48               [ 3]>            pha         ;use stack to load status
3159
0a5d : 28               [ 4]>            plp
3160
 
3161
0a5e : c8               [ 2]         iny             ;ff
3162
                                     tst_y $ff,0+minus
3163
0a5f : 08               [ 3]>            php         ;save flags
3164
0a60 : 08               [ 3]>            php
3165
0a61 : c0ff             [ 2]>            cpy #$ff     ;test result
3166
                            >            trap_ne
3167
0a63 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3168
                            >
3169
0a65 : 68               [ 4]>            pla         ;load status
3170
                            >            cmp_flag 0+minus
3171
0a66 : c9b0             [ 2]>            cmp #(0+minus|fao)&m8    ;expected flags + always on bits
3172
                            >
3173
                            >            trap_ne
3174
0a68 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3175
                            >
3176
0a6a : 28               [ 4]>            plp         ;restore status
3177
 
3178
0a6b : c8               [ 2]         iny             ;00
3179
                                     tst_y 0,zero
3180
0a6c : 08               [ 3]>            php         ;save flags
3181
0a6d : 08               [ 3]>            php
3182
0a6e : c000             [ 2]>            cpy #0     ;test result
3183
                            >            trap_ne
3184
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   56
3185
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3186
 
3187
0a70 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3188
                            >
3189
0a72 : 68               [ 4]>            pla         ;load status
3190
                            >            cmp_flag zero
3191
0a73 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
3192
                            >
3193
                            >            trap_ne
3194
0a75 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3195
                            >
3196
0a77 : 28               [ 4]>            plp         ;restore status
3197
 
3198
0a78 : c8               [ 2]         iny             ;01
3199
                                     tst_y 1,0
3200
0a79 : 08               [ 3]>            php         ;save flags
3201
0a7a : 08               [ 3]>            php
3202
0a7b : c001             [ 2]>            cpy #1     ;test result
3203
                            >            trap_ne
3204
0a7d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3205
                            >
3206
0a7f : 68               [ 4]>            pla         ;load status
3207
                            >            cmp_flag 0
3208
0a80 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3209
                            >
3210
                            >            trap_ne
3211
0a82 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3212
                            >
3213
0a84 : 28               [ 4]>            plp         ;restore status
3214
 
3215
0a85 : 88               [ 2]         dey             ;00
3216
                                     tst_y 0,zero
3217
0a86 : 08               [ 3]>            php         ;save flags
3218
0a87 : 08               [ 3]>            php
3219
0a88 : c000             [ 2]>            cpy #0     ;test result
3220
                            >            trap_ne
3221
0a8a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3222
                            >
3223
0a8c : 68               [ 4]>            pla         ;load status
3224
                            >            cmp_flag zero
3225
0a8d : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
3226
                            >
3227
                            >            trap_ne
3228
0a8f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3229
                            >
3230
0a91 : 28               [ 4]>            plp         ;restore status
3231
 
3232
0a92 : 88               [ 2]         dey             ;ff
3233
                                     tst_y $ff,minus
3234
0a93 : 08               [ 3]>            php         ;save flags
3235
0a94 : 08               [ 3]>            php
3236
0a95 : c0ff             [ 2]>            cpy #$ff     ;test result
3237
                            >            trap_ne
3238
0a97 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3239
                            >
3240
0a99 : 68               [ 4]>            pla         ;load status
3241
                            >            cmp_flag minus
3242
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   57
3243
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3244
 
3245
0a9a : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
3246
                            >
3247
                            >            trap_ne
3248
0a9c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3249
                            >
3250
0a9e : 28               [ 4]>            plp         ;restore status
3251
 
3252
 
3253
0a9f : a2ff             [ 2]         ldx #$ff
3254
                                     set_stat $ff
3255
                            >            load_flag $ff
3256
0aa1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3257
                            >
3258
0aa3 : 48               [ 3]>            pha         ;use stack to load status
3259
0aa4 : 28               [ 4]>            plp
3260
 
3261
0aa5 : 8a               [ 2]         txa
3262
                                     tst_a $ff,$ff-zero
3263
0aa6 : 08               [ 3]>            php         ;save flags
3264
0aa7 : 08               [ 3]>            php
3265
0aa8 : c9ff             [ 2]>            cmp #$ff     ;test result
3266
                            >            trap_ne
3267
0aaa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3268
                            >
3269
0aac : 68               [ 4]>            pla         ;load status
3270
                            >            cmp_flag $ff-zero
3271
0aad : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
3272
                            >
3273
                            >            trap_ne
3274
0aaf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3275
                            >
3276
0ab1 : 28               [ 4]>            plp         ;restore status
3277
 
3278
0ab2 : 08               [ 3]         php
3279
0ab3 : e8               [ 2]         inx             ;00
3280
0ab4 : 28               [ 4]         plp
3281
0ab5 : 8a               [ 2]         txa
3282
                                     tst_a 0,$ff-minus
3283
0ab6 : 08               [ 3]>            php         ;save flags
3284
0ab7 : 08               [ 3]>            php
3285
0ab8 : c900             [ 2]>            cmp #0     ;test result
3286
                            >            trap_ne
3287
0aba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3288
                            >
3289
0abc : 68               [ 4]>            pla         ;load status
3290
                            >            cmp_flag $ff-minus
3291
0abd : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
3292
                            >
3293
                            >            trap_ne
3294
0abf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3295
                            >
3296
0ac1 : 28               [ 4]>            plp         ;restore status
3297
 
3298
0ac2 : 08               [ 3]         php
3299
0ac3 : e8               [ 2]         inx             ;01
3300
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   58
3301
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3302
 
3303
0ac4 : 28               [ 4]         plp
3304
0ac5 : 8a               [ 2]         txa
3305
                                     tst_a 1,$ff-minus-zero
3306
0ac6 : 08               [ 3]>            php         ;save flags
3307
0ac7 : 08               [ 3]>            php
3308
0ac8 : c901             [ 2]>            cmp #1     ;test result
3309
                            >            trap_ne
3310
0aca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3311
                            >
3312
0acc : 68               [ 4]>            pla         ;load status
3313
                            >            cmp_flag $ff-minus-zero
3314
0acd : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
3315
                            >
3316
                            >            trap_ne
3317
0acf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3318
                            >
3319
0ad1 : 28               [ 4]>            plp         ;restore status
3320
 
3321
                                     set_stat 0
3322
                            >            load_flag 0
3323
0ad2 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3324
                            >
3325
0ad4 : 48               [ 3]>            pha         ;use stack to load status
3326
0ad5 : 28               [ 4]>            plp
3327
 
3328
0ad6 : 8a               [ 2]         txa
3329
                                     tst_a 1,0
3330
0ad7 : 08               [ 3]>            php         ;save flags
3331
0ad8 : 08               [ 3]>            php
3332
0ad9 : c901             [ 2]>            cmp #1     ;test result
3333
                            >            trap_ne
3334
0adb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3335
                            >
3336
0add : 68               [ 4]>            pla         ;load status
3337
                            >            cmp_flag 0
3338
0ade : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3339
                            >
3340
                            >            trap_ne
3341
0ae0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3342
                            >
3343
0ae2 : 28               [ 4]>            plp         ;restore status
3344
 
3345
0ae3 : 08               [ 3]         php
3346
0ae4 : ca               [ 2]         dex             ;00
3347
0ae5 : 28               [ 4]         plp
3348
0ae6 : 8a               [ 2]         txa
3349
                                     tst_a 0,zero
3350
0ae7 : 08               [ 3]>            php         ;save flags
3351
0ae8 : 08               [ 3]>            php
3352
0ae9 : c900             [ 2]>            cmp #0     ;test result
3353
                            >            trap_ne
3354
0aeb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3355
                            >
3356
0aed : 68               [ 4]>            pla         ;load status
3357
                            >            cmp_flag zero
3358
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   59
3359
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3360
 
3361
0aee : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
3362
                            >
3363
                            >            trap_ne
3364
0af0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3365
                            >
3366
0af2 : 28               [ 4]>            plp         ;restore status
3367
 
3368
0af3 : 08               [ 3]         php
3369
0af4 : ca               [ 2]         dex             ;ff
3370
0af5 : 28               [ 4]         plp
3371
0af6 : 8a               [ 2]         txa
3372
                                     tst_a $ff,minus
3373
0af7 : 08               [ 3]>            php         ;save flags
3374
0af8 : 08               [ 3]>            php
3375
0af9 : c9ff             [ 2]>            cmp #$ff     ;test result
3376
                            >            trap_ne
3377
0afb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3378
                            >
3379
0afd : 68               [ 4]>            pla         ;load status
3380
                            >            cmp_flag minus
3381
0afe : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
3382
                            >
3383
                            >            trap_ne
3384
0b00 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3385
                            >
3386
0b02 : 28               [ 4]>            plp         ;restore status
3387
 
3388
 
3389
0b03 : a0ff             [ 2]         ldy #$ff
3390
                                     set_stat $ff
3391
                            >            load_flag $ff
3392
0b05 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3393
                            >
3394
0b07 : 48               [ 3]>            pha         ;use stack to load status
3395
0b08 : 28               [ 4]>            plp
3396
 
3397
0b09 : 98               [ 2]         tya
3398
                                     tst_a $ff,$ff-zero
3399
0b0a : 08               [ 3]>            php         ;save flags
3400
0b0b : 08               [ 3]>            php
3401
0b0c : c9ff             [ 2]>            cmp #$ff     ;test result
3402
                            >            trap_ne
3403
0b0e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3404
                            >
3405
0b10 : 68               [ 4]>            pla         ;load status
3406
                            >            cmp_flag $ff-zero
3407
0b11 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
3408
                            >
3409
                            >            trap_ne
3410
0b13 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3411
                            >
3412
0b15 : 28               [ 4]>            plp         ;restore status
3413
 
3414
0b16 : 08               [ 3]         php
3415
0b17 : c8               [ 2]         iny             ;00
3416
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   60
3417
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3418
 
3419
0b18 : 28               [ 4]         plp
3420
0b19 : 98               [ 2]         tya
3421
                                     tst_a 0,$ff-minus
3422
0b1a : 08               [ 3]>            php         ;save flags
3423
0b1b : 08               [ 3]>            php
3424
0b1c : c900             [ 2]>            cmp #0     ;test result
3425
                            >            trap_ne
3426
0b1e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3427
                            >
3428
0b20 : 68               [ 4]>            pla         ;load status
3429
                            >            cmp_flag $ff-minus
3430
0b21 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
3431
                            >
3432
                            >            trap_ne
3433
0b23 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3434
                            >
3435
0b25 : 28               [ 4]>            plp         ;restore status
3436
 
3437
0b26 : 08               [ 3]         php
3438
0b27 : c8               [ 2]         iny             ;01
3439
0b28 : 28               [ 4]         plp
3440
0b29 : 98               [ 2]         tya
3441
                                     tst_a 1,$ff-minus-zero
3442
0b2a : 08               [ 3]>            php         ;save flags
3443
0b2b : 08               [ 3]>            php
3444
0b2c : c901             [ 2]>            cmp #1     ;test result
3445
                            >            trap_ne
3446
0b2e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3447
                            >
3448
0b30 : 68               [ 4]>            pla         ;load status
3449
                            >            cmp_flag $ff-minus-zero
3450
0b31 : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
3451
                            >
3452
                            >            trap_ne
3453
0b33 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3454
                            >
3455
0b35 : 28               [ 4]>            plp         ;restore status
3456
 
3457
                                     set_stat 0
3458
                            >            load_flag 0
3459
0b36 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3460
                            >
3461
0b38 : 48               [ 3]>            pha         ;use stack to load status
3462
0b39 : 28               [ 4]>            plp
3463
 
3464
0b3a : 98               [ 2]         tya
3465
                                     tst_a 1,0
3466
0b3b : 08               [ 3]>            php         ;save flags
3467
0b3c : 08               [ 3]>            php
3468
0b3d : c901             [ 2]>            cmp #1     ;test result
3469
                            >            trap_ne
3470
0b3f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3471
                            >
3472
0b41 : 68               [ 4]>            pla         ;load status
3473
                            >            cmp_flag 0
3474
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   61
3475
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3476
 
3477
0b42 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3478
                            >
3479
                            >            trap_ne
3480
0b44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3481
                            >
3482
0b46 : 28               [ 4]>            plp         ;restore status
3483
 
3484
0b47 : 08               [ 3]         php
3485
0b48 : 88               [ 2]         dey             ;00
3486
0b49 : 28               [ 4]         plp
3487
0b4a : 98               [ 2]         tya
3488
                                     tst_a 0,zero
3489
0b4b : 08               [ 3]>            php         ;save flags
3490
0b4c : 08               [ 3]>            php
3491
0b4d : c900             [ 2]>            cmp #0     ;test result
3492
                            >            trap_ne
3493
0b4f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3494
                            >
3495
0b51 : 68               [ 4]>            pla         ;load status
3496
                            >            cmp_flag zero
3497
0b52 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
3498
                            >
3499
                            >            trap_ne
3500
0b54 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3501
                            >
3502
0b56 : 28               [ 4]>            plp         ;restore status
3503
 
3504
0b57 : 08               [ 3]         php
3505
0b58 : 88               [ 2]         dey             ;ff
3506
0b59 : 28               [ 4]         plp
3507
0b5a : 98               [ 2]         tya
3508
                                     tst_a $ff,minus
3509
0b5b : 08               [ 3]>            php         ;save flags
3510
0b5c : 08               [ 3]>            php
3511
0b5d : c9ff             [ 2]>            cmp #$ff     ;test result
3512
                            >            trap_ne
3513
0b5f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3514
                            >
3515
0b61 : 68               [ 4]>            pla         ;load status
3516
                            >            cmp_flag minus
3517
0b62 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
3518
                            >
3519
                            >            trap_ne
3520
0b64 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3521
                            >
3522
0b66 : 28               [ 4]>            plp         ;restore status
3523
 
3524
 
3525
                                     load_flag $ff
3526
0b67 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3527
 
3528
0b69 : 48               [ 3]         pha
3529
0b6a : a2ff             [ 2]         ldx #$ff        ;ff
3530
0b6c : 8a               [ 2]         txa
3531
0b6d : 28               [ 4]         plp
3532
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   62
3533
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3534
 
3535
0b6e : a8               [ 2]         tay
3536
                                     tst_y $ff,$ff-zero
3537
0b6f : 08               [ 3]>            php         ;save flags
3538
0b70 : 08               [ 3]>            php
3539
0b71 : c0ff             [ 2]>            cpy #$ff     ;test result
3540
                            >            trap_ne
3541
0b73 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3542
                            >
3543
0b75 : 68               [ 4]>            pla         ;load status
3544
                            >            cmp_flag $ff-zero
3545
0b76 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
3546
                            >
3547
                            >            trap_ne
3548
0b78 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3549
                            >
3550
0b7a : 28               [ 4]>            plp         ;restore status
3551
 
3552
0b7b : 08               [ 3]         php
3553
0b7c : e8               [ 2]         inx             ;00
3554
0b7d : 8a               [ 2]         txa
3555
0b7e : 28               [ 4]         plp
3556
0b7f : a8               [ 2]         tay
3557
                                     tst_y 0,$ff-minus
3558
0b80 : 08               [ 3]>            php         ;save flags
3559
0b81 : 08               [ 3]>            php
3560
0b82 : c000             [ 2]>            cpy #0     ;test result
3561
                            >            trap_ne
3562
0b84 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3563
                            >
3564
0b86 : 68               [ 4]>            pla         ;load status
3565
                            >            cmp_flag $ff-minus
3566
0b87 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
3567
                            >
3568
                            >            trap_ne
3569
0b89 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3570
                            >
3571
0b8b : 28               [ 4]>            plp         ;restore status
3572
 
3573
0b8c : 08               [ 3]         php
3574
0b8d : e8               [ 2]         inx             ;01
3575
0b8e : 8a               [ 2]         txa
3576
0b8f : 28               [ 4]         plp
3577
0b90 : a8               [ 2]         tay
3578
                                     tst_y 1,$ff-minus-zero
3579
0b91 : 08               [ 3]>            php         ;save flags
3580
0b92 : 08               [ 3]>            php
3581
0b93 : c001             [ 2]>            cpy #1     ;test result
3582
                            >            trap_ne
3583
0b95 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3584
                            >
3585
0b97 : 68               [ 4]>            pla         ;load status
3586
                            >            cmp_flag $ff-minus-zero
3587
0b98 : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
3588
                            >
3589
                            >            trap_ne
3590
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   63
3591
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3592
 
3593
0b9a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3594
                            >
3595
0b9c : 28               [ 4]>            plp         ;restore status
3596
 
3597
                                     load_flag 0
3598
0b9d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3599
 
3600
0b9f : 48               [ 3]         pha
3601
0ba0 : a900             [ 2]         lda #0
3602
0ba2 : 8a               [ 2]         txa
3603
0ba3 : 28               [ 4]         plp
3604
0ba4 : a8               [ 2]         tay
3605
                                     tst_y 1,0
3606
0ba5 : 08               [ 3]>            php         ;save flags
3607
0ba6 : 08               [ 3]>            php
3608
0ba7 : c001             [ 2]>            cpy #1     ;test result
3609
                            >            trap_ne
3610
0ba9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3611
                            >
3612
0bab : 68               [ 4]>            pla         ;load status
3613
                            >            cmp_flag 0
3614
0bac : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3615
                            >
3616
                            >            trap_ne
3617
0bae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3618
                            >
3619
0bb0 : 28               [ 4]>            plp         ;restore status
3620
 
3621
0bb1 : 08               [ 3]         php
3622
0bb2 : ca               [ 2]         dex             ;00
3623
0bb3 : 8a               [ 2]         txa
3624
0bb4 : 28               [ 4]         plp
3625
0bb5 : a8               [ 2]         tay
3626
                                     tst_y 0,zero
3627
0bb6 : 08               [ 3]>            php         ;save flags
3628
0bb7 : 08               [ 3]>            php
3629
0bb8 : c000             [ 2]>            cpy #0     ;test result
3630
                            >            trap_ne
3631
0bba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3632
                            >
3633
0bbc : 68               [ 4]>            pla         ;load status
3634
                            >            cmp_flag zero
3635
0bbd : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
3636
                            >
3637
                            >            trap_ne
3638
0bbf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3639
                            >
3640
0bc1 : 28               [ 4]>            plp         ;restore status
3641
 
3642
0bc2 : 08               [ 3]         php
3643
0bc3 : ca               [ 2]         dex             ;ff
3644
0bc4 : 8a               [ 2]         txa
3645
0bc5 : 28               [ 4]         plp
3646
0bc6 : a8               [ 2]         tay
3647
                                     tst_y $ff,minus
3648
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   64
3649
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3650
 
3651
0bc7 : 08               [ 3]>            php         ;save flags
3652
0bc8 : 08               [ 3]>            php
3653
0bc9 : c0ff             [ 2]>            cpy #$ff     ;test result
3654
                            >            trap_ne
3655
0bcb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3656
                            >
3657
0bcd : 68               [ 4]>            pla         ;load status
3658
                            >            cmp_flag minus
3659
0bce : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
3660
                            >
3661
                            >            trap_ne
3662
0bd0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3663
                            >
3664
0bd2 : 28               [ 4]>            plp         ;restore status
3665
 
3666
 
3667
 
3668
                                     load_flag $ff
3669
0bd3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3670
 
3671
0bd5 : 48               [ 3]         pha
3672
0bd6 : a0ff             [ 2]         ldy #$ff        ;ff
3673
0bd8 : 98               [ 2]         tya
3674
0bd9 : 28               [ 4]         plp
3675
0bda : aa               [ 2]         tax
3676
                                     tst_x $ff,$ff-zero
3677
0bdb : 08               [ 3]>            php         ;save flags
3678
0bdc : 08               [ 3]>            php
3679
0bdd : e0ff             [ 2]>            cpx #$ff     ;test result
3680
                            >            trap_ne
3681
0bdf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3682
                            >
3683
0be1 : 68               [ 4]>            pla         ;load status
3684
                            >            cmp_flag $ff-zero
3685
0be2 : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
3686
                            >
3687
                            >            trap_ne
3688
0be4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3689
                            >
3690
0be6 : 28               [ 4]>            plp         ;restore status
3691
 
3692
0be7 : 08               [ 3]         php
3693
0be8 : c8               [ 2]         iny             ;00
3694
0be9 : 98               [ 2]         tya
3695
0bea : 28               [ 4]         plp
3696
0beb : aa               [ 2]         tax
3697
                                     tst_x 0,$ff-minus
3698
0bec : 08               [ 3]>            php         ;save flags
3699
0bed : 08               [ 3]>            php
3700
0bee : e000             [ 2]>            cpx #0     ;test result
3701
                            >            trap_ne
3702
0bf0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3703
                            >
3704
0bf2 : 68               [ 4]>            pla         ;load status
3705
                            >            cmp_flag $ff-minus
3706
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   65
3707
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3708
 
3709
0bf3 : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
3710
                            >
3711
                            >            trap_ne
3712
0bf5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3713
                            >
3714
0bf7 : 28               [ 4]>            plp         ;restore status
3715
 
3716
0bf8 : 08               [ 3]         php
3717
0bf9 : c8               [ 2]         iny             ;01
3718
0bfa : 98               [ 2]         tya
3719
0bfb : 28               [ 4]         plp
3720
0bfc : aa               [ 2]         tax
3721
                                     tst_x 1,$ff-minus-zero
3722
0bfd : 08               [ 3]>            php         ;save flags
3723
0bfe : 08               [ 3]>            php
3724
0bff : e001             [ 2]>            cpx #1     ;test result
3725
                            >            trap_ne
3726
0c01 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3727
                            >
3728
0c03 : 68               [ 4]>            pla         ;load status
3729
                            >            cmp_flag $ff-minus-zero
3730
0c04 : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
3731
                            >
3732
                            >            trap_ne
3733
0c06 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3734
                            >
3735
0c08 : 28               [ 4]>            plp         ;restore status
3736
 
3737
                                     load_flag 0
3738
0c09 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3739
 
3740
0c0b : 48               [ 3]         pha
3741
0c0c : a900             [ 2]         lda #0          ;preset status
3742
0c0e : 98               [ 2]         tya
3743
0c0f : 28               [ 4]         plp
3744
0c10 : aa               [ 2]         tax
3745
                                     tst_x 1,0
3746
0c11 : 08               [ 3]>            php         ;save flags
3747
0c12 : 08               [ 3]>            php
3748
0c13 : e001             [ 2]>            cpx #1     ;test result
3749
                            >            trap_ne
3750
0c15 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3751
                            >
3752
0c17 : 68               [ 4]>            pla         ;load status
3753
                            >            cmp_flag 0
3754
0c18 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3755
                            >
3756
                            >            trap_ne
3757
0c1a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3758
                            >
3759
0c1c : 28               [ 4]>            plp         ;restore status
3760
 
3761
0c1d : 08               [ 3]         php
3762
0c1e : 88               [ 2]         dey             ;00
3763
0c1f : 98               [ 2]         tya
3764
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   66
3765
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3766
 
3767
0c20 : 28               [ 4]         plp
3768
0c21 : aa               [ 2]         tax
3769
                                     tst_x 0,zero
3770
0c22 : 08               [ 3]>            php         ;save flags
3771
0c23 : 08               [ 3]>            php
3772
0c24 : e000             [ 2]>            cpx #0     ;test result
3773
                            >            trap_ne
3774
0c26 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3775
                            >
3776
0c28 : 68               [ 4]>            pla         ;load status
3777
                            >            cmp_flag zero
3778
0c29 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
3779
                            >
3780
                            >            trap_ne
3781
0c2b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3782
                            >
3783
0c2d : 28               [ 4]>            plp         ;restore status
3784
 
3785
0c2e : 08               [ 3]         php
3786
0c2f : 88               [ 2]         dey             ;ff
3787
0c30 : 98               [ 2]         tya
3788
0c31 : 28               [ 4]         plp
3789
0c32 : aa               [ 2]         tax
3790
                                     tst_x $ff,minus
3791
0c33 : 08               [ 3]>            php         ;save flags
3792
0c34 : 08               [ 3]>            php
3793
0c35 : e0ff             [ 2]>            cpx #$ff     ;test result
3794
                            >            trap_ne
3795
0c37 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3796
                            >
3797
0c39 : 68               [ 4]>            pla         ;load status
3798
                            >            cmp_flag minus
3799
0c3a : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
3800
                            >
3801
                            >            trap_ne
3802
0c3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3803
                            >
3804
0c3e : 28               [ 4]>            plp         ;restore status
3805
 
3806
                                     next_test
3807
0c3f : ad0002           [ 4]>            lda test_case   ;previous test
3808
0c42 : c90d             [ 2]>            cmp #test_num
3809
                            >            trap_ne         ;test is out of sequence
3810
0c44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3811
                            >
3812
000e =                      >test_num = test_num + 1
3813
0c46 : a90e             [ 2]>            lda #test_num   ;*** this tests' number
3814
0c48 : 8d0002           [ 4]>            sta test_case
3815
                            >            ;check_ram       ;uncomment to find altered RAM after each test
3816
 
3817
 
3818
                             ;TSX sets NZ - TXS does not
3819
0c4b : a201             [ 2]         ldx #1          ;01
3820
                                     set_stat $ff
3821
                            >            load_flag $ff
3822
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   67
3823
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3824
 
3825
0c4d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3826
                            >
3827
0c4f : 48               [ 3]>            pha         ;use stack to load status
3828
0c50 : 28               [ 4]>            plp
3829
 
3830
0c51 : 9a               [ 2]         txs
3831
0c52 : 08               [ 3]         php
3832
0c53 : ad0101           [ 4]         lda $101
3833
                                     cmp_flag $ff
3834
0c56 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
3835
 
3836
                                     trap_ne
3837
0c58 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3838
 
3839
                                     set_stat 0
3840
                            >            load_flag 0
3841
0c5a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3842
                            >
3843
0c5c : 48               [ 3]>            pha         ;use stack to load status
3844
0c5d : 28               [ 4]>            plp
3845
 
3846
0c5e : 9a               [ 2]         txs
3847
0c5f : 08               [ 3]         php
3848
0c60 : ad0101           [ 4]         lda $101
3849
                                     cmp_flag 0
3850
0c63 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3851
 
3852
                                     trap_ne
3853
0c65 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3854
 
3855
0c67 : ca               [ 2]         dex             ;00
3856
                                     set_stat $ff
3857
                            >            load_flag $ff
3858
0c68 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3859
                            >
3860
0c6a : 48               [ 3]>            pha         ;use stack to load status
3861
0c6b : 28               [ 4]>            plp
3862
 
3863
0c6c : 9a               [ 2]         txs
3864
0c6d : 08               [ 3]         php
3865
0c6e : ad0001           [ 4]         lda $100
3866
                                     cmp_flag $ff
3867
0c71 : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
3868
 
3869
                                     trap_ne
3870
0c73 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3871
 
3872
                                     set_stat 0
3873
                            >            load_flag 0
3874
0c75 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3875
                            >
3876
0c77 : 48               [ 3]>            pha         ;use stack to load status
3877
0c78 : 28               [ 4]>            plp
3878
 
3879
0c79 : 9a               [ 2]         txs
3880
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   68
3881
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3882
 
3883
0c7a : 08               [ 3]         php
3884
0c7b : ad0001           [ 4]         lda $100
3885
                                     cmp_flag 0
3886
0c7e : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3887
 
3888
                                     trap_ne
3889
0c80 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3890
 
3891
0c82 : ca               [ 2]         dex             ;ff
3892
                                     set_stat $ff
3893
                            >            load_flag $ff
3894
0c83 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3895
                            >
3896
0c85 : 48               [ 3]>            pha         ;use stack to load status
3897
0c86 : 28               [ 4]>            plp
3898
 
3899
0c87 : 9a               [ 2]         txs
3900
0c88 : 08               [ 3]         php
3901
0c89 : adff01           [ 4]         lda $1ff
3902
                                     cmp_flag $ff
3903
0c8c : c9ff             [ 2]>            cmp #($ff|fao)&m8    ;expected flags + always on bits
3904
 
3905
                                     trap_ne
3906
0c8e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3907
 
3908
                                     set_stat 0
3909
                            >            load_flag 0
3910
0c90 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3911
                            >
3912
0c92 : 48               [ 3]>            pha         ;use stack to load status
3913
0c93 : 28               [ 4]>            plp
3914
 
3915
0c94 : 9a               [ 2]         txs
3916
0c95 : 08               [ 3]         php
3917
0c96 : adff01           [ 4]         lda $1ff
3918
                                     cmp_flag 0
3919
0c99 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
3920
 
3921
 
3922
0c9b : a201             [ 2]         ldx #1
3923
0c9d : 9a               [ 2]         txs             ;sp=01
3924
                                     set_stat $ff
3925
                            >            load_flag $ff
3926
0c9e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3927
                            >
3928
0ca0 : 48               [ 3]>            pha         ;use stack to load status
3929
0ca1 : 28               [ 4]>            plp
3930
 
3931
0ca2 : ba               [ 2]         tsx             ;clears Z, N
3932
0ca3 : 08               [ 3]         php             ;sp=00
3933
0ca4 : e001             [ 2]         cpx #1
3934
                                     trap_ne
3935
0ca6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3936
 
3937
0ca8 : ad0101           [ 4]         lda $101
3938
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   69
3939
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3940
 
3941
                                     cmp_flag $ff-minus-zero
3942
0cab : c97d             [ 2]>            cmp #($ff-minus-zero|fao)&m8    ;expected flags + always on bits
3943
 
3944
                                     trap_ne
3945
0cad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3946
 
3947
                                     set_stat $ff
3948
                            >            load_flag $ff
3949
0caf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3950
                            >
3951
0cb1 : 48               [ 3]>            pha         ;use stack to load status
3952
0cb2 : 28               [ 4]>            plp
3953
 
3954
0cb3 : ba               [ 2]         tsx             ;clears N, sets Z
3955
0cb4 : 08               [ 3]         php             ;sp=ff
3956
0cb5 : e000             [ 2]         cpx #0
3957
                                     trap_ne
3958
0cb7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3959
 
3960
0cb9 : ad0001           [ 4]         lda $100
3961
                                     cmp_flag $ff-minus
3962
0cbc : c97f             [ 2]>            cmp #($ff-minus|fao)&m8    ;expected flags + always on bits
3963
 
3964
                                     trap_ne
3965
0cbe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3966
 
3967
                                     set_stat $ff
3968
                            >            load_flag $ff
3969
0cc0 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
3970
                            >
3971
0cc2 : 48               [ 3]>            pha         ;use stack to load status
3972
0cc3 : 28               [ 4]>            plp
3973
 
3974
0cc4 : ba               [ 2]         tsx             ;clears N, sets Z
3975
0cc5 : 08               [ 3]         php             ;sp=fe
3976
0cc6 : e0ff             [ 2]         cpx #$ff
3977
                                     trap_ne
3978
0cc8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3979
 
3980
0cca : adff01           [ 4]         lda $1ff
3981
                                     cmp_flag $ff-zero
3982
0ccd : c9fd             [ 2]>            cmp #($ff-zero|fao)&m8    ;expected flags + always on bits
3983
 
3984
                                     trap_ne
3985
0ccf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
3986
 
3987
 
3988
0cd1 : a201             [ 2]         ldx #1
3989
0cd3 : 9a               [ 2]         txs             ;sp=01
3990
                                     set_stat 0
3991
                            >            load_flag 0
3992
0cd4 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
3993
                            >
3994
0cd6 : 48               [ 3]>            pha         ;use stack to load status
3995
0cd7 : 28               [ 4]>            plp
3996
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   70
3997
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
3998
 
3999
 
4000
0cd8 : ba               [ 2]         tsx             ;clears Z, N
4001
0cd9 : 08               [ 3]         php             ;sp=00
4002
0cda : e001             [ 2]         cpx #1
4003
                                     trap_ne
4004
0cdc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4005
 
4006
0cde : ad0101           [ 4]         lda $101
4007
                                     cmp_flag 0
4008
0ce1 : c930             [ 2]>            cmp #(0|fao)&m8    ;expected flags + always on bits
4009
 
4010
                                     trap_ne
4011
0ce3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4012
 
4013
                                     set_stat 0
4014
                            >            load_flag 0
4015
0ce5 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4016
                            >
4017
0ce7 : 48               [ 3]>            pha         ;use stack to load status
4018
0ce8 : 28               [ 4]>            plp
4019
 
4020
0ce9 : ba               [ 2]         tsx             ;clears N, sets Z
4021
0cea : 08               [ 3]         php             ;sp=ff
4022
0ceb : e000             [ 2]         cpx #0
4023
                                     trap_ne
4024
0ced : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4025
 
4026
0cef : ad0001           [ 4]         lda $100
4027
                                     cmp_flag zero
4028
0cf2 : c932             [ 2]>            cmp #(zero|fao)&m8    ;expected flags + always on bits
4029
 
4030
                                     trap_ne
4031
0cf4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4032
 
4033
                                     set_stat 0
4034
                            >            load_flag 0
4035
0cf6 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4036
                            >
4037
0cf8 : 48               [ 3]>            pha         ;use stack to load status
4038
0cf9 : 28               [ 4]>            plp
4039
 
4040
0cfa : ba               [ 2]         tsx             ;clears N, sets Z
4041
0cfb : 08               [ 3]         php             ;sp=fe
4042
0cfc : e0ff             [ 2]         cpx #$ff
4043
                                     trap_ne
4044
0cfe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4045
 
4046
0d00 : adff01           [ 4]         lda $1ff
4047
                                     cmp_flag minus
4048
0d03 : c9b0             [ 2]>            cmp #(minus|fao)&m8    ;expected flags + always on bits
4049
 
4050
                                     trap_ne
4051
0d05 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4052
 
4053
0d07 : 68               [ 4]         pla             ;sp=ff
4054
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   71
4055
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4056
 
4057
                                     next_test
4058
0d08 : ad0002           [ 4]>            lda test_case   ;previous test
4059
0d0b : c90e             [ 2]>            cmp #test_num
4060
                            >            trap_ne         ;test is out of sequence
4061
0d0d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4062
                            >
4063
000f =                      >test_num = test_num + 1
4064
0d0f : a90f             [ 2]>            lda #test_num   ;*** this tests' number
4065
0d11 : 8d0002           [ 4]>            sta test_case
4066
                            >            ;check_ram       ;uncomment to find altered RAM after each test
4067
 
4068
 
4069
                             ; testing index register load & store LDY LDX STY STX all addressing modes
4070
                             ; LDX / STX - zp,y / abs,y
4071
0d14 : a003             [ 2]         ldy #3
4072
0d16 :                       tldx
4073
                                     set_stat 0
4074
                            >            load_flag 0
4075
0d16 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4076
                            >
4077
0d18 : 48               [ 3]>            pha         ;use stack to load status
4078
0d19 : 28               [ 4]>            plp
4079
 
4080
0d1a : b613             [ 4]         ldx zp1,y
4081
0d1c : 08               [ 3]         php         ;test stores do not alter flags
4082
0d1d : 8a               [ 2]         txa
4083
0d1e : 49c3             [ 2]         eor #$c3
4084
0d20 : 28               [ 4]         plp
4085
0d21 : 990302           [ 5]         sta abst,y
4086
0d24 : 08               [ 3]         php         ;flags after load/store sequence
4087
0d25 : 49c3             [ 2]         eor #$c3
4088
0d27 : d90802           [ 4]         cmp abs1,y  ;test result
4089
                                     trap_ne
4090
0d2a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4091
 
4092
0d2c : 68               [ 4]         pla         ;load status
4093
                                     eor_flag 0
4094
0d2d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4095
 
4096
0d2f : d90d02           [ 4]         cmp fLDx,y  ;test flags
4097
                                     trap_ne
4098
0d32 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4099
 
4100
0d34 : 88               [ 2]         dey
4101
0d35 : 10df             [ 3]         bpl tldx
4102
 
4103
0d37 : a003             [ 2]         ldy #3
4104
0d39 :                       tldx1
4105
                                     set_stat $ff
4106
                            >            load_flag $ff
4107
0d39 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4108
                            >
4109
0d3b : 48               [ 3]>            pha         ;use stack to load status
4110
0d3c : 28               [ 4]>            plp
4111
 
4112
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   72
4113
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4114
 
4115
0d3d : b613             [ 4]         ldx zp1,y
4116
0d3f : 08               [ 3]         php         ;test stores do not alter flags
4117
0d40 : 8a               [ 2]         txa
4118
0d41 : 49c3             [ 2]         eor #$c3
4119
0d43 : 28               [ 4]         plp
4120
0d44 : 990302           [ 5]         sta abst,y
4121
0d47 : 08               [ 3]         php         ;flags after load/store sequence
4122
0d48 : 49c3             [ 2]         eor #$c3
4123
0d4a : d90802           [ 4]         cmp abs1,y  ;test result
4124
                                     trap_ne
4125
0d4d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4126
 
4127
0d4f : 68               [ 4]         pla         ;load status
4128
                                     eor_flag lo~fnz ;mask bits not altered
4129
0d50 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4130
 
4131
0d52 : d90d02           [ 4]         cmp fLDx,y  ;test flags
4132
                                     trap_ne
4133
0d55 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4134
 
4135
0d57 : 88               [ 2]         dey
4136
0d58 : 10df             [ 3]         bpl tldx1
4137
 
4138
0d5a : a003             [ 2]         ldy #3
4139
0d5c :                       tldx2
4140
                                     set_stat 0
4141
                            >            load_flag 0
4142
0d5c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4143
                            >
4144
0d5e : 48               [ 3]>            pha         ;use stack to load status
4145
0d5f : 28               [ 4]>            plp
4146
 
4147
0d60 : be0802           [ 4]         ldx abs1,y
4148
0d63 : 08               [ 3]         php         ;test stores do not alter flags
4149
0d64 : 8a               [ 2]         txa
4150
0d65 : 49c3             [ 2]         eor #$c3
4151
0d67 : aa               [ 2]         tax
4152
0d68 : 28               [ 4]         plp
4153
0d69 : 960c             [ 4]         stx zpt,y
4154
0d6b : 08               [ 3]         php         ;flags after load/store sequence
4155
0d6c : 49c3             [ 2]         eor #$c3
4156
0d6e : d91300           [ 4]         cmp zp1,y   ;test result
4157
                                     trap_ne
4158
0d71 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4159
 
4160
0d73 : 68               [ 4]         pla         ;load status
4161
                                     eor_flag 0
4162
0d74 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4163
 
4164
0d76 : d90d02           [ 4]         cmp fLDx,y  ;test flags
4165
                                     trap_ne
4166
0d79 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4167
 
4168
0d7b : 88               [ 2]         dey
4169
0d7c : 10de             [ 3]         bpl tldx2
4170
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   73
4171
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4172
 
4173
 
4174
0d7e : a003             [ 2]         ldy #3
4175
0d80 :                       tldx3
4176
                                     set_stat $ff
4177
                            >            load_flag $ff
4178
0d80 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4179
                            >
4180
0d82 : 48               [ 3]>            pha         ;use stack to load status
4181
0d83 : 28               [ 4]>            plp
4182
 
4183
0d84 : be0802           [ 4]         ldx abs1,y
4184
0d87 : 08               [ 3]         php         ;test stores do not alter flags
4185
0d88 : 8a               [ 2]         txa
4186
0d89 : 49c3             [ 2]         eor #$c3
4187
0d8b : aa               [ 2]         tax
4188
0d8c : 28               [ 4]         plp
4189
0d8d : 960c             [ 4]         stx zpt,y
4190
0d8f : 08               [ 3]         php         ;flags after load/store sequence
4191
0d90 : 49c3             [ 2]         eor #$c3
4192
0d92 : d91300           [ 4]         cmp zp1,y   ;test result
4193
                                     trap_ne
4194
0d95 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4195
 
4196
0d97 : 68               [ 4]         pla         ;load status
4197
                                     eor_flag lo~fnz ;mask bits not altered
4198
0d98 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4199
 
4200
0d9a : d90d02           [ 4]         cmp fLDx,y  ;test flags
4201
                                     trap_ne
4202
0d9d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4203
 
4204
0d9f : 88               [ 2]         dey
4205
0da0 : 10de             [ 3]         bpl tldx3
4206
 
4207
0da2 : a003             [ 2]         ldy #3      ;testing store result
4208
0da4 : a200             [ 2]         ldx #0
4209
0da6 : b90c00           [ 4] tstx    lda zpt,y
4210
0da9 : 49c3             [ 2]         eor #$c3
4211
0dab : d91300           [ 4]         cmp zp1,y
4212
                                     trap_ne     ;store to zp data
4213
0dae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4214
 
4215
0db0 : 960c             [ 4]         stx zpt,y   ;clear
4216
0db2 : b90302           [ 4]         lda abst,y
4217
0db5 : 49c3             [ 2]         eor #$c3
4218
0db7 : d90802           [ 4]         cmp abs1,y
4219
                                     trap_ne     ;store to abs data
4220
0dba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4221
 
4222
0dbc : 8a               [ 2]         txa
4223
0dbd : 990302           [ 5]         sta abst,y  ;clear
4224
0dc0 : 88               [ 2]         dey
4225
0dc1 : 10e3             [ 3]         bpl tstx
4226
                                     next_test
4227
0dc3 : ad0002           [ 4]>            lda test_case   ;previous test
4228
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   74
4229
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4230
 
4231
0dc6 : c90f             [ 2]>            cmp #test_num
4232
                            >            trap_ne         ;test is out of sequence
4233
0dc8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4234
                            >
4235
0010 =                      >test_num = test_num + 1
4236
0dca : a910             [ 2]>            lda #test_num   ;*** this tests' number
4237
0dcc : 8d0002           [ 4]>            sta test_case
4238
                            >            ;check_ram       ;uncomment to find altered RAM after each test
4239
 
4240
 
4241
                             ; indexed wraparound test (only zp should wrap)
4242
0dcf : a0fd             [ 2]         ldy #3+$fa
4243
0dd1 : b619             [ 4] tldx4   ldx zp1-$fa&$ff,y   ;wrap on indexed zp
4244
0dd3 : 8a               [ 2]         txa
4245
0dd4 : 990901           [ 5]         sta abst-$fa,y      ;no STX abs,y!
4246
0dd7 : 88               [ 2]         dey
4247
0dd8 : c0fa             [ 2]         cpy #$fa
4248
0dda : b0f5             [ 3]         bcs tldx4
4249
0ddc : a0fd             [ 2]         ldy #3+$fa
4250
0dde : be0e01           [ 4] tldx5   ldx abs1-$fa,y      ;no wrap on indexed abs
4251
0de1 : 9612             [ 4]         stx zpt-$fa&$ff,y
4252
0de3 : 88               [ 2]         dey
4253
0de4 : c0fa             [ 2]         cpy #$fa
4254
0de6 : b0f6             [ 3]         bcs tldx5
4255
0de8 : a003             [ 2]         ldy #3      ;testing wraparound result
4256
0dea : a200             [ 2]         ldx #0
4257
0dec : b90c00           [ 4] tstx1   lda zpt,y
4258
0def : d91300           [ 4]         cmp zp1,y
4259
                                     trap_ne     ;store to zp data
4260
0df2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4261
 
4262
0df4 : 960c             [ 4]         stx zpt,y   ;clear
4263
0df6 : b90302           [ 4]         lda abst,y
4264
0df9 : d90802           [ 4]         cmp abs1,y
4265
                                     trap_ne     ;store to abs data
4266
0dfc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4267
 
4268
0dfe : 8a               [ 2]         txa
4269
0dff : 990302           [ 5]         sta abst,y  ;clear
4270
0e02 : 88               [ 2]         dey
4271
0e03 : 10e7             [ 4]         bpl tstx1
4272
                                     next_test
4273
0e05 : ad0002           [ 4]>            lda test_case   ;previous test
4274
0e08 : c910             [ 2]>            cmp #test_num
4275
                            >            trap_ne         ;test is out of sequence
4276
0e0a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4277
                            >
4278
0011 =                      >test_num = test_num + 1
4279
0e0c : a911             [ 2]>            lda #test_num   ;*** this tests' number
4280
0e0e : 8d0002           [ 4]>            sta test_case
4281
                            >            ;check_ram       ;uncomment to find altered RAM after each test
4282
 
4283
 
4284
                             ; LDY / STY - zp,x / abs,x
4285
0e11 : a203             [ 2]         ldx #3
4286
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   75
4287
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4288
 
4289
0e13 :                       tldy
4290
                                     set_stat 0
4291
                            >            load_flag 0
4292
0e13 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4293
                            >
4294
0e15 : 48               [ 3]>            pha         ;use stack to load status
4295
0e16 : 28               [ 4]>            plp
4296
 
4297
0e17 : b413             [ 4]         ldy zp1,x
4298
0e19 : 08               [ 3]         php         ;test stores do not alter flags
4299
0e1a : 98               [ 2]         tya
4300
0e1b : 49c3             [ 2]         eor #$c3
4301
0e1d : 28               [ 4]         plp
4302
0e1e : 9d0302           [ 5]         sta abst,x
4303
0e21 : 08               [ 3]         php         ;flags after load/store sequence
4304
0e22 : 49c3             [ 2]         eor #$c3
4305
0e24 : dd0802           [ 4]         cmp abs1,x  ;test result
4306
                                     trap_ne
4307
0e27 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4308
 
4309
0e29 : 68               [ 4]         pla         ;load status
4310
                                     eor_flag 0
4311
0e2a : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4312
 
4313
0e2c : dd0d02           [ 4]         cmp fLDx,x  ;test flags
4314
                                     trap_ne
4315
0e2f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4316
 
4317
0e31 : ca               [ 2]         dex
4318
0e32 : 10df             [ 3]         bpl tldy
4319
 
4320
0e34 : a203             [ 2]         ldx #3
4321
0e36 :                       tldy1
4322
                                     set_stat $ff
4323
                            >            load_flag $ff
4324
0e36 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4325
                            >
4326
0e38 : 48               [ 3]>            pha         ;use stack to load status
4327
0e39 : 28               [ 4]>            plp
4328
 
4329
0e3a : b413             [ 4]         ldy zp1,x
4330
0e3c : 08               [ 3]         php         ;test stores do not alter flags
4331
0e3d : 98               [ 2]         tya
4332
0e3e : 49c3             [ 2]         eor #$c3
4333
0e40 : 28               [ 4]         plp
4334
0e41 : 9d0302           [ 5]         sta abst,x
4335
0e44 : 08               [ 3]         php         ;flags after load/store sequence
4336
0e45 : 49c3             [ 2]         eor #$c3
4337
0e47 : dd0802           [ 4]         cmp abs1,x  ;test result
4338
                                     trap_ne
4339
0e4a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4340
 
4341
0e4c : 68               [ 4]         pla         ;load status
4342
                                     eor_flag lo~fnz ;mask bits not altered
4343
0e4d : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4344
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   76
4345
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4346
 
4347
 
4348
0e4f : dd0d02           [ 4]         cmp fLDx,x  ;test flags
4349
                                     trap_ne
4350
0e52 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4351
 
4352
0e54 : ca               [ 2]         dex
4353
0e55 : 10df             [ 3]         bpl tldy1
4354
 
4355
0e57 : a203             [ 2]         ldx #3
4356
0e59 :                       tldy2
4357
                                     set_stat 0
4358
                            >            load_flag 0
4359
0e59 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4360
                            >
4361
0e5b : 48               [ 3]>            pha         ;use stack to load status
4362
0e5c : 28               [ 4]>            plp
4363
 
4364
0e5d : bc0802           [ 4]         ldy abs1,x
4365
0e60 : 08               [ 3]         php         ;test stores do not alter flags
4366
0e61 : 98               [ 2]         tya
4367
0e62 : 49c3             [ 2]         eor #$c3
4368
0e64 : a8               [ 2]         tay
4369
0e65 : 28               [ 4]         plp
4370
0e66 : 940c             [ 4]         sty zpt,x
4371
0e68 : 08               [ 3]         php         ;flags after load/store sequence
4372
0e69 : 49c3             [ 2]         eor #$c3
4373
0e6b : d513             [ 4]         cmp zp1,x   ;test result
4374
                                     trap_ne
4375
0e6d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4376
 
4377
0e6f : 68               [ 4]         pla         ;load status
4378
                                     eor_flag 0
4379
0e70 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4380
 
4381
0e72 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
4382
                                     trap_ne
4383
0e75 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4384
 
4385
0e77 : ca               [ 2]         dex
4386
0e78 : 10df             [ 3]         bpl tldy2
4387
 
4388
0e7a : a203             [ 2]         ldx #3
4389
0e7c :                       tldy3
4390
                                     set_stat $ff
4391
                            >            load_flag $ff
4392
0e7c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4393
                            >
4394
0e7e : 48               [ 3]>            pha         ;use stack to load status
4395
0e7f : 28               [ 4]>            plp
4396
 
4397
0e80 : bc0802           [ 4]         ldy abs1,x
4398
0e83 : 08               [ 3]         php         ;test stores do not alter flags
4399
0e84 : 98               [ 2]         tya
4400
0e85 : 49c3             [ 2]         eor #$c3
4401
0e87 : a8               [ 2]         tay
4402
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   77
4403
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4404
 
4405
0e88 : 28               [ 4]         plp
4406
0e89 : 940c             [ 4]         sty zpt,x
4407
0e8b : 08               [ 3]         php         ;flags after load/store sequence
4408
0e8c : 49c3             [ 2]         eor #$c3
4409
0e8e : d513             [ 4]         cmp zp1,x   ;test result
4410
                                     trap_ne
4411
0e90 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4412
 
4413
0e92 : 68               [ 4]         pla         ;load status
4414
                                     eor_flag lo~fnz ;mask bits not altered
4415
0e93 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4416
 
4417
0e95 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
4418
                                     trap_ne
4419
0e98 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4420
 
4421
0e9a : ca               [ 2]         dex
4422
0e9b : 10df             [ 3]         bpl tldy3
4423
 
4424
0e9d : a203             [ 2]         ldx #3      ;testing store result
4425
0e9f : a000             [ 2]         ldy #0
4426
0ea1 : b50c             [ 4] tsty    lda zpt,x
4427
0ea3 : 49c3             [ 2]         eor #$c3
4428
0ea5 : d513             [ 4]         cmp zp1,x
4429
                                     trap_ne     ;store to zp,x data
4430
0ea7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4431
 
4432
0ea9 : 940c             [ 4]         sty zpt,x   ;clear
4433
0eab : bd0302           [ 4]         lda abst,x
4434
0eae : 49c3             [ 2]         eor #$c3
4435
0eb0 : dd0802           [ 4]         cmp abs1,x
4436
                                     trap_ne     ;store to abs,x data
4437
0eb3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4438
 
4439
0eb5 : 8a               [ 2]         txa
4440
0eb6 : 9d0302           [ 5]         sta abst,x  ;clear
4441
0eb9 : ca               [ 2]         dex
4442
0eba : 10e5             [ 3]         bpl tsty
4443
                                     next_test
4444
0ebc : ad0002           [ 4]>            lda test_case   ;previous test
4445
0ebf : c911             [ 2]>            cmp #test_num
4446
                            >            trap_ne         ;test is out of sequence
4447
0ec1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4448
                            >
4449
0012 =                      >test_num = test_num + 1
4450
0ec3 : a912             [ 2]>            lda #test_num   ;*** this tests' number
4451
0ec5 : 8d0002           [ 4]>            sta test_case
4452
                            >            ;check_ram       ;uncomment to find altered RAM after each test
4453
 
4454
 
4455
                             ; indexed wraparound test (only zp should wrap)
4456
0ec8 : a2fd             [ 2]         ldx #3+$fa
4457
0eca : b419             [ 4] tldy4   ldy zp1-$fa&$ff,x   ;wrap on indexed zp
4458
0ecc : 98               [ 2]         tya
4459
0ecd : 9d0901           [ 5]         sta abst-$fa,x      ;no STX abs,x!
4460
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   78
4461
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4462
 
4463
0ed0 : ca               [ 2]         dex
4464
0ed1 : e0fa             [ 2]         cpx #$fa
4465
0ed3 : b0f5             [ 3]         bcs tldy4
4466
0ed5 : a2fd             [ 2]         ldx #3+$fa
4467
0ed7 : bc0e01           [ 4] tldy5   ldy abs1-$fa,x      ;no wrap on indexed abs
4468
0eda : 9412             [ 4]         sty zpt-$fa&$ff,x
4469
0edc : ca               [ 2]         dex
4470
0edd : e0fa             [ 2]         cpx #$fa
4471
0edf : b0f6             [ 3]         bcs tldy5
4472
0ee1 : a203             [ 2]         ldx #3      ;testing wraparound result
4473
0ee3 : a000             [ 2]         ldy #0
4474
0ee5 : b50c             [ 4] tsty1   lda zpt,x
4475
0ee7 : d513             [ 4]         cmp zp1,x
4476
                                     trap_ne     ;store to zp,x data
4477
0ee9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4478
 
4479
0eeb : 940c             [ 4]         sty zpt,x   ;clear
4480
0eed : bd0302           [ 4]         lda abst,x
4481
0ef0 : dd0802           [ 4]         cmp abs1,x
4482
                                     trap_ne     ;store to abs,x data
4483
0ef3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4484
 
4485
0ef5 : 8a               [ 2]         txa
4486
0ef6 : 9d0302           [ 5]         sta abst,x  ;clear
4487
0ef9 : ca               [ 2]         dex
4488
0efa : 10e9             [ 3]         bpl tsty1
4489
                                     next_test
4490
0efc : ad0002           [ 4]>            lda test_case   ;previous test
4491
0eff : c912             [ 2]>            cmp #test_num
4492
                            >            trap_ne         ;test is out of sequence
4493
0f01 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4494
                            >
4495
0013 =                      >test_num = test_num + 1
4496
0f03 : a913             [ 2]>            lda #test_num   ;*** this tests' number
4497
0f05 : 8d0002           [ 4]>            sta test_case
4498
                            >            ;check_ram       ;uncomment to find altered RAM after each test
4499
 
4500
 
4501
                             ; LDX / STX - zp / abs / #
4502
                                     set_stat 0
4503
                            >            load_flag 0
4504
0f08 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
4505
                            >
4506
0f0a : 48               [ 3]>            pha         ;use stack to load status
4507
0f0b : 28               [ 4]>            plp
4508
 
4509
0f0c : a613             [ 3]         ldx zp1
4510
0f0e : 08               [ 3]         php         ;test stores do not alter flags
4511
0f0f : 8a               [ 2]         txa
4512
0f10 : 49c3             [ 2]         eor #$c3
4513
0f12 : aa               [ 2]         tax
4514
0f13 : 28               [ 4]         plp
4515
0f14 : 8e0302           [ 4]         stx abst
4516
0f17 : 08               [ 3]         php         ;flags after load/store sequence
4517
0f18 : 49c3             [ 2]         eor #$c3
4518
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   79
4519
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4520
 
4521
0f1a : aa               [ 2]         tax
4522
0f1b : e0c3             [ 2]         cpx #$c3    ;test result
4523
                                     trap_ne
4524
0f1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4525
 
4526
0f1f : 68               [ 4]         pla         ;load status
4527
                                     eor_flag 0
4528
0f20 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4529
 
4530
0f22 : cd0d02           [ 4]         cmp fLDx    ;test flags
4531
                                     trap_ne
4532
0f25 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4533
 
4534
                                     set_stat 0
4535
                            >            load_flag 0
4536
0f27 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4537
                            >
4538
0f29 : 48               [ 3]>            pha         ;use stack to load status
4539
0f2a : 28               [ 4]>            plp
4540
 
4541
0f2b : a614             [ 3]         ldx zp1+1
4542
0f2d : 08               [ 3]         php         ;test stores do not alter flags
4543
0f2e : 8a               [ 2]         txa
4544
0f2f : 49c3             [ 2]         eor #$c3
4545
0f31 : aa               [ 2]         tax
4546
0f32 : 28               [ 4]         plp
4547
0f33 : 8e0402           [ 4]         stx abst+1
4548
0f36 : 08               [ 3]         php         ;flags after load/store sequence
4549
0f37 : 49c3             [ 2]         eor #$c3
4550
0f39 : aa               [ 2]         tax
4551
0f3a : e082             [ 2]         cpx #$82    ;test result
4552
                                     trap_ne
4553
0f3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4554
 
4555
0f3e : 68               [ 4]         pla         ;load status
4556
                                     eor_flag 0
4557
0f3f : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4558
 
4559
0f41 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
4560
                                     trap_ne
4561
0f44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4562
 
4563
                                     set_stat 0
4564
                            >            load_flag 0
4565
0f46 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4566
                            >
4567
0f48 : 48               [ 3]>            pha         ;use stack to load status
4568
0f49 : 28               [ 4]>            plp
4569
 
4570
0f4a : a615             [ 3]         ldx zp1+2
4571
0f4c : 08               [ 3]         php         ;test stores do not alter flags
4572
0f4d : 8a               [ 2]         txa
4573
0f4e : 49c3             [ 2]         eor #$c3
4574
0f50 : aa               [ 2]         tax
4575
0f51 : 28               [ 4]         plp
4576
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   80
4577
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4578
 
4579
0f52 : 8e0502           [ 4]         stx abst+2
4580
0f55 : 08               [ 3]         php         ;flags after load/store sequence
4581
0f56 : 49c3             [ 2]         eor #$c3
4582
0f58 : aa               [ 2]         tax
4583
0f59 : e041             [ 2]         cpx #$41    ;test result
4584
                                     trap_ne
4585
0f5b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4586
 
4587
0f5d : 68               [ 4]         pla         ;load status
4588
                                     eor_flag 0
4589
0f5e : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4590
 
4591
0f60 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
4592
                                     trap_ne
4593
0f63 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4594
 
4595
                                     set_stat 0
4596
                            >            load_flag 0
4597
0f65 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4598
                            >
4599
0f67 : 48               [ 3]>            pha         ;use stack to load status
4600
0f68 : 28               [ 4]>            plp
4601
 
4602
0f69 : a616             [ 3]         ldx zp1+3
4603
0f6b : 08               [ 3]         php         ;test stores do not alter flags
4604
0f6c : 8a               [ 2]         txa
4605
0f6d : 49c3             [ 2]         eor #$c3
4606
0f6f : aa               [ 2]         tax
4607
0f70 : 28               [ 4]         plp
4608
0f71 : 8e0602           [ 4]         stx abst+3
4609
0f74 : 08               [ 3]         php         ;flags after load/store sequence
4610
0f75 : 49c3             [ 2]         eor #$c3
4611
0f77 : aa               [ 2]         tax
4612
0f78 : e000             [ 2]         cpx #0      ;test result
4613
                                     trap_ne
4614
0f7a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4615
 
4616
0f7c : 68               [ 4]         pla         ;load status
4617
                                     eor_flag 0
4618
0f7d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4619
 
4620
0f7f : cd1002           [ 4]         cmp fLDx+3  ;test flags
4621
                                     trap_ne
4622
0f82 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4623
 
4624
 
4625
                                     set_stat $ff
4626
                            >            load_flag $ff
4627
0f84 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4628
                            >
4629
0f86 : 48               [ 3]>            pha         ;use stack to load status
4630
0f87 : 28               [ 4]>            plp
4631
 
4632
0f88 : a613             [ 3]         ldx zp1
4633
0f8a : 08               [ 3]         php         ;test stores do not alter flags
4634
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   81
4635
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4636
 
4637
0f8b : 8a               [ 2]         txa
4638
0f8c : 49c3             [ 2]         eor #$c3
4639
0f8e : aa               [ 2]         tax
4640
0f8f : 28               [ 4]         plp
4641
0f90 : 8e0302           [ 4]         stx abst
4642
0f93 : 08               [ 3]         php         ;flags after load/store sequence
4643
0f94 : 49c3             [ 2]         eor #$c3
4644
0f96 : aa               [ 2]         tax
4645
0f97 : e0c3             [ 2]         cpx #$c3    ;test result
4646
                                     trap_ne     ;
4647
0f99 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4648
 
4649
0f9b : 68               [ 4]         pla         ;load status
4650
                                     eor_flag lo~fnz ;mask bits not altered
4651
0f9c : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4652
 
4653
0f9e : cd0d02           [ 4]         cmp fLDx    ;test flags
4654
                                     trap_ne
4655
0fa1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4656
 
4657
                                     set_stat $ff
4658
                            >            load_flag $ff
4659
0fa3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4660
                            >
4661
0fa5 : 48               [ 3]>            pha         ;use stack to load status
4662
0fa6 : 28               [ 4]>            plp
4663
 
4664
0fa7 : a614             [ 3]         ldx zp1+1
4665
0fa9 : 08               [ 3]         php         ;test stores do not alter flags
4666
0faa : 8a               [ 2]         txa
4667
0fab : 49c3             [ 2]         eor #$c3
4668
0fad : aa               [ 2]         tax
4669
0fae : 28               [ 4]         plp
4670
0faf : 8e0402           [ 4]         stx abst+1
4671
0fb2 : 08               [ 3]         php         ;flags after load/store sequence
4672
0fb3 : 49c3             [ 2]         eor #$c3
4673
0fb5 : aa               [ 2]         tax
4674
0fb6 : e082             [ 2]         cpx #$82    ;test result
4675
                                     trap_ne
4676
0fb8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4677
 
4678
0fba : 68               [ 4]         pla         ;load status
4679
                                     eor_flag lo~fnz ;mask bits not altered
4680
0fbb : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4681
 
4682
0fbd : cd0e02           [ 4]         cmp fLDx+1  ;test flags
4683
                                     trap_ne
4684
0fc0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4685
 
4686
                                     set_stat $ff
4687
                            >            load_flag $ff
4688
0fc2 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4689
                            >
4690
0fc4 : 48               [ 3]>            pha         ;use stack to load status
4691
0fc5 : 28               [ 4]>            plp
4692
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   82
4693
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4694
 
4695
 
4696
0fc6 : a615             [ 3]         ldx zp1+2
4697
0fc8 : 08               [ 3]         php         ;test stores do not alter flags
4698
0fc9 : 8a               [ 2]         txa
4699
0fca : 49c3             [ 2]         eor #$c3
4700
0fcc : aa               [ 2]         tax
4701
0fcd : 28               [ 4]         plp
4702
0fce : 8e0502           [ 4]         stx abst+2
4703
0fd1 : 08               [ 3]         php         ;flags after load/store sequence
4704
0fd2 : 49c3             [ 2]         eor #$c3
4705
0fd4 : aa               [ 2]         tax
4706
0fd5 : e041             [ 2]         cpx #$41    ;test result
4707
                                     trap_ne     ;
4708
0fd7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4709
 
4710
0fd9 : 68               [ 4]         pla         ;load status
4711
                                     eor_flag lo~fnz ;mask bits not altered
4712
0fda : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4713
 
4714
0fdc : cd0f02           [ 4]         cmp fLDx+2  ;test flags
4715
                                     trap_ne
4716
0fdf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4717
 
4718
                                     set_stat $ff
4719
                            >            load_flag $ff
4720
0fe1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4721
                            >
4722
0fe3 : 48               [ 3]>            pha         ;use stack to load status
4723
0fe4 : 28               [ 4]>            plp
4724
 
4725
0fe5 : a616             [ 3]         ldx zp1+3
4726
0fe7 : 08               [ 3]         php         ;test stores do not alter flags
4727
0fe8 : 8a               [ 2]         txa
4728
0fe9 : 49c3             [ 2]         eor #$c3
4729
0feb : aa               [ 2]         tax
4730
0fec : 28               [ 4]         plp
4731
0fed : 8e0602           [ 4]         stx abst+3
4732
0ff0 : 08               [ 3]         php         ;flags after load/store sequence
4733
0ff1 : 49c3             [ 2]         eor #$c3
4734
0ff3 : aa               [ 2]         tax
4735
0ff4 : e000             [ 2]         cpx #0      ;test result
4736
                                     trap_ne
4737
0ff6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4738
 
4739
0ff8 : 68               [ 4]         pla         ;load status
4740
                                     eor_flag lo~fnz ;mask bits not altered
4741
0ff9 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4742
 
4743
0ffb : cd1002           [ 4]         cmp fLDx+3  ;test flags
4744
                                     trap_ne
4745
0ffe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4746
 
4747
 
4748
                                     set_stat 0
4749
                            >            load_flag 0
4750
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   83
4751
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4752
 
4753
1000 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4754
                            >
4755
1002 : 48               [ 3]>            pha         ;use stack to load status
4756
1003 : 28               [ 4]>            plp
4757
 
4758
1004 : ae0802           [ 4]         ldx abs1
4759
1007 : 08               [ 3]         php         ;test stores do not alter flags
4760
1008 : 8a               [ 2]         txa
4761
1009 : 49c3             [ 2]         eor #$c3
4762
100b : aa               [ 2]         tax
4763
100c : 28               [ 4]         plp
4764
100d : 860c             [ 3]         stx zpt
4765
100f : 08               [ 3]         php         ;flags after load/store sequence
4766
1010 : 49c3             [ 2]         eor #$c3
4767
1012 : c513             [ 3]         cmp zp1     ;test result
4768
                                     trap_ne
4769
1014 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4770
 
4771
1016 : 68               [ 4]         pla         ;load status
4772
                                     eor_flag 0
4773
1017 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4774
 
4775
1019 : cd0d02           [ 4]         cmp fLDx    ;test flags
4776
                                     trap_ne
4777
101c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4778
 
4779
                                     set_stat 0
4780
                            >            load_flag 0
4781
101e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4782
                            >
4783
1020 : 48               [ 3]>            pha         ;use stack to load status
4784
1021 : 28               [ 4]>            plp
4785
 
4786
1022 : ae0902           [ 4]         ldx abs1+1
4787
1025 : 08               [ 3]         php         ;test stores do not alter flags
4788
1026 : 8a               [ 2]         txa
4789
1027 : 49c3             [ 2]         eor #$c3
4790
1029 : aa               [ 2]         tax
4791
102a : 28               [ 4]         plp
4792
102b : 860d             [ 3]         stx zpt+1
4793
102d : 08               [ 3]         php         ;flags after load/store sequence
4794
102e : 49c3             [ 2]         eor #$c3
4795
1030 : c514             [ 3]         cmp zp1+1   ;test result
4796
                                     trap_ne
4797
1032 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4798
 
4799
1034 : 68               [ 4]         pla         ;load status
4800
                                     eor_flag 0
4801
1035 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4802
 
4803
1037 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
4804
                                     trap_ne
4805
103a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4806
 
4807
                                     set_stat 0
4808
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   84
4809
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4810
 
4811
                            >            load_flag 0
4812
103c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4813
                            >
4814
103e : 48               [ 3]>            pha         ;use stack to load status
4815
103f : 28               [ 4]>            plp
4816
 
4817
1040 : ae0a02           [ 4]         ldx abs1+2
4818
1043 : 08               [ 3]         php         ;test stores do not alter flags
4819
1044 : 8a               [ 2]         txa
4820
1045 : 49c3             [ 2]         eor #$c3
4821
1047 : aa               [ 2]         tax
4822
1048 : 28               [ 4]         plp
4823
1049 : 860e             [ 3]         stx zpt+2
4824
104b : 08               [ 3]         php         ;flags after load/store sequence
4825
104c : 49c3             [ 2]         eor #$c3
4826
104e : c515             [ 3]         cmp zp1+2   ;test result
4827
                                     trap_ne
4828
1050 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4829
 
4830
1052 : 68               [ 4]         pla         ;load status
4831
                                     eor_flag 0
4832
1053 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4833
 
4834
1055 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
4835
                                     trap_ne
4836
1058 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4837
 
4838
                                     set_stat 0
4839
                            >            load_flag 0
4840
105a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
4841
                            >
4842
105c : 48               [ 3]>            pha         ;use stack to load status
4843
105d : 28               [ 4]>            plp
4844
 
4845
105e : ae0b02           [ 4]         ldx abs1+3
4846
1061 : 08               [ 3]         php         ;test stores do not alter flags
4847
1062 : 8a               [ 2]         txa
4848
1063 : 49c3             [ 2]         eor #$c3
4849
1065 : aa               [ 2]         tax
4850
1066 : 28               [ 4]         plp
4851
1067 : 860f             [ 3]         stx zpt+3
4852
1069 : 08               [ 3]         php         ;flags after load/store sequence
4853
106a : 49c3             [ 2]         eor #$c3
4854
106c : c516             [ 3]         cmp zp1+3   ;test result
4855
                                     trap_ne
4856
106e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4857
 
4858
1070 : 68               [ 4]         pla         ;load status
4859
                                     eor_flag 0
4860
1071 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
4861
 
4862
1073 : cd1002           [ 4]         cmp fLDx+3  ;test flags
4863
                                     trap_ne
4864
1076 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4865
 
4866
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   85
4867
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4868
 
4869
 
4870
                                     set_stat $ff
4871
                            >            load_flag $ff
4872
1078 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4873
                            >
4874
107a : 48               [ 3]>            pha         ;use stack to load status
4875
107b : 28               [ 4]>            plp
4876
 
4877
107c : ae0802           [ 4]         ldx abs1
4878
107f : 08               [ 3]         php         ;test stores do not alter flags
4879
1080 : 8a               [ 2]         txa
4880
1081 : 49c3             [ 2]         eor #$c3
4881
1083 : aa               [ 2]         tax
4882
1084 : 28               [ 4]         plp
4883
1085 : 860c             [ 3]         stx zpt
4884
1087 : 08               [ 3]         php         ;flags after load/store sequence
4885
1088 : 49c3             [ 2]         eor #$c3
4886
108a : aa               [ 2]         tax
4887
108b : e413             [ 3]         cpx zp1     ;test result
4888
                                     trap_ne
4889
108d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4890
 
4891
108f : 68               [ 4]         pla         ;load status
4892
                                     eor_flag lo~fnz ;mask bits not altered
4893
1090 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4894
 
4895
1092 : cd0d02           [ 4]         cmp fLDx    ;test flags
4896
                                     trap_ne
4897
1095 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4898
 
4899
                                     set_stat $ff
4900
                            >            load_flag $ff
4901
1097 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4902
                            >
4903
1099 : 48               [ 3]>            pha         ;use stack to load status
4904
109a : 28               [ 4]>            plp
4905
 
4906
109b : ae0902           [ 4]         ldx abs1+1
4907
109e : 08               [ 3]         php         ;test stores do not alter flags
4908
109f : 8a               [ 2]         txa
4909
10a0 : 49c3             [ 2]         eor #$c3
4910
10a2 : aa               [ 2]         tax
4911
10a3 : 28               [ 4]         plp
4912
10a4 : 860d             [ 3]         stx zpt+1
4913
10a6 : 08               [ 3]         php         ;flags after load/store sequence
4914
10a7 : 49c3             [ 2]         eor #$c3
4915
10a9 : aa               [ 2]         tax
4916
10aa : e414             [ 3]         cpx zp1+1   ;test result
4917
                                     trap_ne
4918
10ac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4919
 
4920
10ae : 68               [ 4]         pla         ;load status
4921
                                     eor_flag lo~fnz ;mask bits not altered
4922
10af : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4923
 
4924
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   86
4925
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4926
 
4927
10b1 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
4928
                                     trap_ne
4929
10b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4930
 
4931
                                     set_stat $ff
4932
                            >            load_flag $ff
4933
10b6 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4934
                            >
4935
10b8 : 48               [ 3]>            pha         ;use stack to load status
4936
10b9 : 28               [ 4]>            plp
4937
 
4938
10ba : ae0a02           [ 4]         ldx abs1+2
4939
10bd : 08               [ 3]         php         ;test stores do not alter flags
4940
10be : 8a               [ 2]         txa
4941
10bf : 49c3             [ 2]         eor #$c3
4942
10c1 : aa               [ 2]         tax
4943
10c2 : 28               [ 4]         plp
4944
10c3 : 860e             [ 3]         stx zpt+2
4945
10c5 : 08               [ 3]         php         ;flags after load/store sequence
4946
10c6 : 49c3             [ 2]         eor #$c3
4947
10c8 : aa               [ 2]         tax
4948
10c9 : e415             [ 3]         cpx zp1+2   ;test result
4949
                                     trap_ne
4950
10cb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4951
 
4952
10cd : 68               [ 4]         pla         ;load status
4953
                                     eor_flag lo~fnz ;mask bits not altered
4954
10ce : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4955
 
4956
10d0 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
4957
                                     trap_ne
4958
10d3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4959
 
4960
                                     set_stat $ff
4961
                            >            load_flag $ff
4962
10d5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
4963
                            >
4964
10d7 : 48               [ 3]>            pha         ;use stack to load status
4965
10d8 : 28               [ 4]>            plp
4966
 
4967
10d9 : ae0b02           [ 4]         ldx abs1+3
4968
10dc : 08               [ 3]         php         ;test stores do not alter flags
4969
10dd : 8a               [ 2]         txa
4970
10de : 49c3             [ 2]         eor #$c3
4971
10e0 : aa               [ 2]         tax
4972
10e1 : 28               [ 4]         plp
4973
10e2 : 860f             [ 3]         stx zpt+3
4974
10e4 : 08               [ 3]         php         ;flags after load/store sequence
4975
10e5 : 49c3             [ 2]         eor #$c3
4976
10e7 : aa               [ 2]         tax
4977
10e8 : e416             [ 3]         cpx zp1+3   ;test result
4978
                                     trap_ne
4979
10ea : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4980
 
4981
10ec : 68               [ 4]         pla         ;load status
4982
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   87
4983
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
4984
 
4985
                                     eor_flag lo~fnz ;mask bits not altered
4986
10ed : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
4987
 
4988
10ef : cd1002           [ 4]         cmp fLDx+3  ;test flags
4989
                                     trap_ne
4990
10f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
4991
 
4992
 
4993
                                     set_stat 0
4994
                            >            load_flag 0
4995
10f4 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
4996
                            >
4997
10f6 : 48               [ 3]>            pha         ;use stack to load status
4998
10f7 : 28               [ 4]>            plp
4999
 
5000
10f8 : a2c3             [ 2]         ldx #$c3
5001
10fa : 08               [ 3]         php
5002
10fb : ec0802           [ 4]         cpx abs1    ;test result
5003
                                     trap_ne
5004
10fe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5005
 
5006
1100 : 68               [ 4]         pla         ;load status
5007
                                     eor_flag 0
5008
1101 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5009
 
5010
1103 : cd0d02           [ 4]         cmp fLDx    ;test flags
5011
                                     trap_ne
5012
1106 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5013
 
5014
                                     set_stat 0
5015
                            >            load_flag 0
5016
1108 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5017
                            >
5018
110a : 48               [ 3]>            pha         ;use stack to load status
5019
110b : 28               [ 4]>            plp
5020
 
5021
110c : a282             [ 2]         ldx #$82
5022
110e : 08               [ 3]         php
5023
110f : ec0902           [ 4]         cpx abs1+1  ;test result
5024
                                     trap_ne
5025
1112 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5026
 
5027
1114 : 68               [ 4]         pla         ;load status
5028
                                     eor_flag 0
5029
1115 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5030
 
5031
1117 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5032
                                     trap_ne
5033
111a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5034
 
5035
                                     set_stat 0
5036
                            >            load_flag 0
5037
111c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5038
                            >
5039
111e : 48               [ 3]>            pha         ;use stack to load status
5040
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   88
5041
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5042
 
5043
111f : 28               [ 4]>            plp
5044
 
5045
1120 : a241             [ 2]         ldx #$41
5046
1122 : 08               [ 3]         php
5047
1123 : ec0a02           [ 4]         cpx abs1+2  ;test result
5048
                                     trap_ne
5049
1126 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5050
 
5051
1128 : 68               [ 4]         pla         ;load status
5052
                                     eor_flag 0
5053
1129 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5054
 
5055
112b : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5056
                                     trap_ne
5057
112e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5058
 
5059
                                     set_stat 0
5060
                            >            load_flag 0
5061
1130 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5062
                            >
5063
1132 : 48               [ 3]>            pha         ;use stack to load status
5064
1133 : 28               [ 4]>            plp
5065
 
5066
1134 : a200             [ 2]         ldx #0
5067
1136 : 08               [ 3]         php
5068
1137 : ec0b02           [ 4]         cpx abs1+3  ;test result
5069
                                     trap_ne
5070
113a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5071
 
5072
113c : 68               [ 4]         pla         ;load status
5073
                                     eor_flag 0
5074
113d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5075
 
5076
113f : cd1002           [ 4]         cmp fLDx+3  ;test flags
5077
                                     trap_ne
5078
1142 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5079
 
5080
 
5081
                                     set_stat $ff
5082
                            >            load_flag $ff
5083
1144 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5084
                            >
5085
1146 : 48               [ 3]>            pha         ;use stack to load status
5086
1147 : 28               [ 4]>            plp
5087
 
5088
1148 : a2c3             [ 2]         ldx #$c3
5089
114a : 08               [ 3]         php
5090
114b : ec0802           [ 4]         cpx abs1    ;test result
5091
                                     trap_ne
5092
114e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5093
 
5094
1150 : 68               [ 4]         pla         ;load status
5095
                                     eor_flag lo~fnz ;mask bits not altered
5096
1151 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5097
 
5098
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   89
5099
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5100
 
5101
1153 : cd0d02           [ 4]         cmp fLDx    ;test flags
5102
                                     trap_ne
5103
1156 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5104
 
5105
                                     set_stat $ff
5106
                            >            load_flag $ff
5107
1158 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5108
                            >
5109
115a : 48               [ 3]>            pha         ;use stack to load status
5110
115b : 28               [ 4]>            plp
5111
 
5112
115c : a282             [ 2]         ldx #$82
5113
115e : 08               [ 3]         php
5114
115f : ec0902           [ 4]         cpx abs1+1  ;test result
5115
                                     trap_ne
5116
1162 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5117
 
5118
1164 : 68               [ 4]         pla         ;load status
5119
                                     eor_flag lo~fnz ;mask bits not altered
5120
1165 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5121
 
5122
1167 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5123
                                     trap_ne
5124
116a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5125
 
5126
                                     set_stat $ff
5127
                            >            load_flag $ff
5128
116c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5129
                            >
5130
116e : 48               [ 3]>            pha         ;use stack to load status
5131
116f : 28               [ 4]>            plp
5132
 
5133
1170 : a241             [ 2]         ldx #$41
5134
1172 : 08               [ 3]         php
5135
1173 : ec0a02           [ 4]         cpx abs1+2  ;test result
5136
                                     trap_ne
5137
1176 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5138
 
5139
1178 : 68               [ 4]         pla         ;load status
5140
                                     eor_flag lo~fnz ;mask bits not altered
5141
1179 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5142
 
5143
117b : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5144
                                     trap_ne
5145
117e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5146
 
5147
                                     set_stat $ff
5148
                            >            load_flag $ff
5149
1180 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5150
                            >
5151
1182 : 48               [ 3]>            pha         ;use stack to load status
5152
1183 : 28               [ 4]>            plp
5153
 
5154
1184 : a200             [ 2]         ldx #0
5155
1186 : 08               [ 3]         php
5156
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   90
5157
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5158
 
5159
1187 : ec0b02           [ 4]         cpx abs1+3  ;test result
5160
                                     trap_ne
5161
118a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5162
 
5163
118c : 68               [ 4]         pla         ;load status
5164
                                     eor_flag lo~fnz ;mask bits not altered
5165
118d : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5166
 
5167
118f : cd1002           [ 4]         cmp fLDx+3  ;test flags
5168
                                     trap_ne
5169
1192 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5170
 
5171
 
5172
1194 : a200             [ 2]         ldx #0
5173
1196 : a50c             [ 3]         lda zpt
5174
1198 : 49c3             [ 2]         eor #$c3
5175
119a : c513             [ 3]         cmp zp1
5176
                                     trap_ne     ;store to zp data
5177
119c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5178
 
5179
119e : 860c             [ 3]         stx zpt     ;clear
5180
11a0 : ad0302           [ 4]         lda abst
5181
11a3 : 49c3             [ 2]         eor #$c3
5182
11a5 : cd0802           [ 4]         cmp abs1
5183
                                     trap_ne     ;store to abs data
5184
11a8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5185
 
5186
11aa : 8e0302           [ 4]         stx abst    ;clear
5187
11ad : a50d             [ 3]         lda zpt+1
5188
11af : 49c3             [ 2]         eor #$c3
5189
11b1 : c514             [ 3]         cmp zp1+1
5190
                                     trap_ne     ;store to zp data
5191
11b3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5192
 
5193
11b5 : 860d             [ 3]         stx zpt+1   ;clear
5194
11b7 : ad0402           [ 4]         lda abst+1
5195
11ba : 49c3             [ 2]         eor #$c3
5196
11bc : cd0902           [ 4]         cmp abs1+1
5197
                                     trap_ne     ;store to abs data
5198
11bf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5199
 
5200
11c1 : 8e0402           [ 4]         stx abst+1  ;clear
5201
11c4 : a50e             [ 3]         lda zpt+2
5202
11c6 : 49c3             [ 2]         eor #$c3
5203
11c8 : c515             [ 3]         cmp zp1+2
5204
                                     trap_ne     ;store to zp data
5205
11ca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5206
 
5207
11cc : 860e             [ 3]         stx zpt+2   ;clear
5208
11ce : ad0502           [ 4]         lda abst+2
5209
11d1 : 49c3             [ 2]         eor #$c3
5210
11d3 : cd0a02           [ 4]         cmp abs1+2
5211
                                     trap_ne     ;store to abs data
5212
11d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5213
 
5214
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   91
5215
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5216
 
5217
11d8 : 8e0502           [ 4]         stx abst+2  ;clear
5218
11db : a50f             [ 3]         lda zpt+3
5219
11dd : 49c3             [ 2]         eor #$c3
5220
11df : c516             [ 3]         cmp zp1+3
5221
                                     trap_ne     ;store to zp data
5222
11e1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5223
 
5224
11e3 : 860f             [ 3]         stx zpt+3   ;clear
5225
11e5 : ad0602           [ 4]         lda abst+3
5226
11e8 : 49c3             [ 2]         eor #$c3
5227
11ea : cd0b02           [ 4]         cmp abs1+3
5228
                                     trap_ne     ;store to abs data
5229
11ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5230
 
5231
11ef : 8e0602           [ 4]         stx abst+3  ;clear
5232
                                     next_test
5233
11f2 : ad0002           [ 4]>            lda test_case   ;previous test
5234
11f5 : c913             [ 2]>            cmp #test_num
5235
                            >            trap_ne         ;test is out of sequence
5236
11f7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5237
                            >
5238
0014 =                      >test_num = test_num + 1
5239
11f9 : a914             [ 2]>            lda #test_num   ;*** this tests' number
5240
11fb : 8d0002           [ 4]>            sta test_case
5241
                            >            ;check_ram       ;uncomment to find altered RAM after each test
5242
 
5243
 
5244
                             ; LDY / STY - zp / abs / #
5245
                                     set_stat 0
5246
                            >            load_flag 0
5247
11fe : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5248
                            >
5249
1200 : 48               [ 3]>            pha         ;use stack to load status
5250
1201 : 28               [ 4]>            plp
5251
 
5252
1202 : a413             [ 3]         ldy zp1
5253
1204 : 08               [ 3]         php         ;test stores do not alter flags
5254
1205 : 98               [ 2]         tya
5255
1206 : 49c3             [ 2]         eor #$c3
5256
1208 : a8               [ 2]         tay
5257
1209 : 28               [ 4]         plp
5258
120a : 8c0302           [ 4]         sty abst
5259
120d : 08               [ 3]         php         ;flags after load/store sequence
5260
120e : 49c3             [ 2]         eor #$c3
5261
1210 : a8               [ 2]         tay
5262
1211 : c0c3             [ 2]         cpy #$c3    ;test result
5263
                                     trap_ne
5264
1213 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5265
 
5266
1215 : 68               [ 4]         pla         ;load status
5267
                                     eor_flag 0
5268
1216 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5269
 
5270
1218 : cd0d02           [ 4]         cmp fLDx    ;test flags
5271
                                     trap_ne
5272
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   92
5273
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5274
 
5275
121b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5276
 
5277
                                     set_stat 0
5278
                            >            load_flag 0
5279
121d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5280
                            >
5281
121f : 48               [ 3]>            pha         ;use stack to load status
5282
1220 : 28               [ 4]>            plp
5283
 
5284
1221 : a414             [ 3]         ldy zp1+1
5285
1223 : 08               [ 3]         php         ;test stores do not alter flags
5286
1224 : 98               [ 2]         tya
5287
1225 : 49c3             [ 2]         eor #$c3
5288
1227 : a8               [ 2]         tay
5289
1228 : 28               [ 4]         plp
5290
1229 : 8c0402           [ 4]         sty abst+1
5291
122c : 08               [ 3]         php         ;flags after load/store sequence
5292
122d : 49c3             [ 2]         eor #$c3
5293
122f : a8               [ 2]         tay
5294
1230 : c082             [ 2]         cpy #$82    ;test result
5295
                                     trap_ne
5296
1232 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5297
 
5298
1234 : 68               [ 4]         pla         ;load status
5299
                                     eor_flag 0
5300
1235 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5301
 
5302
1237 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5303
                                     trap_ne
5304
123a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5305
 
5306
                                     set_stat 0
5307
                            >            load_flag 0
5308
123c : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5309
                            >
5310
123e : 48               [ 3]>            pha         ;use stack to load status
5311
123f : 28               [ 4]>            plp
5312
 
5313
1240 : a415             [ 3]         ldy zp1+2
5314
1242 : 08               [ 3]         php         ;test stores do not alter flags
5315
1243 : 98               [ 2]         tya
5316
1244 : 49c3             [ 2]         eor #$c3
5317
1246 : a8               [ 2]         tay
5318
1247 : 28               [ 4]         plp
5319
1248 : 8c0502           [ 4]         sty abst+2
5320
124b : 08               [ 3]         php         ;flags after load/store sequence
5321
124c : 49c3             [ 2]         eor #$c3
5322
124e : a8               [ 2]         tay
5323
124f : c041             [ 2]         cpy #$41    ;test result
5324
                                     trap_ne
5325
1251 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5326
 
5327
1253 : 68               [ 4]         pla         ;load status
5328
                                     eor_flag 0
5329
1254 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5330
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   93
5331
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5332
 
5333
 
5334
1256 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5335
                                     trap_ne
5336
1259 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5337
 
5338
                                     set_stat 0
5339
                            >            load_flag 0
5340
125b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5341
                            >
5342
125d : 48               [ 3]>            pha         ;use stack to load status
5343
125e : 28               [ 4]>            plp
5344
 
5345
125f : a416             [ 3]         ldy zp1+3
5346
1261 : 08               [ 3]         php         ;test stores do not alter flags
5347
1262 : 98               [ 2]         tya
5348
1263 : 49c3             [ 2]         eor #$c3
5349
1265 : a8               [ 2]         tay
5350
1266 : 28               [ 4]         plp
5351
1267 : 8c0602           [ 4]         sty abst+3
5352
126a : 08               [ 3]         php         ;flags after load/store sequence
5353
126b : 49c3             [ 2]         eor #$c3
5354
126d : a8               [ 2]         tay
5355
126e : c000             [ 2]         cpy #0      ;test result
5356
                                     trap_ne
5357
1270 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5358
 
5359
1272 : 68               [ 4]         pla         ;load status
5360
                                     eor_flag 0
5361
1273 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5362
 
5363
1275 : cd1002           [ 4]         cmp fLDx+3  ;test flags
5364
                                     trap_ne
5365
1278 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5366
 
5367
 
5368
                                     set_stat $ff
5369
                            >            load_flag $ff
5370
127a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5371
                            >
5372
127c : 48               [ 3]>            pha         ;use stack to load status
5373
127d : 28               [ 4]>            plp
5374
 
5375
127e : a413             [ 3]         ldy zp1
5376
1280 : 08               [ 3]         php         ;test stores do not alter flags
5377
1281 : 98               [ 2]         tya
5378
1282 : 49c3             [ 2]         eor #$c3
5379
1284 : a8               [ 2]         tay
5380
1285 : 28               [ 4]         plp
5381
1286 : 8c0302           [ 4]         sty abst
5382
1289 : 08               [ 3]         php         ;flags after load/store sequence
5383
128a : 49c3             [ 2]         eor #$c3
5384
128c : a8               [ 2]         tay
5385
128d : c0c3             [ 2]         cpy #$c3    ;test result
5386
                                     trap_ne
5387
128f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5388
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   94
5389
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5390
 
5391
 
5392
1291 : 68               [ 4]         pla         ;load status
5393
                                     eor_flag lo~fnz ;mask bits not altered
5394
1292 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5395
 
5396
1294 : cd0d02           [ 4]         cmp fLDx    ;test flags
5397
                                     trap_ne
5398
1297 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5399
 
5400
                                     set_stat $ff
5401
                            >            load_flag $ff
5402
1299 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5403
                            >
5404
129b : 48               [ 3]>            pha         ;use stack to load status
5405
129c : 28               [ 4]>            plp
5406
 
5407
129d : a414             [ 3]         ldy zp1+1
5408
129f : 08               [ 3]         php         ;test stores do not alter flags
5409
12a0 : 98               [ 2]         tya
5410
12a1 : 49c3             [ 2]         eor #$c3
5411
12a3 : a8               [ 2]         tay
5412
12a4 : 28               [ 4]         plp
5413
12a5 : 8c0402           [ 4]         sty abst+1
5414
12a8 : 08               [ 3]         php         ;flags after load/store sequence
5415
12a9 : 49c3             [ 2]         eor #$c3
5416
12ab : a8               [ 2]         tay
5417
12ac : c082             [ 2]         cpy #$82   ;test result
5418
                                     trap_ne
5419
12ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5420
 
5421
12b0 : 68               [ 4]         pla         ;load status
5422
                                     eor_flag lo~fnz ;mask bits not altered
5423
12b1 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5424
 
5425
12b3 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5426
                                     trap_ne
5427
12b6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5428
 
5429
                                     set_stat $ff
5430
                            >            load_flag $ff
5431
12b8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5432
                            >
5433
12ba : 48               [ 3]>            pha         ;use stack to load status
5434
12bb : 28               [ 4]>            plp
5435
 
5436
12bc : a415             [ 3]         ldy zp1+2
5437
12be : 08               [ 3]         php         ;test stores do not alter flags
5438
12bf : 98               [ 2]         tya
5439
12c0 : 49c3             [ 2]         eor #$c3
5440
12c2 : a8               [ 2]         tay
5441
12c3 : 28               [ 4]         plp
5442
12c4 : 8c0502           [ 4]         sty abst+2
5443
12c7 : 08               [ 3]         php         ;flags after load/store sequence
5444
12c8 : 49c3             [ 2]         eor #$c3
5445
12ca : a8               [ 2]         tay
5446
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   95
5447
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5448
 
5449
12cb : c041             [ 2]         cpy #$41    ;test result
5450
                                     trap_ne
5451
12cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5452
 
5453
12cf : 68               [ 4]         pla         ;load status
5454
                                     eor_flag lo~fnz ;mask bits not altered
5455
12d0 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5456
 
5457
12d2 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5458
                                     trap_ne
5459
12d5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5460
 
5461
                                     set_stat $ff
5462
                            >            load_flag $ff
5463
12d7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5464
                            >
5465
12d9 : 48               [ 3]>            pha         ;use stack to load status
5466
12da : 28               [ 4]>            plp
5467
 
5468
12db : a416             [ 3]         ldy zp1+3
5469
12dd : 08               [ 3]         php         ;test stores do not alter flags
5470
12de : 98               [ 2]         tya
5471
12df : 49c3             [ 2]         eor #$c3
5472
12e1 : a8               [ 2]         tay
5473
12e2 : 28               [ 4]         plp
5474
12e3 : 8c0602           [ 4]         sty abst+3
5475
12e6 : 08               [ 3]         php         ;flags after load/store sequence
5476
12e7 : 49c3             [ 2]         eor #$c3
5477
12e9 : a8               [ 2]         tay
5478
12ea : c000             [ 2]         cpy #0      ;test result
5479
                                     trap_ne
5480
12ec : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5481
 
5482
12ee : 68               [ 4]         pla         ;load status
5483
                                     eor_flag lo~fnz ;mask bits not altered
5484
12ef : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5485
 
5486
12f1 : cd1002           [ 4]         cmp fLDx+3  ;test flags
5487
                                     trap_ne
5488
12f4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5489
 
5490
 
5491
                                     set_stat 0
5492
                            >            load_flag 0
5493
12f6 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5494
                            >
5495
12f8 : 48               [ 3]>            pha         ;use stack to load status
5496
12f9 : 28               [ 4]>            plp
5497
 
5498
12fa : ac0802           [ 4]         ldy abs1
5499
12fd : 08               [ 3]         php         ;test stores do not alter flags
5500
12fe : 98               [ 2]         tya
5501
12ff : 49c3             [ 2]         eor #$c3
5502
1301 : a8               [ 2]         tay
5503
1302 : 28               [ 4]         plp
5504
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   96
5505
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5506
 
5507
1303 : 840c             [ 3]         sty zpt
5508
1305 : 08               [ 3]         php         ;flags after load/store sequence
5509
1306 : 49c3             [ 2]         eor #$c3
5510
1308 : a8               [ 2]         tay
5511
1309 : c413             [ 3]         cpy zp1     ;test result
5512
                                     trap_ne
5513
130b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5514
 
5515
130d : 68               [ 4]         pla         ;load status
5516
                                     eor_flag 0
5517
130e : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5518
 
5519
1310 : cd0d02           [ 4]         cmp fLDx    ;test flags
5520
                                     trap_ne
5521
1313 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5522
 
5523
                                     set_stat 0
5524
                            >            load_flag 0
5525
1315 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5526
                            >
5527
1317 : 48               [ 3]>            pha         ;use stack to load status
5528
1318 : 28               [ 4]>            plp
5529
 
5530
1319 : ac0902           [ 4]         ldy abs1+1
5531
131c : 08               [ 3]         php         ;test stores do not alter flags
5532
131d : 98               [ 2]         tya
5533
131e : 49c3             [ 2]         eor #$c3
5534
1320 : a8               [ 2]         tay
5535
1321 : 28               [ 4]         plp
5536
1322 : 840d             [ 3]         sty zpt+1
5537
1324 : 08               [ 3]         php         ;flags after load/store sequence
5538
1325 : 49c3             [ 2]         eor #$c3
5539
1327 : a8               [ 2]         tay
5540
1328 : c414             [ 3]         cpy zp1+1   ;test result
5541
                                     trap_ne
5542
132a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5543
 
5544
132c : 68               [ 4]         pla         ;load status
5545
                                     eor_flag 0
5546
132d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5547
 
5548
132f : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5549
                                     trap_ne
5550
1332 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5551
 
5552
                                     set_stat 0
5553
                            >            load_flag 0
5554
1334 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5555
                            >
5556
1336 : 48               [ 3]>            pha         ;use stack to load status
5557
1337 : 28               [ 4]>            plp
5558
 
5559
1338 : ac0a02           [ 4]         ldy abs1+2
5560
133b : 08               [ 3]         php         ;test stores do not alter flags
5561
133c : 98               [ 2]         tya
5562
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   97
5563
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5564
 
5565
133d : 49c3             [ 2]         eor #$c3
5566
133f : a8               [ 2]         tay
5567
1340 : 28               [ 4]         plp
5568
1341 : 840e             [ 3]         sty zpt+2
5569
1343 : 08               [ 3]         php         ;flags after load/store sequence
5570
1344 : 49c3             [ 2]         eor #$c3
5571
1346 : a8               [ 2]         tay
5572
1347 : c415             [ 3]         cpy zp1+2   ;test result
5573
                                     trap_ne
5574
1349 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5575
 
5576
134b : 68               [ 4]         pla         ;load status
5577
                                     eor_flag 0
5578
134c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5579
 
5580
134e : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5581
                                     trap_ne
5582
1351 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5583
 
5584
                                     set_stat 0
5585
                            >            load_flag 0
5586
1353 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5587
                            >
5588
1355 : 48               [ 3]>            pha         ;use stack to load status
5589
1356 : 28               [ 4]>            plp
5590
 
5591
1357 : ac0b02           [ 4]         ldy abs1+3
5592
135a : 08               [ 3]         php         ;test stores do not alter flags
5593
135b : 98               [ 2]         tya
5594
135c : 49c3             [ 2]         eor #$c3
5595
135e : a8               [ 2]         tay
5596
135f : 28               [ 4]         plp
5597
1360 : 840f             [ 3]         sty zpt+3
5598
1362 : 08               [ 3]         php         ;flags after load/store sequence
5599
1363 : 49c3             [ 2]         eor #$c3
5600
1365 : a8               [ 2]         tay
5601
1366 : c416             [ 3]         cpy zp1+3   ;test result
5602
                                     trap_ne
5603
1368 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5604
 
5605
136a : 68               [ 4]         pla         ;load status
5606
                                     eor_flag 0
5607
136b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5608
 
5609
136d : cd1002           [ 4]         cmp fLDx+3  ;test flags
5610
                                     trap_ne
5611
1370 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5612
 
5613
 
5614
                                     set_stat $ff
5615
                            >            load_flag $ff
5616
1372 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5617
                            >
5618
1374 : 48               [ 3]>            pha         ;use stack to load status
5619
1375 : 28               [ 4]>            plp
5620
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   98
5621
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5622
 
5623
 
5624
1376 : ac0802           [ 4]         ldy abs1
5625
1379 : 08               [ 3]         php         ;test stores do not alter flags
5626
137a : 98               [ 2]         tya
5627
137b : 49c3             [ 2]         eor #$c3
5628
137d : a8               [ 2]         tay
5629
137e : 28               [ 4]         plp
5630
137f : 840c             [ 3]         sty zpt
5631
1381 : 08               [ 3]         php         ;flags after load/store sequence
5632
1382 : 49c3             [ 2]         eor #$c3
5633
1384 : a8               [ 2]         tay
5634
1385 : c513             [ 3]         cmp zp1     ;test result
5635
                                     trap_ne
5636
1387 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5637
 
5638
1389 : 68               [ 4]         pla         ;load status
5639
                                     eor_flag lo~fnz ;mask bits not altered
5640
138a : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5641
 
5642
138c : cd0d02           [ 4]         cmp fLDx    ;test flags
5643
                                     trap_ne
5644
138f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5645
 
5646
                                     set_stat $ff
5647
                            >            load_flag $ff
5648
1391 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5649
                            >
5650
1393 : 48               [ 3]>            pha         ;use stack to load status
5651
1394 : 28               [ 4]>            plp
5652
 
5653
1395 : ac0902           [ 4]         ldy abs1+1
5654
1398 : 08               [ 3]         php         ;test stores do not alter flags
5655
1399 : 98               [ 2]         tya
5656
139a : 49c3             [ 2]         eor #$c3
5657
139c : a8               [ 2]         tay
5658
139d : 28               [ 4]         plp
5659
139e : 840d             [ 3]         sty zpt+1
5660
13a0 : 08               [ 3]         php         ;flags after load/store sequence
5661
13a1 : 49c3             [ 2]         eor #$c3
5662
13a3 : a8               [ 2]         tay
5663
13a4 : c514             [ 3]         cmp zp1+1   ;test result
5664
                                     trap_ne
5665
13a6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5666
 
5667
13a8 : 68               [ 4]         pla         ;load status
5668
                                     eor_flag lo~fnz ;mask bits not altered
5669
13a9 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5670
 
5671
13ab : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5672
                                     trap_ne
5673
13ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5674
 
5675
                                     set_stat $ff
5676
                            >            load_flag $ff
5677
13b0 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5678
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page   99
5679
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5680
 
5681
                            >
5682
13b2 : 48               [ 3]>            pha         ;use stack to load status
5683
13b3 : 28               [ 4]>            plp
5684
 
5685
13b4 : ac0a02           [ 4]         ldy abs1+2
5686
13b7 : 08               [ 3]         php         ;test stores do not alter flags
5687
13b8 : 98               [ 2]         tya
5688
13b9 : 49c3             [ 2]         eor #$c3
5689
13bb : a8               [ 2]         tay
5690
13bc : 28               [ 4]         plp
5691
13bd : 840e             [ 3]         sty zpt+2
5692
13bf : 08               [ 3]         php         ;flags after load/store sequence
5693
13c0 : 49c3             [ 2]         eor #$c3
5694
13c2 : a8               [ 2]         tay
5695
13c3 : c515             [ 3]         cmp zp1+2   ;test result
5696
                                     trap_ne
5697
13c5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5698
 
5699
13c7 : 68               [ 4]         pla         ;load status
5700
                                     eor_flag lo~fnz ;mask bits not altered
5701
13c8 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5702
 
5703
13ca : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5704
                                     trap_ne
5705
13cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5706
 
5707
                                     set_stat $ff
5708
                            >            load_flag $ff
5709
13cf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5710
                            >
5711
13d1 : 48               [ 3]>            pha         ;use stack to load status
5712
13d2 : 28               [ 4]>            plp
5713
 
5714
13d3 : ac0b02           [ 4]         ldy abs1+3
5715
13d6 : 08               [ 3]         php         ;test stores do not alter flags
5716
13d7 : 98               [ 2]         tya
5717
13d8 : 49c3             [ 2]         eor #$c3
5718
13da : a8               [ 2]         tay
5719
13db : 28               [ 4]         plp
5720
13dc : 840f             [ 3]         sty zpt+3
5721
13de : 08               [ 3]         php         ;flags after load/store sequence
5722
13df : 49c3             [ 2]         eor #$c3
5723
13e1 : a8               [ 2]         tay
5724
13e2 : c516             [ 3]         cmp zp1+3   ;test result
5725
                                     trap_ne
5726
13e4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5727
 
5728
13e6 : 68               [ 4]         pla         ;load status
5729
                                     eor_flag lo~fnz ;mask bits not altered
5730
13e7 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5731
 
5732
13e9 : cd1002           [ 4]         cmp fLDx+3  ;test flags
5733
                                     trap_ne
5734
13ec : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5735
 
5736
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  100
5737
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5738
 
5739
 
5740
 
5741
                                     set_stat 0
5742
                            >            load_flag 0
5743
13ee : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5744
                            >
5745
13f0 : 48               [ 3]>            pha         ;use stack to load status
5746
13f1 : 28               [ 4]>            plp
5747
 
5748
13f2 : a0c3             [ 2]         ldy #$c3
5749
13f4 : 08               [ 3]         php
5750
13f5 : cc0802           [ 4]         cpy abs1    ;test result
5751
                                     trap_ne
5752
13f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5753
 
5754
13fa : 68               [ 4]         pla         ;load status
5755
                                     eor_flag 0
5756
13fb : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5757
 
5758
13fd : cd0d02           [ 4]         cmp fLDx    ;test flags
5759
                                     trap_ne
5760
1400 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5761
 
5762
                                     set_stat 0
5763
                            >            load_flag 0
5764
1402 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5765
                            >
5766
1404 : 48               [ 3]>            pha         ;use stack to load status
5767
1405 : 28               [ 4]>            plp
5768
 
5769
1406 : a082             [ 2]         ldy #$82
5770
1408 : 08               [ 3]         php
5771
1409 : cc0902           [ 4]         cpy abs1+1  ;test result
5772
                                     trap_ne
5773
140c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5774
 
5775
140e : 68               [ 4]         pla         ;load status
5776
                                     eor_flag 0
5777
140f : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5778
 
5779
1411 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5780
                                     trap_ne
5781
1414 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5782
 
5783
                                     set_stat 0
5784
                            >            load_flag 0
5785
1416 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5786
                            >
5787
1418 : 48               [ 3]>            pha         ;use stack to load status
5788
1419 : 28               [ 4]>            plp
5789
 
5790
141a : a041             [ 2]         ldy #$41
5791
141c : 08               [ 3]         php
5792
141d : cc0a02           [ 4]         cpy abs1+2  ;test result
5793
                                     trap_ne
5794
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  101
5795
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5796
 
5797
1420 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5798
 
5799
1422 : 68               [ 4]         pla         ;load status
5800
                                     eor_flag 0
5801
1423 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5802
 
5803
1425 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5804
                                     trap_ne
5805
1428 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5806
 
5807
                                     set_stat 0
5808
                            >            load_flag 0
5809
142a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5810
                            >
5811
142c : 48               [ 3]>            pha         ;use stack to load status
5812
142d : 28               [ 4]>            plp
5813
 
5814
142e : a000             [ 2]         ldy #0
5815
1430 : 08               [ 3]         php
5816
1431 : cc0b02           [ 4]         cpy abs1+3  ;test result
5817
                                     trap_ne
5818
1434 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5819
 
5820
1436 : 68               [ 4]         pla         ;load status
5821
                                     eor_flag 0
5822
1437 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
5823
 
5824
1439 : cd1002           [ 4]         cmp fLDx+3  ;test flags
5825
                                     trap_ne
5826
143c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5827
 
5828
 
5829
                                     set_stat $ff
5830
                            >            load_flag $ff
5831
143e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5832
                            >
5833
1440 : 48               [ 3]>            pha         ;use stack to load status
5834
1441 : 28               [ 4]>            plp
5835
 
5836
1442 : a0c3             [ 2]         ldy #$c3
5837
1444 : 08               [ 3]         php
5838
1445 : cc0802           [ 4]         cpy abs1    ;test result
5839
                                     trap_ne
5840
1448 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5841
 
5842
144a : 68               [ 4]         pla         ;load status
5843
                                     eor_flag lo~fnz ;mask bits not altered
5844
144b : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5845
 
5846
144d : cd0d02           [ 4]         cmp fLDx    ;test flags
5847
                                     trap_ne
5848
1450 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5849
 
5850
                                     set_stat $ff
5851
                            >            load_flag $ff
5852
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  102
5853
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5854
 
5855
1452 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5856
                            >
5857
1454 : 48               [ 3]>            pha         ;use stack to load status
5858
1455 : 28               [ 4]>            plp
5859
 
5860
1456 : a082             [ 2]         ldy #$82
5861
1458 : 08               [ 3]         php
5862
1459 : cc0902           [ 4]         cpy abs1+1  ;test result
5863
                                     trap_ne
5864
145c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5865
 
5866
145e : 68               [ 4]         pla         ;load status
5867
                                     eor_flag lo~fnz ;mask bits not altered
5868
145f : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5869
 
5870
1461 : cd0e02           [ 4]         cmp fLDx+1  ;test flags
5871
                                     trap_ne
5872
1464 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5873
 
5874
                                     set_stat $ff
5875
                            >            load_flag $ff
5876
1466 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5877
                            >
5878
1468 : 48               [ 3]>            pha         ;use stack to load status
5879
1469 : 28               [ 4]>            plp
5880
 
5881
146a : a041             [ 2]         ldy #$41
5882
146c : 08               [ 3]         php
5883
146d : cc0a02           [ 4]         cpy abs1+2   ;test result
5884
                                     trap_ne
5885
1470 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5886
 
5887
1472 : 68               [ 4]         pla         ;load status
5888
                                     eor_flag lo~fnz ;mask bits not altered
5889
1473 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5890
 
5891
1475 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
5892
                                     trap_ne
5893
1478 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5894
 
5895
                                     set_stat $ff
5896
                            >            load_flag $ff
5897
147a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
5898
                            >
5899
147c : 48               [ 3]>            pha         ;use stack to load status
5900
147d : 28               [ 4]>            plp
5901
 
5902
147e : a000             [ 2]         ldy #0
5903
1480 : 08               [ 3]         php
5904
1481 : cc0b02           [ 4]         cpy abs1+3  ;test result
5905
                                     trap_ne
5906
1484 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5907
 
5908
1486 : 68               [ 4]         pla         ;load status
5909
                                     eor_flag lo~fnz ;mask bits not altered
5910
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  103
5911
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5912
 
5913
1487 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
5914
 
5915
1489 : cd1002           [ 4]         cmp fLDx+3  ;test flags
5916
                                     trap_ne
5917
148c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5918
 
5919
 
5920
148e : a000             [ 2]         ldy #0
5921
1490 : a50c             [ 3]         lda zpt
5922
1492 : 49c3             [ 2]         eor #$c3
5923
1494 : c513             [ 3]         cmp zp1
5924
                                     trap_ne     ;store to zp   data
5925
1496 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5926
 
5927
1498 : 840c             [ 3]         sty zpt     ;clear
5928
149a : ad0302           [ 4]         lda abst
5929
149d : 49c3             [ 2]         eor #$c3
5930
149f : cd0802           [ 4]         cmp abs1
5931
                                     trap_ne     ;store to abs   data
5932
14a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5933
 
5934
14a4 : 8c0302           [ 4]         sty abst    ;clear
5935
14a7 : a50d             [ 3]         lda zpt+1
5936
14a9 : 49c3             [ 2]         eor #$c3
5937
14ab : c514             [ 3]         cmp zp1+1
5938
                                     trap_ne     ;store to zp+1 data
5939
14ad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5940
 
5941
14af : 840d             [ 3]         sty zpt+1   ;clear
5942
14b1 : ad0402           [ 4]         lda abst+1
5943
14b4 : 49c3             [ 2]         eor #$c3
5944
14b6 : cd0902           [ 4]         cmp abs1+1
5945
                                     trap_ne     ;store to abs+1 data
5946
14b9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5947
 
5948
14bb : 8c0402           [ 4]         sty abst+1  ;clear
5949
14be : a50e             [ 3]         lda zpt+2
5950
14c0 : 49c3             [ 2]         eor #$c3
5951
14c2 : c515             [ 3]         cmp zp1+2
5952
                                     trap_ne     ;store to zp+2 data
5953
14c4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5954
 
5955
14c6 : 840e             [ 3]         sty zpt+2   ;clear
5956
14c8 : ad0502           [ 4]         lda abst+2
5957
14cb : 49c3             [ 2]         eor #$c3
5958
14cd : cd0a02           [ 4]         cmp abs1+2
5959
                                     trap_ne     ;store to abs+2 data
5960
14d0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5961
 
5962
14d2 : 8c0502           [ 4]         sty abst+2  ;clear
5963
14d5 : a50f             [ 3]         lda zpt+3
5964
14d7 : 49c3             [ 2]         eor #$c3
5965
14d9 : c516             [ 3]         cmp zp1+3
5966
                                     trap_ne     ;store to zp+3 data
5967
14db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5968
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  104
5969
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
5970
 
5971
 
5972
14dd : 840f             [ 3]         sty zpt+3   ;clear
5973
14df : ad0602           [ 4]         lda abst+3
5974
14e2 : 49c3             [ 2]         eor #$c3
5975
14e4 : cd0b02           [ 4]         cmp abs1+3
5976
                                     trap_ne     ;store to abs+3 data
5977
14e7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5978
 
5979
14e9 : 8c0602           [ 4]         sty abst+3  ;clear
5980
                                     next_test
5981
14ec : ad0002           [ 4]>            lda test_case   ;previous test
5982
14ef : c914             [ 2]>            cmp #test_num
5983
                            >            trap_ne         ;test is out of sequence
5984
14f1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
5985
                            >
5986
0015 =                      >test_num = test_num + 1
5987
14f3 : a915             [ 2]>            lda #test_num   ;*** this tests' number
5988
14f5 : 8d0002           [ 4]>            sta test_case
5989
                            >            ;check_ram       ;uncomment to find altered RAM after each test
5990
 
5991
 
5992
                             ; testing load / store accumulator LDA / STA all addressing modes
5993
                             ; LDA / STA - zp,x / abs,x
5994
14f8 : a203             [ 2]         ldx #3
5995
14fa :                       tldax
5996
                                     set_stat 0
5997
                            >            load_flag 0
5998
14fa : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
5999
                            >
6000
14fc : 48               [ 3]>            pha         ;use stack to load status
6001
14fd : 28               [ 4]>            plp
6002
 
6003
14fe : b513             [ 4]         lda zp1,x
6004
1500 : 08               [ 3]         php         ;test stores do not alter flags
6005
1501 : 49c3             [ 2]         eor #$c3
6006
1503 : 28               [ 4]         plp
6007
1504 : 9d0302           [ 5]         sta abst,x
6008
1507 : 08               [ 3]         php         ;flags after load/store sequence
6009
1508 : 49c3             [ 2]         eor #$c3
6010
150a : dd0802           [ 4]         cmp abs1,x  ;test result
6011
                                     trap_ne
6012
150d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6013
 
6014
150f : 68               [ 4]         pla         ;load status
6015
                                     eor_flag 0
6016
1510 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6017
 
6018
1512 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
6019
                                     trap_ne
6020
1515 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6021
 
6022
1517 : ca               [ 2]         dex
6023
1518 : 10e0             [ 4]         bpl tldax
6024
 
6025
151a : a203             [ 2]         ldx #3
6026
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  105
6027
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6028
 
6029
151c :                       tldax1
6030
                                     set_stat $ff
6031
                            >            load_flag $ff
6032
151c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6033
                            >
6034
151e : 48               [ 3]>            pha         ;use stack to load status
6035
151f : 28               [ 4]>            plp
6036
 
6037
1520 : b513             [ 4]         lda zp1,x
6038
1522 : 08               [ 3]         php         ;test stores do not alter flags
6039
1523 : 49c3             [ 2]         eor #$c3
6040
1525 : 28               [ 4]         plp
6041
1526 : 9d0302           [ 5]         sta abst,x
6042
1529 : 08               [ 3]         php         ;flags after load/store sequence
6043
152a : 49c3             [ 2]         eor #$c3
6044
152c : dd0802           [ 4]         cmp abs1,x   ;test result
6045
                                     trap_ne
6046
152f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6047
 
6048
1531 : 68               [ 4]         pla         ;load status
6049
                                     eor_flag lo~fnz ;mask bits not altered
6050
1532 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6051
 
6052
1534 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
6053
                                     trap_ne
6054
1537 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6055
 
6056
1539 : ca               [ 2]         dex
6057
153a : 10e0             [ 3]         bpl tldax1
6058
 
6059
153c : a203             [ 2]         ldx #3
6060
153e :                       tldax2
6061
                                     set_stat 0
6062
                            >            load_flag 0
6063
153e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6064
                            >
6065
1540 : 48               [ 3]>            pha         ;use stack to load status
6066
1541 : 28               [ 4]>            plp
6067
 
6068
1542 : bd0802           [ 4]         lda abs1,x
6069
1545 : 08               [ 3]         php         ;test stores do not alter flags
6070
1546 : 49c3             [ 2]         eor #$c3
6071
1548 : 28               [ 4]         plp
6072
1549 : 950c             [ 4]         sta zpt,x
6073
154b : 08               [ 3]         php         ;flags after load/store sequence
6074
154c : 49c3             [ 2]         eor #$c3
6075
154e : d513             [ 4]         cmp zp1,x   ;test result
6076
                                     trap_ne
6077
1550 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6078
 
6079
1552 : 68               [ 4]         pla         ;load status
6080
                                     eor_flag 0
6081
1553 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6082
 
6083
1555 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
6084
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  106
6085
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6086
 
6087
                                     trap_ne
6088
1558 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6089
 
6090
155a : ca               [ 2]         dex
6091
155b : 10e1             [ 3]         bpl tldax2
6092
 
6093
155d : a203             [ 2]         ldx #3
6094
155f :                       tldax3
6095
                                     set_stat $ff
6096
                            >            load_flag $ff
6097
155f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6098
                            >
6099
1561 : 48               [ 3]>            pha         ;use stack to load status
6100
1562 : 28               [ 4]>            plp
6101
 
6102
1563 : bd0802           [ 4]         lda abs1,x
6103
1566 : 08               [ 3]         php         ;test stores do not alter flags
6104
1567 : 49c3             [ 2]         eor #$c3
6105
1569 : 28               [ 4]         plp
6106
156a : 950c             [ 4]         sta zpt,x
6107
156c : 08               [ 3]         php         ;flags after load/store sequence
6108
156d : 49c3             [ 2]         eor #$c3
6109
156f : d513             [ 4]         cmp zp1,x   ;test result
6110
                                     trap_ne
6111
1571 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6112
 
6113
1573 : 68               [ 4]         pla         ;load status
6114
                                     eor_flag lo~fnz ;mask bits not altered
6115
1574 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6116
 
6117
1576 : dd0d02           [ 4]         cmp fLDx,x  ;test flags
6118
                                     trap_ne
6119
1579 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6120
 
6121
157b : ca               [ 2]         dex
6122
157c : 10e1             [ 3]         bpl tldax3
6123
 
6124
157e : a203             [ 2]         ldx #3      ;testing store result
6125
1580 : a000             [ 2]         ldy #0
6126
1582 : b50c             [ 4] tstax   lda zpt,x
6127
1584 : 49c3             [ 2]         eor #$c3
6128
1586 : d513             [ 4]         cmp zp1,x
6129
                                     trap_ne     ;store to zp,x data
6130
1588 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6131
 
6132
158a : 940c             [ 4]         sty zpt,x   ;clear
6133
158c : bd0302           [ 4]         lda abst,x
6134
158f : 49c3             [ 2]         eor #$c3
6135
1591 : dd0802           [ 4]         cmp abs1,x
6136
                                     trap_ne     ;store to abs,x data
6137
1594 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6138
 
6139
1596 : 8a               [ 2]         txa
6140
1597 : 9d0302           [ 5]         sta abst,x  ;clear
6141
159a : ca               [ 2]         dex
6142
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  107
6143
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6144
 
6145
159b : 10e5             [ 3]         bpl tstax
6146
                                     next_test
6147
159d : ad0002           [ 4]>            lda test_case   ;previous test
6148
15a0 : c915             [ 2]>            cmp #test_num
6149
                            >            trap_ne         ;test is out of sequence
6150
15a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6151
                            >
6152
0016 =                      >test_num = test_num + 1
6153
15a4 : a916             [ 2]>            lda #test_num   ;*** this tests' number
6154
15a6 : 8d0002           [ 4]>            sta test_case
6155
                            >            ;check_ram       ;uncomment to find altered RAM after each test
6156
 
6157
 
6158
                             ; LDA / STA - (zp),y / abs,y / (zp,x)
6159
15a9 : a003             [ 2]         ldy #3
6160
15ab :                       tlday
6161
                                     set_stat 0
6162
                            >            load_flag 0
6163
15ab : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6164
                            >
6165
15ad : 48               [ 3]>            pha         ;use stack to load status
6166
15ae : 28               [ 4]>            plp
6167
 
6168
15af : b124             [ 5]         lda (ind1),y
6169
15b1 : 08               [ 3]         php         ;test stores do not alter flags
6170
15b2 : 49c3             [ 2]         eor #$c3
6171
15b4 : 28               [ 4]         plp
6172
15b5 : 990302           [ 5]         sta abst,y
6173
15b8 : 08               [ 3]         php         ;flags after load/store sequence
6174
15b9 : 49c3             [ 2]         eor #$c3
6175
15bb : d90802           [ 4]         cmp abs1,y  ;test result
6176
                                     trap_ne
6177
15be : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6178
 
6179
15c0 : 68               [ 4]         pla         ;load status
6180
                                     eor_flag 0
6181
15c1 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6182
 
6183
15c3 : d90d02           [ 4]         cmp fLDx,y  ;test flags
6184
                                     trap_ne
6185
15c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6186
 
6187
15c8 : 88               [ 2]         dey
6188
15c9 : 10e0             [ 3]         bpl tlday
6189
 
6190
15cb : a003             [ 2]         ldy #3
6191
15cd :                       tlday1
6192
                                     set_stat $ff
6193
                            >            load_flag $ff
6194
15cd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6195
                            >
6196
15cf : 48               [ 3]>            pha         ;use stack to load status
6197
15d0 : 28               [ 4]>            plp
6198
 
6199
15d1 : b124             [ 5]         lda (ind1),y
6200
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  108
6201
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6202
 
6203
15d3 : 08               [ 3]         php         ;test stores do not alter flags
6204
15d4 : 49c3             [ 2]         eor #$c3
6205
15d6 : 28               [ 4]         plp
6206
15d7 : 990302           [ 5]         sta abst,y
6207
15da : 08               [ 3]         php         ;flags after load/store sequence
6208
15db : 49c3             [ 2]         eor #$c3
6209
15dd : d90802           [ 4]         cmp abs1,y  ;test result
6210
                                     trap_ne
6211
15e0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6212
 
6213
15e2 : 68               [ 4]         pla         ;load status
6214
                                     eor_flag lo~fnz ;mask bits not altered
6215
15e3 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6216
 
6217
15e5 : d90d02           [ 4]         cmp fLDx,y  ;test flags
6218
                                     trap_ne
6219
15e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6220
 
6221
15ea : 88               [ 2]         dey
6222
15eb : 10e0             [ 3]         bpl tlday1
6223
 
6224
15ed : a003             [ 2]         ldy #3      ;testing store result
6225
15ef : a200             [ 2]         ldx #0
6226
15f1 : b90302           [ 4] tstay   lda abst,y
6227
15f4 : 49c3             [ 2]         eor #$c3
6228
15f6 : d90802           [ 4]         cmp abs1,y
6229
                                     trap_ne     ;store to abs data
6230
15f9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6231
 
6232
15fb : 8a               [ 2]         txa
6233
15fc : 990302           [ 5]         sta abst,y  ;clear
6234
15ff : 88               [ 2]         dey
6235
1600 : 10ef             [ 4]         bpl tstay
6236
 
6237
1602 : a003             [ 2]         ldy #3
6238
1604 :                       tlday2
6239
                                     set_stat 0
6240
                            >            load_flag 0
6241
1604 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6242
                            >
6243
1606 : 48               [ 3]>            pha         ;use stack to load status
6244
1607 : 28               [ 4]>            plp
6245
 
6246
1608 : b90802           [ 4]         lda abs1,y
6247
160b : 08               [ 3]         php         ;test stores do not alter flags
6248
160c : 49c3             [ 2]         eor #$c3
6249
160e : 28               [ 4]         plp
6250
160f : 9130             [ 5]         sta (indt),y
6251
1611 : 08               [ 3]         php         ;flags after load/store sequence
6252
1612 : 49c3             [ 2]         eor #$c3
6253
1614 : d124             [ 5]         cmp (ind1),y    ;test result
6254
                                     trap_ne
6255
1616 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6256
 
6257
1618 : 68               [ 4]         pla         ;load status
6258
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  109
6259
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6260
 
6261
                                     eor_flag 0
6262
1619 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6263
 
6264
161b : d90d02           [ 4]         cmp fLDx,y  ;test flags
6265
                                     trap_ne
6266
161e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6267
 
6268
1620 : 88               [ 2]         dey
6269
1621 : 10e1             [ 3]         bpl tlday2
6270
 
6271
1623 : a003             [ 2]         ldy #3
6272
1625 :                       tlday3
6273
                                     set_stat $ff
6274
                            >            load_flag $ff
6275
1625 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6276
                            >
6277
1627 : 48               [ 3]>            pha         ;use stack to load status
6278
1628 : 28               [ 4]>            plp
6279
 
6280
1629 : b90802           [ 4]         lda abs1,y
6281
162c : 08               [ 3]         php         ;test stores do not alter flags
6282
162d : 49c3             [ 2]         eor #$c3
6283
162f : 28               [ 4]         plp
6284
1630 : 9130             [ 5]         sta (indt),y
6285
1632 : 08               [ 3]         php         ;flags after load/store sequence
6286
1633 : 49c3             [ 2]         eor #$c3
6287
1635 : d124             [ 5]         cmp (ind1),y   ;test result
6288
                                     trap_ne
6289
1637 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6290
 
6291
1639 : 68               [ 4]         pla         ;load status
6292
                                     eor_flag lo~fnz ;mask bits not altered
6293
163a : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6294
 
6295
163c : d90d02           [ 4]         cmp fLDx,y  ;test flags
6296
                                     trap_ne
6297
163f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6298
 
6299
1641 : 88               [ 2]         dey
6300
1642 : 10e1             [ 3]         bpl tlday3
6301
 
6302
1644 : a003             [ 2]         ldy #3      ;testing store result
6303
1646 : a200             [ 2]         ldx #0
6304
1648 : b90302           [ 4] tstay1  lda abst,y
6305
164b : 49c3             [ 2]         eor #$c3
6306
164d : d90802           [ 4]         cmp abs1,y
6307
                                     trap_ne     ;store to abs data
6308
1650 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6309
 
6310
1652 : 8a               [ 2]         txa
6311
1653 : 990302           [ 5]         sta abst,y  ;clear
6312
1656 : 88               [ 2]         dey
6313
1657 : 10ef             [ 3]         bpl tstay1
6314
 
6315
1659 : a206             [ 2]         ldx #6
6316
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  110
6317
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6318
 
6319
165b : a003             [ 2]         ldy #3
6320
165d :                       tldax4
6321
                                     set_stat 0
6322
                            >            load_flag 0
6323
165d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6324
                            >
6325
165f : 48               [ 3]>            pha         ;use stack to load status
6326
1660 : 28               [ 4]>            plp
6327
 
6328
1661 : a124             [ 6]         lda (ind1,x)
6329
1663 : 08               [ 3]         php         ;test stores do not alter flags
6330
1664 : 49c3             [ 2]         eor #$c3
6331
1666 : 28               [ 4]         plp
6332
1667 : 8130             [ 6]         sta (indt,x)
6333
1669 : 08               [ 3]         php         ;flags after load/store sequence
6334
166a : 49c3             [ 2]         eor #$c3
6335
166c : d90802           [ 4]         cmp abs1,y  ;test result
6336
                                     trap_ne
6337
166f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6338
 
6339
1671 : 68               [ 4]         pla         ;load status
6340
                                     eor_flag 0
6341
1672 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6342
 
6343
1674 : d90d02           [ 4]         cmp fLDx,y  ;test flags
6344
                                     trap_ne
6345
1677 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6346
 
6347
1679 : ca               [ 2]         dex
6348
167a : ca               [ 2]         dex
6349
167b : 88               [ 2]         dey
6350
167c : 10df             [ 3]         bpl tldax4
6351
 
6352
167e : a206             [ 2]         ldx #6
6353
1680 : a003             [ 2]         ldy #3
6354
1682 :                       tldax5
6355
                                     set_stat $ff
6356
                            >            load_flag $ff
6357
1682 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6358
                            >
6359
1684 : 48               [ 3]>            pha         ;use stack to load status
6360
1685 : 28               [ 4]>            plp
6361
 
6362
1686 : a124             [ 6]         lda (ind1,x)
6363
1688 : 08               [ 3]         php         ;test stores do not alter flags
6364
1689 : 49c3             [ 2]         eor #$c3
6365
168b : 28               [ 4]         plp
6366
168c : 8130             [ 6]         sta (indt,x)
6367
168e : 08               [ 3]         php         ;flags after load/store sequence
6368
168f : 49c3             [ 2]         eor #$c3
6369
1691 : d90802           [ 4]         cmp abs1,y  ;test result
6370
                                     trap_ne
6371
1694 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6372
 
6373
1696 : 68               [ 4]         pla         ;load status
6374
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  111
6375
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6376
 
6377
                                     eor_flag lo~fnz ;mask bits not altered
6378
1697 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6379
 
6380
1699 : d90d02           [ 4]         cmp fLDx,y  ;test flags
6381
                                     trap_ne
6382
169c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6383
 
6384
169e : ca               [ 2]         dex
6385
169f : ca               [ 2]         dex
6386
16a0 : 88               [ 2]         dey
6387
16a1 : 10df             [ 3]         bpl tldax5
6388
 
6389
16a3 : a003             [ 2]         ldy #3      ;testing store result
6390
16a5 : a200             [ 2]         ldx #0
6391
16a7 : b90302           [ 4] tstay2  lda abst,y
6392
16aa : 49c3             [ 2]         eor #$c3
6393
16ac : d90802           [ 4]         cmp abs1,y
6394
                                     trap_ne     ;store to abs data
6395
16af : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6396
 
6397
16b1 : 8a               [ 2]         txa
6398
16b2 : 990302           [ 5]         sta abst,y  ;clear
6399
16b5 : 88               [ 2]         dey
6400
16b6 : 10ef             [ 3]         bpl tstay2
6401
                                     next_test
6402
16b8 : ad0002           [ 4]>            lda test_case   ;previous test
6403
16bb : c916             [ 2]>            cmp #test_num
6404
                            >            trap_ne         ;test is out of sequence
6405
16bd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6406
                            >
6407
0017 =                      >test_num = test_num + 1
6408
16bf : a917             [ 2]>            lda #test_num   ;*** this tests' number
6409
16c1 : 8d0002           [ 4]>            sta test_case
6410
                            >            ;check_ram       ;uncomment to find altered RAM after each test
6411
 
6412
 
6413
                             ; indexed wraparound test (only zp should wrap)
6414
16c4 : a2fd             [ 2]         ldx #3+$fa
6415
16c6 : b519             [ 4] tldax6  lda zp1-$fa&$ff,x   ;wrap on indexed zp
6416
16c8 : 9d0901           [ 5]         sta abst-$fa,x      ;no STX abs,x!
6417
16cb : ca               [ 2]         dex
6418
16cc : e0fa             [ 2]         cpx #$fa
6419
16ce : b0f6             [ 3]         bcs tldax6
6420
16d0 : a2fd             [ 2]         ldx #3+$fa
6421
16d2 : bd0e01           [ 4] tldax7  lda abs1-$fa,x      ;no wrap on indexed abs
6422
16d5 : 9512             [ 4]         sta zpt-$fa&$ff,x
6423
16d7 : ca               [ 2]         dex
6424
16d8 : e0fa             [ 2]         cpx #$fa
6425
16da : b0f6             [ 3]         bcs tldax7
6426
 
6427
16dc : a203             [ 2]         ldx #3      ;testing wraparound result
6428
16de : a000             [ 2]         ldy #0
6429
16e0 : b50c             [ 4] tstax1  lda zpt,x
6430
16e2 : d513             [ 4]         cmp zp1,x
6431
                                     trap_ne     ;store to zp,x data
6432
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  112
6433
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6434
 
6435
16e4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6436
 
6437
16e6 : 940c             [ 4]         sty zpt,x   ;clear
6438
16e8 : bd0302           [ 4]         lda abst,x
6439
16eb : dd0802           [ 4]         cmp abs1,x
6440
                                     trap_ne     ;store to abs,x data
6441
16ee : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6442
 
6443
16f0 : 8a               [ 2]         txa
6444
16f1 : 9d0302           [ 5]         sta abst,x  ;clear
6445
16f4 : ca               [ 2]         dex
6446
16f5 : 10e9             [ 3]         bpl tstax1
6447
 
6448
16f7 : a0fb             [ 2]         ldy #3+$f8
6449
16f9 : a2fe             [ 2]         ldx #6+$f8
6450
16fb : a12c             [ 6] tlday4  lda (ind1-$f8&$ff,x) ;wrap on indexed zp indirect
6451
16fd : 990b01           [ 5]         sta abst-$f8,y
6452
1700 : ca               [ 2]         dex
6453
1701 : ca               [ 2]         dex
6454
1702 : 88               [ 2]         dey
6455
1703 : c0f8             [ 2]         cpy #$f8
6456
1705 : b0f4             [ 4]         bcs tlday4
6457
1707 : a003             [ 2]         ldy #3      ;testing wraparound result
6458
1709 : a200             [ 2]         ldx #0
6459
170b : b90302           [ 4] tstay4  lda abst,y
6460
170e : d90802           [ 4]         cmp abs1,y
6461
                                     trap_ne     ;store to abs data
6462
1711 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6463
 
6464
1713 : 8a               [ 2]         txa
6465
1714 : 990302           [ 5]         sta abst,y  ;clear
6466
1717 : 88               [ 2]         dey
6467
1718 : 10f1             [ 3]         bpl tstay4
6468
 
6469
171a : a0fb             [ 2]         ldy #3+$f8
6470
171c : b91001           [ 4] tlday5  lda abs1-$f8,y  ;no wrap on indexed abs
6471
171f : 9138             [ 5]         sta (inwt),y
6472
1721 : 88               [ 2]         dey
6473
1722 : c0f8             [ 2]         cpy #$f8
6474
1724 : b0f6             [ 3]         bcs tlday5
6475
1726 : a003             [ 2]         ldy #3      ;testing wraparound result
6476
1728 : a200             [ 2]         ldx #0
6477
172a : b90302           [ 4] tstay5  lda abst,y
6478
172d : d90802           [ 4]         cmp abs1,y
6479
                                     trap_ne     ;store to abs data
6480
1730 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6481
 
6482
1732 : 8a               [ 2]         txa
6483
1733 : 990302           [ 5]         sta abst,y  ;clear
6484
1736 : 88               [ 2]         dey
6485
1737 : 10f1             [ 3]         bpl tstay5
6486
 
6487
1739 : a0fb             [ 2]         ldy #3+$f8
6488
173b : a2fe             [ 2]         ldx #6+$f8
6489
173d : b12e             [ 5] tlday6  lda (inw1),y    ;no wrap on zp indirect indexed
6490
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  113
6491
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6492
 
6493
173f : 8138             [ 6]         sta (indt-$f8&$ff,x)
6494
1741 : ca               [ 2]         dex
6495
1742 : ca               [ 2]         dex
6496
1743 : 88               [ 2]         dey
6497
1744 : c0f8             [ 2]         cpy #$f8
6498
1746 : b0f5             [ 3]         bcs tlday6
6499
1748 : a003             [ 2]         ldy #3      ;testing wraparound result
6500
174a : a200             [ 2]         ldx #0
6501
174c : b90302           [ 4] tstay6  lda abst,y
6502
174f : d90802           [ 4]         cmp abs1,y
6503
                                     trap_ne     ;store to abs data
6504
1752 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6505
 
6506
1754 : 8a               [ 2]         txa
6507
1755 : 990302           [ 5]         sta abst,y  ;clear
6508
1758 : 88               [ 2]         dey
6509
1759 : 10f1             [ 3]         bpl tstay6
6510
                                     next_test
6511
175b : ad0002           [ 4]>            lda test_case   ;previous test
6512
175e : c917             [ 2]>            cmp #test_num
6513
                            >            trap_ne         ;test is out of sequence
6514
1760 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6515
                            >
6516
0018 =                      >test_num = test_num + 1
6517
1762 : a918             [ 2]>            lda #test_num   ;*** this tests' number
6518
1764 : 8d0002           [ 4]>            sta test_case
6519
                            >            ;check_ram       ;uncomment to find altered RAM after each test
6520
 
6521
 
6522
                             ; LDA / STA - zp / abs / #
6523
                                     set_stat 0
6524
                            >            load_flag 0
6525
1767 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
6526
                            >
6527
1769 : 48               [ 3]>            pha         ;use stack to load status
6528
176a : 28               [ 4]>            plp
6529
 
6530
176b : a513             [ 3]         lda zp1
6531
176d : 08               [ 3]         php         ;test stores do not alter flags
6532
176e : 49c3             [ 2]         eor #$c3
6533
1770 : 28               [ 4]         plp
6534
1771 : 8d0302           [ 4]         sta abst
6535
1774 : 08               [ 3]         php         ;flags after load/store sequence
6536
1775 : 49c3             [ 2]         eor #$c3
6537
1777 : c9c3             [ 2]         cmp #$c3    ;test result
6538
                                     trap_ne
6539
1779 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6540
 
6541
177b : 68               [ 4]         pla         ;load status
6542
                                     eor_flag 0
6543
177c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6544
 
6545
177e : cd0d02           [ 4]         cmp fLDx    ;test flags
6546
                                     trap_ne
6547
1781 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6548
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  114
6549
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6550
 
6551
 
6552
                                     set_stat 0
6553
                            >            load_flag 0
6554
1783 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6555
                            >
6556
1785 : 48               [ 3]>            pha         ;use stack to load status
6557
1786 : 28               [ 4]>            plp
6558
 
6559
1787 : a514             [ 3]         lda zp1+1
6560
1789 : 08               [ 3]         php         ;test stores do not alter flags
6561
178a : 49c3             [ 2]         eor #$c3
6562
178c : 28               [ 4]         plp
6563
178d : 8d0402           [ 4]         sta abst+1
6564
1790 : 08               [ 3]         php         ;flags after load/store sequence
6565
1791 : 49c3             [ 2]         eor #$c3
6566
1793 : c982             [ 2]         cmp #$82    ;test result
6567
                                     trap_ne
6568
1795 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6569
 
6570
1797 : 68               [ 4]         pla         ;load status
6571
                                     eor_flag 0
6572
1798 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6573
 
6574
179a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
6575
                                     trap_ne
6576
179d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6577
 
6578
                                     set_stat 0
6579
                            >            load_flag 0
6580
179f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6581
                            >
6582
17a1 : 48               [ 3]>            pha         ;use stack to load status
6583
17a2 : 28               [ 4]>            plp
6584
 
6585
17a3 : a515             [ 3]         lda zp1+2
6586
17a5 : 08               [ 3]         php         ;test stores do not alter flags
6587
17a6 : 49c3             [ 2]         eor #$c3
6588
17a8 : 28               [ 4]         plp
6589
17a9 : 8d0502           [ 4]         sta abst+2
6590
17ac : 08               [ 3]         php         ;flags after load/store sequence
6591
17ad : 49c3             [ 2]         eor #$c3
6592
17af : c941             [ 2]         cmp #$41    ;test result
6593
                                     trap_ne
6594
17b1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6595
 
6596
17b3 : 68               [ 4]         pla         ;load status
6597
                                     eor_flag 0
6598
17b4 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6599
 
6600
17b6 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
6601
                                     trap_ne
6602
17b9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6603
 
6604
                                     set_stat 0
6605
                            >            load_flag 0
6606
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  115
6607
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6608
 
6609
17bb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6610
                            >
6611
17bd : 48               [ 3]>            pha         ;use stack to load status
6612
17be : 28               [ 4]>            plp
6613
 
6614
17bf : a516             [ 3]         lda zp1+3
6615
17c1 : 08               [ 3]         php         ;test stores do not alter flags
6616
17c2 : 49c3             [ 2]         eor #$c3
6617
17c4 : 28               [ 4]         plp
6618
17c5 : 8d0602           [ 4]         sta abst+3
6619
17c8 : 08               [ 3]         php         ;flags after load/store sequence
6620
17c9 : 49c3             [ 2]         eor #$c3
6621
17cb : c900             [ 2]         cmp #0      ;test result
6622
                                     trap_ne
6623
17cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6624
 
6625
17cf : 68               [ 4]         pla         ;load status
6626
                                     eor_flag 0
6627
17d0 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6628
 
6629
17d2 : cd1002           [ 4]         cmp fLDx+3  ;test flags
6630
                                     trap_ne
6631
17d5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6632
 
6633
                                     set_stat $ff
6634
                            >            load_flag $ff
6635
17d7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6636
                            >
6637
17d9 : 48               [ 3]>            pha         ;use stack to load status
6638
17da : 28               [ 4]>            plp
6639
 
6640
17db : a513             [ 3]         lda zp1
6641
17dd : 08               [ 3]         php         ;test stores do not alter flags
6642
17de : 49c3             [ 2]         eor #$c3
6643
17e0 : 28               [ 4]         plp
6644
17e1 : 8d0302           [ 4]         sta abst
6645
17e4 : 08               [ 3]         php         ;flags after load/store sequence
6646
17e5 : 49c3             [ 2]         eor #$c3
6647
17e7 : c9c3             [ 2]         cmp #$c3    ;test result
6648
                                     trap_ne
6649
17e9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6650
 
6651
17eb : 68               [ 4]         pla         ;load status
6652
                                     eor_flag lo~fnz ;mask bits not altered
6653
17ec : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6654
 
6655
17ee : cd0d02           [ 4]         cmp fLDx    ;test flags
6656
                                     trap_ne
6657
17f1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6658
 
6659
                                     set_stat $ff
6660
                            >            load_flag $ff
6661
17f3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6662
                            >
6663
17f5 : 48               [ 3]>            pha         ;use stack to load status
6664
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  116
6665
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6666
 
6667
17f6 : 28               [ 4]>            plp
6668
 
6669
17f7 : a514             [ 3]         lda zp1+1
6670
17f9 : 08               [ 3]         php         ;test stores do not alter flags
6671
17fa : 49c3             [ 2]         eor #$c3
6672
17fc : 28               [ 4]         plp
6673
17fd : 8d0402           [ 4]         sta abst+1
6674
1800 : 08               [ 3]         php         ;flags after load/store sequence
6675
1801 : 49c3             [ 2]         eor #$c3
6676
1803 : c982             [ 2]         cmp #$82    ;test result
6677
                                     trap_ne
6678
1805 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6679
 
6680
1807 : 68               [ 4]         pla         ;load status
6681
                                     eor_flag lo~fnz ;mask bits not altered
6682
1808 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6683
 
6684
180a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
6685
                                     trap_ne
6686
180d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6687
 
6688
                                     set_stat $ff
6689
                            >            load_flag $ff
6690
180f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6691
                            >
6692
1811 : 48               [ 3]>            pha         ;use stack to load status
6693
1812 : 28               [ 4]>            plp
6694
 
6695
1813 : a515             [ 3]         lda zp1+2
6696
1815 : 08               [ 3]         php         ;test stores do not alter flags
6697
1816 : 49c3             [ 2]         eor #$c3
6698
1818 : 28               [ 4]         plp
6699
1819 : 8d0502           [ 4]         sta abst+2
6700
181c : 08               [ 3]         php         ;flags after load/store sequence
6701
181d : 49c3             [ 2]         eor #$c3
6702
181f : c941             [ 2]         cmp #$41    ;test result
6703
                                     trap_ne
6704
1821 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6705
 
6706
1823 : 68               [ 4]         pla         ;load status
6707
                                     eor_flag lo~fnz ;mask bits not altered
6708
1824 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6709
 
6710
1826 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
6711
                                     trap_ne
6712
1829 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6713
 
6714
                                     set_stat $ff
6715
                            >            load_flag $ff
6716
182b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6717
                            >
6718
182d : 48               [ 3]>            pha         ;use stack to load status
6719
182e : 28               [ 4]>            plp
6720
 
6721
182f : a516             [ 3]         lda zp1+3
6722
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  117
6723
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6724
 
6725
1831 : 08               [ 3]         php         ;test stores do not alter flags
6726
1832 : 49c3             [ 2]         eor #$c3
6727
1834 : 28               [ 4]         plp
6728
1835 : 8d0602           [ 4]         sta abst+3
6729
1838 : 08               [ 3]         php         ;flags after load/store sequence
6730
1839 : 49c3             [ 2]         eor #$c3
6731
183b : c900             [ 2]         cmp #0      ;test result
6732
                                     trap_ne
6733
183d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6734
 
6735
183f : 68               [ 4]         pla         ;load status
6736
                                     eor_flag lo~fnz ;mask bits not altered
6737
1840 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6738
 
6739
1842 : cd1002           [ 4]         cmp fLDx+3  ;test flags
6740
                                     trap_ne
6741
1845 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6742
 
6743
                                     set_stat 0
6744
                            >            load_flag 0
6745
1847 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6746
                            >
6747
1849 : 48               [ 3]>            pha         ;use stack to load status
6748
184a : 28               [ 4]>            plp
6749
 
6750
184b : ad0802           [ 4]         lda abs1
6751
184e : 08               [ 3]         php         ;test stores do not alter flags
6752
184f : 49c3             [ 2]         eor #$c3
6753
1851 : 28               [ 4]         plp
6754
1852 : 850c             [ 3]         sta zpt
6755
1854 : 08               [ 3]         php         ;flags after load/store sequence
6756
1855 : 49c3             [ 2]         eor #$c3
6757
1857 : c513             [ 3]         cmp zp1     ;test result
6758
                                     trap_ne
6759
1859 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6760
 
6761
185b : 68               [ 4]         pla         ;load status
6762
                                     eor_flag 0
6763
185c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6764
 
6765
185e : cd0d02           [ 4]         cmp fLDx    ;test flags
6766
                                     trap_ne
6767
1861 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6768
 
6769
                                     set_stat 0
6770
                            >            load_flag 0
6771
1863 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6772
                            >
6773
1865 : 48               [ 3]>            pha         ;use stack to load status
6774
1866 : 28               [ 4]>            plp
6775
 
6776
1867 : ad0902           [ 4]         lda abs1+1
6777
186a : 08               [ 3]         php         ;test stores do not alter flags
6778
186b : 49c3             [ 2]         eor #$c3
6779
186d : 28               [ 4]         plp
6780
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  118
6781
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6782
 
6783
186e : 850d             [ 3]         sta zpt+1
6784
1870 : 08               [ 3]         php         ;flags after load/store sequence
6785
1871 : 49c3             [ 2]         eor #$c3
6786
1873 : c514             [ 3]         cmp zp1+1   ;test result
6787
                                     trap_ne
6788
1875 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6789
 
6790
1877 : 68               [ 4]         pla         ;load status
6791
                                     eor_flag 0
6792
1878 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6793
 
6794
187a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
6795
                                     trap_ne
6796
187d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6797
 
6798
                                     set_stat 0
6799
                            >            load_flag 0
6800
187f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6801
                            >
6802
1881 : 48               [ 3]>            pha         ;use stack to load status
6803
1882 : 28               [ 4]>            plp
6804
 
6805
1883 : ad0a02           [ 4]         lda abs1+2
6806
1886 : 08               [ 3]         php         ;test stores do not alter flags
6807
1887 : 49c3             [ 2]         eor #$c3
6808
1889 : 28               [ 4]         plp
6809
188a : 850e             [ 3]         sta zpt+2
6810
188c : 08               [ 3]         php         ;flags after load/store sequence
6811
188d : 49c3             [ 2]         eor #$c3
6812
188f : c515             [ 3]         cmp zp1+2   ;test result
6813
                                     trap_ne
6814
1891 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6815
 
6816
1893 : 68               [ 4]         pla         ;load status
6817
                                     eor_flag 0
6818
1894 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6819
 
6820
1896 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
6821
                                     trap_ne
6822
1899 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6823
 
6824
                                     set_stat 0
6825
                            >            load_flag 0
6826
189b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6827
                            >
6828
189d : 48               [ 3]>            pha         ;use stack to load status
6829
189e : 28               [ 4]>            plp
6830
 
6831
189f : ad0b02           [ 4]         lda abs1+3
6832
18a2 : 08               [ 3]         php         ;test stores do not alter flags
6833
18a3 : 49c3             [ 2]         eor #$c3
6834
18a5 : 28               [ 4]         plp
6835
18a6 : 850f             [ 3]         sta zpt+3
6836
18a8 : 08               [ 3]         php         ;flags after load/store sequence
6837
18a9 : 49c3             [ 2]         eor #$c3
6838
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  119
6839
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6840
 
6841
18ab : c516             [ 3]         cmp zp1+3   ;test result
6842
                                     trap_ne
6843
18ad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6844
 
6845
18af : 68               [ 4]         pla         ;load status
6846
                                     eor_flag 0
6847
18b0 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6848
 
6849
18b2 : cd1002           [ 4]         cmp fLDx+3  ;test flags
6850
                                     trap_ne
6851
18b5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6852
 
6853
                                     set_stat $ff
6854
                            >            load_flag $ff
6855
18b7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6856
                            >
6857
18b9 : 48               [ 3]>            pha         ;use stack to load status
6858
18ba : 28               [ 4]>            plp
6859
 
6860
18bb : ad0802           [ 4]         lda abs1
6861
18be : 08               [ 3]         php         ;test stores do not alter flags
6862
18bf : 49c3             [ 2]         eor #$c3
6863
18c1 : 28               [ 4]         plp
6864
18c2 : 850c             [ 3]         sta zpt
6865
18c4 : 08               [ 3]         php         ;flags after load/store sequence
6866
18c5 : 49c3             [ 2]         eor #$c3
6867
18c7 : c513             [ 3]         cmp zp1     ;test result
6868
                                     trap_ne
6869
18c9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6870
 
6871
18cb : 68               [ 4]         pla         ;load status
6872
                                     eor_flag lo~fnz ;mask bits not altered
6873
18cc : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6874
 
6875
18ce : cd0d02           [ 4]         cmp fLDx    ;test flags
6876
                                     trap_ne
6877
18d1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6878
 
6879
                                     set_stat $ff
6880
                            >            load_flag $ff
6881
18d3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6882
                            >
6883
18d5 : 48               [ 3]>            pha         ;use stack to load status
6884
18d6 : 28               [ 4]>            plp
6885
 
6886
18d7 : ad0902           [ 4]         lda abs1+1
6887
18da : 08               [ 3]         php         ;test stores do not alter flags
6888
18db : 49c3             [ 2]         eor #$c3
6889
18dd : 28               [ 4]         plp
6890
18de : 850d             [ 3]         sta zpt+1
6891
18e0 : 08               [ 3]         php         ;flags after load/store sequence
6892
18e1 : 49c3             [ 2]         eor #$c3
6893
18e3 : c514             [ 3]         cmp zp1+1   ;test result
6894
                                     trap_ne
6895
18e5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6896
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  120
6897
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6898
 
6899
 
6900
18e7 : 68               [ 4]         pla         ;load status
6901
                                     eor_flag lo~fnz ;mask bits not altered
6902
18e8 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6903
 
6904
18ea : cd0e02           [ 4]         cmp fLDx+1  ;test flags
6905
                                     trap_ne
6906
18ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6907
 
6908
                                     set_stat $ff
6909
                            >            load_flag $ff
6910
18ef : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6911
                            >
6912
18f1 : 48               [ 3]>            pha         ;use stack to load status
6913
18f2 : 28               [ 4]>            plp
6914
 
6915
18f3 : ad0a02           [ 4]         lda abs1+2
6916
18f6 : 08               [ 3]         php         ;test stores do not alter flags
6917
18f7 : 49c3             [ 2]         eor #$c3
6918
18f9 : 28               [ 4]         plp
6919
18fa : 850e             [ 3]         sta zpt+2
6920
18fc : 08               [ 3]         php         ;flags after load/store sequence
6921
18fd : 49c3             [ 2]         eor #$c3
6922
18ff : c515             [ 3]         cmp zp1+2   ;test result
6923
                                     trap_ne
6924
1901 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6925
 
6926
1903 : 68               [ 4]         pla         ;load status
6927
                                     eor_flag lo~fnz ;mask bits not altered
6928
1904 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6929
 
6930
1906 : cd0f02           [ 4]         cmp fLDx+2  ;test flags
6931
                                     trap_ne
6932
1909 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6933
 
6934
                                     set_stat $ff
6935
                            >            load_flag $ff
6936
190b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
6937
                            >
6938
190d : 48               [ 3]>            pha         ;use stack to load status
6939
190e : 28               [ 4]>            plp
6940
 
6941
190f : ad0b02           [ 4]         lda abs1+3
6942
1912 : 08               [ 3]         php         ;test stores do not alter flags
6943
1913 : 49c3             [ 2]         eor #$c3
6944
1915 : 28               [ 4]         plp
6945
1916 : 850f             [ 3]         sta zpt+3
6946
1918 : 08               [ 3]         php         ;flags after load/store sequence
6947
1919 : 49c3             [ 2]         eor #$c3
6948
191b : c516             [ 3]         cmp zp1+3   ;test result
6949
                                     trap_ne
6950
191d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6951
 
6952
191f : 68               [ 4]         pla         ;load status
6953
                                     eor_flag lo~fnz ;mask bits not altered
6954
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  121
6955
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
6956
 
6957
1920 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
6958
 
6959
1922 : cd1002           [ 4]         cmp fLDx+3  ;test flags
6960
                                     trap_ne
6961
1925 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6962
 
6963
                                     set_stat 0
6964
                            >            load_flag 0
6965
1927 : a900             [ 2]>            lda #0               ;allow test to change I-flag (no mask)
6966
                            >
6967
1929 : 48               [ 3]>            pha         ;use stack to load status
6968
192a : 28               [ 4]>            plp
6969
 
6970
192b : a9c3             [ 2]         lda #$c3
6971
192d : 08               [ 3]         php
6972
192e : cd0802           [ 4]         cmp abs1    ;test result
6973
                                     trap_ne
6974
1931 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6975
 
6976
1933 : 68               [ 4]         pla         ;load status
6977
                                     eor_flag 0
6978
1934 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
6979
 
6980
1936 : cd0d02           [ 4]         cmp fLDx    ;test flags
6981
                                     trap_ne
6982
1939 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6983
 
6984
                                     set_stat 0
6985
                            >            load_flag 0
6986
193b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
6987
                            >
6988
193d : 48               [ 3]>            pha         ;use stack to load status
6989
193e : 28               [ 4]>            plp
6990
 
6991
193f : a982             [ 2]         lda #$82
6992
1941 : 08               [ 3]         php
6993
1942 : cd0902           [ 4]         cmp abs1+1  ;test result
6994
                                     trap_ne
6995
1945 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
6996
 
6997
1947 : 68               [ 4]         pla         ;load status
6998
                                     eor_flag 0
6999
1948 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
7000
 
7001
194a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
7002
                                     trap_ne
7003
194d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7004
 
7005
                                     set_stat 0
7006
                            >            load_flag 0
7007
194f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7008
                            >
7009
1951 : 48               [ 3]>            pha         ;use stack to load status
7010
1952 : 28               [ 4]>            plp
7011
 
7012
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  122
7013
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7014
 
7015
1953 : a941             [ 2]         lda #$41
7016
1955 : 08               [ 3]         php
7017
1956 : cd0a02           [ 4]         cmp abs1+2  ;test result
7018
                                     trap_ne
7019
1959 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7020
 
7021
195b : 68               [ 4]         pla         ;load status
7022
                                     eor_flag 0
7023
195c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
7024
 
7025
195e : cd0f02           [ 4]         cmp fLDx+2  ;test flags
7026
                                     trap_ne
7027
1961 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7028
 
7029
                                     set_stat 0
7030
                            >            load_flag 0
7031
1963 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7032
                            >
7033
1965 : 48               [ 3]>            pha         ;use stack to load status
7034
1966 : 28               [ 4]>            plp
7035
 
7036
1967 : a900             [ 2]         lda #0
7037
1969 : 08               [ 3]         php
7038
196a : cd0b02           [ 4]         cmp abs1+3  ;test result
7039
                                     trap_ne
7040
196d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7041
 
7042
196f : 68               [ 4]         pla         ;load status
7043
                                     eor_flag 0
7044
1970 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
7045
 
7046
1972 : cd1002           [ 4]         cmp fLDx+3  ;test flags
7047
                                     trap_ne
7048
1975 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7049
 
7050
 
7051
                                     set_stat $ff
7052
                            >            load_flag $ff
7053
1977 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7054
                            >
7055
1979 : 48               [ 3]>            pha         ;use stack to load status
7056
197a : 28               [ 4]>            plp
7057
 
7058
197b : a9c3             [ 2]         lda #$c3
7059
197d : 08               [ 3]         php
7060
197e : cd0802           [ 4]         cmp abs1    ;test result
7061
                                     trap_ne
7062
1981 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7063
 
7064
1983 : 68               [ 4]         pla         ;load status
7065
                                     eor_flag lo~fnz ;mask bits not altered
7066
1984 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
7067
 
7068
1986 : cd0d02           [ 4]         cmp fLDx    ;test flags
7069
                                     trap_ne
7070
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  123
7071
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7072
 
7073
1989 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7074
 
7075
                                     set_stat $ff
7076
                            >            load_flag $ff
7077
198b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7078
                            >
7079
198d : 48               [ 3]>            pha         ;use stack to load status
7080
198e : 28               [ 4]>            plp
7081
 
7082
198f : a982             [ 2]         lda #$82
7083
1991 : 08               [ 3]         php
7084
1992 : cd0902           [ 4]         cmp abs1+1  ;test result
7085
                                     trap_ne
7086
1995 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7087
 
7088
1997 : 68               [ 4]         pla         ;load status
7089
                                     eor_flag lo~fnz ;mask bits not altered
7090
1998 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
7091
 
7092
199a : cd0e02           [ 4]         cmp fLDx+1  ;test flags
7093
                                     trap_ne
7094
199d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7095
 
7096
                                     set_stat $ff
7097
                            >            load_flag $ff
7098
199f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7099
                            >
7100
19a1 : 48               [ 3]>            pha         ;use stack to load status
7101
19a2 : 28               [ 4]>            plp
7102
 
7103
19a3 : a941             [ 2]         lda #$41
7104
19a5 : 08               [ 3]         php
7105
19a6 : cd0a02           [ 4]         cmp abs1+2  ;test result
7106
                                     trap_ne
7107
19a9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7108
 
7109
19ab : 68               [ 4]         pla         ;load status
7110
                                     eor_flag lo~fnz ;mask bits not altered
7111
19ac : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
7112
 
7113
19ae : cd0f02           [ 4]         cmp fLDx+2  ;test flags
7114
                                     trap_ne
7115
19b1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7116
 
7117
                                     set_stat $ff
7118
                            >            load_flag $ff
7119
19b3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7120
                            >
7121
19b5 : 48               [ 3]>            pha         ;use stack to load status
7122
19b6 : 28               [ 4]>            plp
7123
 
7124
19b7 : a900             [ 2]         lda #0
7125
19b9 : 08               [ 3]         php
7126
19ba : cd0b02           [ 4]         cmp abs1+3  ;test result
7127
                                     trap_ne
7128
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  124
7129
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7130
 
7131
19bd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7132
 
7133
19bf : 68               [ 4]         pla         ;load status
7134
                                     eor_flag lo~fnz ;mask bits not altered
7135
19c0 : 497d             [ 2]>            eor #lo~fnz |fao         ;invert expected flags + always on bits
7136
 
7137
19c2 : cd1002           [ 4]         cmp fLDx+3  ;test flags
7138
                                     trap_ne
7139
19c5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7140
 
7141
 
7142
19c7 : a200             [ 2]         ldx #0
7143
19c9 : a50c             [ 3]         lda zpt
7144
19cb : 49c3             [ 2]         eor #$c3
7145
19cd : c513             [ 3]         cmp zp1
7146
                                     trap_ne     ;store to zp data
7147
19cf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7148
 
7149
19d1 : 860c             [ 3]         stx zpt     ;clear
7150
19d3 : ad0302           [ 4]         lda abst
7151
19d6 : 49c3             [ 2]         eor #$c3
7152
19d8 : cd0802           [ 4]         cmp abs1
7153
                                     trap_ne     ;store to abs data
7154
19db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7155
 
7156
19dd : 8e0302           [ 4]         stx abst    ;clear
7157
19e0 : a50d             [ 3]         lda zpt+1
7158
19e2 : 49c3             [ 2]         eor #$c3
7159
19e4 : c514             [ 3]         cmp zp1+1
7160
                                     trap_ne     ;store to zp data
7161
19e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7162
 
7163
19e8 : 860d             [ 3]         stx zpt+1   ;clear
7164
19ea : ad0402           [ 4]         lda abst+1
7165
19ed : 49c3             [ 2]         eor #$c3
7166
19ef : cd0902           [ 4]         cmp abs1+1
7167
                                     trap_ne     ;store to abs data
7168
19f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7169
 
7170
19f4 : 8e0402           [ 4]         stx abst+1  ;clear
7171
19f7 : a50e             [ 3]         lda zpt+2
7172
19f9 : 49c3             [ 2]         eor #$c3
7173
19fb : c515             [ 3]         cmp zp1+2
7174
                                     trap_ne     ;store to zp data
7175
19fd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7176
 
7177
19ff : 860e             [ 3]         stx zpt+2   ;clear
7178
1a01 : ad0502           [ 4]         lda abst+2
7179
1a04 : 49c3             [ 2]         eor #$c3
7180
1a06 : cd0a02           [ 4]         cmp abs1+2
7181
                                     trap_ne     ;store to abs data
7182
1a09 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7183
 
7184
1a0b : 8e0502           [ 4]         stx abst+2  ;clear
7185
1a0e : a50f             [ 3]         lda zpt+3
7186
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  125
7187
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7188
 
7189
1a10 : 49c3             [ 2]         eor #$c3
7190
1a12 : c516             [ 3]         cmp zp1+3
7191
                                     trap_ne     ;store to zp data
7192
1a14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7193
 
7194
1a16 : 860f             [ 3]         stx zpt+3   ;clear
7195
1a18 : ad0602           [ 4]         lda abst+3
7196
1a1b : 49c3             [ 2]         eor #$c3
7197
1a1d : cd0b02           [ 4]         cmp abs1+3
7198
                                     trap_ne     ;store to abs data
7199
1a20 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7200
 
7201
1a22 : 8e0602           [ 4]         stx abst+3  ;clear
7202
                                     next_test
7203
1a25 : ad0002           [ 4]>            lda test_case   ;previous test
7204
1a28 : c918             [ 2]>            cmp #test_num
7205
                            >            trap_ne         ;test is out of sequence
7206
1a2a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7207
                            >
7208
0019 =                      >test_num = test_num + 1
7209
1a2c : a919             [ 2]>            lda #test_num   ;*** this tests' number
7210
1a2e : 8d0002           [ 4]>            sta test_case
7211
                            >            ;check_ram       ;uncomment to find altered RAM after each test
7212
 
7213
 
7214
                             ; testing bit test & compares BIT CPX CPY CMP all addressing modes
7215
                             ; BIT - zp / abs
7216
                                     set_a $ff,0
7217
                            >            load_flag 0
7218
1a31 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7219
                            >
7220
1a33 : 48               [ 3]>            pha         ;use stack to load status
7221
1a34 : a9ff             [ 2]>            lda #$ff     ;precharge accu
7222
1a36 : 28               [ 4]>            plp
7223
 
7224
1a37 : 2416             [ 3]         bit zp1+3   ;00 - should set Z / clear  NV
7225
                                     tst_a $ff,fz
7226
1a39 : 08               [ 3]>            php         ;save flags
7227
1a3a : 08               [ 3]>            php
7228
1a3b : c9ff             [ 2]>            cmp #$ff     ;test result
7229
                            >            trap_ne
7230
1a3d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7231
                            >
7232
1a3f : 68               [ 4]>            pla         ;load status
7233
                            >            cmp_flag fz
7234
1a40 : c932             [ 2]>            cmp #(fz |fao)&m8    ;expected flags + always on bits
7235
                            >
7236
                            >            trap_ne
7237
1a42 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7238
                            >
7239
1a44 : 28               [ 4]>            plp         ;restore status
7240
 
7241
                                     set_a 1,0
7242
                            >            load_flag 0
7243
1a45 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7244
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  126
7245
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7246
 
7247
                            >
7248
1a47 : 48               [ 3]>            pha         ;use stack to load status
7249
1a48 : a901             [ 2]>            lda #1     ;precharge accu
7250
1a4a : 28               [ 4]>            plp
7251
 
7252
1a4b : 2415             [ 3]         bit zp1+2   ;41 - should set V (M6) / clear NZ
7253
                                     tst_a 1,fv
7254
1a4d : 08               [ 3]>            php         ;save flags
7255
1a4e : 08               [ 3]>            php
7256
1a4f : c901             [ 2]>            cmp #1     ;test result
7257
                            >            trap_ne
7258
1a51 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7259
                            >
7260
1a53 : 68               [ 4]>            pla         ;load status
7261
                            >            cmp_flag fv
7262
1a54 : c970             [ 2]>            cmp #(fv|fao)&m8    ;expected flags + always on bits
7263
                            >
7264
                            >            trap_ne
7265
1a56 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7266
                            >
7267
1a58 : 28               [ 4]>            plp         ;restore status
7268
 
7269
                                     set_a 1,0
7270
                            >            load_flag 0
7271
1a59 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7272
                            >
7273
1a5b : 48               [ 3]>            pha         ;use stack to load status
7274
1a5c : a901             [ 2]>            lda #1     ;precharge accu
7275
1a5e : 28               [ 4]>            plp
7276
 
7277
1a5f : 2414             [ 3]         bit zp1+1   ;82 - should set N (M7) & Z / clear V
7278
                                     tst_a 1,fnz
7279
1a61 : 08               [ 3]>            php         ;save flags
7280
1a62 : 08               [ 3]>            php
7281
1a63 : c901             [ 2]>            cmp #1     ;test result
7282
                            >            trap_ne
7283
1a65 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7284
                            >
7285
1a67 : 68               [ 4]>            pla         ;load status
7286
                            >            cmp_flag fnz
7287
1a68 : c9b2             [ 2]>            cmp #(fnz|fao)&m8    ;expected flags + always on bits
7288
                            >
7289
                            >            trap_ne
7290
1a6a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7291
                            >
7292
1a6c : 28               [ 4]>            plp         ;restore status
7293
 
7294
                                     set_a 1,0
7295
                            >            load_flag 0
7296
1a6d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7297
                            >
7298
1a6f : 48               [ 3]>            pha         ;use stack to load status
7299
1a70 : a901             [ 2]>            lda #1     ;precharge accu
7300
1a72 : 28               [ 4]>            plp
7301
 
7302
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  127
7303
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7304
 
7305
1a73 : 2413             [ 3]         bit zp1     ;c3 - should set N (M7) & V (M6) / clear Z
7306
                                     tst_a 1,fnv
7307
1a75 : 08               [ 3]>            php         ;save flags
7308
1a76 : 08               [ 3]>            php
7309
1a77 : c901             [ 2]>            cmp #1     ;test result
7310
                            >            trap_ne
7311
1a79 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7312
                            >
7313
1a7b : 68               [ 4]>            pla         ;load status
7314
                            >            cmp_flag fnv
7315
1a7c : c9f0             [ 2]>            cmp #(fnv|fao)&m8    ;expected flags + always on bits
7316
                            >
7317
                            >            trap_ne
7318
1a7e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7319
                            >
7320
1a80 : 28               [ 4]>            plp         ;restore status
7321
 
7322
 
7323
                                     set_a $ff,$ff
7324
                            >            load_flag $ff
7325
1a81 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7326
                            >
7327
1a83 : 48               [ 3]>            pha         ;use stack to load status
7328
1a84 : a9ff             [ 2]>            lda #$ff     ;precharge accu
7329
1a86 : 28               [ 4]>            plp
7330
 
7331
1a87 : 2416             [ 3]         bit zp1+3   ;00 - should set Z / clear  NV
7332
                                     tst_a $ff,~fnv
7333
1a89 : 08               [ 3]>            php         ;save flags
7334
1a8a : 08               [ 3]>            php
7335
1a8b : c9ff             [ 2]>            cmp #$ff     ;test result
7336
                            >            trap_ne
7337
1a8d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7338
                            >
7339
1a8f : 68               [ 4]>            pla         ;load status
7340
                            >            cmp_flag ~fnv
7341
1a90 : c93f             [ 2]>            cmp #(~fnv |fao)&m8    ;expected flags + always on bits
7342
                            >
7343
                            >            trap_ne
7344
1a92 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7345
                            >
7346
1a94 : 28               [ 4]>            plp         ;restore status
7347
 
7348
                                     set_a 1,$ff
7349
                            >            load_flag $ff
7350
1a95 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7351
                            >
7352
1a97 : 48               [ 3]>            pha         ;use stack to load status
7353
1a98 : a901             [ 2]>            lda #1     ;precharge accu
7354
1a9a : 28               [ 4]>            plp
7355
 
7356
1a9b : 2415             [ 3]         bit zp1+2   ;41 - should set V (M6) / clear NZ
7357
                                     tst_a 1,~fnz
7358
1a9d : 08               [ 3]>            php         ;save flags
7359
1a9e : 08               [ 3]>            php
7360
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  128
7361
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7362
 
7363
1a9f : c901             [ 2]>            cmp #1     ;test result
7364
                            >            trap_ne
7365
1aa1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7366
                            >
7367
1aa3 : 68               [ 4]>            pla         ;load status
7368
                            >            cmp_flag ~fnz
7369
1aa4 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
7370
                            >
7371
                            >            trap_ne
7372
1aa6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7373
                            >
7374
1aa8 : 28               [ 4]>            plp         ;restore status
7375
 
7376
                                     set_a 1,$ff
7377
                            >            load_flag $ff
7378
1aa9 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7379
                            >
7380
1aab : 48               [ 3]>            pha         ;use stack to load status
7381
1aac : a901             [ 2]>            lda #1     ;precharge accu
7382
1aae : 28               [ 4]>            plp
7383
 
7384
1aaf : 2414             [ 3]         bit zp1+1   ;82 - should set N (M7) & Z / clear V
7385
                                     tst_a 1,~fv
7386
1ab1 : 08               [ 3]>            php         ;save flags
7387
1ab2 : 08               [ 3]>            php
7388
1ab3 : c901             [ 2]>            cmp #1     ;test result
7389
                            >            trap_ne
7390
1ab5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7391
                            >
7392
1ab7 : 68               [ 4]>            pla         ;load status
7393
                            >            cmp_flag ~fv
7394
1ab8 : c9bf             [ 2]>            cmp #(~fv|fao)&m8    ;expected flags + always on bits
7395
                            >
7396
                            >            trap_ne
7397
1aba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7398
                            >
7399
1abc : 28               [ 4]>            plp         ;restore status
7400
 
7401
                                     set_a 1,$ff
7402
                            >            load_flag $ff
7403
1abd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7404
                            >
7405
1abf : 48               [ 3]>            pha         ;use stack to load status
7406
1ac0 : a901             [ 2]>            lda #1     ;precharge accu
7407
1ac2 : 28               [ 4]>            plp
7408
 
7409
1ac3 : 2413             [ 3]         bit zp1     ;c3 - should set N (M7) & V (M6) / clear Z
7410
                                     tst_a 1,~fz
7411
1ac5 : 08               [ 3]>            php         ;save flags
7412
1ac6 : 08               [ 3]>            php
7413
1ac7 : c901             [ 2]>            cmp #1     ;test result
7414
                            >            trap_ne
7415
1ac9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7416
                            >
7417
1acb : 68               [ 4]>            pla         ;load status
7418
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  129
7419
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7420
 
7421
                            >            cmp_flag ~fz
7422
1acc : c9fd             [ 2]>            cmp #(~fz|fao)&m8    ;expected flags + always on bits
7423
                            >
7424
                            >            trap_ne
7425
1ace : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7426
                            >
7427
1ad0 : 28               [ 4]>            plp         ;restore status
7428
 
7429
 
7430
                                     set_a $ff,0
7431
                            >            load_flag 0
7432
1ad1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7433
                            >
7434
1ad3 : 48               [ 3]>            pha         ;use stack to load status
7435
1ad4 : a9ff             [ 2]>            lda #$ff     ;precharge accu
7436
1ad6 : 28               [ 4]>            plp
7437
 
7438
1ad7 : 2c0b02           [ 4]         bit abs1+3  ;00 - should set Z / clear  NV
7439
                                     tst_a $ff,fz
7440
1ada : 08               [ 3]>            php         ;save flags
7441
1adb : 08               [ 3]>            php
7442
1adc : c9ff             [ 2]>            cmp #$ff     ;test result
7443
                            >            trap_ne
7444
1ade : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7445
                            >
7446
1ae0 : 68               [ 4]>            pla         ;load status
7447
                            >            cmp_flag fz
7448
1ae1 : c932             [ 2]>            cmp #(fz |fao)&m8    ;expected flags + always on bits
7449
                            >
7450
                            >            trap_ne
7451
1ae3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7452
                            >
7453
1ae5 : 28               [ 4]>            plp         ;restore status
7454
 
7455
                                     set_a 1,0
7456
                            >            load_flag 0
7457
1ae6 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7458
                            >
7459
1ae8 : 48               [ 3]>            pha         ;use stack to load status
7460
1ae9 : a901             [ 2]>            lda #1     ;precharge accu
7461
1aeb : 28               [ 4]>            plp
7462
 
7463
1aec : 2c0a02           [ 4]         bit abs1+2  ;41 - should set V (M6) / clear NZ
7464
                                     tst_a 1,fv
7465
1aef : 08               [ 3]>            php         ;save flags
7466
1af0 : 08               [ 3]>            php
7467
1af1 : c901             [ 2]>            cmp #1     ;test result
7468
                            >            trap_ne
7469
1af3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7470
                            >
7471
1af5 : 68               [ 4]>            pla         ;load status
7472
                            >            cmp_flag fv
7473
1af6 : c970             [ 2]>            cmp #(fv|fao)&m8    ;expected flags + always on bits
7474
                            >
7475
                            >            trap_ne
7476
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  130
7477
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7478
 
7479
1af8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7480
                            >
7481
1afa : 28               [ 4]>            plp         ;restore status
7482
 
7483
                                     set_a 1,0
7484
                            >            load_flag 0
7485
1afb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7486
                            >
7487
1afd : 48               [ 3]>            pha         ;use stack to load status
7488
1afe : a901             [ 2]>            lda #1     ;precharge accu
7489
1b00 : 28               [ 4]>            plp
7490
 
7491
1b01 : 2c0902           [ 4]         bit abs1+1  ;82 - should set N (M7) & Z / clear V
7492
                                     tst_a 1,fnz
7493
1b04 : 08               [ 3]>            php         ;save flags
7494
1b05 : 08               [ 3]>            php
7495
1b06 : c901             [ 2]>            cmp #1     ;test result
7496
                            >            trap_ne
7497
1b08 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7498
                            >
7499
1b0a : 68               [ 4]>            pla         ;load status
7500
                            >            cmp_flag fnz
7501
1b0b : c9b2             [ 2]>            cmp #(fnz|fao)&m8    ;expected flags + always on bits
7502
                            >
7503
                            >            trap_ne
7504
1b0d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7505
                            >
7506
1b0f : 28               [ 4]>            plp         ;restore status
7507
 
7508
                                     set_a 1,0
7509
                            >            load_flag 0
7510
1b10 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7511
                            >
7512
1b12 : 48               [ 3]>            pha         ;use stack to load status
7513
1b13 : a901             [ 2]>            lda #1     ;precharge accu
7514
1b15 : 28               [ 4]>            plp
7515
 
7516
1b16 : 2c0802           [ 4]         bit abs1    ;c3 - should set N (M7) & V (M6) / clear Z
7517
                                     tst_a 1,fnv
7518
1b19 : 08               [ 3]>            php         ;save flags
7519
1b1a : 08               [ 3]>            php
7520
1b1b : c901             [ 2]>            cmp #1     ;test result
7521
                            >            trap_ne
7522
1b1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7523
                            >
7524
1b1f : 68               [ 4]>            pla         ;load status
7525
                            >            cmp_flag fnv
7526
1b20 : c9f0             [ 2]>            cmp #(fnv|fao)&m8    ;expected flags + always on bits
7527
                            >
7528
                            >            trap_ne
7529
1b22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7530
                            >
7531
1b24 : 28               [ 4]>            plp         ;restore status
7532
 
7533
 
7534
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  131
7535
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7536
 
7537
                                     set_a $ff,$ff
7538
                            >            load_flag $ff
7539
1b25 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7540
                            >
7541
1b27 : 48               [ 3]>            pha         ;use stack to load status
7542
1b28 : a9ff             [ 2]>            lda #$ff     ;precharge accu
7543
1b2a : 28               [ 4]>            plp
7544
 
7545
1b2b : 2c0b02           [ 4]         bit abs1+3  ;00 - should set Z / clear  NV
7546
                                     tst_a $ff,~fnv
7547
1b2e : 08               [ 3]>            php         ;save flags
7548
1b2f : 08               [ 3]>            php
7549
1b30 : c9ff             [ 2]>            cmp #$ff     ;test result
7550
                            >            trap_ne
7551
1b32 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7552
                            >
7553
1b34 : 68               [ 4]>            pla         ;load status
7554
                            >            cmp_flag ~fnv
7555
1b35 : c93f             [ 2]>            cmp #(~fnv |fao)&m8    ;expected flags + always on bits
7556
                            >
7557
                            >            trap_ne
7558
1b37 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7559
                            >
7560
1b39 : 28               [ 4]>            plp         ;restore status
7561
 
7562
                                     set_a 1,$ff
7563
                            >            load_flag $ff
7564
1b3a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7565
                            >
7566
1b3c : 48               [ 3]>            pha         ;use stack to load status
7567
1b3d : a901             [ 2]>            lda #1     ;precharge accu
7568
1b3f : 28               [ 4]>            plp
7569
 
7570
1b40 : 2c0a02           [ 4]         bit abs1+2  ;41 - should set V (M6) / clear NZ
7571
                                     tst_a 1,~fnz
7572
1b43 : 08               [ 3]>            php         ;save flags
7573
1b44 : 08               [ 3]>            php
7574
1b45 : c901             [ 2]>            cmp #1     ;test result
7575
                            >            trap_ne
7576
1b47 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7577
                            >
7578
1b49 : 68               [ 4]>            pla         ;load status
7579
                            >            cmp_flag ~fnz
7580
1b4a : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
7581
                            >
7582
                            >            trap_ne
7583
1b4c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7584
                            >
7585
1b4e : 28               [ 4]>            plp         ;restore status
7586
 
7587
                                     set_a 1,$ff
7588
                            >            load_flag $ff
7589
1b4f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7590
                            >
7591
1b51 : 48               [ 3]>            pha         ;use stack to load status
7592
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  132
7593
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7594
 
7595
1b52 : a901             [ 2]>            lda #1     ;precharge accu
7596
1b54 : 28               [ 4]>            plp
7597
 
7598
1b55 : 2c0902           [ 4]         bit abs1+1  ;82 - should set N (M7) & Z / clear V
7599
                                     tst_a 1,~fv
7600
1b58 : 08               [ 3]>            php         ;save flags
7601
1b59 : 08               [ 3]>            php
7602
1b5a : c901             [ 2]>            cmp #1     ;test result
7603
                            >            trap_ne
7604
1b5c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7605
                            >
7606
1b5e : 68               [ 4]>            pla         ;load status
7607
                            >            cmp_flag ~fv
7608
1b5f : c9bf             [ 2]>            cmp #(~fv|fao)&m8    ;expected flags + always on bits
7609
                            >
7610
                            >            trap_ne
7611
1b61 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7612
                            >
7613
1b63 : 28               [ 4]>            plp         ;restore status
7614
 
7615
                                     set_a 1,$ff
7616
                            >            load_flag $ff
7617
1b64 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7618
                            >
7619
1b66 : 48               [ 3]>            pha         ;use stack to load status
7620
1b67 : a901             [ 2]>            lda #1     ;precharge accu
7621
1b69 : 28               [ 4]>            plp
7622
 
7623
1b6a : 2c0802           [ 4]         bit abs1    ;c3 - should set N (M7) & V (M6) / clear Z
7624
                                     tst_a 1,~fz
7625
1b6d : 08               [ 3]>            php         ;save flags
7626
1b6e : 08               [ 3]>            php
7627
1b6f : c901             [ 2]>            cmp #1     ;test result
7628
                            >            trap_ne
7629
1b71 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7630
                            >
7631
1b73 : 68               [ 4]>            pla         ;load status
7632
                            >            cmp_flag ~fz
7633
1b74 : c9fd             [ 2]>            cmp #(~fz|fao)&m8    ;expected flags + always on bits
7634
                            >
7635
                            >            trap_ne
7636
1b76 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7637
                            >
7638
1b78 : 28               [ 4]>            plp         ;restore status
7639
 
7640
                                     next_test
7641
1b79 : ad0002           [ 4]>            lda test_case   ;previous test
7642
1b7c : c919             [ 2]>            cmp #test_num
7643
                            >            trap_ne         ;test is out of sequence
7644
1b7e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7645
                            >
7646
001a =                      >test_num = test_num + 1
7647
1b80 : a91a             [ 2]>            lda #test_num   ;*** this tests' number
7648
1b82 : 8d0002           [ 4]>            sta test_case
7649
                            >            ;check_ram       ;uncomment to find altered RAM after each test
7650
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  133
7651
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7652
 
7653
 
7654
 
7655
                             ; CPX - zp / abs / #
7656
                                     set_x $80,0
7657
                            >            load_flag 0
7658
1b85 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7659
                            >
7660
1b87 : 48               [ 3]>            pha         ;use stack to load status
7661
1b88 : a280             [ 2]>            ldx #$80     ;precharge index x
7662
1b8a : 28               [ 4]>            plp
7663
 
7664
1b8b : e417             [ 3]         cpx zp7f
7665
                                     tst_stat fc
7666
1b8d : 08               [ 3]>            php         ;save status
7667
1b8e : 08               [ 3]>            php         ;use stack to retrieve status
7668
1b8f : 68               [ 4]>            pla
7669
                            >            cmp_flag fc
7670
1b90 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
7671
                            >
7672
                            >            trap_ne
7673
1b92 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7674
                            >
7675
1b94 : 28               [ 4]>            plp         ;restore status
7676
 
7677
1b95 : ca               [ 2]         dex
7678
1b96 : e417             [ 3]         cpx zp7f
7679
                                     tst_stat fzc
7680
1b98 : 08               [ 3]>            php         ;save status
7681
1b99 : 08               [ 3]>            php         ;use stack to retrieve status
7682
1b9a : 68               [ 4]>            pla
7683
                            >            cmp_flag fzc
7684
1b9b : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
7685
                            >
7686
                            >            trap_ne
7687
1b9d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7688
                            >
7689
1b9f : 28               [ 4]>            plp         ;restore status
7690
 
7691
1ba0 : ca               [ 2]         dex
7692
1ba1 : e417             [ 3]         cpx zp7f
7693
                                     tst_x $7e,fn
7694
1ba3 : 08               [ 3]>            php         ;save flags
7695
1ba4 : 08               [ 3]>            php
7696
1ba5 : e07e             [ 2]>            cpx #$7e     ;test result
7697
                            >            trap_ne
7698
1ba7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7699
                            >
7700
1ba9 : 68               [ 4]>            pla         ;load status
7701
                            >            cmp_flag fn
7702
1baa : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
7703
                            >
7704
                            >            trap_ne
7705
1bac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7706
                            >
7707
1bae : 28               [ 4]>            plp         ;restore status
7708
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  134
7709
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7710
 
7711
 
7712
                                     set_x $80,$ff
7713
                            >            load_flag $ff
7714
1baf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7715
                            >
7716
1bb1 : 48               [ 3]>            pha         ;use stack to load status
7717
1bb2 : a280             [ 2]>            ldx #$80     ;precharge index x
7718
1bb4 : 28               [ 4]>            plp
7719
 
7720
1bb5 : e417             [ 3]         cpx zp7f
7721
                                     tst_stat ~fnz
7722
1bb7 : 08               [ 3]>            php         ;save status
7723
1bb8 : 08               [ 3]>            php         ;use stack to retrieve status
7724
1bb9 : 68               [ 4]>            pla
7725
                            >            cmp_flag ~fnz
7726
1bba : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
7727
                            >
7728
                            >            trap_ne
7729
1bbc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7730
                            >
7731
1bbe : 28               [ 4]>            plp         ;restore status
7732
 
7733
1bbf : ca               [ 2]         dex
7734
1bc0 : e417             [ 3]         cpx zp7f
7735
                                     tst_stat ~fn
7736
1bc2 : 08               [ 3]>            php         ;save status
7737
1bc3 : 08               [ 3]>            php         ;use stack to retrieve status
7738
1bc4 : 68               [ 4]>            pla
7739
                            >            cmp_flag ~fn
7740
1bc5 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
7741
                            >
7742
                            >            trap_ne
7743
1bc7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7744
                            >
7745
1bc9 : 28               [ 4]>            plp         ;restore status
7746
 
7747
1bca : ca               [ 2]         dex
7748
1bcb : e417             [ 3]         cpx zp7f
7749
                                     tst_x $7e,~fzc
7750
1bcd : 08               [ 3]>            php         ;save flags
7751
1bce : 08               [ 3]>            php
7752
1bcf : e07e             [ 2]>            cpx #$7e     ;test result
7753
                            >            trap_ne
7754
1bd1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7755
                            >
7756
1bd3 : 68               [ 4]>            pla         ;load status
7757
                            >            cmp_flag ~fzc
7758
1bd4 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
7759
                            >
7760
                            >            trap_ne
7761
1bd6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7762
                            >
7763
1bd8 : 28               [ 4]>            plp         ;restore status
7764
 
7765
 
7766
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  135
7767
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7768
 
7769
                                     set_x $80,0
7770
                            >            load_flag 0
7771
1bd9 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7772
                            >
7773
1bdb : 48               [ 3]>            pha         ;use stack to load status
7774
1bdc : a280             [ 2]>            ldx #$80     ;precharge index x
7775
1bde : 28               [ 4]>            plp
7776
 
7777
1bdf : ec0c02           [ 4]         cpx abs7f
7778
                                     tst_stat fc
7779
1be2 : 08               [ 3]>            php         ;save status
7780
1be3 : 08               [ 3]>            php         ;use stack to retrieve status
7781
1be4 : 68               [ 4]>            pla
7782
                            >            cmp_flag fc
7783
1be5 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
7784
                            >
7785
                            >            trap_ne
7786
1be7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7787
                            >
7788
1be9 : 28               [ 4]>            plp         ;restore status
7789
 
7790
1bea : ca               [ 2]         dex
7791
1beb : ec0c02           [ 4]         cpx abs7f
7792
                                     tst_stat fzc
7793
1bee : 08               [ 3]>            php         ;save status
7794
1bef : 08               [ 3]>            php         ;use stack to retrieve status
7795
1bf0 : 68               [ 4]>            pla
7796
                            >            cmp_flag fzc
7797
1bf1 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
7798
                            >
7799
                            >            trap_ne
7800
1bf3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7801
                            >
7802
1bf5 : 28               [ 4]>            plp         ;restore status
7803
 
7804
1bf6 : ca               [ 2]         dex
7805
1bf7 : ec0c02           [ 4]         cpx abs7f
7806
                                     tst_x $7e,fn
7807
1bfa : 08               [ 3]>            php         ;save flags
7808
1bfb : 08               [ 3]>            php
7809
1bfc : e07e             [ 2]>            cpx #$7e     ;test result
7810
                            >            trap_ne
7811
1bfe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7812
                            >
7813
1c00 : 68               [ 4]>            pla         ;load status
7814
                            >            cmp_flag fn
7815
1c01 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
7816
                            >
7817
                            >            trap_ne
7818
1c03 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7819
                            >
7820
1c05 : 28               [ 4]>            plp         ;restore status
7821
 
7822
                                     set_x $80,$ff
7823
                            >            load_flag $ff
7824
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  136
7825
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7826
 
7827
1c06 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7828
                            >
7829
1c08 : 48               [ 3]>            pha         ;use stack to load status
7830
1c09 : a280             [ 2]>            ldx #$80     ;precharge index x
7831
1c0b : 28               [ 4]>            plp
7832
 
7833
1c0c : ec0c02           [ 4]         cpx abs7f
7834
                                     tst_stat ~fnz
7835
1c0f : 08               [ 3]>            php         ;save status
7836
1c10 : 08               [ 3]>            php         ;use stack to retrieve status
7837
1c11 : 68               [ 4]>            pla
7838
                            >            cmp_flag ~fnz
7839
1c12 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
7840
                            >
7841
                            >            trap_ne
7842
1c14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7843
                            >
7844
1c16 : 28               [ 4]>            plp         ;restore status
7845
 
7846
1c17 : ca               [ 2]         dex
7847
1c18 : ec0c02           [ 4]         cpx abs7f
7848
                                     tst_stat ~fn
7849
1c1b : 08               [ 3]>            php         ;save status
7850
1c1c : 08               [ 3]>            php         ;use stack to retrieve status
7851
1c1d : 68               [ 4]>            pla
7852
                            >            cmp_flag ~fn
7853
1c1e : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
7854
                            >
7855
                            >            trap_ne
7856
1c20 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7857
                            >
7858
1c22 : 28               [ 4]>            plp         ;restore status
7859
 
7860
1c23 : ca               [ 2]         dex
7861
1c24 : ec0c02           [ 4]         cpx abs7f
7862
                                     tst_x $7e,~fzc
7863
1c27 : 08               [ 3]>            php         ;save flags
7864
1c28 : 08               [ 3]>            php
7865
1c29 : e07e             [ 2]>            cpx #$7e     ;test result
7866
                            >            trap_ne
7867
1c2b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7868
                            >
7869
1c2d : 68               [ 4]>            pla         ;load status
7870
                            >            cmp_flag ~fzc
7871
1c2e : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
7872
                            >
7873
                            >            trap_ne
7874
1c30 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7875
                            >
7876
1c32 : 28               [ 4]>            plp         ;restore status
7877
 
7878
 
7879
                                     set_x $80,0
7880
                            >            load_flag 0
7881
1c33 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
7882
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  137
7883
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7884
 
7885
                            >
7886
1c35 : 48               [ 3]>            pha         ;use stack to load status
7887
1c36 : a280             [ 2]>            ldx #$80     ;precharge index x
7888
1c38 : 28               [ 4]>            plp
7889
 
7890
1c39 : e07f             [ 2]         cpx #$7f
7891
                                     tst_stat fc
7892
1c3b : 08               [ 3]>            php         ;save status
7893
1c3c : 08               [ 3]>            php         ;use stack to retrieve status
7894
1c3d : 68               [ 4]>            pla
7895
                            >            cmp_flag fc
7896
1c3e : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
7897
                            >
7898
                            >            trap_ne
7899
1c40 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7900
                            >
7901
1c42 : 28               [ 4]>            plp         ;restore status
7902
 
7903
1c43 : ca               [ 2]         dex
7904
1c44 : e07f             [ 2]         cpx #$7f
7905
                                     tst_stat fzc
7906
1c46 : 08               [ 3]>            php         ;save status
7907
1c47 : 08               [ 3]>            php         ;use stack to retrieve status
7908
1c48 : 68               [ 4]>            pla
7909
                            >            cmp_flag fzc
7910
1c49 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
7911
                            >
7912
                            >            trap_ne
7913
1c4b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7914
                            >
7915
1c4d : 28               [ 4]>            plp         ;restore status
7916
 
7917
1c4e : ca               [ 2]         dex
7918
1c4f : e07f             [ 2]         cpx #$7f
7919
                                     tst_x $7e,fn
7920
1c51 : 08               [ 3]>            php         ;save flags
7921
1c52 : 08               [ 3]>            php
7922
1c53 : e07e             [ 2]>            cpx #$7e     ;test result
7923
                            >            trap_ne
7924
1c55 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7925
                            >
7926
1c57 : 68               [ 4]>            pla         ;load status
7927
                            >            cmp_flag fn
7928
1c58 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
7929
                            >
7930
                            >            trap_ne
7931
1c5a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7932
                            >
7933
1c5c : 28               [ 4]>            plp         ;restore status
7934
 
7935
                                     set_x $80,$ff
7936
                            >            load_flag $ff
7937
1c5d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
7938
                            >
7939
1c5f : 48               [ 3]>            pha         ;use stack to load status
7940
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  138
7941
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
7942
 
7943
1c60 : a280             [ 2]>            ldx #$80     ;precharge index x
7944
1c62 : 28               [ 4]>            plp
7945
 
7946
1c63 : e07f             [ 2]         cpx #$7f
7947
                                     tst_stat ~fnz
7948
1c65 : 08               [ 3]>            php         ;save status
7949
1c66 : 08               [ 3]>            php         ;use stack to retrieve status
7950
1c67 : 68               [ 4]>            pla
7951
                            >            cmp_flag ~fnz
7952
1c68 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
7953
                            >
7954
                            >            trap_ne
7955
1c6a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7956
                            >
7957
1c6c : 28               [ 4]>            plp         ;restore status
7958
 
7959
1c6d : ca               [ 2]         dex
7960
1c6e : e07f             [ 2]         cpx #$7f
7961
                                     tst_stat ~fn
7962
1c70 : 08               [ 3]>            php         ;save status
7963
1c71 : 08               [ 3]>            php         ;use stack to retrieve status
7964
1c72 : 68               [ 4]>            pla
7965
                            >            cmp_flag ~fn
7966
1c73 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
7967
                            >
7968
                            >            trap_ne
7969
1c75 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7970
                            >
7971
1c77 : 28               [ 4]>            plp         ;restore status
7972
 
7973
1c78 : ca               [ 2]         dex
7974
1c79 : e07f             [ 2]         cpx #$7f
7975
                                     tst_x $7e,~fzc
7976
1c7b : 08               [ 3]>            php         ;save flags
7977
1c7c : 08               [ 3]>            php
7978
1c7d : e07e             [ 2]>            cpx #$7e     ;test result
7979
                            >            trap_ne
7980
1c7f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7981
                            >
7982
1c81 : 68               [ 4]>            pla         ;load status
7983
                            >            cmp_flag ~fzc
7984
1c82 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
7985
                            >
7986
                            >            trap_ne
7987
1c84 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7988
                            >
7989
1c86 : 28               [ 4]>            plp         ;restore status
7990
 
7991
                                     next_test
7992
1c87 : ad0002           [ 4]>            lda test_case   ;previous test
7993
1c8a : c91a             [ 2]>            cmp #test_num
7994
                            >            trap_ne         ;test is out of sequence
7995
1c8c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
7996
                            >
7997
001b =                      >test_num = test_num + 1
7998
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  139
7999
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8000
 
8001
1c8e : a91b             [ 2]>            lda #test_num   ;*** this tests' number
8002
1c90 : 8d0002           [ 4]>            sta test_case
8003
                            >            ;check_ram       ;uncomment to find altered RAM after each test
8004
 
8005
 
8006
                             ; CPY - zp / abs / #
8007
                                     set_y $80,0
8008
                            >            load_flag 0
8009
1c93 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8010
                            >
8011
1c95 : 48               [ 3]>            pha         ;use stack to load status
8012
1c96 : a080             [ 2]>            ldy #$80     ;precharge index y
8013
1c98 : 28               [ 4]>            plp
8014
 
8015
1c99 : c417             [ 3]         cpy zp7f
8016
                                     tst_stat fc
8017
1c9b : 08               [ 3]>            php         ;save status
8018
1c9c : 08               [ 3]>            php         ;use stack to retrieve status
8019
1c9d : 68               [ 4]>            pla
8020
                            >            cmp_flag fc
8021
1c9e : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
8022
                            >
8023
                            >            trap_ne
8024
1ca0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8025
                            >
8026
1ca2 : 28               [ 4]>            plp         ;restore status
8027
 
8028
1ca3 : 88               [ 2]         dey
8029
1ca4 : c417             [ 3]         cpy zp7f
8030
                                     tst_stat fzc
8031
1ca6 : 08               [ 3]>            php         ;save status
8032
1ca7 : 08               [ 3]>            php         ;use stack to retrieve status
8033
1ca8 : 68               [ 4]>            pla
8034
                            >            cmp_flag fzc
8035
1ca9 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
8036
                            >
8037
                            >            trap_ne
8038
1cab : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8039
                            >
8040
1cad : 28               [ 4]>            plp         ;restore status
8041
 
8042
1cae : 88               [ 2]         dey
8043
1caf : c417             [ 3]         cpy zp7f
8044
                                     tst_y $7e,fn
8045
1cb1 : 08               [ 3]>            php         ;save flags
8046
1cb2 : 08               [ 3]>            php
8047
1cb3 : c07e             [ 2]>            cpy #$7e     ;test result
8048
                            >            trap_ne
8049
1cb5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8050
                            >
8051
1cb7 : 68               [ 4]>            pla         ;load status
8052
                            >            cmp_flag fn
8053
1cb8 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
8054
                            >
8055
                            >            trap_ne
8056
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  140
8057
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8058
 
8059
1cba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8060
                            >
8061
1cbc : 28               [ 4]>            plp         ;restore status
8062
 
8063
                                     set_y $80,$ff
8064
                            >            load_flag $ff
8065
1cbd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8066
                            >
8067
1cbf : 48               [ 3]>            pha         ;use stack to load status
8068
1cc0 : a080             [ 2]>            ldy #$80     ;precharge index y
8069
1cc2 : 28               [ 4]>            plp
8070
 
8071
1cc3 : c417             [ 3]         cpy zp7f
8072
                                     tst_stat ~fnz
8073
1cc5 : 08               [ 3]>            php         ;save status
8074
1cc6 : 08               [ 3]>            php         ;use stack to retrieve status
8075
1cc7 : 68               [ 4]>            pla
8076
                            >            cmp_flag ~fnz
8077
1cc8 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
8078
                            >
8079
                            >            trap_ne
8080
1cca : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8081
                            >
8082
1ccc : 28               [ 4]>            plp         ;restore status
8083
 
8084
1ccd : 88               [ 2]         dey
8085
1cce : c417             [ 3]         cpy zp7f
8086
                                     tst_stat ~fn
8087
1cd0 : 08               [ 3]>            php         ;save status
8088
1cd1 : 08               [ 3]>            php         ;use stack to retrieve status
8089
1cd2 : 68               [ 4]>            pla
8090
                            >            cmp_flag ~fn
8091
1cd3 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
8092
                            >
8093
                            >            trap_ne
8094
1cd5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8095
                            >
8096
1cd7 : 28               [ 4]>            plp         ;restore status
8097
 
8098
1cd8 : 88               [ 2]         dey
8099
1cd9 : c417             [ 3]         cpy zp7f
8100
                                     tst_y $7e,~fzc
8101
1cdb : 08               [ 3]>            php         ;save flags
8102
1cdc : 08               [ 3]>            php
8103
1cdd : c07e             [ 2]>            cpy #$7e     ;test result
8104
                            >            trap_ne
8105
1cdf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8106
                            >
8107
1ce1 : 68               [ 4]>            pla         ;load status
8108
                            >            cmp_flag ~fzc
8109
1ce2 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
8110
                            >
8111
                            >            trap_ne
8112
1ce4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8113
                            >
8114
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  141
8115
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8116
 
8117
1ce6 : 28               [ 4]>            plp         ;restore status
8118
 
8119
 
8120
                                     set_y $80,0
8121
                            >            load_flag 0
8122
1ce7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8123
                            >
8124
1ce9 : 48               [ 3]>            pha         ;use stack to load status
8125
1cea : a080             [ 2]>            ldy #$80     ;precharge index y
8126
1cec : 28               [ 4]>            plp
8127
 
8128
1ced : cc0c02           [ 4]         cpy abs7f
8129
                                     tst_stat fc
8130
1cf0 : 08               [ 3]>            php         ;save status
8131
1cf1 : 08               [ 3]>            php         ;use stack to retrieve status
8132
1cf2 : 68               [ 4]>            pla
8133
                            >            cmp_flag fc
8134
1cf3 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
8135
                            >
8136
                            >            trap_ne
8137
1cf5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8138
                            >
8139
1cf7 : 28               [ 4]>            plp         ;restore status
8140
 
8141
1cf8 : 88               [ 2]         dey
8142
1cf9 : cc0c02           [ 4]         cpy abs7f
8143
                                     tst_stat fzc
8144
1cfc : 08               [ 3]>            php         ;save status
8145
1cfd : 08               [ 3]>            php         ;use stack to retrieve status
8146
1cfe : 68               [ 4]>            pla
8147
                            >            cmp_flag fzc
8148
1cff : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
8149
                            >
8150
                            >            trap_ne
8151
1d01 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8152
                            >
8153
1d03 : 28               [ 4]>            plp         ;restore status
8154
 
8155
1d04 : 88               [ 2]         dey
8156
1d05 : cc0c02           [ 4]         cpy abs7f
8157
                                     tst_y $7e,fn
8158
1d08 : 08               [ 3]>            php         ;save flags
8159
1d09 : 08               [ 3]>            php
8160
1d0a : c07e             [ 2]>            cpy #$7e     ;test result
8161
                            >            trap_ne
8162
1d0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8163
                            >
8164
1d0e : 68               [ 4]>            pla         ;load status
8165
                            >            cmp_flag fn
8166
1d0f : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
8167
                            >
8168
                            >            trap_ne
8169
1d11 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8170
                            >
8171
1d13 : 28               [ 4]>            plp         ;restore status
8172
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  142
8173
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8174
 
8175
 
8176
                                     set_y $80,$ff
8177
                            >            load_flag $ff
8178
1d14 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8179
                            >
8180
1d16 : 48               [ 3]>            pha         ;use stack to load status
8181
1d17 : a080             [ 2]>            ldy #$80     ;precharge index y
8182
1d19 : 28               [ 4]>            plp
8183
 
8184
1d1a : cc0c02           [ 4]         cpy abs7f
8185
                                     tst_stat ~fnz
8186
1d1d : 08               [ 3]>            php         ;save status
8187
1d1e : 08               [ 3]>            php         ;use stack to retrieve status
8188
1d1f : 68               [ 4]>            pla
8189
                            >            cmp_flag ~fnz
8190
1d20 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
8191
                            >
8192
                            >            trap_ne
8193
1d22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8194
                            >
8195
1d24 : 28               [ 4]>            plp         ;restore status
8196
 
8197
1d25 : 88               [ 2]         dey
8198
1d26 : cc0c02           [ 4]         cpy abs7f
8199
                                     tst_stat ~fn
8200
1d29 : 08               [ 3]>            php         ;save status
8201
1d2a : 08               [ 3]>            php         ;use stack to retrieve status
8202
1d2b : 68               [ 4]>            pla
8203
                            >            cmp_flag ~fn
8204
1d2c : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
8205
                            >
8206
                            >            trap_ne
8207
1d2e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8208
                            >
8209
1d30 : 28               [ 4]>            plp         ;restore status
8210
 
8211
1d31 : 88               [ 2]         dey
8212
1d32 : cc0c02           [ 4]         cpy abs7f
8213
                                     tst_y $7e,~fzc
8214
1d35 : 08               [ 3]>            php         ;save flags
8215
1d36 : 08               [ 3]>            php
8216
1d37 : c07e             [ 2]>            cpy #$7e     ;test result
8217
                            >            trap_ne
8218
1d39 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8219
                            >
8220
1d3b : 68               [ 4]>            pla         ;load status
8221
                            >            cmp_flag ~fzc
8222
1d3c : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
8223
                            >
8224
                            >            trap_ne
8225
1d3e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8226
                            >
8227
1d40 : 28               [ 4]>            plp         ;restore status
8228
 
8229
 
8230
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  143
8231
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8232
 
8233
                                     set_y $80,0
8234
                            >            load_flag 0
8235
1d41 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8236
                            >
8237
1d43 : 48               [ 3]>            pha         ;use stack to load status
8238
1d44 : a080             [ 2]>            ldy #$80     ;precharge index y
8239
1d46 : 28               [ 4]>            plp
8240
 
8241
1d47 : c07f             [ 2]         cpy #$7f
8242
                                     tst_stat fc
8243
1d49 : 08               [ 3]>            php         ;save status
8244
1d4a : 08               [ 3]>            php         ;use stack to retrieve status
8245
1d4b : 68               [ 4]>            pla
8246
                            >            cmp_flag fc
8247
1d4c : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
8248
                            >
8249
                            >            trap_ne
8250
1d4e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8251
                            >
8252
1d50 : 28               [ 4]>            plp         ;restore status
8253
 
8254
1d51 : 88               [ 2]         dey
8255
1d52 : c07f             [ 2]         cpy #$7f
8256
                                     tst_stat fzc
8257
1d54 : 08               [ 3]>            php         ;save status
8258
1d55 : 08               [ 3]>            php         ;use stack to retrieve status
8259
1d56 : 68               [ 4]>            pla
8260
                            >            cmp_flag fzc
8261
1d57 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
8262
                            >
8263
                            >            trap_ne
8264
1d59 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8265
                            >
8266
1d5b : 28               [ 4]>            plp         ;restore status
8267
 
8268
1d5c : 88               [ 2]         dey
8269
1d5d : c07f             [ 2]         cpy #$7f
8270
                                     tst_y $7e,fn
8271
1d5f : 08               [ 3]>            php         ;save flags
8272
1d60 : 08               [ 3]>            php
8273
1d61 : c07e             [ 2]>            cpy #$7e     ;test result
8274
                            >            trap_ne
8275
1d63 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8276
                            >
8277
1d65 : 68               [ 4]>            pla         ;load status
8278
                            >            cmp_flag fn
8279
1d66 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
8280
                            >
8281
                            >            trap_ne
8282
1d68 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8283
                            >
8284
1d6a : 28               [ 4]>            plp         ;restore status
8285
 
8286
                                     set_y $80,$ff
8287
                            >            load_flag $ff
8288
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  144
8289
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8290
 
8291
1d6b : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8292
                            >
8293
1d6d : 48               [ 3]>            pha         ;use stack to load status
8294
1d6e : a080             [ 2]>            ldy #$80     ;precharge index y
8295
1d70 : 28               [ 4]>            plp
8296
 
8297
1d71 : c07f             [ 2]         cpy #$7f
8298
                                     tst_stat ~fnz
8299
1d73 : 08               [ 3]>            php         ;save status
8300
1d74 : 08               [ 3]>            php         ;use stack to retrieve status
8301
1d75 : 68               [ 4]>            pla
8302
                            >            cmp_flag ~fnz
8303
1d76 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
8304
                            >
8305
                            >            trap_ne
8306
1d78 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8307
                            >
8308
1d7a : 28               [ 4]>            plp         ;restore status
8309
 
8310
1d7b : 88               [ 2]         dey
8311
1d7c : c07f             [ 2]         cpy #$7f
8312
                                     tst_stat ~fn
8313
1d7e : 08               [ 3]>            php         ;save status
8314
1d7f : 08               [ 3]>            php         ;use stack to retrieve status
8315
1d80 : 68               [ 4]>            pla
8316
                            >            cmp_flag ~fn
8317
1d81 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
8318
                            >
8319
                            >            trap_ne
8320
1d83 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8321
                            >
8322
1d85 : 28               [ 4]>            plp         ;restore status
8323
 
8324
1d86 : 88               [ 2]         dey
8325
1d87 : c07f             [ 2]         cpy #$7f
8326
                                     tst_y $7e,~fzc
8327
1d89 : 08               [ 3]>            php         ;save flags
8328
1d8a : 08               [ 3]>            php
8329
1d8b : c07e             [ 2]>            cpy #$7e     ;test result
8330
                            >            trap_ne
8331
1d8d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8332
                            >
8333
1d8f : 68               [ 4]>            pla         ;load status
8334
                            >            cmp_flag ~fzc
8335
1d90 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
8336
                            >
8337
                            >            trap_ne
8338
1d92 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8339
                            >
8340
1d94 : 28               [ 4]>            plp         ;restore status
8341
 
8342
                                     next_test
8343
1d95 : ad0002           [ 4]>            lda test_case   ;previous test
8344
1d98 : c91b             [ 2]>            cmp #test_num
8345
                            >            trap_ne         ;test is out of sequence
8346
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  145
8347
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8348
 
8349
1d9a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8350
                            >
8351
001c =                      >test_num = test_num + 1
8352
1d9c : a91c             [ 2]>            lda #test_num   ;*** this tests' number
8353
1d9e : 8d0002           [ 4]>            sta test_case
8354
                            >            ;check_ram       ;uncomment to find altered RAM after each test
8355
 
8356
 
8357
                             ; CMP - zp / abs / #
8358
                                     set_a $80,0
8359
                            >            load_flag 0
8360
1da1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8361
                            >
8362
1da3 : 48               [ 3]>            pha         ;use stack to load status
8363
1da4 : a980             [ 2]>            lda #$80     ;precharge accu
8364
1da6 : 28               [ 4]>            plp
8365
 
8366
1da7 : c517             [ 3]         cmp zp7f
8367
                                     tst_a $80,fc
8368
1da9 : 08               [ 3]>            php         ;save flags
8369
1daa : 08               [ 3]>            php
8370
1dab : c980             [ 2]>            cmp #$80     ;test result
8371
                            >            trap_ne
8372
1dad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8373
                            >
8374
1daf : 68               [ 4]>            pla         ;load status
8375
                            >            cmp_flag fc
8376
1db0 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
8377
                            >
8378
                            >            trap_ne
8379
1db2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8380
                            >
8381
1db4 : 28               [ 4]>            plp         ;restore status
8382
 
8383
                                     set_a $7f,0
8384
                            >            load_flag 0
8385
1db5 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8386
                            >
8387
1db7 : 48               [ 3]>            pha         ;use stack to load status
8388
1db8 : a97f             [ 2]>            lda #$7f     ;precharge accu
8389
1dba : 28               [ 4]>            plp
8390
 
8391
1dbb : c517             [ 3]         cmp zp7f
8392
                                     tst_a $7f,fzc
8393
1dbd : 08               [ 3]>            php         ;save flags
8394
1dbe : 08               [ 3]>            php
8395
1dbf : c97f             [ 2]>            cmp #$7f     ;test result
8396
                            >            trap_ne
8397
1dc1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8398
                            >
8399
1dc3 : 68               [ 4]>            pla         ;load status
8400
                            >            cmp_flag fzc
8401
1dc4 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
8402
                            >
8403
                            >            trap_ne
8404
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  146
8405
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8406
 
8407
1dc6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8408
                            >
8409
1dc8 : 28               [ 4]>            plp         ;restore status
8410
 
8411
                                     set_a $7e,0
8412
                            >            load_flag 0
8413
1dc9 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8414
                            >
8415
1dcb : 48               [ 3]>            pha         ;use stack to load status
8416
1dcc : a97e             [ 2]>            lda #$7e     ;precharge accu
8417
1dce : 28               [ 4]>            plp
8418
 
8419
1dcf : c517             [ 3]         cmp zp7f
8420
                                     tst_a $7e,fn
8421
1dd1 : 08               [ 3]>            php         ;save flags
8422
1dd2 : 08               [ 3]>            php
8423
1dd3 : c97e             [ 2]>            cmp #$7e     ;test result
8424
                            >            trap_ne
8425
1dd5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8426
                            >
8427
1dd7 : 68               [ 4]>            pla         ;load status
8428
                            >            cmp_flag fn
8429
1dd8 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
8430
                            >
8431
                            >            trap_ne
8432
1dda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8433
                            >
8434
1ddc : 28               [ 4]>            plp         ;restore status
8435
 
8436
                                     set_a $80,$ff
8437
                            >            load_flag $ff
8438
1ddd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8439
                            >
8440
1ddf : 48               [ 3]>            pha         ;use stack to load status
8441
1de0 : a980             [ 2]>            lda #$80     ;precharge accu
8442
1de2 : 28               [ 4]>            plp
8443
 
8444
1de3 : c517             [ 3]         cmp zp7f
8445
                                     tst_a $80,~fnz
8446
1de5 : 08               [ 3]>            php         ;save flags
8447
1de6 : 08               [ 3]>            php
8448
1de7 : c980             [ 2]>            cmp #$80     ;test result
8449
                            >            trap_ne
8450
1de9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8451
                            >
8452
1deb : 68               [ 4]>            pla         ;load status
8453
                            >            cmp_flag ~fnz
8454
1dec : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
8455
                            >
8456
                            >            trap_ne
8457
1dee : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8458
                            >
8459
1df0 : 28               [ 4]>            plp         ;restore status
8460
 
8461
                                     set_a $7f,$ff
8462
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  147
8463
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8464
 
8465
                            >            load_flag $ff
8466
1df1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8467
                            >
8468
1df3 : 48               [ 3]>            pha         ;use stack to load status
8469
1df4 : a97f             [ 2]>            lda #$7f     ;precharge accu
8470
1df6 : 28               [ 4]>            plp
8471
 
8472
1df7 : c517             [ 3]         cmp zp7f
8473
                                     tst_a $7f,~fn
8474
1df9 : 08               [ 3]>            php         ;save flags
8475
1dfa : 08               [ 3]>            php
8476
1dfb : c97f             [ 2]>            cmp #$7f     ;test result
8477
                            >            trap_ne
8478
1dfd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8479
                            >
8480
1dff : 68               [ 4]>            pla         ;load status
8481
                            >            cmp_flag ~fn
8482
1e00 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
8483
                            >
8484
                            >            trap_ne
8485
1e02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8486
                            >
8487
1e04 : 28               [ 4]>            plp         ;restore status
8488
 
8489
                                     set_a $7e,$ff
8490
                            >            load_flag $ff
8491
1e05 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8492
                            >
8493
1e07 : 48               [ 3]>            pha         ;use stack to load status
8494
1e08 : a97e             [ 2]>            lda #$7e     ;precharge accu
8495
1e0a : 28               [ 4]>            plp
8496
 
8497
1e0b : c517             [ 3]         cmp zp7f
8498
                                     tst_a $7e,~fzc
8499
1e0d : 08               [ 3]>            php         ;save flags
8500
1e0e : 08               [ 3]>            php
8501
1e0f : c97e             [ 2]>            cmp #$7e     ;test result
8502
                            >            trap_ne
8503
1e11 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8504
                            >
8505
1e13 : 68               [ 4]>            pla         ;load status
8506
                            >            cmp_flag ~fzc
8507
1e14 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
8508
                            >
8509
                            >            trap_ne
8510
1e16 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8511
                            >
8512
1e18 : 28               [ 4]>            plp         ;restore status
8513
 
8514
 
8515
                                     set_a $80,0
8516
                            >            load_flag 0
8517
1e19 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8518
                            >
8519
1e1b : 48               [ 3]>            pha         ;use stack to load status
8520
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  148
8521
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8522
 
8523
1e1c : a980             [ 2]>            lda #$80     ;precharge accu
8524
1e1e : 28               [ 4]>            plp
8525
 
8526
1e1f : cd0c02           [ 4]         cmp abs7f
8527
                                     tst_a $80,fc
8528
1e22 : 08               [ 3]>            php         ;save flags
8529
1e23 : 08               [ 3]>            php
8530
1e24 : c980             [ 2]>            cmp #$80     ;test result
8531
                            >            trap_ne
8532
1e26 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8533
                            >
8534
1e28 : 68               [ 4]>            pla         ;load status
8535
                            >            cmp_flag fc
8536
1e29 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
8537
                            >
8538
                            >            trap_ne
8539
1e2b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8540
                            >
8541
1e2d : 28               [ 4]>            plp         ;restore status
8542
 
8543
                                     set_a $7f,0
8544
                            >            load_flag 0
8545
1e2e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8546
                            >
8547
1e30 : 48               [ 3]>            pha         ;use stack to load status
8548
1e31 : a97f             [ 2]>            lda #$7f     ;precharge accu
8549
1e33 : 28               [ 4]>            plp
8550
 
8551
1e34 : cd0c02           [ 4]         cmp abs7f
8552
                                     tst_a $7f,fzc
8553
1e37 : 08               [ 3]>            php         ;save flags
8554
1e38 : 08               [ 3]>            php
8555
1e39 : c97f             [ 2]>            cmp #$7f     ;test result
8556
                            >            trap_ne
8557
1e3b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8558
                            >
8559
1e3d : 68               [ 4]>            pla         ;load status
8560
                            >            cmp_flag fzc
8561
1e3e : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
8562
                            >
8563
                            >            trap_ne
8564
1e40 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8565
                            >
8566
1e42 : 28               [ 4]>            plp         ;restore status
8567
 
8568
                                     set_a $7e,0
8569
                            >            load_flag 0
8570
1e43 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8571
                            >
8572
1e45 : 48               [ 3]>            pha         ;use stack to load status
8573
1e46 : a97e             [ 2]>            lda #$7e     ;precharge accu
8574
1e48 : 28               [ 4]>            plp
8575
 
8576
1e49 : cd0c02           [ 4]         cmp abs7f
8577
                                     tst_a $7e,fn
8578
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  149
8579
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8580
 
8581
1e4c : 08               [ 3]>            php         ;save flags
8582
1e4d : 08               [ 3]>            php
8583
1e4e : c97e             [ 2]>            cmp #$7e     ;test result
8584
                            >            trap_ne
8585
1e50 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8586
                            >
8587
1e52 : 68               [ 4]>            pla         ;load status
8588
                            >            cmp_flag fn
8589
1e53 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
8590
                            >
8591
                            >            trap_ne
8592
1e55 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8593
                            >
8594
1e57 : 28               [ 4]>            plp         ;restore status
8595
 
8596
                                     set_a $80,$ff
8597
                            >            load_flag $ff
8598
1e58 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8599
                            >
8600
1e5a : 48               [ 3]>            pha         ;use stack to load status
8601
1e5b : a980             [ 2]>            lda #$80     ;precharge accu
8602
1e5d : 28               [ 4]>            plp
8603
 
8604
1e5e : cd0c02           [ 4]         cmp abs7f
8605
                                     tst_a $80,~fnz
8606
1e61 : 08               [ 3]>            php         ;save flags
8607
1e62 : 08               [ 3]>            php
8608
1e63 : c980             [ 2]>            cmp #$80     ;test result
8609
                            >            trap_ne
8610
1e65 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8611
                            >
8612
1e67 : 68               [ 4]>            pla         ;load status
8613
                            >            cmp_flag ~fnz
8614
1e68 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
8615
                            >
8616
                            >            trap_ne
8617
1e6a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8618
                            >
8619
1e6c : 28               [ 4]>            plp         ;restore status
8620
 
8621
                                     set_a $7f,$ff
8622
                            >            load_flag $ff
8623
1e6d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8624
                            >
8625
1e6f : 48               [ 3]>            pha         ;use stack to load status
8626
1e70 : a97f             [ 2]>            lda #$7f     ;precharge accu
8627
1e72 : 28               [ 4]>            plp
8628
 
8629
1e73 : cd0c02           [ 4]         cmp abs7f
8630
                                     tst_a $7f,~fn
8631
1e76 : 08               [ 3]>            php         ;save flags
8632
1e77 : 08               [ 3]>            php
8633
1e78 : c97f             [ 2]>            cmp #$7f     ;test result
8634
                            >            trap_ne
8635
1e7a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8636
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  150
8637
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8638
 
8639
                            >
8640
1e7c : 68               [ 4]>            pla         ;load status
8641
                            >            cmp_flag ~fn
8642
1e7d : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
8643
                            >
8644
                            >            trap_ne
8645
1e7f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8646
                            >
8647
1e81 : 28               [ 4]>            plp         ;restore status
8648
 
8649
                                     set_a $7e,$ff
8650
                            >            load_flag $ff
8651
1e82 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8652
                            >
8653
1e84 : 48               [ 3]>            pha         ;use stack to load status
8654
1e85 : a97e             [ 2]>            lda #$7e     ;precharge accu
8655
1e87 : 28               [ 4]>            plp
8656
 
8657
1e88 : cd0c02           [ 4]         cmp abs7f
8658
                                     tst_a $7e,~fzc
8659
1e8b : 08               [ 3]>            php         ;save flags
8660
1e8c : 08               [ 3]>            php
8661
1e8d : c97e             [ 2]>            cmp #$7e     ;test result
8662
                            >            trap_ne
8663
1e8f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8664
                            >
8665
1e91 : 68               [ 4]>            pla         ;load status
8666
                            >            cmp_flag ~fzc
8667
1e92 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
8668
                            >
8669
                            >            trap_ne
8670
1e94 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8671
                            >
8672
1e96 : 28               [ 4]>            plp         ;restore status
8673
 
8674
 
8675
                                     set_a $80,0
8676
                            >            load_flag 0
8677
1e97 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8678
                            >
8679
1e99 : 48               [ 3]>            pha         ;use stack to load status
8680
1e9a : a980             [ 2]>            lda #$80     ;precharge accu
8681
1e9c : 28               [ 4]>            plp
8682
 
8683
1e9d : c97f             [ 2]         cmp #$7f
8684
                                     tst_a $80,fc
8685
1e9f : 08               [ 3]>            php         ;save flags
8686
1ea0 : 08               [ 3]>            php
8687
1ea1 : c980             [ 2]>            cmp #$80     ;test result
8688
                            >            trap_ne
8689
1ea3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8690
                            >
8691
1ea5 : 68               [ 4]>            pla         ;load status
8692
                            >            cmp_flag fc
8693
1ea6 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
8694
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  151
8695
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8696
 
8697
                            >
8698
                            >            trap_ne
8699
1ea8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8700
                            >
8701
1eaa : 28               [ 4]>            plp         ;restore status
8702
 
8703
                                     set_a $7f,0
8704
                            >            load_flag 0
8705
1eab : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8706
                            >
8707
1ead : 48               [ 3]>            pha         ;use stack to load status
8708
1eae : a97f             [ 2]>            lda #$7f     ;precharge accu
8709
1eb0 : 28               [ 4]>            plp
8710
 
8711
1eb1 : c97f             [ 2]         cmp #$7f
8712
                                     tst_a $7f,fzc
8713
1eb3 : 08               [ 3]>            php         ;save flags
8714
1eb4 : 08               [ 3]>            php
8715
1eb5 : c97f             [ 2]>            cmp #$7f     ;test result
8716
                            >            trap_ne
8717
1eb7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8718
                            >
8719
1eb9 : 68               [ 4]>            pla         ;load status
8720
                            >            cmp_flag fzc
8721
1eba : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
8722
                            >
8723
                            >            trap_ne
8724
1ebc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8725
                            >
8726
1ebe : 28               [ 4]>            plp         ;restore status
8727
 
8728
                                     set_a $7e,0
8729
                            >            load_flag 0
8730
1ebf : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8731
                            >
8732
1ec1 : 48               [ 3]>            pha         ;use stack to load status
8733
1ec2 : a97e             [ 2]>            lda #$7e     ;precharge accu
8734
1ec4 : 28               [ 4]>            plp
8735
 
8736
1ec5 : c97f             [ 2]         cmp #$7f
8737
                                     tst_a $7e,fn
8738
1ec7 : 08               [ 3]>            php         ;save flags
8739
1ec8 : 08               [ 3]>            php
8740
1ec9 : c97e             [ 2]>            cmp #$7e     ;test result
8741
                            >            trap_ne
8742
1ecb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8743
                            >
8744
1ecd : 68               [ 4]>            pla         ;load status
8745
                            >            cmp_flag fn
8746
1ece : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
8747
                            >
8748
                            >            trap_ne
8749
1ed0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8750
                            >
8751
1ed2 : 28               [ 4]>            plp         ;restore status
8752
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  152
8753
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8754
 
8755
 
8756
                                     set_a $80,$ff
8757
                            >            load_flag $ff
8758
1ed3 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8759
                            >
8760
1ed5 : 48               [ 3]>            pha         ;use stack to load status
8761
1ed6 : a980             [ 2]>            lda #$80     ;precharge accu
8762
1ed8 : 28               [ 4]>            plp
8763
 
8764
1ed9 : c97f             [ 2]         cmp #$7f
8765
                                     tst_a $80,~fnz
8766
1edb : 08               [ 3]>            php         ;save flags
8767
1edc : 08               [ 3]>            php
8768
1edd : c980             [ 2]>            cmp #$80     ;test result
8769
                            >            trap_ne
8770
1edf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8771
                            >
8772
1ee1 : 68               [ 4]>            pla         ;load status
8773
                            >            cmp_flag ~fnz
8774
1ee2 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
8775
                            >
8776
                            >            trap_ne
8777
1ee4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8778
                            >
8779
1ee6 : 28               [ 4]>            plp         ;restore status
8780
 
8781
                                     set_a $7f,$ff
8782
                            >            load_flag $ff
8783
1ee7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8784
                            >
8785
1ee9 : 48               [ 3]>            pha         ;use stack to load status
8786
1eea : a97f             [ 2]>            lda #$7f     ;precharge accu
8787
1eec : 28               [ 4]>            plp
8788
 
8789
1eed : c97f             [ 2]         cmp #$7f
8790
                                     tst_a $7f,~fn
8791
1eef : 08               [ 3]>            php         ;save flags
8792
1ef0 : 08               [ 3]>            php
8793
1ef1 : c97f             [ 2]>            cmp #$7f     ;test result
8794
                            >            trap_ne
8795
1ef3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8796
                            >
8797
1ef5 : 68               [ 4]>            pla         ;load status
8798
                            >            cmp_flag ~fn
8799
1ef6 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
8800
                            >
8801
                            >            trap_ne
8802
1ef8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8803
                            >
8804
1efa : 28               [ 4]>            plp         ;restore status
8805
 
8806
                                     set_a $7e,$ff
8807
                            >            load_flag $ff
8808
1efb : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8809
                            >
8810
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  153
8811
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8812
 
8813
1efd : 48               [ 3]>            pha         ;use stack to load status
8814
1efe : a97e             [ 2]>            lda #$7e     ;precharge accu
8815
1f00 : 28               [ 4]>            plp
8816
 
8817
1f01 : c97f             [ 2]         cmp #$7f
8818
                                     tst_a $7e,~fzc
8819
1f03 : 08               [ 3]>            php         ;save flags
8820
1f04 : 08               [ 3]>            php
8821
1f05 : c97e             [ 2]>            cmp #$7e     ;test result
8822
                            >            trap_ne
8823
1f07 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8824
                            >
8825
1f09 : 68               [ 4]>            pla         ;load status
8826
                            >            cmp_flag ~fzc
8827
1f0a : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
8828
                            >
8829
                            >            trap_ne
8830
1f0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8831
                            >
8832
1f0e : 28               [ 4]>            plp         ;restore status
8833
 
8834
 
8835
1f0f : a204             [ 2]         ldx #4          ;with indexing by X
8836
                                     set_a $80,0
8837
                            >            load_flag 0
8838
1f11 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8839
                            >
8840
1f13 : 48               [ 3]>            pha         ;use stack to load status
8841
1f14 : a980             [ 2]>            lda #$80     ;precharge accu
8842
1f16 : 28               [ 4]>            plp
8843
 
8844
1f17 : d513             [ 4]         cmp zp1,x
8845
                                     tst_a $80,fc
8846
1f19 : 08               [ 3]>            php         ;save flags
8847
1f1a : 08               [ 3]>            php
8848
1f1b : c980             [ 2]>            cmp #$80     ;test result
8849
                            >            trap_ne
8850
1f1d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8851
                            >
8852
1f1f : 68               [ 4]>            pla         ;load status
8853
                            >            cmp_flag fc
8854
1f20 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
8855
                            >
8856
                            >            trap_ne
8857
1f22 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8858
                            >
8859
1f24 : 28               [ 4]>            plp         ;restore status
8860
 
8861
                                     set_a $7f,0
8862
                            >            load_flag 0
8863
1f25 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8864
                            >
8865
1f27 : 48               [ 3]>            pha         ;use stack to load status
8866
1f28 : a97f             [ 2]>            lda #$7f     ;precharge accu
8867
1f2a : 28               [ 4]>            plp
8868
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  154
8869
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8870
 
8871
 
8872
1f2b : d513             [ 4]         cmp zp1,x
8873
                                     tst_a $7f,fzc
8874
1f2d : 08               [ 3]>            php         ;save flags
8875
1f2e : 08               [ 3]>            php
8876
1f2f : c97f             [ 2]>            cmp #$7f     ;test result
8877
                            >            trap_ne
8878
1f31 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8879
                            >
8880
1f33 : 68               [ 4]>            pla         ;load status
8881
                            >            cmp_flag fzc
8882
1f34 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
8883
                            >
8884
                            >            trap_ne
8885
1f36 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8886
                            >
8887
1f38 : 28               [ 4]>            plp         ;restore status
8888
 
8889
                                     set_a $7e,0
8890
                            >            load_flag 0
8891
1f39 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8892
                            >
8893
1f3b : 48               [ 3]>            pha         ;use stack to load status
8894
1f3c : a97e             [ 2]>            lda #$7e     ;precharge accu
8895
1f3e : 28               [ 4]>            plp
8896
 
8897
1f3f : d513             [ 4]         cmp zp1,x
8898
                                     tst_a $7e,fn
8899
1f41 : 08               [ 3]>            php         ;save flags
8900
1f42 : 08               [ 3]>            php
8901
1f43 : c97e             [ 2]>            cmp #$7e     ;test result
8902
                            >            trap_ne
8903
1f45 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8904
                            >
8905
1f47 : 68               [ 4]>            pla         ;load status
8906
                            >            cmp_flag fn
8907
1f48 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
8908
                            >
8909
                            >            trap_ne
8910
1f4a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8911
                            >
8912
1f4c : 28               [ 4]>            plp         ;restore status
8913
 
8914
                                     set_a $80,$ff
8915
                            >            load_flag $ff
8916
1f4d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8917
                            >
8918
1f4f : 48               [ 3]>            pha         ;use stack to load status
8919
1f50 : a980             [ 2]>            lda #$80     ;precharge accu
8920
1f52 : 28               [ 4]>            plp
8921
 
8922
1f53 : d513             [ 4]         cmp zp1,x
8923
                                     tst_a $80,~fnz
8924
1f55 : 08               [ 3]>            php         ;save flags
8925
1f56 : 08               [ 3]>            php
8926
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  155
8927
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8928
 
8929
1f57 : c980             [ 2]>            cmp #$80     ;test result
8930
                            >            trap_ne
8931
1f59 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8932
                            >
8933
1f5b : 68               [ 4]>            pla         ;load status
8934
                            >            cmp_flag ~fnz
8935
1f5c : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
8936
                            >
8937
                            >            trap_ne
8938
1f5e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8939
                            >
8940
1f60 : 28               [ 4]>            plp         ;restore status
8941
 
8942
                                     set_a $7f,$ff
8943
                            >            load_flag $ff
8944
1f61 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8945
                            >
8946
1f63 : 48               [ 3]>            pha         ;use stack to load status
8947
1f64 : a97f             [ 2]>            lda #$7f     ;precharge accu
8948
1f66 : 28               [ 4]>            plp
8949
 
8950
1f67 : d513             [ 4]         cmp zp1,x
8951
                                     tst_a $7f,~fn
8952
1f69 : 08               [ 3]>            php         ;save flags
8953
1f6a : 08               [ 3]>            php
8954
1f6b : c97f             [ 2]>            cmp #$7f     ;test result
8955
                            >            trap_ne
8956
1f6d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8957
                            >
8958
1f6f : 68               [ 4]>            pla         ;load status
8959
                            >            cmp_flag ~fn
8960
1f70 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
8961
                            >
8962
                            >            trap_ne
8963
1f72 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8964
                            >
8965
1f74 : 28               [ 4]>            plp         ;restore status
8966
 
8967
                                     set_a $7e,$ff
8968
                            >            load_flag $ff
8969
1f75 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
8970
                            >
8971
1f77 : 48               [ 3]>            pha         ;use stack to load status
8972
1f78 : a97e             [ 2]>            lda #$7e     ;precharge accu
8973
1f7a : 28               [ 4]>            plp
8974
 
8975
1f7b : d513             [ 4]         cmp zp1,x
8976
                                     tst_a $7e,~fzc
8977
1f7d : 08               [ 3]>            php         ;save flags
8978
1f7e : 08               [ 3]>            php
8979
1f7f : c97e             [ 2]>            cmp #$7e     ;test result
8980
                            >            trap_ne
8981
1f81 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8982
                            >
8983
1f83 : 68               [ 4]>            pla         ;load status
8984
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  156
8985
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
8986
 
8987
                            >            cmp_flag ~fzc
8988
1f84 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
8989
                            >
8990
                            >            trap_ne
8991
1f86 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
8992
                            >
8993
1f88 : 28               [ 4]>            plp         ;restore status
8994
 
8995
 
8996
                                     set_a $80,0
8997
                            >            load_flag 0
8998
1f89 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
8999
                            >
9000
1f8b : 48               [ 3]>            pha         ;use stack to load status
9001
1f8c : a980             [ 2]>            lda #$80     ;precharge accu
9002
1f8e : 28               [ 4]>            plp
9003
 
9004
1f8f : dd0802           [ 4]         cmp abs1,x
9005
                                     tst_a $80,fc
9006
1f92 : 08               [ 3]>            php         ;save flags
9007
1f93 : 08               [ 3]>            php
9008
1f94 : c980             [ 2]>            cmp #$80     ;test result
9009
                            >            trap_ne
9010
1f96 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9011
                            >
9012
1f98 : 68               [ 4]>            pla         ;load status
9013
                            >            cmp_flag fc
9014
1f99 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
9015
                            >
9016
                            >            trap_ne
9017
1f9b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9018
                            >
9019
1f9d : 28               [ 4]>            plp         ;restore status
9020
 
9021
                                     set_a $7f,0
9022
                            >            load_flag 0
9023
1f9e : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9024
                            >
9025
1fa0 : 48               [ 3]>            pha         ;use stack to load status
9026
1fa1 : a97f             [ 2]>            lda #$7f     ;precharge accu
9027
1fa3 : 28               [ 4]>            plp
9028
 
9029
1fa4 : dd0802           [ 4]         cmp abs1,x
9030
                                     tst_a $7f,fzc
9031
1fa7 : 08               [ 3]>            php         ;save flags
9032
1fa8 : 08               [ 3]>            php
9033
1fa9 : c97f             [ 2]>            cmp #$7f     ;test result
9034
                            >            trap_ne
9035
1fab : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9036
                            >
9037
1fad : 68               [ 4]>            pla         ;load status
9038
                            >            cmp_flag fzc
9039
1fae : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
9040
                            >
9041
                            >            trap_ne
9042
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  157
9043
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9044
 
9045
1fb0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9046
                            >
9047
1fb2 : 28               [ 4]>            plp         ;restore status
9048
 
9049
                                     set_a $7e,0
9050
                            >            load_flag 0
9051
1fb3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9052
                            >
9053
1fb5 : 48               [ 3]>            pha         ;use stack to load status
9054
1fb6 : a97e             [ 2]>            lda #$7e     ;precharge accu
9055
1fb8 : 28               [ 4]>            plp
9056
 
9057
1fb9 : dd0802           [ 4]         cmp abs1,x
9058
                                     tst_a $7e,fn
9059
1fbc : 08               [ 3]>            php         ;save flags
9060
1fbd : 08               [ 3]>            php
9061
1fbe : c97e             [ 2]>            cmp #$7e     ;test result
9062
                            >            trap_ne
9063
1fc0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9064
                            >
9065
1fc2 : 68               [ 4]>            pla         ;load status
9066
                            >            cmp_flag fn
9067
1fc3 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
9068
                            >
9069
                            >            trap_ne
9070
1fc5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9071
                            >
9072
1fc7 : 28               [ 4]>            plp         ;restore status
9073
 
9074
                                     set_a $80,$ff
9075
                            >            load_flag $ff
9076
1fc8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9077
                            >
9078
1fca : 48               [ 3]>            pha         ;use stack to load status
9079
1fcb : a980             [ 2]>            lda #$80     ;precharge accu
9080
1fcd : 28               [ 4]>            plp
9081
 
9082
1fce : dd0802           [ 4]         cmp abs1,x
9083
                                     tst_a $80,~fnz
9084
1fd1 : 08               [ 3]>            php         ;save flags
9085
1fd2 : 08               [ 3]>            php
9086
1fd3 : c980             [ 2]>            cmp #$80     ;test result
9087
                            >            trap_ne
9088
1fd5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9089
                            >
9090
1fd7 : 68               [ 4]>            pla         ;load status
9091
                            >            cmp_flag ~fnz
9092
1fd8 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
9093
                            >
9094
                            >            trap_ne
9095
1fda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9096
                            >
9097
1fdc : 28               [ 4]>            plp         ;restore status
9098
 
9099
                                     set_a $7f,$ff
9100
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  158
9101
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9102
 
9103
                            >            load_flag $ff
9104
1fdd : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9105
                            >
9106
1fdf : 48               [ 3]>            pha         ;use stack to load status
9107
1fe0 : a97f             [ 2]>            lda #$7f     ;precharge accu
9108
1fe2 : 28               [ 4]>            plp
9109
 
9110
1fe3 : dd0802           [ 4]         cmp abs1,x
9111
                                     tst_a $7f,~fn
9112
1fe6 : 08               [ 3]>            php         ;save flags
9113
1fe7 : 08               [ 3]>            php
9114
1fe8 : c97f             [ 2]>            cmp #$7f     ;test result
9115
                            >            trap_ne
9116
1fea : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9117
                            >
9118
1fec : 68               [ 4]>            pla         ;load status
9119
                            >            cmp_flag ~fn
9120
1fed : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
9121
                            >
9122
                            >            trap_ne
9123
1fef : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9124
                            >
9125
1ff1 : 28               [ 4]>            plp         ;restore status
9126
 
9127
                                     set_a $7e,$ff
9128
                            >            load_flag $ff
9129
1ff2 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9130
                            >
9131
1ff4 : 48               [ 3]>            pha         ;use stack to load status
9132
1ff5 : a97e             [ 2]>            lda #$7e     ;precharge accu
9133
1ff7 : 28               [ 4]>            plp
9134
 
9135
1ff8 : dd0802           [ 4]         cmp abs1,x
9136
                                     tst_a $7e,~fzc
9137
1ffb : 08               [ 3]>            php         ;save flags
9138
1ffc : 08               [ 3]>            php
9139
1ffd : c97e             [ 2]>            cmp #$7e     ;test result
9140
                            >            trap_ne
9141
1fff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9142
                            >
9143
2001 : 68               [ 4]>            pla         ;load status
9144
                            >            cmp_flag ~fzc
9145
2002 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
9146
                            >
9147
                            >            trap_ne
9148
2004 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9149
                            >
9150
2006 : 28               [ 4]>            plp         ;restore status
9151
 
9152
 
9153
2007 : a004             [ 2]         ldy #4          ;with indexing by Y
9154
2009 : a208             [ 2]         ldx #8          ;with indexed indirect
9155
                                     set_a $80,0
9156
                            >            load_flag 0
9157
200b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9158
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  159
9159
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9160
 
9161
                            >
9162
200d : 48               [ 3]>            pha         ;use stack to load status
9163
200e : a980             [ 2]>            lda #$80     ;precharge accu
9164
2010 : 28               [ 4]>            plp
9165
 
9166
2011 : d90802           [ 4]         cmp abs1,y
9167
                                     tst_a $80,fc
9168
2014 : 08               [ 3]>            php         ;save flags
9169
2015 : 08               [ 3]>            php
9170
2016 : c980             [ 2]>            cmp #$80     ;test result
9171
                            >            trap_ne
9172
2018 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9173
                            >
9174
201a : 68               [ 4]>            pla         ;load status
9175
                            >            cmp_flag fc
9176
201b : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
9177
                            >
9178
                            >            trap_ne
9179
201d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9180
                            >
9181
201f : 28               [ 4]>            plp         ;restore status
9182
 
9183
                                     set_a $7f,0
9184
                            >            load_flag 0
9185
2020 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9186
                            >
9187
2022 : 48               [ 3]>            pha         ;use stack to load status
9188
2023 : a97f             [ 2]>            lda #$7f     ;precharge accu
9189
2025 : 28               [ 4]>            plp
9190
 
9191
2026 : d90802           [ 4]         cmp abs1,y
9192
                                     tst_a $7f,fzc
9193
2029 : 08               [ 3]>            php         ;save flags
9194
202a : 08               [ 3]>            php
9195
202b : c97f             [ 2]>            cmp #$7f     ;test result
9196
                            >            trap_ne
9197
202d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9198
                            >
9199
202f : 68               [ 4]>            pla         ;load status
9200
                            >            cmp_flag fzc
9201
2030 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
9202
                            >
9203
                            >            trap_ne
9204
2032 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9205
                            >
9206
2034 : 28               [ 4]>            plp         ;restore status
9207
 
9208
                                     set_a $7e,0
9209
                            >            load_flag 0
9210
2035 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9211
                            >
9212
2037 : 48               [ 3]>            pha         ;use stack to load status
9213
2038 : a97e             [ 2]>            lda #$7e     ;precharge accu
9214
203a : 28               [ 4]>            plp
9215
 
9216
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  160
9217
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9218
 
9219
203b : d90802           [ 4]         cmp abs1,y
9220
                                     tst_a $7e,fn
9221
203e : 08               [ 3]>            php         ;save flags
9222
203f : 08               [ 3]>            php
9223
2040 : c97e             [ 2]>            cmp #$7e     ;test result
9224
                            >            trap_ne
9225
2042 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9226
                            >
9227
2044 : 68               [ 4]>            pla         ;load status
9228
                            >            cmp_flag fn
9229
2045 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
9230
                            >
9231
                            >            trap_ne
9232
2047 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9233
                            >
9234
2049 : 28               [ 4]>            plp         ;restore status
9235
 
9236
                                     set_a $80,$ff
9237
                            >            load_flag $ff
9238
204a : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9239
                            >
9240
204c : 48               [ 3]>            pha         ;use stack to load status
9241
204d : a980             [ 2]>            lda #$80     ;precharge accu
9242
204f : 28               [ 4]>            plp
9243
 
9244
2050 : d90802           [ 4]         cmp abs1,y
9245
                                     tst_a $80,~fnz
9246
2053 : 08               [ 3]>            php         ;save flags
9247
2054 : 08               [ 3]>            php
9248
2055 : c980             [ 2]>            cmp #$80     ;test result
9249
                            >            trap_ne
9250
2057 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9251
                            >
9252
2059 : 68               [ 4]>            pla         ;load status
9253
                            >            cmp_flag ~fnz
9254
205a : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
9255
                            >
9256
                            >            trap_ne
9257
205c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9258
                            >
9259
205e : 28               [ 4]>            plp         ;restore status
9260
 
9261
                                     set_a $7f,$ff
9262
                            >            load_flag $ff
9263
205f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9264
                            >
9265
2061 : 48               [ 3]>            pha         ;use stack to load status
9266
2062 : a97f             [ 2]>            lda #$7f     ;precharge accu
9267
2064 : 28               [ 4]>            plp
9268
 
9269
2065 : d90802           [ 4]         cmp abs1,y
9270
                                     tst_a $7f,~fn
9271
2068 : 08               [ 3]>            php         ;save flags
9272
2069 : 08               [ 3]>            php
9273
206a : c97f             [ 2]>            cmp #$7f     ;test result
9274
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  161
9275
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9276
 
9277
                            >            trap_ne
9278
206c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9279
                            >
9280
206e : 68               [ 4]>            pla         ;load status
9281
                            >            cmp_flag ~fn
9282
206f : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
9283
                            >
9284
                            >            trap_ne
9285
2071 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9286
                            >
9287
2073 : 28               [ 4]>            plp         ;restore status
9288
 
9289
                                     set_a $7e,$ff
9290
                            >            load_flag $ff
9291
2074 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9292
                            >
9293
2076 : 48               [ 3]>            pha         ;use stack to load status
9294
2077 : a97e             [ 2]>            lda #$7e     ;precharge accu
9295
2079 : 28               [ 4]>            plp
9296
 
9297
207a : d90802           [ 4]         cmp abs1,y
9298
                                     tst_a $7e,~fzc
9299
207d : 08               [ 3]>            php         ;save flags
9300
207e : 08               [ 3]>            php
9301
207f : c97e             [ 2]>            cmp #$7e     ;test result
9302
                            >            trap_ne
9303
2081 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9304
                            >
9305
2083 : 68               [ 4]>            pla         ;load status
9306
                            >            cmp_flag ~fzc
9307
2084 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
9308
                            >
9309
                            >            trap_ne
9310
2086 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9311
                            >
9312
2088 : 28               [ 4]>            plp         ;restore status
9313
 
9314
 
9315
                                     set_a $80,0
9316
                            >            load_flag 0
9317
2089 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9318
                            >
9319
208b : 48               [ 3]>            pha         ;use stack to load status
9320
208c : a980             [ 2]>            lda #$80     ;precharge accu
9321
208e : 28               [ 4]>            plp
9322
 
9323
208f : c124             [ 6]         cmp (ind1,x)
9324
                                     tst_a $80,fc
9325
2091 : 08               [ 3]>            php         ;save flags
9326
2092 : 08               [ 3]>            php
9327
2093 : c980             [ 2]>            cmp #$80     ;test result
9328
                            >            trap_ne
9329
2095 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9330
                            >
9331
2097 : 68               [ 4]>            pla         ;load status
9332
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  162
9333
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9334
 
9335
                            >            cmp_flag fc
9336
2098 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
9337
                            >
9338
                            >            trap_ne
9339
209a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9340
                            >
9341
209c : 28               [ 4]>            plp         ;restore status
9342
 
9343
                                     set_a $7f,0
9344
                            >            load_flag 0
9345
209d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9346
                            >
9347
209f : 48               [ 3]>            pha         ;use stack to load status
9348
20a0 : a97f             [ 2]>            lda #$7f     ;precharge accu
9349
20a2 : 28               [ 4]>            plp
9350
 
9351
20a3 : c124             [ 6]         cmp (ind1,x)
9352
                                     tst_a $7f,fzc
9353
20a5 : 08               [ 3]>            php         ;save flags
9354
20a6 : 08               [ 3]>            php
9355
20a7 : c97f             [ 2]>            cmp #$7f     ;test result
9356
                            >            trap_ne
9357
20a9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9358
                            >
9359
20ab : 68               [ 4]>            pla         ;load status
9360
                            >            cmp_flag fzc
9361
20ac : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
9362
                            >
9363
                            >            trap_ne
9364
20ae : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9365
                            >
9366
20b0 : 28               [ 4]>            plp         ;restore status
9367
 
9368
                                     set_a $7e,0
9369
                            >            load_flag 0
9370
20b1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9371
                            >
9372
20b3 : 48               [ 3]>            pha         ;use stack to load status
9373
20b4 : a97e             [ 2]>            lda #$7e     ;precharge accu
9374
20b6 : 28               [ 4]>            plp
9375
 
9376
20b7 : c124             [ 6]         cmp (ind1,x)
9377
                                     tst_a $7e,fn
9378
20b9 : 08               [ 3]>            php         ;save flags
9379
20ba : 08               [ 3]>            php
9380
20bb : c97e             [ 2]>            cmp #$7e     ;test result
9381
                            >            trap_ne
9382
20bd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9383
                            >
9384
20bf : 68               [ 4]>            pla         ;load status
9385
                            >            cmp_flag fn
9386
20c0 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
9387
                            >
9388
                            >            trap_ne
9389
20c2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9390
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  163
9391
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9392
 
9393
                            >
9394
20c4 : 28               [ 4]>            plp         ;restore status
9395
 
9396
                                     set_a $80,$ff
9397
                            >            load_flag $ff
9398
20c5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9399
                            >
9400
20c7 : 48               [ 3]>            pha         ;use stack to load status
9401
20c8 : a980             [ 2]>            lda #$80     ;precharge accu
9402
20ca : 28               [ 4]>            plp
9403
 
9404
20cb : c124             [ 6]         cmp (ind1,x)
9405
                                     tst_a $80,~fnz
9406
20cd : 08               [ 3]>            php         ;save flags
9407
20ce : 08               [ 3]>            php
9408
20cf : c980             [ 2]>            cmp #$80     ;test result
9409
                            >            trap_ne
9410
20d1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9411
                            >
9412
20d3 : 68               [ 4]>            pla         ;load status
9413
                            >            cmp_flag ~fnz
9414
20d4 : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
9415
                            >
9416
                            >            trap_ne
9417
20d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9418
                            >
9419
20d8 : 28               [ 4]>            plp         ;restore status
9420
 
9421
                                     set_a $7f,$ff
9422
                            >            load_flag $ff
9423
20d9 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9424
                            >
9425
20db : 48               [ 3]>            pha         ;use stack to load status
9426
20dc : a97f             [ 2]>            lda #$7f     ;precharge accu
9427
20de : 28               [ 4]>            plp
9428
 
9429
20df : c124             [ 6]         cmp (ind1,x)
9430
                                     tst_a $7f,~fn
9431
20e1 : 08               [ 3]>            php         ;save flags
9432
20e2 : 08               [ 3]>            php
9433
20e3 : c97f             [ 2]>            cmp #$7f     ;test result
9434
                            >            trap_ne
9435
20e5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9436
                            >
9437
20e7 : 68               [ 4]>            pla         ;load status
9438
                            >            cmp_flag ~fn
9439
20e8 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
9440
                            >
9441
                            >            trap_ne
9442
20ea : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9443
                            >
9444
20ec : 28               [ 4]>            plp         ;restore status
9445
 
9446
                                     set_a $7e,$ff
9447
                            >            load_flag $ff
9448
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  164
9449
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9450
 
9451
20ed : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9452
                            >
9453
20ef : 48               [ 3]>            pha         ;use stack to load status
9454
20f0 : a97e             [ 2]>            lda #$7e     ;precharge accu
9455
20f2 : 28               [ 4]>            plp
9456
 
9457
20f3 : c124             [ 6]         cmp (ind1,x)
9458
                                     tst_a $7e,~fzc
9459
20f5 : 08               [ 3]>            php         ;save flags
9460
20f6 : 08               [ 3]>            php
9461
20f7 : c97e             [ 2]>            cmp #$7e     ;test result
9462
                            >            trap_ne
9463
20f9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9464
                            >
9465
20fb : 68               [ 4]>            pla         ;load status
9466
                            >            cmp_flag ~fzc
9467
20fc : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
9468
                            >
9469
                            >            trap_ne
9470
20fe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9471
                            >
9472
2100 : 28               [ 4]>            plp         ;restore status
9473
 
9474
 
9475
                                     set_a $80,0
9476
                            >            load_flag 0
9477
2101 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9478
                            >
9479
2103 : 48               [ 3]>            pha         ;use stack to load status
9480
2104 : a980             [ 2]>            lda #$80     ;precharge accu
9481
2106 : 28               [ 4]>            plp
9482
 
9483
2107 : d124             [ 5]         cmp (ind1),y
9484
                                     tst_a $80,fc
9485
2109 : 08               [ 3]>            php         ;save flags
9486
210a : 08               [ 3]>            php
9487
210b : c980             [ 2]>            cmp #$80     ;test result
9488
                            >            trap_ne
9489
210d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9490
                            >
9491
210f : 68               [ 4]>            pla         ;load status
9492
                            >            cmp_flag fc
9493
2110 : c931             [ 2]>            cmp #(fc|fao)&m8    ;expected flags + always on bits
9494
                            >
9495
                            >            trap_ne
9496
2112 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9497
                            >
9498
2114 : 28               [ 4]>            plp         ;restore status
9499
 
9500
                                     set_a $7f,0
9501
                            >            load_flag 0
9502
2115 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9503
                            >
9504
2117 : 48               [ 3]>            pha         ;use stack to load status
9505
2118 : a97f             [ 2]>            lda #$7f     ;precharge accu
9506
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  165
9507
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9508
 
9509
211a : 28               [ 4]>            plp
9510
 
9511
211b : d124             [ 5]         cmp (ind1),y
9512
                                     tst_a $7f,fzc
9513
211d : 08               [ 3]>            php         ;save flags
9514
211e : 08               [ 3]>            php
9515
211f : c97f             [ 2]>            cmp #$7f     ;test result
9516
                            >            trap_ne
9517
2121 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9518
                            >
9519
2123 : 68               [ 4]>            pla         ;load status
9520
                            >            cmp_flag fzc
9521
2124 : c933             [ 2]>            cmp #(fzc|fao)&m8    ;expected flags + always on bits
9522
                            >
9523
                            >            trap_ne
9524
2126 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9525
                            >
9526
2128 : 28               [ 4]>            plp         ;restore status
9527
 
9528
                                     set_a $7e,0
9529
                            >            load_flag 0
9530
2129 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9531
                            >
9532
212b : 48               [ 3]>            pha         ;use stack to load status
9533
212c : a97e             [ 2]>            lda #$7e     ;precharge accu
9534
212e : 28               [ 4]>            plp
9535
 
9536
212f : d124             [ 5]         cmp (ind1),y
9537
                                     tst_a $7e,fn
9538
2131 : 08               [ 3]>            php         ;save flags
9539
2132 : 08               [ 3]>            php
9540
2133 : c97e             [ 2]>            cmp #$7e     ;test result
9541
                            >            trap_ne
9542
2135 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9543
                            >
9544
2137 : 68               [ 4]>            pla         ;load status
9545
                            >            cmp_flag fn
9546
2138 : c9b0             [ 2]>            cmp #(fn|fao)&m8    ;expected flags + always on bits
9547
                            >
9548
                            >            trap_ne
9549
213a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9550
                            >
9551
213c : 28               [ 4]>            plp         ;restore status
9552
 
9553
                                     set_a $80,$ff
9554
                            >            load_flag $ff
9555
213d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9556
                            >
9557
213f : 48               [ 3]>            pha         ;use stack to load status
9558
2140 : a980             [ 2]>            lda #$80     ;precharge accu
9559
2142 : 28               [ 4]>            plp
9560
 
9561
2143 : d124             [ 5]         cmp (ind1),y
9562
                                     tst_a $80,~fnz
9563
2145 : 08               [ 3]>            php         ;save flags
9564
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  166
9565
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9566
 
9567
2146 : 08               [ 3]>            php
9568
2147 : c980             [ 2]>            cmp #$80     ;test result
9569
                            >            trap_ne
9570
2149 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9571
                            >
9572
214b : 68               [ 4]>            pla         ;load status
9573
                            >            cmp_flag ~fnz
9574
214c : c97d             [ 2]>            cmp #(~fnz|fao)&m8    ;expected flags + always on bits
9575
                            >
9576
                            >            trap_ne
9577
214e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9578
                            >
9579
2150 : 28               [ 4]>            plp         ;restore status
9580
 
9581
                                     set_a $7f,$ff
9582
                            >            load_flag $ff
9583
2151 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9584
                            >
9585
2153 : 48               [ 3]>            pha         ;use stack to load status
9586
2154 : a97f             [ 2]>            lda #$7f     ;precharge accu
9587
2156 : 28               [ 4]>            plp
9588
 
9589
2157 : d124             [ 5]         cmp (ind1),y
9590
                                     tst_a $7f,~fn
9591
2159 : 08               [ 3]>            php         ;save flags
9592
215a : 08               [ 3]>            php
9593
215b : c97f             [ 2]>            cmp #$7f     ;test result
9594
                            >            trap_ne
9595
215d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9596
                            >
9597
215f : 68               [ 4]>            pla         ;load status
9598
                            >            cmp_flag ~fn
9599
2160 : c97f             [ 2]>            cmp #(~fn|fao)&m8    ;expected flags + always on bits
9600
                            >
9601
                            >            trap_ne
9602
2162 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9603
                            >
9604
2164 : 28               [ 4]>            plp         ;restore status
9605
 
9606
                                     set_a $7e,$ff
9607
                            >            load_flag $ff
9608
2165 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9609
                            >
9610
2167 : 48               [ 3]>            pha         ;use stack to load status
9611
2168 : a97e             [ 2]>            lda #$7e     ;precharge accu
9612
216a : 28               [ 4]>            plp
9613
 
9614
216b : d124             [ 5]         cmp (ind1),y
9615
                                     tst_a $7e,~fzc
9616
216d : 08               [ 3]>            php         ;save flags
9617
216e : 08               [ 3]>            php
9618
216f : c97e             [ 2]>            cmp #$7e     ;test result
9619
                            >            trap_ne
9620
2171 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9621
                            >
9622
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  167
9623
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9624
 
9625
2173 : 68               [ 4]>            pla         ;load status
9626
                            >            cmp_flag ~fzc
9627
2174 : c9fc             [ 2]>            cmp #(~fzc|fao)&m8    ;expected flags + always on bits
9628
                            >
9629
                            >            trap_ne
9630
2176 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9631
                            >
9632
2178 : 28               [ 4]>            plp         ;restore status
9633
 
9634
                                     next_test
9635
2179 : ad0002           [ 4]>            lda test_case   ;previous test
9636
217c : c91c             [ 2]>            cmp #test_num
9637
                            >            trap_ne         ;test is out of sequence
9638
217e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9639
                            >
9640
001d =                      >test_num = test_num + 1
9641
2180 : a91d             [ 2]>            lda #test_num   ;*** this tests' number
9642
2182 : 8d0002           [ 4]>            sta test_case
9643
                            >            ;check_ram       ;uncomment to find altered RAM after each test
9644
 
9645
 
9646
                             ; testing shifts - ASL LSR ROL ROR all addressing modes
9647
                             ; shifts - accumulator
9648
2185 : a203             [ 2]         ldx #3
9649
2187 :                       tasl
9650
                                     set_ax zp1,0
9651
                            >            load_flag 0
9652
2187 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9653
                            >
9654
2189 : 48               [ 3]>            pha         ;use stack to load status
9655
218a : b513             [ 4]>            lda zp1,x    ;precharge accu
9656
218c : 28               [ 4]>            plp
9657
 
9658
218d : 0a               [ 2]         asl a
9659
                                     tst_ax rASL,fASL,0
9660
218e : 08               [ 3]>            php         ;save flags
9661
218f : dd1102           [ 4]>            cmp rASL,x    ;test result
9662
                            >            trap_ne
9663
2192 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9664
                            >
9665
2194 : 68               [ 4]>            pla         ;load status
9666
                            >            eor_flag 0
9667
2195 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
9668
                            >
9669
2197 : dd2102           [ 4]>            cmp fASL,x    ;test flags
9670
                            >            trap_ne     ;
9671
219a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9672
                            >
9673
 
9674
219c : ca               [ 2]         dex
9675
219d : 10e8             [ 3]         bpl tasl
9676
219f : a203             [ 2]         ldx #3
9677
21a1 :                       tasl1
9678
                                     set_ax zp1,$ff
9679
                            >            load_flag $ff
9680
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  168
9681
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9682
 
9683
21a1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9684
                            >
9685
21a3 : 48               [ 3]>            pha         ;use stack to load status
9686
21a4 : b513             [ 4]>            lda zp1,x    ;precharge accu
9687
21a6 : 28               [ 4]>            plp
9688
 
9689
21a7 : 0a               [ 2]         asl a
9690
                                     tst_ax rASL,fASL,$ff-fnzc
9691
21a8 : 08               [ 3]>            php         ;save flags
9692
21a9 : dd1102           [ 4]>            cmp rASL,x    ;test result
9693
                            >            trap_ne
9694
21ac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9695
                            >
9696
21ae : 68               [ 4]>            pla         ;load status
9697
                            >            eor_flag $ff-fnzc
9698
21af : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
9699
                            >
9700
21b1 : dd2102           [ 4]>            cmp fASL,x    ;test flags
9701
                            >            trap_ne     ;
9702
21b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9703
                            >
9704
 
9705
21b6 : ca               [ 2]         dex
9706
21b7 : 10e8             [ 3]         bpl tasl1
9707
 
9708
21b9 : a203             [ 2]         ldx #3
9709
21bb :                       tlsr
9710
                                     set_ax zp1,0
9711
                            >            load_flag 0
9712
21bb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9713
                            >
9714
21bd : 48               [ 3]>            pha         ;use stack to load status
9715
21be : b513             [ 4]>            lda zp1,x    ;precharge accu
9716
21c0 : 28               [ 4]>            plp
9717
 
9718
21c1 : 4a               [ 2]         lsr a
9719
                                     tst_ax rLSR,fLSR,0
9720
21c2 : 08               [ 3]>            php         ;save flags
9721
21c3 : dd1902           [ 4]>            cmp rLSR,x    ;test result
9722
                            >            trap_ne
9723
21c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9724
                            >
9725
21c8 : 68               [ 4]>            pla         ;load status
9726
                            >            eor_flag 0
9727
21c9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
9728
                            >
9729
21cb : dd2902           [ 4]>            cmp fLSR,x    ;test flags
9730
                            >            trap_ne     ;
9731
21ce : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9732
                            >
9733
 
9734
21d0 : ca               [ 2]         dex
9735
21d1 : 10e8             [ 3]         bpl tlsr
9736
21d3 : a203             [ 2]         ldx #3
9737
21d5 :                       tlsr1
9738
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  169
9739
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9740
 
9741
                                     set_ax zp1,$ff
9742
                            >            load_flag $ff
9743
21d5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9744
                            >
9745
21d7 : 48               [ 3]>            pha         ;use stack to load status
9746
21d8 : b513             [ 4]>            lda zp1,x    ;precharge accu
9747
21da : 28               [ 4]>            plp
9748
 
9749
21db : 4a               [ 2]         lsr a
9750
                                     tst_ax rLSR,fLSR,$ff-fnzc
9751
21dc : 08               [ 3]>            php         ;save flags
9752
21dd : dd1902           [ 4]>            cmp rLSR,x    ;test result
9753
                            >            trap_ne
9754
21e0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9755
                            >
9756
21e2 : 68               [ 4]>            pla         ;load status
9757
                            >            eor_flag $ff-fnzc
9758
21e3 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
9759
                            >
9760
21e5 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
9761
                            >            trap_ne     ;
9762
21e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9763
                            >
9764
 
9765
21ea : ca               [ 2]         dex
9766
21eb : 10e8             [ 3]         bpl tlsr1
9767
 
9768
21ed : a203             [ 2]         ldx #3
9769
21ef :                       trol
9770
                                     set_ax zp1,0
9771
                            >            load_flag 0
9772
21ef : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9773
                            >
9774
21f1 : 48               [ 3]>            pha         ;use stack to load status
9775
21f2 : b513             [ 4]>            lda zp1,x    ;precharge accu
9776
21f4 : 28               [ 4]>            plp
9777
 
9778
21f5 : 2a               [ 2]         rol a
9779
                                     tst_ax rROL,fROL,0
9780
21f6 : 08               [ 3]>            php         ;save flags
9781
21f7 : dd1102           [ 4]>            cmp rROL,x    ;test result
9782
                            >            trap_ne
9783
21fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9784
                            >
9785
21fc : 68               [ 4]>            pla         ;load status
9786
                            >            eor_flag 0
9787
21fd : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
9788
                            >
9789
21ff : dd2102           [ 4]>            cmp fROL,x    ;test flags
9790
                            >            trap_ne     ;
9791
2202 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9792
                            >
9793
 
9794
2204 : ca               [ 2]         dex
9795
2205 : 10e8             [ 4]         bpl trol
9796
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  170
9797
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9798
 
9799
2207 : a203             [ 2]         ldx #3
9800
2209 :                       trol1
9801
                                     set_ax zp1,$ff-fc
9802
                            >            load_flag $ff-fc
9803
2209 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
9804
                            >
9805
220b : 48               [ 3]>            pha         ;use stack to load status
9806
220c : b513             [ 4]>            lda zp1,x    ;precharge accu
9807
220e : 28               [ 4]>            plp
9808
 
9809
220f : 2a               [ 2]         rol a
9810
                                     tst_ax rROL,fROL,$ff-fnzc
9811
2210 : 08               [ 3]>            php         ;save flags
9812
2211 : dd1102           [ 4]>            cmp rROL,x    ;test result
9813
                            >            trap_ne
9814
2214 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9815
                            >
9816
2216 : 68               [ 4]>            pla         ;load status
9817
                            >            eor_flag $ff-fnzc
9818
2217 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
9819
                            >
9820
2219 : dd2102           [ 4]>            cmp fROL,x    ;test flags
9821
                            >            trap_ne     ;
9822
221c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9823
                            >
9824
 
9825
221e : ca               [ 2]         dex
9826
221f : 10e8             [ 3]         bpl trol1
9827
 
9828
2221 : a203             [ 2]         ldx #3
9829
2223 :                       trolc
9830
                                     set_ax zp1,fc
9831
                            >            load_flag fc
9832
2223 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
9833
                            >
9834
2225 : 48               [ 3]>            pha         ;use stack to load status
9835
2226 : b513             [ 4]>            lda zp1,x    ;precharge accu
9836
2228 : 28               [ 4]>            plp
9837
 
9838
2229 : 2a               [ 2]         rol a
9839
                                     tst_ax rROLc,fROLc,0
9840
222a : 08               [ 3]>            php         ;save flags
9841
222b : dd1502           [ 4]>            cmp rROLc,x    ;test result
9842
                            >            trap_ne
9843
222e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9844
                            >
9845
2230 : 68               [ 4]>            pla         ;load status
9846
                            >            eor_flag 0
9847
2231 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
9848
                            >
9849
2233 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
9850
                            >            trap_ne     ;
9851
2236 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9852
                            >
9853
 
9854
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  171
9855
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9856
 
9857
2238 : ca               [ 2]         dex
9858
2239 : 10e8             [ 3]         bpl trolc
9859
223b : a203             [ 2]         ldx #3
9860
223d :                       trolc1
9861
                                     set_ax zp1,$ff
9862
                            >            load_flag $ff
9863
223d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9864
                            >
9865
223f : 48               [ 3]>            pha         ;use stack to load status
9866
2240 : b513             [ 4]>            lda zp1,x    ;precharge accu
9867
2242 : 28               [ 4]>            plp
9868
 
9869
2243 : 2a               [ 2]         rol a
9870
                                     tst_ax rROLc,fROLc,$ff-fnzc
9871
2244 : 08               [ 3]>            php         ;save flags
9872
2245 : dd1502           [ 4]>            cmp rROLc,x    ;test result
9873
                            >            trap_ne
9874
2248 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9875
                            >
9876
224a : 68               [ 4]>            pla         ;load status
9877
                            >            eor_flag $ff-fnzc
9878
224b : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
9879
                            >
9880
224d : dd2502           [ 4]>            cmp fROLc,x    ;test flags
9881
                            >            trap_ne     ;
9882
2250 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9883
                            >
9884
 
9885
2252 : ca               [ 2]         dex
9886
2253 : 10e8             [ 3]         bpl trolc1
9887
 
9888
2255 : a203             [ 2]         ldx #3
9889
2257 :                       tror
9890
                                     set_ax zp1,0
9891
                            >            load_flag 0
9892
2257 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
9893
                            >
9894
2259 : 48               [ 3]>            pha         ;use stack to load status
9895
225a : b513             [ 4]>            lda zp1,x    ;precharge accu
9896
225c : 28               [ 4]>            plp
9897
 
9898
225d : 6a               [ 2]         ror a
9899
                                     tst_ax rROR,fROR,0
9900
225e : 08               [ 3]>            php         ;save flags
9901
225f : dd1902           [ 4]>            cmp rROR,x    ;test result
9902
                            >            trap_ne
9903
2262 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9904
                            >
9905
2264 : 68               [ 4]>            pla         ;load status
9906
                            >            eor_flag 0
9907
2265 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
9908
                            >
9909
2267 : dd2902           [ 4]>            cmp fROR,x    ;test flags
9910
                            >            trap_ne     ;
9911
226a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9912
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  172
9913
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9914
 
9915
                            >
9916
 
9917
226c : ca               [ 2]         dex
9918
226d : 10e8             [ 3]         bpl tror
9919
226f : a203             [ 2]         ldx #3
9920
2271 :                       tror1
9921
                                     set_ax zp1,$ff-fc
9922
                            >            load_flag $ff-fc
9923
2271 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
9924
                            >
9925
2273 : 48               [ 3]>            pha         ;use stack to load status
9926
2274 : b513             [ 4]>            lda zp1,x    ;precharge accu
9927
2276 : 28               [ 4]>            plp
9928
 
9929
2277 : 6a               [ 2]         ror a
9930
                                     tst_ax rROR,fROR,$ff-fnzc
9931
2278 : 08               [ 3]>            php         ;save flags
9932
2279 : dd1902           [ 4]>            cmp rROR,x    ;test result
9933
                            >            trap_ne
9934
227c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9935
                            >
9936
227e : 68               [ 4]>            pla         ;load status
9937
                            >            eor_flag $ff-fnzc
9938
227f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
9939
                            >
9940
2281 : dd2902           [ 4]>            cmp fROR,x    ;test flags
9941
                            >            trap_ne     ;
9942
2284 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9943
                            >
9944
 
9945
2286 : ca               [ 2]         dex
9946
2287 : 10e8             [ 3]         bpl tror1
9947
 
9948
2289 : a203             [ 2]         ldx #3
9949
228b :                       trorc
9950
                                     set_ax zp1,fc
9951
                            >            load_flag fc
9952
228b : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
9953
                            >
9954
228d : 48               [ 3]>            pha         ;use stack to load status
9955
228e : b513             [ 4]>            lda zp1,x    ;precharge accu
9956
2290 : 28               [ 4]>            plp
9957
 
9958
2291 : 6a               [ 2]         ror a
9959
                                     tst_ax rRORc,fRORc,0
9960
2292 : 08               [ 3]>            php         ;save flags
9961
2293 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
9962
                            >            trap_ne
9963
2296 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9964
                            >
9965
2298 : 68               [ 4]>            pla         ;load status
9966
                            >            eor_flag 0
9967
2299 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
9968
                            >
9969
229b : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
9970
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  173
9971
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
9972
 
9973
                            >            trap_ne     ;
9974
229e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9975
                            >
9976
 
9977
22a0 : ca               [ 2]         dex
9978
22a1 : 10e8             [ 3]         bpl trorc
9979
22a3 : a203             [ 2]         ldx #3
9980
22a5 :                       trorc1
9981
                                     set_ax zp1,$ff
9982
                            >            load_flag $ff
9983
22a5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
9984
                            >
9985
22a7 : 48               [ 3]>            pha         ;use stack to load status
9986
22a8 : b513             [ 4]>            lda zp1,x    ;precharge accu
9987
22aa : 28               [ 4]>            plp
9988
 
9989
22ab : 6a               [ 2]         ror a
9990
                                     tst_ax rRORc,fRORc,$ff-fnzc
9991
22ac : 08               [ 3]>            php         ;save flags
9992
22ad : dd1d02           [ 4]>            cmp rRORc,x    ;test result
9993
                            >            trap_ne
9994
22b0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
9995
                            >
9996
22b2 : 68               [ 4]>            pla         ;load status
9997
                            >            eor_flag $ff-fnzc
9998
22b3 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
9999
                            >
10000
22b5 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
10001
                            >            trap_ne     ;
10002
22b8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10003
                            >
10004
 
10005
22ba : ca               [ 2]         dex
10006
22bb : 10e8             [ 3]         bpl trorc1
10007
                                     next_test
10008
22bd : ad0002           [ 4]>            lda test_case   ;previous test
10009
22c0 : c91d             [ 2]>            cmp #test_num
10010
                            >            trap_ne         ;test is out of sequence
10011
22c2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10012
                            >
10013
001e =                      >test_num = test_num + 1
10014
22c4 : a91e             [ 2]>            lda #test_num   ;*** this tests' number
10015
22c6 : 8d0002           [ 4]>            sta test_case
10016
                            >            ;check_ram       ;uncomment to find altered RAM after each test
10017
 
10018
 
10019
                             ; shifts - zeropage
10020
22c9 : a203             [ 2]         ldx #3
10021
22cb :                       tasl2
10022
                                     set_z zp1,0
10023
                            >            load_flag 0
10024
22cb : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10025
                            >
10026
22cd : 48               [ 3]>            pha         ;use stack to load status
10027
22ce : b513             [ 4]>            lda zp1,x    ;load to zeropage
10028
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  174
10029
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10030
 
10031
22d0 : 850c             [ 3]>            sta zpt
10032
22d2 : 28               [ 4]>            plp
10033
 
10034
22d3 : 060c             [ 5]         asl zpt
10035
                                     tst_z rASL,fASL,0
10036
22d5 : 08               [ 3]>            php         ;save flags
10037
22d6 : a50c             [ 3]>            lda zpt
10038
22d8 : dd1102           [ 4]>            cmp rASL,x    ;test result
10039
                            >            trap_ne
10040
22db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10041
                            >
10042
22dd : 68               [ 4]>            pla         ;load status
10043
                            >            eor_flag 0
10044
22de : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10045
                            >
10046
22e0 : dd2102           [ 4]>            cmp fASL,x    ;test flags
10047
                            >            trap_ne
10048
22e3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10049
                            >
10050
 
10051
22e5 : ca               [ 2]         dex
10052
22e6 : 10e3             [ 3]         bpl tasl2
10053
22e8 : a203             [ 2]         ldx #3
10054
22ea :                       tasl3
10055
                                     set_z zp1,$ff
10056
                            >            load_flag $ff
10057
22ea : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10058
                            >
10059
22ec : 48               [ 3]>            pha         ;use stack to load status
10060
22ed : b513             [ 4]>            lda zp1,x    ;load to zeropage
10061
22ef : 850c             [ 3]>            sta zpt
10062
22f1 : 28               [ 4]>            plp
10063
 
10064
22f2 : 060c             [ 5]         asl zpt
10065
                                     tst_z rASL,fASL,$ff-fnzc
10066
22f4 : 08               [ 3]>            php         ;save flags
10067
22f5 : a50c             [ 3]>            lda zpt
10068
22f7 : dd1102           [ 4]>            cmp rASL,x    ;test result
10069
                            >            trap_ne
10070
22fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10071
                            >
10072
22fc : 68               [ 4]>            pla         ;load status
10073
                            >            eor_flag $ff-fnzc
10074
22fd : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10075
                            >
10076
22ff : dd2102           [ 4]>            cmp fASL,x    ;test flags
10077
                            >            trap_ne
10078
2302 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10079
                            >
10080
 
10081
2304 : ca               [ 2]         dex
10082
2305 : 10e3             [ 4]         bpl tasl3
10083
 
10084
2307 : a203             [ 2]         ldx #3
10085
2309 :                       tlsr2
10086
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  175
10087
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10088
 
10089
                                     set_z zp1,0
10090
                            >            load_flag 0
10091
2309 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10092
                            >
10093
230b : 48               [ 3]>            pha         ;use stack to load status
10094
230c : b513             [ 4]>            lda zp1,x    ;load to zeropage
10095
230e : 850c             [ 3]>            sta zpt
10096
2310 : 28               [ 4]>            plp
10097
 
10098
2311 : 460c             [ 5]         lsr zpt
10099
                                     tst_z rLSR,fLSR,0
10100
2313 : 08               [ 3]>            php         ;save flags
10101
2314 : a50c             [ 3]>            lda zpt
10102
2316 : dd1902           [ 4]>            cmp rLSR,x    ;test result
10103
                            >            trap_ne
10104
2319 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10105
                            >
10106
231b : 68               [ 4]>            pla         ;load status
10107
                            >            eor_flag 0
10108
231c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10109
                            >
10110
231e : dd2902           [ 4]>            cmp fLSR,x    ;test flags
10111
                            >            trap_ne
10112
2321 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10113
                            >
10114
 
10115
2323 : ca               [ 2]         dex
10116
2324 : 10e3             [ 3]         bpl tlsr2
10117
2326 : a203             [ 2]         ldx #3
10118
2328 :                       tlsr3
10119
                                     set_z zp1,$ff
10120
                            >            load_flag $ff
10121
2328 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10122
                            >
10123
232a : 48               [ 3]>            pha         ;use stack to load status
10124
232b : b513             [ 4]>            lda zp1,x    ;load to zeropage
10125
232d : 850c             [ 3]>            sta zpt
10126
232f : 28               [ 4]>            plp
10127
 
10128
2330 : 460c             [ 5]         lsr zpt
10129
                                     tst_z rLSR,fLSR,$ff-fnzc
10130
2332 : 08               [ 3]>            php         ;save flags
10131
2333 : a50c             [ 3]>            lda zpt
10132
2335 : dd1902           [ 4]>            cmp rLSR,x    ;test result
10133
                            >            trap_ne
10134
2338 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10135
                            >
10136
233a : 68               [ 4]>            pla         ;load status
10137
                            >            eor_flag $ff-fnzc
10138
233b : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10139
                            >
10140
233d : dd2902           [ 4]>            cmp fLSR,x    ;test flags
10141
                            >            trap_ne
10142
2340 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10143
                            >
10144
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  176
10145
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10146
 
10147
 
10148
2342 : ca               [ 2]         dex
10149
2343 : 10e3             [ 3]         bpl tlsr3
10150
 
10151
2345 : a203             [ 2]         ldx #3
10152
2347 :                       trol2
10153
                                     set_z zp1,0
10154
                            >            load_flag 0
10155
2347 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10156
                            >
10157
2349 : 48               [ 3]>            pha         ;use stack to load status
10158
234a : b513             [ 4]>            lda zp1,x    ;load to zeropage
10159
234c : 850c             [ 3]>            sta zpt
10160
234e : 28               [ 4]>            plp
10161
 
10162
234f : 260c             [ 5]         rol zpt
10163
                                     tst_z rROL,fROL,0
10164
2351 : 08               [ 3]>            php         ;save flags
10165
2352 : a50c             [ 3]>            lda zpt
10166
2354 : dd1102           [ 4]>            cmp rROL,x    ;test result
10167
                            >            trap_ne
10168
2357 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10169
                            >
10170
2359 : 68               [ 4]>            pla         ;load status
10171
                            >            eor_flag 0
10172
235a : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10173
                            >
10174
235c : dd2102           [ 4]>            cmp fROL,x    ;test flags
10175
                            >            trap_ne
10176
235f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10177
                            >
10178
 
10179
2361 : ca               [ 2]         dex
10180
2362 : 10e3             [ 3]         bpl trol2
10181
2364 : a203             [ 2]         ldx #3
10182
2366 :                       trol3
10183
                                     set_z zp1,$ff-fc
10184
                            >            load_flag $ff-fc
10185
2366 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
10186
                            >
10187
2368 : 48               [ 3]>            pha         ;use stack to load status
10188
2369 : b513             [ 4]>            lda zp1,x    ;load to zeropage
10189
236b : 850c             [ 3]>            sta zpt
10190
236d : 28               [ 4]>            plp
10191
 
10192
236e : 260c             [ 5]         rol zpt
10193
                                     tst_z rROL,fROL,$ff-fnzc
10194
2370 : 08               [ 3]>            php         ;save flags
10195
2371 : a50c             [ 3]>            lda zpt
10196
2373 : dd1102           [ 4]>            cmp rROL,x    ;test result
10197
                            >            trap_ne
10198
2376 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10199
                            >
10200
2378 : 68               [ 4]>            pla         ;load status
10201
                            >            eor_flag $ff-fnzc
10202
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  177
10203
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10204
 
10205
2379 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10206
                            >
10207
237b : dd2102           [ 4]>            cmp fROL,x    ;test flags
10208
                            >            trap_ne
10209
237e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10210
                            >
10211
 
10212
2380 : ca               [ 2]         dex
10213
2381 : 10e3             [ 3]         bpl trol3
10214
 
10215
2383 : a203             [ 2]         ldx #3
10216
2385 :                       trolc2
10217
                                     set_z zp1,fc
10218
                            >            load_flag fc
10219
2385 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
10220
                            >
10221
2387 : 48               [ 3]>            pha         ;use stack to load status
10222
2388 : b513             [ 4]>            lda zp1,x    ;load to zeropage
10223
238a : 850c             [ 3]>            sta zpt
10224
238c : 28               [ 4]>            plp
10225
 
10226
238d : 260c             [ 5]         rol zpt
10227
                                     tst_z rROLc,fROLc,0
10228
238f : 08               [ 3]>            php         ;save flags
10229
2390 : a50c             [ 3]>            lda zpt
10230
2392 : dd1502           [ 4]>            cmp rROLc,x    ;test result
10231
                            >            trap_ne
10232
2395 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10233
                            >
10234
2397 : 68               [ 4]>            pla         ;load status
10235
                            >            eor_flag 0
10236
2398 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10237
                            >
10238
239a : dd2502           [ 4]>            cmp fROLc,x    ;test flags
10239
                            >            trap_ne
10240
239d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10241
                            >
10242
 
10243
239f : ca               [ 2]         dex
10244
23a0 : 10e3             [ 3]         bpl trolc2
10245
23a2 : a203             [ 2]         ldx #3
10246
23a4 :                       trolc3
10247
                                     set_z zp1,$ff
10248
                            >            load_flag $ff
10249
23a4 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10250
                            >
10251
23a6 : 48               [ 3]>            pha         ;use stack to load status
10252
23a7 : b513             [ 4]>            lda zp1,x    ;load to zeropage
10253
23a9 : 850c             [ 3]>            sta zpt
10254
23ab : 28               [ 4]>            plp
10255
 
10256
23ac : 260c             [ 5]         rol zpt
10257
                                     tst_z rROLc,fROLc,$ff-fnzc
10258
23ae : 08               [ 3]>            php         ;save flags
10259
23af : a50c             [ 3]>            lda zpt
10260
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  178
10261
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10262
 
10263
23b1 : dd1502           [ 4]>            cmp rROLc,x    ;test result
10264
                            >            trap_ne
10265
23b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10266
                            >
10267
23b6 : 68               [ 4]>            pla         ;load status
10268
                            >            eor_flag $ff-fnzc
10269
23b7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10270
                            >
10271
23b9 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
10272
                            >            trap_ne
10273
23bc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10274
                            >
10275
 
10276
23be : ca               [ 2]         dex
10277
23bf : 10e3             [ 3]         bpl trolc3
10278
 
10279
23c1 : a203             [ 2]         ldx #3
10280
23c3 :                       tror2
10281
                                     set_z zp1,0
10282
                            >            load_flag 0
10283
23c3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10284
                            >
10285
23c5 : 48               [ 3]>            pha         ;use stack to load status
10286
23c6 : b513             [ 4]>            lda zp1,x    ;load to zeropage
10287
23c8 : 850c             [ 3]>            sta zpt
10288
23ca : 28               [ 4]>            plp
10289
 
10290
23cb : 660c             [ 5]         ror zpt
10291
                                     tst_z rROR,fROR,0
10292
23cd : 08               [ 3]>            php         ;save flags
10293
23ce : a50c             [ 3]>            lda zpt
10294
23d0 : dd1902           [ 4]>            cmp rROR,x    ;test result
10295
                            >            trap_ne
10296
23d3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10297
                            >
10298
23d5 : 68               [ 4]>            pla         ;load status
10299
                            >            eor_flag 0
10300
23d6 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10301
                            >
10302
23d8 : dd2902           [ 4]>            cmp fROR,x    ;test flags
10303
                            >            trap_ne
10304
23db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10305
                            >
10306
 
10307
23dd : ca               [ 2]         dex
10308
23de : 10e3             [ 3]         bpl tror2
10309
23e0 : a203             [ 2]         ldx #3
10310
23e2 :                       tror3
10311
                                     set_z zp1,$ff-fc
10312
                            >            load_flag $ff-fc
10313
23e2 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
10314
                            >
10315
23e4 : 48               [ 3]>            pha         ;use stack to load status
10316
23e5 : b513             [ 4]>            lda zp1,x    ;load to zeropage
10317
23e7 : 850c             [ 3]>            sta zpt
10318
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  179
10319
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10320
 
10321
23e9 : 28               [ 4]>            plp
10322
 
10323
23ea : 660c             [ 5]         ror zpt
10324
                                     tst_z rROR,fROR,$ff-fnzc
10325
23ec : 08               [ 3]>            php         ;save flags
10326
23ed : a50c             [ 3]>            lda zpt
10327
23ef : dd1902           [ 4]>            cmp rROR,x    ;test result
10328
                            >            trap_ne
10329
23f2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10330
                            >
10331
23f4 : 68               [ 4]>            pla         ;load status
10332
                            >            eor_flag $ff-fnzc
10333
23f5 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10334
                            >
10335
23f7 : dd2902           [ 4]>            cmp fROR,x    ;test flags
10336
                            >            trap_ne
10337
23fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10338
                            >
10339
 
10340
23fc : ca               [ 2]         dex
10341
23fd : 10e3             [ 3]         bpl tror3
10342
 
10343
23ff : a203             [ 2]         ldx #3
10344
2401 :                       trorc2
10345
                                     set_z zp1,fc
10346
                            >            load_flag fc
10347
2401 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
10348
                            >
10349
2403 : 48               [ 3]>            pha         ;use stack to load status
10350
2404 : b513             [ 4]>            lda zp1,x    ;load to zeropage
10351
2406 : 850c             [ 3]>            sta zpt
10352
2408 : 28               [ 4]>            plp
10353
 
10354
2409 : 660c             [ 5]         ror zpt
10355
                                     tst_z rRORc,fRORc,0
10356
240b : 08               [ 3]>            php         ;save flags
10357
240c : a50c             [ 3]>            lda zpt
10358
240e : dd1d02           [ 4]>            cmp rRORc,x    ;test result
10359
                            >            trap_ne
10360
2411 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10361
                            >
10362
2413 : 68               [ 4]>            pla         ;load status
10363
                            >            eor_flag 0
10364
2414 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10365
                            >
10366
2416 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
10367
                            >            trap_ne
10368
2419 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10369
                            >
10370
 
10371
241b : ca               [ 2]         dex
10372
241c : 10e3             [ 3]         bpl trorc2
10373
241e : a203             [ 2]         ldx #3
10374
2420 :                       trorc3
10375
                                     set_z zp1,$ff
10376
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  180
10377
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10378
 
10379
                            >            load_flag $ff
10380
2420 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10381
                            >
10382
2422 : 48               [ 3]>            pha         ;use stack to load status
10383
2423 : b513             [ 4]>            lda zp1,x    ;load to zeropage
10384
2425 : 850c             [ 3]>            sta zpt
10385
2427 : 28               [ 4]>            plp
10386
 
10387
2428 : 660c             [ 5]         ror zpt
10388
                                     tst_z rRORc,fRORc,$ff-fnzc
10389
242a : 08               [ 3]>            php         ;save flags
10390
242b : a50c             [ 3]>            lda zpt
10391
242d : dd1d02           [ 4]>            cmp rRORc,x    ;test result
10392
                            >            trap_ne
10393
2430 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10394
                            >
10395
2432 : 68               [ 4]>            pla         ;load status
10396
                            >            eor_flag $ff-fnzc
10397
2433 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10398
                            >
10399
2435 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
10400
                            >            trap_ne
10401
2438 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10402
                            >
10403
 
10404
243a : ca               [ 2]         dex
10405
243b : 10e3             [ 3]         bpl trorc3
10406
                                     next_test
10407
243d : ad0002           [ 4]>            lda test_case   ;previous test
10408
2440 : c91e             [ 2]>            cmp #test_num
10409
                            >            trap_ne         ;test is out of sequence
10410
2442 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10411
                            >
10412
001f =                      >test_num = test_num + 1
10413
2444 : a91f             [ 2]>            lda #test_num   ;*** this tests' number
10414
2446 : 8d0002           [ 4]>            sta test_case
10415
                            >            ;check_ram       ;uncomment to find altered RAM after each test
10416
 
10417
 
10418
                             ; shifts - absolute
10419
2449 : a203             [ 2]         ldx #3
10420
244b :                       tasl4
10421
                                     set_abs zp1,0
10422
                            >            load_flag 0
10423
244b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10424
                            >
10425
244d : 48               [ 3]>            pha         ;use stack to load status
10426
244e : b513             [ 4]>            lda zp1,x    ;load to memory
10427
2450 : 8d0302           [ 4]>            sta abst
10428
2453 : 28               [ 4]>            plp
10429
 
10430
2454 : 0e0302           [ 6]         asl abst
10431
                                     tst_abs rASL,fASL,0
10432
2457 : 08               [ 3]>            php         ;save flags
10433
2458 : ad0302           [ 4]>            lda abst
10434
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  181
10435
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10436
 
10437
245b : dd1102           [ 4]>            cmp rASL,x    ;test result
10438
                            >            trap_ne
10439
245e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10440
                            >
10441
2460 : 68               [ 4]>            pla         ;load status
10442
                            >            eor_flag 0
10443
2461 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10444
                            >
10445
2463 : dd2102           [ 4]>            cmp fASL,x    ;test flags
10446
                            >            trap_ne
10447
2466 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10448
                            >
10449
 
10450
2468 : ca               [ 2]         dex
10451
2469 : 10e0             [ 3]         bpl tasl4
10452
246b : a203             [ 2]         ldx #3
10453
246d :                       tasl5
10454
                                     set_abs zp1,$ff
10455
                            >            load_flag $ff
10456
246d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10457
                            >
10458
246f : 48               [ 3]>            pha         ;use stack to load status
10459
2470 : b513             [ 4]>            lda zp1,x    ;load to memory
10460
2472 : 8d0302           [ 4]>            sta abst
10461
2475 : 28               [ 4]>            plp
10462
 
10463
2476 : 0e0302           [ 6]         asl abst
10464
                                     tst_abs rASL,fASL,$ff-fnzc
10465
2479 : 08               [ 3]>            php         ;save flags
10466
247a : ad0302           [ 4]>            lda abst
10467
247d : dd1102           [ 4]>            cmp rASL,x    ;test result
10468
                            >            trap_ne
10469
2480 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10470
                            >
10471
2482 : 68               [ 4]>            pla         ;load status
10472
                            >            eor_flag $ff-fnzc
10473
2483 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10474
                            >
10475
2485 : dd2102           [ 4]>            cmp fASL,x    ;test flags
10476
                            >            trap_ne
10477
2488 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10478
                            >
10479
 
10480
248a : ca               [ 2]         dex
10481
248b : 10e0             [ 3]         bpl tasl5
10482
 
10483
248d : a203             [ 2]         ldx #3
10484
248f :                       tlsr4
10485
                                     set_abs zp1,0
10486
                            >            load_flag 0
10487
248f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10488
                            >
10489
2491 : 48               [ 3]>            pha         ;use stack to load status
10490
2492 : b513             [ 4]>            lda zp1,x    ;load to memory
10491
2494 : 8d0302           [ 4]>            sta abst
10492
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  182
10493
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10494
 
10495
2497 : 28               [ 4]>            plp
10496
 
10497
2498 : 4e0302           [ 6]         lsr abst
10498
                                     tst_abs rLSR,fLSR,0
10499
249b : 08               [ 3]>            php         ;save flags
10500
249c : ad0302           [ 4]>            lda abst
10501
249f : dd1902           [ 4]>            cmp rLSR,x    ;test result
10502
                            >            trap_ne
10503
24a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10504
                            >
10505
24a4 : 68               [ 4]>            pla         ;load status
10506
                            >            eor_flag 0
10507
24a5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10508
                            >
10509
24a7 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
10510
                            >            trap_ne
10511
24aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10512
                            >
10513
 
10514
24ac : ca               [ 2]         dex
10515
24ad : 10e0             [ 3]         bpl tlsr4
10516
24af : a203             [ 2]         ldx #3
10517
24b1 :                       tlsr5
10518
                                     set_abs zp1,$ff
10519
                            >            load_flag $ff
10520
24b1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10521
                            >
10522
24b3 : 48               [ 3]>            pha         ;use stack to load status
10523
24b4 : b513             [ 4]>            lda zp1,x    ;load to memory
10524
24b6 : 8d0302           [ 4]>            sta abst
10525
24b9 : 28               [ 4]>            plp
10526
 
10527
24ba : 4e0302           [ 6]         lsr abst
10528
                                     tst_abs rLSR,fLSR,$ff-fnzc
10529
24bd : 08               [ 3]>            php         ;save flags
10530
24be : ad0302           [ 4]>            lda abst
10531
24c1 : dd1902           [ 4]>            cmp rLSR,x    ;test result
10532
                            >            trap_ne
10533
24c4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10534
                            >
10535
24c6 : 68               [ 4]>            pla         ;load status
10536
                            >            eor_flag $ff-fnzc
10537
24c7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10538
                            >
10539
24c9 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
10540
                            >            trap_ne
10541
24cc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10542
                            >
10543
 
10544
24ce : ca               [ 2]         dex
10545
24cf : 10e0             [ 3]         bpl tlsr5
10546
 
10547
24d1 : a203             [ 2]         ldx #3
10548
24d3 :                       trol4
10549
                                     set_abs zp1,0
10550
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  183
10551
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10552
 
10553
                            >            load_flag 0
10554
24d3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10555
                            >
10556
24d5 : 48               [ 3]>            pha         ;use stack to load status
10557
24d6 : b513             [ 4]>            lda zp1,x    ;load to memory
10558
24d8 : 8d0302           [ 4]>            sta abst
10559
24db : 28               [ 4]>            plp
10560
 
10561
24dc : 2e0302           [ 6]         rol abst
10562
                                     tst_abs rROL,fROL,0
10563
24df : 08               [ 3]>            php         ;save flags
10564
24e0 : ad0302           [ 4]>            lda abst
10565
24e3 : dd1102           [ 4]>            cmp rROL,x    ;test result
10566
                            >            trap_ne
10567
24e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10568
                            >
10569
24e8 : 68               [ 4]>            pla         ;load status
10570
                            >            eor_flag 0
10571
24e9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10572
                            >
10573
24eb : dd2102           [ 4]>            cmp fROL,x    ;test flags
10574
                            >            trap_ne
10575
24ee : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10576
                            >
10577
 
10578
24f0 : ca               [ 2]         dex
10579
24f1 : 10e0             [ 3]         bpl trol4
10580
24f3 : a203             [ 2]         ldx #3
10581
24f5 :                       trol5
10582
                                     set_abs zp1,$ff-fc
10583
                            >            load_flag $ff-fc
10584
24f5 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
10585
                            >
10586
24f7 : 48               [ 3]>            pha         ;use stack to load status
10587
24f8 : b513             [ 4]>            lda zp1,x    ;load to memory
10588
24fa : 8d0302           [ 4]>            sta abst
10589
24fd : 28               [ 4]>            plp
10590
 
10591
24fe : 2e0302           [ 6]         rol abst
10592
                                     tst_abs rROL,fROL,$ff-fnzc
10593
2501 : 08               [ 3]>            php         ;save flags
10594
2502 : ad0302           [ 4]>            lda abst
10595
2505 : dd1102           [ 4]>            cmp rROL,x    ;test result
10596
                            >            trap_ne
10597
2508 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10598
                            >
10599
250a : 68               [ 4]>            pla         ;load status
10600
                            >            eor_flag $ff-fnzc
10601
250b : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10602
                            >
10603
250d : dd2102           [ 4]>            cmp fROL,x    ;test flags
10604
                            >            trap_ne
10605
2510 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10606
                            >
10607
 
10608
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  184
10609
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10610
 
10611
2512 : ca               [ 2]         dex
10612
2513 : 10e0             [ 4]         bpl trol5
10613
 
10614
2515 : a203             [ 2]         ldx #3
10615
2517 :                       trolc4
10616
                                     set_abs zp1,fc
10617
                            >            load_flag fc
10618
2517 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
10619
                            >
10620
2519 : 48               [ 3]>            pha         ;use stack to load status
10621
251a : b513             [ 4]>            lda zp1,x    ;load to memory
10622
251c : 8d0302           [ 4]>            sta abst
10623
251f : 28               [ 4]>            plp
10624
 
10625
2520 : 2e0302           [ 6]         rol abst
10626
                                     tst_abs rROLc,fROLc,0
10627
2523 : 08               [ 3]>            php         ;save flags
10628
2524 : ad0302           [ 4]>            lda abst
10629
2527 : dd1502           [ 4]>            cmp rROLc,x    ;test result
10630
                            >            trap_ne
10631
252a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10632
                            >
10633
252c : 68               [ 4]>            pla         ;load status
10634
                            >            eor_flag 0
10635
252d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10636
                            >
10637
252f : dd2502           [ 4]>            cmp fROLc,x    ;test flags
10638
                            >            trap_ne
10639
2532 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10640
                            >
10641
 
10642
2534 : ca               [ 2]         dex
10643
2535 : 10e0             [ 3]         bpl trolc4
10644
2537 : a203             [ 2]         ldx #3
10645
2539 :                       trolc5
10646
                                     set_abs zp1,$ff
10647
                            >            load_flag $ff
10648
2539 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10649
                            >
10650
253b : 48               [ 3]>            pha         ;use stack to load status
10651
253c : b513             [ 4]>            lda zp1,x    ;load to memory
10652
253e : 8d0302           [ 4]>            sta abst
10653
2541 : 28               [ 4]>            plp
10654
 
10655
2542 : 2e0302           [ 6]         rol abst
10656
                                     tst_abs rROLc,fROLc,$ff-fnzc
10657
2545 : 08               [ 3]>            php         ;save flags
10658
2546 : ad0302           [ 4]>            lda abst
10659
2549 : dd1502           [ 4]>            cmp rROLc,x    ;test result
10660
                            >            trap_ne
10661
254c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10662
                            >
10663
254e : 68               [ 4]>            pla         ;load status
10664
                            >            eor_flag $ff-fnzc
10665
254f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10666
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  185
10667
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10668
 
10669
                            >
10670
2551 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
10671
                            >            trap_ne
10672
2554 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10673
                            >
10674
 
10675
2556 : ca               [ 2]         dex
10676
2557 : 10e0             [ 3]         bpl trolc5
10677
 
10678
2559 : a203             [ 2]         ldx #3
10679
255b :                       tror4
10680
                                     set_abs zp1,0
10681
                            >            load_flag 0
10682
255b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10683
                            >
10684
255d : 48               [ 3]>            pha         ;use stack to load status
10685
255e : b513             [ 4]>            lda zp1,x    ;load to memory
10686
2560 : 8d0302           [ 4]>            sta abst
10687
2563 : 28               [ 4]>            plp
10688
 
10689
2564 : 6e0302           [ 6]         ror abst
10690
                                     tst_abs rROR,fROR,0
10691
2567 : 08               [ 3]>            php         ;save flags
10692
2568 : ad0302           [ 4]>            lda abst
10693
256b : dd1902           [ 4]>            cmp rROR,x    ;test result
10694
                            >            trap_ne
10695
256e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10696
                            >
10697
2570 : 68               [ 4]>            pla         ;load status
10698
                            >            eor_flag 0
10699
2571 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10700
                            >
10701
2573 : dd2902           [ 4]>            cmp fROR,x    ;test flags
10702
                            >            trap_ne
10703
2576 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10704
                            >
10705
 
10706
2578 : ca               [ 2]         dex
10707
2579 : 10e0             [ 3]         bpl tror4
10708
257b : a203             [ 2]         ldx #3
10709
257d :                       tror5
10710
                                     set_abs zp1,$ff-fc
10711
                            >            load_flag $ff-fc
10712
257d : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
10713
                            >
10714
257f : 48               [ 3]>            pha         ;use stack to load status
10715
2580 : b513             [ 4]>            lda zp1,x    ;load to memory
10716
2582 : 8d0302           [ 4]>            sta abst
10717
2585 : 28               [ 4]>            plp
10718
 
10719
2586 : 6e0302           [ 6]         ror abst
10720
                                     tst_abs rROR,fROR,$ff-fnzc
10721
2589 : 08               [ 3]>            php         ;save flags
10722
258a : ad0302           [ 4]>            lda abst
10723
258d : dd1902           [ 4]>            cmp rROR,x    ;test result
10724
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  186
10725
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10726
 
10727
                            >            trap_ne
10728
2590 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10729
                            >
10730
2592 : 68               [ 4]>            pla         ;load status
10731
                            >            eor_flag $ff-fnzc
10732
2593 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10733
                            >
10734
2595 : dd2902           [ 4]>            cmp fROR,x    ;test flags
10735
                            >            trap_ne
10736
2598 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10737
                            >
10738
 
10739
259a : ca               [ 2]         dex
10740
259b : 10e0             [ 3]         bpl tror5
10741
 
10742
259d : a203             [ 2]         ldx #3
10743
259f :                       trorc4
10744
                                     set_abs zp1,fc
10745
                            >            load_flag fc
10746
259f : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
10747
                            >
10748
25a1 : 48               [ 3]>            pha         ;use stack to load status
10749
25a2 : b513             [ 4]>            lda zp1,x    ;load to memory
10750
25a4 : 8d0302           [ 4]>            sta abst
10751
25a7 : 28               [ 4]>            plp
10752
 
10753
25a8 : 6e0302           [ 6]         ror abst
10754
                                     tst_abs rRORc,fRORc,0
10755
25ab : 08               [ 3]>            php         ;save flags
10756
25ac : ad0302           [ 4]>            lda abst
10757
25af : dd1d02           [ 4]>            cmp rRORc,x    ;test result
10758
                            >            trap_ne
10759
25b2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10760
                            >
10761
25b4 : 68               [ 4]>            pla         ;load status
10762
                            >            eor_flag 0
10763
25b5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10764
                            >
10765
25b7 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
10766
                            >            trap_ne
10767
25ba : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10768
                            >
10769
 
10770
25bc : ca               [ 2]         dex
10771
25bd : 10e0             [ 3]         bpl trorc4
10772
25bf : a203             [ 2]         ldx #3
10773
25c1 :                       trorc5
10774
                                     set_abs zp1,$ff
10775
                            >            load_flag $ff
10776
25c1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10777
                            >
10778
25c3 : 48               [ 3]>            pha         ;use stack to load status
10779
25c4 : b513             [ 4]>            lda zp1,x    ;load to memory
10780
25c6 : 8d0302           [ 4]>            sta abst
10781
25c9 : 28               [ 4]>            plp
10782
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  187
10783
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10784
 
10785
 
10786
25ca : 6e0302           [ 6]         ror abst
10787
                                     tst_abs rRORc,fRORc,$ff-fnzc
10788
25cd : 08               [ 3]>            php         ;save flags
10789
25ce : ad0302           [ 4]>            lda abst
10790
25d1 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
10791
                            >            trap_ne
10792
25d4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10793
                            >
10794
25d6 : 68               [ 4]>            pla         ;load status
10795
                            >            eor_flag $ff-fnzc
10796
25d7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10797
                            >
10798
25d9 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
10799
                            >            trap_ne
10800
25dc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10801
                            >
10802
 
10803
25de : ca               [ 2]         dex
10804
25df : 10e0             [ 3]         bpl trorc5
10805
                                     next_test
10806
25e1 : ad0002           [ 4]>            lda test_case   ;previous test
10807
25e4 : c91f             [ 2]>            cmp #test_num
10808
                            >            trap_ne         ;test is out of sequence
10809
25e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10810
                            >
10811
0020 =                      >test_num = test_num + 1
10812
25e8 : a920             [ 2]>            lda #test_num   ;*** this tests' number
10813
25ea : 8d0002           [ 4]>            sta test_case
10814
                            >            ;check_ram       ;uncomment to find altered RAM after each test
10815
 
10816
 
10817
                             ; shifts - zp indexed
10818
25ed : a203             [ 2]         ldx #3
10819
25ef :                       tasl6
10820
                                     set_zx zp1,0
10821
                            >            load_flag 0
10822
25ef : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10823
                            >
10824
25f1 : 48               [ 3]>            pha         ;use stack to load status
10825
25f2 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
10826
25f4 : 950c             [ 4]>            sta zpt,x
10827
25f6 : 28               [ 4]>            plp
10828
 
10829
25f7 : 160c             [ 6]         asl zpt,x
10830
                                     tst_zx rASL,fASL,0
10831
25f9 : 08               [ 3]>            php         ;save flags
10832
25fa : b50c             [ 4]>            lda zpt,x
10833
25fc : dd1102           [ 4]>            cmp rASL,x    ;test result
10834
                            >            trap_ne
10835
25ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10836
                            >
10837
2601 : 68               [ 4]>            pla         ;load status
10838
                            >            eor_flag 0
10839
2602 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10840
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  188
10841
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10842
 
10843
                            >
10844
2604 : dd2102           [ 4]>            cmp fASL,x    ;test flags
10845
                            >            trap_ne
10846
2607 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10847
                            >
10848
 
10849
2609 : ca               [ 2]         dex
10850
260a : 10e3             [ 4]         bpl tasl6
10851
260c : a203             [ 2]         ldx #3
10852
260e :                       tasl7
10853
                                     set_zx zp1,$ff
10854
                            >            load_flag $ff
10855
260e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10856
                            >
10857
2610 : 48               [ 3]>            pha         ;use stack to load status
10858
2611 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
10859
2613 : 950c             [ 4]>            sta zpt,x
10860
2615 : 28               [ 4]>            plp
10861
 
10862
2616 : 160c             [ 6]         asl zpt,x
10863
                                     tst_zx rASL,fASL,$ff-fnzc
10864
2618 : 08               [ 3]>            php         ;save flags
10865
2619 : b50c             [ 4]>            lda zpt,x
10866
261b : dd1102           [ 4]>            cmp rASL,x    ;test result
10867
                            >            trap_ne
10868
261e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10869
                            >
10870
2620 : 68               [ 4]>            pla         ;load status
10871
                            >            eor_flag $ff-fnzc
10872
2621 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10873
                            >
10874
2623 : dd2102           [ 4]>            cmp fASL,x    ;test flags
10875
                            >            trap_ne
10876
2626 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10877
                            >
10878
 
10879
2628 : ca               [ 2]         dex
10880
2629 : 10e3             [ 3]         bpl tasl7
10881
 
10882
262b : a203             [ 2]         ldx #3
10883
262d :                       tlsr6
10884
                                     set_zx zp1,0
10885
                            >            load_flag 0
10886
262d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10887
                            >
10888
262f : 48               [ 3]>            pha         ;use stack to load status
10889
2630 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
10890
2632 : 950c             [ 4]>            sta zpt,x
10891
2634 : 28               [ 4]>            plp
10892
 
10893
2635 : 560c             [ 6]         lsr zpt,x
10894
                                     tst_zx rLSR,fLSR,0
10895
2637 : 08               [ 3]>            php         ;save flags
10896
2638 : b50c             [ 4]>            lda zpt,x
10897
263a : dd1902           [ 4]>            cmp rLSR,x    ;test result
10898
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  189
10899
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10900
 
10901
                            >            trap_ne
10902
263d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10903
                            >
10904
263f : 68               [ 4]>            pla         ;load status
10905
                            >            eor_flag 0
10906
2640 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10907
                            >
10908
2642 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
10909
                            >            trap_ne
10910
2645 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10911
                            >
10912
 
10913
2647 : ca               [ 2]         dex
10914
2648 : 10e3             [ 3]         bpl tlsr6
10915
264a : a203             [ 2]         ldx #3
10916
264c :                       tlsr7
10917
                                     set_zx zp1,$ff
10918
                            >            load_flag $ff
10919
264c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
10920
                            >
10921
264e : 48               [ 3]>            pha         ;use stack to load status
10922
264f : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
10923
2651 : 950c             [ 4]>            sta zpt,x
10924
2653 : 28               [ 4]>            plp
10925
 
10926
2654 : 560c             [ 6]         lsr zpt,x
10927
                                     tst_zx rLSR,fLSR,$ff-fnzc
10928
2656 : 08               [ 3]>            php         ;save flags
10929
2657 : b50c             [ 4]>            lda zpt,x
10930
2659 : dd1902           [ 4]>            cmp rLSR,x    ;test result
10931
                            >            trap_ne
10932
265c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10933
                            >
10934
265e : 68               [ 4]>            pla         ;load status
10935
                            >            eor_flag $ff-fnzc
10936
265f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
10937
                            >
10938
2661 : dd2902           [ 4]>            cmp fLSR,x    ;test flags
10939
                            >            trap_ne
10940
2664 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10941
                            >
10942
 
10943
2666 : ca               [ 2]         dex
10944
2667 : 10e3             [ 3]         bpl tlsr7
10945
 
10946
2669 : a203             [ 2]         ldx #3
10947
266b :                       trol6
10948
                                     set_zx zp1,0
10949
                            >            load_flag 0
10950
266b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
10951
                            >
10952
266d : 48               [ 3]>            pha         ;use stack to load status
10953
266e : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
10954
2670 : 950c             [ 4]>            sta zpt,x
10955
2672 : 28               [ 4]>            plp
10956
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  190
10957
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
10958
 
10959
 
10960
2673 : 360c             [ 6]         rol zpt,x
10961
                                     tst_zx rROL,fROL,0
10962
2675 : 08               [ 3]>            php         ;save flags
10963
2676 : b50c             [ 4]>            lda zpt,x
10964
2678 : dd1102           [ 4]>            cmp rROL,x    ;test result
10965
                            >            trap_ne
10966
267b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10967
                            >
10968
267d : 68               [ 4]>            pla         ;load status
10969
                            >            eor_flag 0
10970
267e : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
10971
                            >
10972
2680 : dd2102           [ 4]>            cmp fROL,x    ;test flags
10973
                            >            trap_ne
10974
2683 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10975
                            >
10976
 
10977
2685 : ca               [ 2]         dex
10978
2686 : 10e3             [ 3]         bpl trol6
10979
2688 : a203             [ 2]         ldx #3
10980
268a :                       trol7
10981
                                     set_zx zp1,$ff-fc
10982
                            >            load_flag $ff-fc
10983
268a : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
10984
                            >
10985
268c : 48               [ 3]>            pha         ;use stack to load status
10986
268d : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
10987
268f : 950c             [ 4]>            sta zpt,x
10988
2691 : 28               [ 4]>            plp
10989
 
10990
2692 : 360c             [ 6]         rol zpt,x
10991
                                     tst_zx rROL,fROL,$ff-fnzc
10992
2694 : 08               [ 3]>            php         ;save flags
10993
2695 : b50c             [ 4]>            lda zpt,x
10994
2697 : dd1102           [ 4]>            cmp rROL,x    ;test result
10995
                            >            trap_ne
10996
269a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
10997
                            >
10998
269c : 68               [ 4]>            pla         ;load status
10999
                            >            eor_flag $ff-fnzc
11000
269d : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11001
                            >
11002
269f : dd2102           [ 4]>            cmp fROL,x    ;test flags
11003
                            >            trap_ne
11004
26a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11005
                            >
11006
 
11007
26a4 : ca               [ 2]         dex
11008
26a5 : 10e3             [ 3]         bpl trol7
11009
 
11010
26a7 : a203             [ 2]         ldx #3
11011
26a9 :                       trolc6
11012
                                     set_zx zp1,fc
11013
                            >            load_flag fc
11014
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  191
11015
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11016
 
11017
26a9 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
11018
                            >
11019
26ab : 48               [ 3]>            pha         ;use stack to load status
11020
26ac : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
11021
26ae : 950c             [ 4]>            sta zpt,x
11022
26b0 : 28               [ 4]>            plp
11023
 
11024
26b1 : 360c             [ 6]         rol zpt,x
11025
                                     tst_zx rROLc,fROLc,0
11026
26b3 : 08               [ 3]>            php         ;save flags
11027
26b4 : b50c             [ 4]>            lda zpt,x
11028
26b6 : dd1502           [ 4]>            cmp rROLc,x    ;test result
11029
                            >            trap_ne
11030
26b9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11031
                            >
11032
26bb : 68               [ 4]>            pla         ;load status
11033
                            >            eor_flag 0
11034
26bc : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11035
                            >
11036
26be : dd2502           [ 4]>            cmp fROLc,x    ;test flags
11037
                            >            trap_ne
11038
26c1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11039
                            >
11040
 
11041
26c3 : ca               [ 2]         dex
11042
26c4 : 10e3             [ 3]         bpl trolc6
11043
26c6 : a203             [ 2]         ldx #3
11044
26c8 :                       trolc7
11045
                                     set_zx zp1,$ff
11046
                            >            load_flag $ff
11047
26c8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11048
                            >
11049
26ca : 48               [ 3]>            pha         ;use stack to load status
11050
26cb : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
11051
26cd : 950c             [ 4]>            sta zpt,x
11052
26cf : 28               [ 4]>            plp
11053
 
11054
26d0 : 360c             [ 6]         rol zpt,x
11055
                                     tst_zx rROLc,fROLc,$ff-fnzc
11056
26d2 : 08               [ 3]>            php         ;save flags
11057
26d3 : b50c             [ 4]>            lda zpt,x
11058
26d5 : dd1502           [ 4]>            cmp rROLc,x    ;test result
11059
                            >            trap_ne
11060
26d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11061
                            >
11062
26da : 68               [ 4]>            pla         ;load status
11063
                            >            eor_flag $ff-fnzc
11064
26db : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11065
                            >
11066
26dd : dd2502           [ 4]>            cmp fROLc,x    ;test flags
11067
                            >            trap_ne
11068
26e0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11069
                            >
11070
 
11071
26e2 : ca               [ 2]         dex
11072
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  192
11073
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11074
 
11075
26e3 : 10e3             [ 3]         bpl trolc7
11076
 
11077
26e5 : a203             [ 2]         ldx #3
11078
26e7 :                       tror6
11079
                                     set_zx zp1,0
11080
                            >            load_flag 0
11081
26e7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11082
                            >
11083
26e9 : 48               [ 3]>            pha         ;use stack to load status
11084
26ea : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
11085
26ec : 950c             [ 4]>            sta zpt,x
11086
26ee : 28               [ 4]>            plp
11087
 
11088
26ef : 760c             [ 6]         ror zpt,x
11089
                                     tst_zx rROR,fROR,0
11090
26f1 : 08               [ 3]>            php         ;save flags
11091
26f2 : b50c             [ 4]>            lda zpt,x
11092
26f4 : dd1902           [ 4]>            cmp rROR,x    ;test result
11093
                            >            trap_ne
11094
26f7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11095
                            >
11096
26f9 : 68               [ 4]>            pla         ;load status
11097
                            >            eor_flag 0
11098
26fa : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11099
                            >
11100
26fc : dd2902           [ 4]>            cmp fROR,x    ;test flags
11101
                            >            trap_ne
11102
26ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11103
                            >
11104
 
11105
2701 : ca               [ 2]         dex
11106
2702 : 10e3             [ 4]         bpl tror6
11107
2704 : a203             [ 2]         ldx #3
11108
2706 :                       tror7
11109
                                     set_zx zp1,$ff-fc
11110
                            >            load_flag $ff-fc
11111
2706 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
11112
                            >
11113
2708 : 48               [ 3]>            pha         ;use stack to load status
11114
2709 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
11115
270b : 950c             [ 4]>            sta zpt,x
11116
270d : 28               [ 4]>            plp
11117
 
11118
270e : 760c             [ 6]         ror zpt,x
11119
                                     tst_zx rROR,fROR,$ff-fnzc
11120
2710 : 08               [ 3]>            php         ;save flags
11121
2711 : b50c             [ 4]>            lda zpt,x
11122
2713 : dd1902           [ 4]>            cmp rROR,x    ;test result
11123
                            >            trap_ne
11124
2716 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11125
                            >
11126
2718 : 68               [ 4]>            pla         ;load status
11127
                            >            eor_flag $ff-fnzc
11128
2719 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11129
                            >
11130
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  193
11131
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11132
 
11133
271b : dd2902           [ 4]>            cmp fROR,x    ;test flags
11134
                            >            trap_ne
11135
271e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11136
                            >
11137
 
11138
2720 : ca               [ 2]         dex
11139
2721 : 10e3             [ 3]         bpl tror7
11140
 
11141
2723 : a203             [ 2]         ldx #3
11142
2725 :                       trorc6
11143
                                     set_zx zp1,fc
11144
                            >            load_flag fc
11145
2725 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
11146
                            >
11147
2727 : 48               [ 3]>            pha         ;use stack to load status
11148
2728 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
11149
272a : 950c             [ 4]>            sta zpt,x
11150
272c : 28               [ 4]>            plp
11151
 
11152
272d : 760c             [ 6]         ror zpt,x
11153
                                     tst_zx rRORc,fRORc,0
11154
272f : 08               [ 3]>            php         ;save flags
11155
2730 : b50c             [ 4]>            lda zpt,x
11156
2732 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
11157
                            >            trap_ne
11158
2735 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11159
                            >
11160
2737 : 68               [ 4]>            pla         ;load status
11161
                            >            eor_flag 0
11162
2738 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11163
                            >
11164
273a : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
11165
                            >            trap_ne
11166
273d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11167
                            >
11168
 
11169
273f : ca               [ 2]         dex
11170
2740 : 10e3             [ 3]         bpl trorc6
11171
2742 : a203             [ 2]         ldx #3
11172
2744 :                       trorc7
11173
                                     set_zx zp1,$ff
11174
                            >            load_flag $ff
11175
2744 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11176
                            >
11177
2746 : 48               [ 3]>            pha         ;use stack to load status
11178
2747 : b513             [ 4]>            lda zp1,x    ;load to indexed zeropage
11179
2749 : 950c             [ 4]>            sta zpt,x
11180
274b : 28               [ 4]>            plp
11181
 
11182
274c : 760c             [ 6]         ror zpt,x
11183
                                     tst_zx rRORc,fRORc,$ff-fnzc
11184
274e : 08               [ 3]>            php         ;save flags
11185
274f : b50c             [ 4]>            lda zpt,x
11186
2751 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
11187
                            >            trap_ne
11188
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  194
11189
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11190
 
11191
2754 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11192
                            >
11193
2756 : 68               [ 4]>            pla         ;load status
11194
                            >            eor_flag $ff-fnzc
11195
2757 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11196
                            >
11197
2759 : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
11198
                            >            trap_ne
11199
275c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11200
                            >
11201
 
11202
275e : ca               [ 2]         dex
11203
275f : 10e3             [ 3]         bpl trorc7
11204
                                     next_test
11205
2761 : ad0002           [ 4]>            lda test_case   ;previous test
11206
2764 : c920             [ 2]>            cmp #test_num
11207
                            >            trap_ne         ;test is out of sequence
11208
2766 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11209
                            >
11210
0021 =                      >test_num = test_num + 1
11211
2768 : a921             [ 2]>            lda #test_num   ;*** this tests' number
11212
276a : 8d0002           [ 4]>            sta test_case
11213
                            >            ;check_ram       ;uncomment to find altered RAM after each test
11214
 
11215
 
11216
                             ; shifts - abs indexed
11217
276d : a203             [ 2]         ldx #3
11218
276f :                       tasl8
11219
                                     set_absx zp1,0
11220
                            >            load_flag 0
11221
276f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11222
                            >
11223
2771 : 48               [ 3]>            pha         ;use stack to load status
11224
2772 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11225
2774 : 9d0302           [ 5]>            sta abst,x
11226
2777 : 28               [ 4]>            plp
11227
 
11228
2778 : 1e0302           [ 6]         asl abst,x
11229
                                     tst_absx rASL,fASL,0
11230
277b : 08               [ 3]>            php         ;save flags
11231
277c : bd0302           [ 4]>            lda abst,x
11232
277f : dd1102           [ 4]>            cmp rASL,x    ;test result
11233
                            >            trap_ne
11234
2782 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11235
                            >
11236
2784 : 68               [ 4]>            pla         ;load status
11237
                            >            eor_flag 0
11238
2785 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11239
                            >
11240
2787 : dd2102           [ 4]>            cmp fASL,x    ;test flags
11241
                            >            trap_ne
11242
278a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11243
                            >
11244
 
11245
278c : ca               [ 2]         dex
11246
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  195
11247
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11248
 
11249
278d : 10e0             [ 3]         bpl tasl8
11250
278f : a203             [ 2]         ldx #3
11251
2791 :                       tasl9
11252
                                     set_absx zp1,$ff
11253
                            >            load_flag $ff
11254
2791 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11255
                            >
11256
2793 : 48               [ 3]>            pha         ;use stack to load status
11257
2794 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11258
2796 : 9d0302           [ 5]>            sta abst,x
11259
2799 : 28               [ 4]>            plp
11260
 
11261
279a : 1e0302           [ 6]         asl abst,x
11262
                                     tst_absx rASL,fASL,$ff-fnzc
11263
279d : 08               [ 3]>            php         ;save flags
11264
279e : bd0302           [ 4]>            lda abst,x
11265
27a1 : dd1102           [ 4]>            cmp rASL,x    ;test result
11266
                            >            trap_ne
11267
27a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11268
                            >
11269
27a6 : 68               [ 4]>            pla         ;load status
11270
                            >            eor_flag $ff-fnzc
11271
27a7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11272
                            >
11273
27a9 : dd2102           [ 4]>            cmp fASL,x    ;test flags
11274
                            >            trap_ne
11275
27ac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11276
                            >
11277
 
11278
27ae : ca               [ 2]         dex
11279
27af : 10e0             [ 3]         bpl tasl9
11280
 
11281
27b1 : a203             [ 2]         ldx #3
11282
27b3 :                       tlsr8
11283
                                     set_absx zp1,0
11284
                            >            load_flag 0
11285
27b3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11286
                            >
11287
27b5 : 48               [ 3]>            pha         ;use stack to load status
11288
27b6 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11289
27b8 : 9d0302           [ 5]>            sta abst,x
11290
27bb : 28               [ 4]>            plp
11291
 
11292
27bc : 5e0302           [ 6]         lsr abst,x
11293
                                     tst_absx rLSR,fLSR,0
11294
27bf : 08               [ 3]>            php         ;save flags
11295
27c0 : bd0302           [ 4]>            lda abst,x
11296
27c3 : dd1902           [ 4]>            cmp rLSR,x    ;test result
11297
                            >            trap_ne
11298
27c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11299
                            >
11300
27c8 : 68               [ 4]>            pla         ;load status
11301
                            >            eor_flag 0
11302
27c9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11303
                            >
11304
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  196
11305
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11306
 
11307
27cb : dd2902           [ 4]>            cmp fLSR,x    ;test flags
11308
                            >            trap_ne
11309
27ce : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11310
                            >
11311
 
11312
27d0 : ca               [ 2]         dex
11313
27d1 : 10e0             [ 3]         bpl tlsr8
11314
27d3 : a203             [ 2]         ldx #3
11315
27d5 :                       tlsr9
11316
                                     set_absx zp1,$ff
11317
                            >            load_flag $ff
11318
27d5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11319
                            >
11320
27d7 : 48               [ 3]>            pha         ;use stack to load status
11321
27d8 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11322
27da : 9d0302           [ 5]>            sta abst,x
11323
27dd : 28               [ 4]>            plp
11324
 
11325
27de : 5e0302           [ 6]         lsr abst,x
11326
                                     tst_absx rLSR,fLSR,$ff-fnzc
11327
27e1 : 08               [ 3]>            php         ;save flags
11328
27e2 : bd0302           [ 4]>            lda abst,x
11329
27e5 : dd1902           [ 4]>            cmp rLSR,x    ;test result
11330
                            >            trap_ne
11331
27e8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11332
                            >
11333
27ea : 68               [ 4]>            pla         ;load status
11334
                            >            eor_flag $ff-fnzc
11335
27eb : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11336
                            >
11337
27ed : dd2902           [ 4]>            cmp fLSR,x    ;test flags
11338
                            >            trap_ne
11339
27f0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11340
                            >
11341
 
11342
27f2 : ca               [ 2]         dex
11343
27f3 : 10e0             [ 3]         bpl tlsr9
11344
 
11345
27f5 : a203             [ 2]         ldx #3
11346
27f7 :                       trol8
11347
                                     set_absx zp1,0
11348
                            >            load_flag 0
11349
27f7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11350
                            >
11351
27f9 : 48               [ 3]>            pha         ;use stack to load status
11352
27fa : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11353
27fc : 9d0302           [ 5]>            sta abst,x
11354
27ff : 28               [ 4]>            plp
11355
 
11356
2800 : 3e0302           [ 6]         rol abst,x
11357
                                     tst_absx rROL,fROL,0
11358
2803 : 08               [ 3]>            php         ;save flags
11359
2804 : bd0302           [ 4]>            lda abst,x
11360
2807 : dd1102           [ 4]>            cmp rROL,x    ;test result
11361
                            >            trap_ne
11362
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  197
11363
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11364
 
11365
280a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11366
                            >
11367
280c : 68               [ 4]>            pla         ;load status
11368
                            >            eor_flag 0
11369
280d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11370
                            >
11371
280f : dd2102           [ 4]>            cmp fROL,x    ;test flags
11372
                            >            trap_ne
11373
2812 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11374
                            >
11375
 
11376
2814 : ca               [ 2]         dex
11377
2815 : 10e0             [ 4]         bpl trol8
11378
2817 : a203             [ 2]         ldx #3
11379
2819 :                       trol9
11380
                                     set_absx zp1,$ff-fc
11381
                            >            load_flag $ff-fc
11382
2819 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
11383
                            >
11384
281b : 48               [ 3]>            pha         ;use stack to load status
11385
281c : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11386
281e : 9d0302           [ 5]>            sta abst,x
11387
2821 : 28               [ 4]>            plp
11388
 
11389
2822 : 3e0302           [ 6]         rol abst,x
11390
                                     tst_absx rROL,fROL,$ff-fnzc
11391
2825 : 08               [ 3]>            php         ;save flags
11392
2826 : bd0302           [ 4]>            lda abst,x
11393
2829 : dd1102           [ 4]>            cmp rROL,x    ;test result
11394
                            >            trap_ne
11395
282c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11396
                            >
11397
282e : 68               [ 4]>            pla         ;load status
11398
                            >            eor_flag $ff-fnzc
11399
282f : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11400
                            >
11401
2831 : dd2102           [ 4]>            cmp fROL,x    ;test flags
11402
                            >            trap_ne
11403
2834 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11404
                            >
11405
 
11406
2836 : ca               [ 2]         dex
11407
2837 : 10e0             [ 3]         bpl trol9
11408
 
11409
2839 : a203             [ 2]         ldx #3
11410
283b :                       trolc8
11411
                                     set_absx zp1,fc
11412
                            >            load_flag fc
11413
283b : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
11414
                            >
11415
283d : 48               [ 3]>            pha         ;use stack to load status
11416
283e : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11417
2840 : 9d0302           [ 5]>            sta abst,x
11418
2843 : 28               [ 4]>            plp
11419
 
11420
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  198
11421
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11422
 
11423
2844 : 3e0302           [ 6]         rol abst,x
11424
                                     tst_absx rROLc,fROLc,0
11425
2847 : 08               [ 3]>            php         ;save flags
11426
2848 : bd0302           [ 4]>            lda abst,x
11427
284b : dd1502           [ 4]>            cmp rROLc,x    ;test result
11428
                            >            trap_ne
11429
284e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11430
                            >
11431
2850 : 68               [ 4]>            pla         ;load status
11432
                            >            eor_flag 0
11433
2851 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11434
                            >
11435
2853 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
11436
                            >            trap_ne
11437
2856 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11438
                            >
11439
 
11440
2858 : ca               [ 2]         dex
11441
2859 : 10e0             [ 3]         bpl trolc8
11442
285b : a203             [ 2]         ldx #3
11443
285d :                       trolc9
11444
                                     set_absx zp1,$ff
11445
                            >            load_flag $ff
11446
285d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11447
                            >
11448
285f : 48               [ 3]>            pha         ;use stack to load status
11449
2860 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11450
2862 : 9d0302           [ 5]>            sta abst,x
11451
2865 : 28               [ 4]>            plp
11452
 
11453
2866 : 3e0302           [ 6]         rol abst,x
11454
                                     tst_absx rROLc,fROLc,$ff-fnzc
11455
2869 : 08               [ 3]>            php         ;save flags
11456
286a : bd0302           [ 4]>            lda abst,x
11457
286d : dd1502           [ 4]>            cmp rROLc,x    ;test result
11458
                            >            trap_ne
11459
2870 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11460
                            >
11461
2872 : 68               [ 4]>            pla         ;load status
11462
                            >            eor_flag $ff-fnzc
11463
2873 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11464
                            >
11465
2875 : dd2502           [ 4]>            cmp fROLc,x    ;test flags
11466
                            >            trap_ne
11467
2878 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11468
                            >
11469
 
11470
287a : ca               [ 2]         dex
11471
287b : 10e0             [ 3]         bpl trolc9
11472
 
11473
287d : a203             [ 2]         ldx #3
11474
287f :                       tror8
11475
                                     set_absx zp1,0
11476
                            >            load_flag 0
11477
287f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11478
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  199
11479
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11480
 
11481
                            >
11482
2881 : 48               [ 3]>            pha         ;use stack to load status
11483
2882 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11484
2884 : 9d0302           [ 5]>            sta abst,x
11485
2887 : 28               [ 4]>            plp
11486
 
11487
2888 : 7e0302           [ 6]         ror abst,x
11488
                                     tst_absx rROR,fROR,0
11489
288b : 08               [ 3]>            php         ;save flags
11490
288c : bd0302           [ 4]>            lda abst,x
11491
288f : dd1902           [ 4]>            cmp rROR,x    ;test result
11492
                            >            trap_ne
11493
2892 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11494
                            >
11495
2894 : 68               [ 4]>            pla         ;load status
11496
                            >            eor_flag 0
11497
2895 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11498
                            >
11499
2897 : dd2902           [ 4]>            cmp fROR,x    ;test flags
11500
                            >            trap_ne
11501
289a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11502
                            >
11503
 
11504
289c : ca               [ 2]         dex
11505
289d : 10e0             [ 3]         bpl tror8
11506
289f : a203             [ 2]         ldx #3
11507
28a1 :                       tror9
11508
                                     set_absx zp1,$ff-fc
11509
                            >            load_flag $ff-fc
11510
28a1 : a9fe             [ 2]>            lda #$ff-fc             ;allow test to change I-flag (no mask)
11511
                            >
11512
28a3 : 48               [ 3]>            pha         ;use stack to load status
11513
28a4 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11514
28a6 : 9d0302           [ 5]>            sta abst,x
11515
28a9 : 28               [ 4]>            plp
11516
 
11517
28aa : 7e0302           [ 6]         ror abst,x
11518
                                     tst_absx rROR,fROR,$ff-fnzc
11519
28ad : 08               [ 3]>            php         ;save flags
11520
28ae : bd0302           [ 4]>            lda abst,x
11521
28b1 : dd1902           [ 4]>            cmp rROR,x    ;test result
11522
                            >            trap_ne
11523
28b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11524
                            >
11525
28b6 : 68               [ 4]>            pla         ;load status
11526
                            >            eor_flag $ff-fnzc
11527
28b7 : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11528
                            >
11529
28b9 : dd2902           [ 4]>            cmp fROR,x    ;test flags
11530
                            >            trap_ne
11531
28bc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11532
                            >
11533
 
11534
28be : ca               [ 2]         dex
11535
28bf : 10e0             [ 3]         bpl tror9
11536
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  200
11537
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11538
 
11539
 
11540
28c1 : a203             [ 2]         ldx #3
11541
28c3 :                       trorc8
11542
                                     set_absx zp1,fc
11543
                            >            load_flag fc
11544
28c3 : a901             [ 2]>            lda #fc             ;allow test to change I-flag (no mask)
11545
                            >
11546
28c5 : 48               [ 3]>            pha         ;use stack to load status
11547
28c6 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11548
28c8 : 9d0302           [ 5]>            sta abst,x
11549
28cb : 28               [ 4]>            plp
11550
 
11551
28cc : 7e0302           [ 6]         ror abst,x
11552
                                     tst_absx rRORc,fRORc,0
11553
28cf : 08               [ 3]>            php         ;save flags
11554
28d0 : bd0302           [ 4]>            lda abst,x
11555
28d3 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
11556
                            >            trap_ne
11557
28d6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11558
                            >
11559
28d8 : 68               [ 4]>            pla         ;load status
11560
                            >            eor_flag 0
11561
28d9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11562
                            >
11563
28db : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
11564
                            >            trap_ne
11565
28de : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11566
                            >
11567
 
11568
28e0 : ca               [ 2]         dex
11569
28e1 : 10e0             [ 3]         bpl trorc8
11570
28e3 : a203             [ 2]         ldx #3
11571
28e5 :                       trorc9
11572
                                     set_absx zp1,$ff
11573
                            >            load_flag $ff
11574
28e5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11575
                            >
11576
28e7 : 48               [ 3]>            pha         ;use stack to load status
11577
28e8 : b513             [ 4]>            lda zp1,x    ;load to indexed memory
11578
28ea : 9d0302           [ 5]>            sta abst,x
11579
28ed : 28               [ 4]>            plp
11580
 
11581
28ee : 7e0302           [ 6]         ror abst,x
11582
                                     tst_absx rRORc,fRORc,$ff-fnzc
11583
28f1 : 08               [ 3]>            php         ;save flags
11584
28f2 : bd0302           [ 4]>            lda abst,x
11585
28f5 : dd1d02           [ 4]>            cmp rRORc,x    ;test result
11586
                            >            trap_ne
11587
28f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11588
                            >
11589
28fa : 68               [ 4]>            pla         ;load status
11590
                            >            eor_flag $ff-fnzc
11591
28fb : 497c             [ 2]>            eor #$ff-fnzc|fao         ;invert expected flags + always on bits
11592
                            >
11593
28fd : dd2d02           [ 4]>            cmp fRORc,x    ;test flags
11594
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  201
11595
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11596
 
11597
                            >            trap_ne
11598
2900 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11599
                            >
11600
 
11601
2902 : ca               [ 2]         dex
11602
2903 : 10e0             [ 4]         bpl trorc9
11603
                                     next_test
11604
2905 : ad0002           [ 4]>            lda test_case   ;previous test
11605
2908 : c921             [ 2]>            cmp #test_num
11606
                            >            trap_ne         ;test is out of sequence
11607
290a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11608
                            >
11609
0022 =                      >test_num = test_num + 1
11610
290c : a922             [ 2]>            lda #test_num   ;*** this tests' number
11611
290e : 8d0002           [ 4]>            sta test_case
11612
                            >            ;check_ram       ;uncomment to find altered RAM after each test
11613
 
11614
 
11615
                             ; testing memory increment/decrement - INC DEC all addressing modes
11616
                             ; zeropage
11617
2911 : a200             [ 2]         ldx #0
11618
2913 : a97e             [ 2]         lda #$7e
11619
2915 : 850c             [ 3]         sta zpt
11620
2917 :                       tinc
11621
                                     set_stat 0
11622
                            >            load_flag 0
11623
2917 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11624
                            >
11625
2919 : 48               [ 3]>            pha         ;use stack to load status
11626
291a : 28               [ 4]>            plp
11627
 
11628
291b : e60c             [ 5]         inc zpt
11629
                                     tst_z rINC,fINC,0
11630
291d : 08               [ 3]>            php         ;save flags
11631
291e : a50c             [ 3]>            lda zpt
11632
2920 : dd3102           [ 4]>            cmp rINC,x    ;test result
11633
                            >            trap_ne
11634
2923 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11635
                            >
11636
2925 : 68               [ 4]>            pla         ;load status
11637
                            >            eor_flag 0
11638
2926 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11639
                            >
11640
2928 : dd3602           [ 4]>            cmp fINC,x    ;test flags
11641
                            >            trap_ne
11642
292b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11643
                            >
11644
 
11645
292d : e8               [ 2]         inx
11646
292e : e002             [ 2]         cpx #2
11647
2930 : d004             [ 3]         bne tinc1
11648
2932 : a9fe             [ 2]         lda #$fe
11649
2934 : 850c             [ 3]         sta zpt
11650
2936 : e005             [ 2] tinc1   cpx #5
11651
2938 : d0dd             [ 3]         bne tinc
11652
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  202
11653
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11654
 
11655
293a : ca               [ 2]         dex
11656
293b : e60c             [ 5]         inc zpt
11657
293d :                       tdec
11658
                                     set_stat 0
11659
                            >            load_flag 0
11660
293d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11661
                            >
11662
293f : 48               [ 3]>            pha         ;use stack to load status
11663
2940 : 28               [ 4]>            plp
11664
 
11665
2941 : c60c             [ 5]         dec zpt
11666
                                     tst_z rINC,fINC,0
11667
2943 : 08               [ 3]>            php         ;save flags
11668
2944 : a50c             [ 3]>            lda zpt
11669
2946 : dd3102           [ 4]>            cmp rINC,x    ;test result
11670
                            >            trap_ne
11671
2949 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11672
                            >
11673
294b : 68               [ 4]>            pla         ;load status
11674
                            >            eor_flag 0
11675
294c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11676
                            >
11677
294e : dd3602           [ 4]>            cmp fINC,x    ;test flags
11678
                            >            trap_ne
11679
2951 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11680
                            >
11681
 
11682
2953 : ca               [ 2]         dex
11683
2954 : 300a             [ 3]         bmi tdec1
11684
2956 : e001             [ 2]         cpx #1
11685
2958 : d0e3             [ 3]         bne tdec
11686
295a : a981             [ 2]         lda #$81
11687
295c : 850c             [ 3]         sta zpt
11688
295e : d0dd             [ 3]         bne tdec
11689
2960 :                       tdec1
11690
2960 : a200             [ 2]         ldx #0
11691
2962 : a97e             [ 2]         lda #$7e
11692
2964 : 850c             [ 3]         sta zpt
11693
2966 :                       tinc10
11694
                                     set_stat $ff
11695
                            >            load_flag $ff
11696
2966 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11697
                            >
11698
2968 : 48               [ 3]>            pha         ;use stack to load status
11699
2969 : 28               [ 4]>            plp
11700
 
11701
296a : e60c             [ 5]         inc zpt
11702
                                     tst_z rINC,fINC,$ff-fnz
11703
296c : 08               [ 3]>            php         ;save flags
11704
296d : a50c             [ 3]>            lda zpt
11705
296f : dd3102           [ 4]>            cmp rINC,x    ;test result
11706
                            >            trap_ne
11707
2972 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11708
                            >
11709
2974 : 68               [ 4]>            pla         ;load status
11710
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  203
11711
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11712
 
11713
                            >            eor_flag $ff-fnz
11714
2975 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
11715
                            >
11716
2977 : dd3602           [ 4]>            cmp fINC,x    ;test flags
11717
                            >            trap_ne
11718
297a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11719
                            >
11720
 
11721
297c : e8               [ 2]         inx
11722
297d : e002             [ 2]         cpx #2
11723
297f : d004             [ 3]         bne tinc11
11724
2981 : a9fe             [ 2]         lda #$fe
11725
2983 : 850c             [ 3]         sta zpt
11726
2985 : e005             [ 2] tinc11  cpx #5
11727
2987 : d0dd             [ 3]         bne tinc10
11728
2989 : ca               [ 2]         dex
11729
298a : e60c             [ 5]         inc zpt
11730
298c :                       tdec10
11731
                                     set_stat $ff
11732
                            >            load_flag $ff
11733
298c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11734
                            >
11735
298e : 48               [ 3]>            pha         ;use stack to load status
11736
298f : 28               [ 4]>            plp
11737
 
11738
2990 : c60c             [ 5]         dec zpt
11739
                                     tst_z rINC,fINC,$ff-fnz
11740
2992 : 08               [ 3]>            php         ;save flags
11741
2993 : a50c             [ 3]>            lda zpt
11742
2995 : dd3102           [ 4]>            cmp rINC,x    ;test result
11743
                            >            trap_ne
11744
2998 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11745
                            >
11746
299a : 68               [ 4]>            pla         ;load status
11747
                            >            eor_flag $ff-fnz
11748
299b : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
11749
                            >
11750
299d : dd3602           [ 4]>            cmp fINC,x    ;test flags
11751
                            >            trap_ne
11752
29a0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11753
                            >
11754
 
11755
29a2 : ca               [ 2]         dex
11756
29a3 : 300a             [ 3]         bmi tdec11
11757
29a5 : e001             [ 2]         cpx #1
11758
29a7 : d0e3             [ 3]         bne tdec10
11759
29a9 : a981             [ 2]         lda #$81
11760
29ab : 850c             [ 3]         sta zpt
11761
29ad : d0dd             [ 3]         bne tdec10
11762
29af :                       tdec11
11763
                                     next_test
11764
29af : ad0002           [ 4]>            lda test_case   ;previous test
11765
29b2 : c922             [ 2]>            cmp #test_num
11766
                            >            trap_ne         ;test is out of sequence
11767
29b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11768
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  204
11769
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11770
 
11771
                            >
11772
0023 =                      >test_num = test_num + 1
11773
29b6 : a923             [ 2]>            lda #test_num   ;*** this tests' number
11774
29b8 : 8d0002           [ 4]>            sta test_case
11775
                            >            ;check_ram       ;uncomment to find altered RAM after each test
11776
 
11777
 
11778
                             ; absolute memory
11779
29bb : a200             [ 2]         ldx #0
11780
29bd : a97e             [ 2]         lda #$7e
11781
29bf : 8d0302           [ 4]         sta abst
11782
29c2 :                       tinc2
11783
                                     set_stat 0
11784
                            >            load_flag 0
11785
29c2 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11786
                            >
11787
29c4 : 48               [ 3]>            pha         ;use stack to load status
11788
29c5 : 28               [ 4]>            plp
11789
 
11790
29c6 : ee0302           [ 6]         inc abst
11791
                                     tst_abs rINC,fINC,0
11792
29c9 : 08               [ 3]>            php         ;save flags
11793
29ca : ad0302           [ 4]>            lda abst
11794
29cd : dd3102           [ 4]>            cmp rINC,x    ;test result
11795
                            >            trap_ne
11796
29d0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11797
                            >
11798
29d2 : 68               [ 4]>            pla         ;load status
11799
                            >            eor_flag 0
11800
29d3 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11801
                            >
11802
29d5 : dd3602           [ 4]>            cmp fINC,x    ;test flags
11803
                            >            trap_ne
11804
29d8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11805
                            >
11806
 
11807
29da : e8               [ 2]         inx
11808
29db : e002             [ 2]         cpx #2
11809
29dd : d005             [ 3]         bne tinc3
11810
29df : a9fe             [ 2]         lda #$fe
11811
29e1 : 8d0302           [ 4]         sta abst
11812
29e4 : e005             [ 2] tinc3   cpx #5
11813
29e6 : d0da             [ 3]         bne tinc2
11814
29e8 : ca               [ 2]         dex
11815
29e9 : ee0302           [ 6]         inc abst
11816
29ec :                       tdec2
11817
                                     set_stat 0
11818
                            >            load_flag 0
11819
29ec : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11820
                            >
11821
29ee : 48               [ 3]>            pha         ;use stack to load status
11822
29ef : 28               [ 4]>            plp
11823
 
11824
29f0 : ce0302           [ 6]         dec abst
11825
                                     tst_abs rINC,fINC,0
11826
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  205
11827
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11828
 
11829
29f3 : 08               [ 3]>            php         ;save flags
11830
29f4 : ad0302           [ 4]>            lda abst
11831
29f7 : dd3102           [ 4]>            cmp rINC,x    ;test result
11832
                            >            trap_ne
11833
29fa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11834
                            >
11835
29fc : 68               [ 4]>            pla         ;load status
11836
                            >            eor_flag 0
11837
29fd : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11838
                            >
11839
29ff : dd3602           [ 4]>            cmp fINC,x    ;test flags
11840
                            >            trap_ne
11841
2a02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11842
                            >
11843
 
11844
2a04 : ca               [ 2]         dex
11845
2a05 : 300b             [ 3]         bmi tdec3
11846
2a07 : e001             [ 2]         cpx #1
11847
2a09 : d0e1             [ 4]         bne tdec2
11848
2a0b : a981             [ 2]         lda #$81
11849
2a0d : 8d0302           [ 4]         sta abst
11850
2a10 : d0da             [ 4]         bne tdec2
11851
2a12 :                       tdec3
11852
2a12 : a200             [ 2]         ldx #0
11853
2a14 : a97e             [ 2]         lda #$7e
11854
2a16 : 8d0302           [ 4]         sta abst
11855
2a19 :                       tinc12
11856
                                     set_stat $ff
11857
                            >            load_flag $ff
11858
2a19 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11859
                            >
11860
2a1b : 48               [ 3]>            pha         ;use stack to load status
11861
2a1c : 28               [ 4]>            plp
11862
 
11863
2a1d : ee0302           [ 6]         inc abst
11864
                                     tst_abs rINC,fINC,$ff-fnz
11865
2a20 : 08               [ 3]>            php         ;save flags
11866
2a21 : ad0302           [ 4]>            lda abst
11867
2a24 : dd3102           [ 4]>            cmp rINC,x    ;test result
11868
                            >            trap_ne
11869
2a27 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11870
                            >
11871
2a29 : 68               [ 4]>            pla         ;load status
11872
                            >            eor_flag $ff-fnz
11873
2a2a : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
11874
                            >
11875
2a2c : dd3602           [ 4]>            cmp fINC,x    ;test flags
11876
                            >            trap_ne
11877
2a2f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11878
                            >
11879
 
11880
2a31 : e8               [ 2]         inx
11881
2a32 : e002             [ 2]         cpx #2
11882
2a34 : d005             [ 3]         bne tinc13
11883
2a36 : a9fe             [ 2]         lda #$fe
11884
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  206
11885
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11886
 
11887
2a38 : 8d0302           [ 4]         sta abst
11888
2a3b : e005             [ 2] tinc13   cpx #5
11889
2a3d : d0da             [ 3]         bne tinc12
11890
2a3f : ca               [ 2]         dex
11891
2a40 : ee0302           [ 6]         inc abst
11892
2a43 :                       tdec12
11893
                                     set_stat $ff
11894
                            >            load_flag $ff
11895
2a43 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
11896
                            >
11897
2a45 : 48               [ 3]>            pha         ;use stack to load status
11898
2a46 : 28               [ 4]>            plp
11899
 
11900
2a47 : ce0302           [ 6]         dec abst
11901
                                     tst_abs rINC,fINC,$ff-fnz
11902
2a4a : 08               [ 3]>            php         ;save flags
11903
2a4b : ad0302           [ 4]>            lda abst
11904
2a4e : dd3102           [ 4]>            cmp rINC,x    ;test result
11905
                            >            trap_ne
11906
2a51 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11907
                            >
11908
2a53 : 68               [ 4]>            pla         ;load status
11909
                            >            eor_flag $ff-fnz
11910
2a54 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
11911
                            >
11912
2a56 : dd3602           [ 4]>            cmp fINC,x    ;test flags
11913
                            >            trap_ne
11914
2a59 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11915
                            >
11916
 
11917
2a5b : ca               [ 2]         dex
11918
2a5c : 300b             [ 3]         bmi tdec13
11919
2a5e : e001             [ 2]         cpx #1
11920
2a60 : d0e1             [ 3]         bne tdec12
11921
2a62 : a981             [ 2]         lda #$81
11922
2a64 : 8d0302           [ 4]         sta abst
11923
2a67 : d0da             [ 3]         bne tdec12
11924
2a69 :                       tdec13
11925
                                     next_test
11926
2a69 : ad0002           [ 4]>            lda test_case   ;previous test
11927
2a6c : c923             [ 2]>            cmp #test_num
11928
                            >            trap_ne         ;test is out of sequence
11929
2a6e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11930
                            >
11931
0024 =                      >test_num = test_num + 1
11932
2a70 : a924             [ 2]>            lda #test_num   ;*** this tests' number
11933
2a72 : 8d0002           [ 4]>            sta test_case
11934
                            >            ;check_ram       ;uncomment to find altered RAM after each test
11935
 
11936
 
11937
                             ; zeropage indexed
11938
2a75 : a200             [ 2]         ldx #0
11939
2a77 : a97e             [ 2]         lda #$7e
11940
2a79 : 950c             [ 4] tinc4   sta zpt,x
11941
                                     set_stat 0
11942
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  207
11943
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
11944
 
11945
                            >            load_flag 0
11946
2a7b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11947
                            >
11948
2a7d : 48               [ 3]>            pha         ;use stack to load status
11949
2a7e : 28               [ 4]>            plp
11950
 
11951
2a7f : f60c             [ 6]         inc zpt,x
11952
                                     tst_zx rINC,fINC,0
11953
2a81 : 08               [ 3]>            php         ;save flags
11954
2a82 : b50c             [ 4]>            lda zpt,x
11955
2a84 : dd3102           [ 4]>            cmp rINC,x    ;test result
11956
                            >            trap_ne
11957
2a87 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11958
                            >
11959
2a89 : 68               [ 4]>            pla         ;load status
11960
                            >            eor_flag 0
11961
2a8a : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11962
                            >
11963
2a8c : dd3602           [ 4]>            cmp fINC,x    ;test flags
11964
                            >            trap_ne
11965
2a8f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11966
                            >
11967
 
11968
2a91 : b50c             [ 4]         lda zpt,x
11969
2a93 : e8               [ 2]         inx
11970
2a94 : e002             [ 2]         cpx #2
11971
2a96 : d002             [ 3]         bne tinc5
11972
2a98 : a9fe             [ 2]         lda #$fe
11973
2a9a : e005             [ 2] tinc5   cpx #5
11974
2a9c : d0db             [ 3]         bne tinc4
11975
2a9e : ca               [ 2]         dex
11976
2a9f : a902             [ 2]         lda #2
11977
2aa1 : 950c             [ 4] tdec4   sta zpt,x
11978
                                     set_stat 0
11979
                            >            load_flag 0
11980
2aa3 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
11981
                            >
11982
2aa5 : 48               [ 3]>            pha         ;use stack to load status
11983
2aa6 : 28               [ 4]>            plp
11984
 
11985
2aa7 : d60c             [ 6]         dec zpt,x
11986
                                     tst_zx rINC,fINC,0
11987
2aa9 : 08               [ 3]>            php         ;save flags
11988
2aaa : b50c             [ 4]>            lda zpt,x
11989
2aac : dd3102           [ 4]>            cmp rINC,x    ;test result
11990
                            >            trap_ne
11991
2aaf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
11992
                            >
11993
2ab1 : 68               [ 4]>            pla         ;load status
11994
                            >            eor_flag 0
11995
2ab2 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
11996
                            >
11997
2ab4 : dd3602           [ 4]>            cmp fINC,x    ;test flags
11998
                            >            trap_ne
11999
2ab7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12000
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  208
12001
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12002
 
12003
                            >
12004
 
12005
2ab9 : b50c             [ 4]         lda zpt,x
12006
2abb : ca               [ 2]         dex
12007
2abc : 3008             [ 3]         bmi tdec5
12008
2abe : e001             [ 2]         cpx #1
12009
2ac0 : d0df             [ 3]         bne tdec4
12010
2ac2 : a981             [ 2]         lda #$81
12011
2ac4 : d0db             [ 3]         bne tdec4
12012
2ac6 :                       tdec5
12013
2ac6 : a200             [ 2]         ldx #0
12014
2ac8 : a97e             [ 2]         lda #$7e
12015
2aca : 950c             [ 4] tinc14  sta zpt,x
12016
                                     set_stat $ff
12017
                            >            load_flag $ff
12018
2acc : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12019
                            >
12020
2ace : 48               [ 3]>            pha         ;use stack to load status
12021
2acf : 28               [ 4]>            plp
12022
 
12023
2ad0 : f60c             [ 6]         inc zpt,x
12024
                                     tst_zx rINC,fINC,$ff-fnz
12025
2ad2 : 08               [ 3]>            php         ;save flags
12026
2ad3 : b50c             [ 4]>            lda zpt,x
12027
2ad5 : dd3102           [ 4]>            cmp rINC,x    ;test result
12028
                            >            trap_ne
12029
2ad8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12030
                            >
12031
2ada : 68               [ 4]>            pla         ;load status
12032
                            >            eor_flag $ff-fnz
12033
2adb : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12034
                            >
12035
2add : dd3602           [ 4]>            cmp fINC,x    ;test flags
12036
                            >            trap_ne
12037
2ae0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12038
                            >
12039
 
12040
2ae2 : b50c             [ 4]         lda zpt,x
12041
2ae4 : e8               [ 2]         inx
12042
2ae5 : e002             [ 2]         cpx #2
12043
2ae7 : d002             [ 3]         bne tinc15
12044
2ae9 : a9fe             [ 2]         lda #$fe
12045
2aeb : e005             [ 2] tinc15  cpx #5
12046
2aed : d0db             [ 3]         bne tinc14
12047
2aef : ca               [ 2]         dex
12048
2af0 : a902             [ 2]         lda #2
12049
2af2 : 950c             [ 4] tdec14  sta zpt,x
12050
                                     set_stat $ff
12051
                            >            load_flag $ff
12052
2af4 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12053
                            >
12054
2af6 : 48               [ 3]>            pha         ;use stack to load status
12055
2af7 : 28               [ 4]>            plp
12056
 
12057
2af8 : d60c             [ 6]         dec zpt,x
12058
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  209
12059
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12060
 
12061
                                     tst_zx rINC,fINC,$ff-fnz
12062
2afa : 08               [ 3]>            php         ;save flags
12063
2afb : b50c             [ 4]>            lda zpt,x
12064
2afd : dd3102           [ 4]>            cmp rINC,x    ;test result
12065
                            >            trap_ne
12066
2b00 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12067
                            >
12068
2b02 : 68               [ 4]>            pla         ;load status
12069
                            >            eor_flag $ff-fnz
12070
2b03 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12071
                            >
12072
2b05 : dd3602           [ 4]>            cmp fINC,x    ;test flags
12073
                            >            trap_ne
12074
2b08 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12075
                            >
12076
 
12077
2b0a : b50c             [ 4]         lda zpt,x
12078
2b0c : ca               [ 2]         dex
12079
2b0d : 3008             [ 3]         bmi tdec15
12080
2b0f : e001             [ 2]         cpx #1
12081
2b11 : d0df             [ 4]         bne tdec14
12082
2b13 : a981             [ 2]         lda #$81
12083
2b15 : d0db             [ 4]         bne tdec14
12084
2b17 :                       tdec15
12085
                                     next_test
12086
2b17 : ad0002           [ 4]>            lda test_case   ;previous test
12087
2b1a : c924             [ 2]>            cmp #test_num
12088
                            >            trap_ne         ;test is out of sequence
12089
2b1c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12090
                            >
12091
0025 =                      >test_num = test_num + 1
12092
2b1e : a925             [ 2]>            lda #test_num   ;*** this tests' number
12093
2b20 : 8d0002           [ 4]>            sta test_case
12094
                            >            ;check_ram       ;uncomment to find altered RAM after each test
12095
 
12096
 
12097
                             ; memory indexed
12098
2b23 : a200             [ 2]         ldx #0
12099
2b25 : a97e             [ 2]         lda #$7e
12100
2b27 : 9d0302           [ 5] tinc6   sta abst,x
12101
                                     set_stat 0
12102
                            >            load_flag 0
12103
2b2a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12104
                            >
12105
2b2c : 48               [ 3]>            pha         ;use stack to load status
12106
2b2d : 28               [ 4]>            plp
12107
 
12108
2b2e : fe0302           [ 6]         inc abst,x
12109
                                     tst_absx rINC,fINC,0
12110
2b31 : 08               [ 3]>            php         ;save flags
12111
2b32 : bd0302           [ 4]>            lda abst,x
12112
2b35 : dd3102           [ 4]>            cmp rINC,x    ;test result
12113
                            >            trap_ne
12114
2b38 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12115
                            >
12116
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  210
12117
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12118
 
12119
2b3a : 68               [ 4]>            pla         ;load status
12120
                            >            eor_flag 0
12121
2b3b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12122
                            >
12123
2b3d : dd3602           [ 4]>            cmp fINC,x    ;test flags
12124
                            >            trap_ne
12125
2b40 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12126
                            >
12127
 
12128
2b42 : bd0302           [ 4]         lda abst,x
12129
2b45 : e8               [ 2]         inx
12130
2b46 : e002             [ 2]         cpx #2
12131
2b48 : d002             [ 3]         bne tinc7
12132
2b4a : a9fe             [ 2]         lda #$fe
12133
2b4c : e005             [ 2] tinc7   cpx #5
12134
2b4e : d0d7             [ 3]         bne tinc6
12135
2b50 : ca               [ 2]         dex
12136
2b51 : a902             [ 2]         lda #2
12137
2b53 : 9d0302           [ 5] tdec6   sta abst,x
12138
                                     set_stat 0
12139
                            >            load_flag 0
12140
2b56 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12141
                            >
12142
2b58 : 48               [ 3]>            pha         ;use stack to load status
12143
2b59 : 28               [ 4]>            plp
12144
 
12145
2b5a : de0302           [ 6]         dec abst,x
12146
                                     tst_absx rINC,fINC,0
12147
2b5d : 08               [ 3]>            php         ;save flags
12148
2b5e : bd0302           [ 4]>            lda abst,x
12149
2b61 : dd3102           [ 4]>            cmp rINC,x    ;test result
12150
                            >            trap_ne
12151
2b64 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12152
                            >
12153
2b66 : 68               [ 4]>            pla         ;load status
12154
                            >            eor_flag 0
12155
2b67 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12156
                            >
12157
2b69 : dd3602           [ 4]>            cmp fINC,x    ;test flags
12158
                            >            trap_ne
12159
2b6c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12160
                            >
12161
 
12162
2b6e : bd0302           [ 4]         lda abst,x
12163
2b71 : ca               [ 2]         dex
12164
2b72 : 3008             [ 3]         bmi tdec7
12165
2b74 : e001             [ 2]         cpx #1
12166
2b76 : d0db             [ 3]         bne tdec6
12167
2b78 : a981             [ 2]         lda #$81
12168
2b7a : d0d7             [ 3]         bne tdec6
12169
2b7c :                       tdec7
12170
2b7c : a200             [ 2]         ldx #0
12171
2b7e : a97e             [ 2]         lda #$7e
12172
2b80 : 9d0302           [ 5] tinc16  sta abst,x
12173
                                     set_stat $ff
12174
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  211
12175
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12176
 
12177
                            >            load_flag $ff
12178
2b83 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12179
                            >
12180
2b85 : 48               [ 3]>            pha         ;use stack to load status
12181
2b86 : 28               [ 4]>            plp
12182
 
12183
2b87 : fe0302           [ 6]         inc abst,x
12184
                                     tst_absx rINC,fINC,$ff-fnz
12185
2b8a : 08               [ 3]>            php         ;save flags
12186
2b8b : bd0302           [ 4]>            lda abst,x
12187
2b8e : dd3102           [ 4]>            cmp rINC,x    ;test result
12188
                            >            trap_ne
12189
2b91 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12190
                            >
12191
2b93 : 68               [ 4]>            pla         ;load status
12192
                            >            eor_flag $ff-fnz
12193
2b94 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12194
                            >
12195
2b96 : dd3602           [ 4]>            cmp fINC,x    ;test flags
12196
                            >            trap_ne
12197
2b99 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12198
                            >
12199
 
12200
2b9b : bd0302           [ 4]         lda abst,x
12201
2b9e : e8               [ 2]         inx
12202
2b9f : e002             [ 2]         cpx #2
12203
2ba1 : d002             [ 3]         bne tinc17
12204
2ba3 : a9fe             [ 2]         lda #$fe
12205
2ba5 : e005             [ 2] tinc17  cpx #5
12206
2ba7 : d0d7             [ 3]         bne tinc16
12207
2ba9 : ca               [ 2]         dex
12208
2baa : a902             [ 2]         lda #2
12209
2bac : 9d0302           [ 5] tdec16  sta abst,x
12210
                                     set_stat $ff
12211
                            >            load_flag $ff
12212
2baf : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12213
                            >
12214
2bb1 : 48               [ 3]>            pha         ;use stack to load status
12215
2bb2 : 28               [ 4]>            plp
12216
 
12217
2bb3 : de0302           [ 6]         dec abst,x
12218
                                     tst_absx rINC,fINC,$ff-fnz
12219
2bb6 : 08               [ 3]>            php         ;save flags
12220
2bb7 : bd0302           [ 4]>            lda abst,x
12221
2bba : dd3102           [ 4]>            cmp rINC,x    ;test result
12222
                            >            trap_ne
12223
2bbd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12224
                            >
12225
2bbf : 68               [ 4]>            pla         ;load status
12226
                            >            eor_flag $ff-fnz
12227
2bc0 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12228
                            >
12229
2bc2 : dd3602           [ 4]>            cmp fINC,x    ;test flags
12230
                            >            trap_ne
12231
2bc5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12232
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  212
12233
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12234
 
12235
                            >
12236
 
12237
2bc7 : bd0302           [ 4]         lda abst,x
12238
2bca : ca               [ 2]         dex
12239
2bcb : 3008             [ 3]         bmi tdec17
12240
2bcd : e001             [ 2]         cpx #1
12241
2bcf : d0db             [ 3]         bne tdec16
12242
2bd1 : a981             [ 2]         lda #$81
12243
2bd3 : d0d7             [ 3]         bne tdec16
12244
2bd5 :                       tdec17
12245
                                     next_test
12246
2bd5 : ad0002           [ 4]>            lda test_case   ;previous test
12247
2bd8 : c925             [ 2]>            cmp #test_num
12248
                            >            trap_ne         ;test is out of sequence
12249
2bda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12250
                            >
12251
0026 =                      >test_num = test_num + 1
12252
2bdc : a926             [ 2]>            lda #test_num   ;*** this tests' number
12253
2bde : 8d0002           [ 4]>            sta test_case
12254
                            >            ;check_ram       ;uncomment to find altered RAM after each test
12255
 
12256
 
12257
                             ; testing logical instructions - AND EOR ORA all addressing modes
12258
                             ; AND
12259
2be1 : a203             [ 2]         ldx #3      ;immediate - self modifying code
12260
2be3 : b51c             [ 4] tand    lda zpAN,x
12261
2be5 : 8df02b           [ 4]         sta tandi1
12262
                                     set_ax  absANa,0
12263
                            >            load_flag 0
12264
2be8 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12265
                            >
12266
2bea : 48               [ 3]>            pha         ;use stack to load status
12267
2beb : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12268
2bee : 28               [ 4]>            plp
12269
 
12270
2bf0 =                       tandi1  equ *+1     ;target for immediate operand
12271
2bef : 2963             [ 2]         and #99
12272
                                     tst_ax  absrlo,absflo,0
12273
2bf1 : 08               [ 3]>            php         ;save flags
12274
2bf2 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12275
                            >            trap_ne
12276
2bf5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12277
                            >
12278
2bf7 : 68               [ 4]>            pla         ;load status
12279
                            >            eor_flag 0
12280
2bf8 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12281
                            >
12282
2bfa : dd5702           [ 4]>            cmp absflo,x    ;test flags
12283
                            >            trap_ne     ;
12284
2bfd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12285
                            >
12286
 
12287
2bff : ca               [ 2]         dex
12288
2c00 : 10e1             [ 4]         bpl tand
12289
2c02 : a203             [ 2]         ldx #3
12290
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  213
12291
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12292
 
12293
2c04 : b51c             [ 4] tand1   lda zpAN,x
12294
2c06 : 8d112c           [ 4]         sta tandi2
12295
                                     set_ax  absANa,$ff
12296
                            >            load_flag $ff
12297
2c09 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12298
                            >
12299
2c0b : 48               [ 3]>            pha         ;use stack to load status
12300
2c0c : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12301
2c0f : 28               [ 4]>            plp
12302
 
12303
2c11 =                       tandi2  equ *+1     ;target for immediate operand
12304
2c10 : 2963             [ 2]         and #99
12305
                                     tst_ax  absrlo,absflo,$ff-fnz
12306
2c12 : 08               [ 3]>            php         ;save flags
12307
2c13 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12308
                            >            trap_ne
12309
2c16 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12310
                            >
12311
2c18 : 68               [ 4]>            pla         ;load status
12312
                            >            eor_flag $ff-fnz
12313
2c19 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12314
                            >
12315
2c1b : dd5702           [ 4]>            cmp absflo,x    ;test flags
12316
                            >            trap_ne     ;
12317
2c1e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12318
                            >
12319
 
12320
2c20 : ca               [ 2]         dex
12321
2c21 : 10e1             [ 3]         bpl tand1
12322
 
12323
2c23 : a203             [ 2]         ldx #3      ;zp
12324
2c25 : b51c             [ 4] tand2    lda zpAN,x
12325
2c27 : 850c             [ 3]         sta zpt
12326
                                     set_ax  absANa,0
12327
                            >            load_flag 0
12328
2c29 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12329
                            >
12330
2c2b : 48               [ 3]>            pha         ;use stack to load status
12331
2c2c : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12332
2c2f : 28               [ 4]>            plp
12333
 
12334
2c30 : 250c             [ 3]         and zpt
12335
                                     tst_ax  absrlo,absflo,0
12336
2c32 : 08               [ 3]>            php         ;save flags
12337
2c33 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12338
                            >            trap_ne
12339
2c36 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12340
                            >
12341
2c38 : 68               [ 4]>            pla         ;load status
12342
                            >            eor_flag 0
12343
2c39 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12344
                            >
12345
2c3b : dd5702           [ 4]>            cmp absflo,x    ;test flags
12346
                            >            trap_ne     ;
12347
2c3e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12348
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  214
12349
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12350
 
12351
                            >
12352
 
12353
2c40 : ca               [ 2]         dex
12354
2c41 : 10e2             [ 3]         bpl tand2
12355
2c43 : a203             [ 2]         ldx #3
12356
2c45 : b51c             [ 4] tand3   lda zpAN,x
12357
2c47 : 850c             [ 3]         sta zpt
12358
                                     set_ax  absANa,$ff
12359
                            >            load_flag $ff
12360
2c49 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12361
                            >
12362
2c4b : 48               [ 3]>            pha         ;use stack to load status
12363
2c4c : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12364
2c4f : 28               [ 4]>            plp
12365
 
12366
2c50 : 250c             [ 3]         and zpt
12367
                                     tst_ax  absrlo,absflo,$ff-fnz
12368
2c52 : 08               [ 3]>            php         ;save flags
12369
2c53 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12370
                            >            trap_ne
12371
2c56 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12372
                            >
12373
2c58 : 68               [ 4]>            pla         ;load status
12374
                            >            eor_flag $ff-fnz
12375
2c59 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12376
                            >
12377
2c5b : dd5702           [ 4]>            cmp absflo,x    ;test flags
12378
                            >            trap_ne     ;
12379
2c5e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12380
                            >
12381
 
12382
2c60 : ca               [ 2]         dex
12383
2c61 : 10e2             [ 3]         bpl tand3
12384
 
12385
2c63 : a203             [ 2]         ldx #3      ;abs
12386
2c65 : b51c             [ 4] tand4   lda zpAN,x
12387
2c67 : 8d0302           [ 4]         sta abst
12388
                                     set_ax  absANa,0
12389
                            >            load_flag 0
12390
2c6a : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12391
                            >
12392
2c6c : 48               [ 3]>            pha         ;use stack to load status
12393
2c6d : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12394
2c70 : 28               [ 4]>            plp
12395
 
12396
2c71 : 2d0302           [ 4]         and abst
12397
                                     tst_ax  absrlo,absflo,0
12398
2c74 : 08               [ 3]>            php         ;save flags
12399
2c75 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12400
                            >            trap_ne
12401
2c78 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12402
                            >
12403
2c7a : 68               [ 4]>            pla         ;load status
12404
                            >            eor_flag 0
12405
2c7b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12406
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  215
12407
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12408
 
12409
                            >
12410
2c7d : dd5702           [ 4]>            cmp absflo,x    ;test flags
12411
                            >            trap_ne     ;
12412
2c80 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12413
                            >
12414
 
12415
2c82 : ca               [ 2]         dex
12416
2c83 : 10e0             [ 3]         bpl tand4
12417
2c85 : a203             [ 2]         ldx #3
12418
2c87 : b51c             [ 4] tand5   lda zpAN,x
12419
2c89 : 8d0302           [ 4]         sta abst
12420
                                     set_ax  absANa,$ff
12421
                            >            load_flag $ff
12422
2c8c : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12423
                            >
12424
2c8e : 48               [ 3]>            pha         ;use stack to load status
12425
2c8f : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12426
2c92 : 28               [ 4]>            plp
12427
 
12428
2c93 : 2d0302           [ 4]         and abst
12429
                                     tst_ax  absrlo,absflo,$ff-fnz
12430
2c96 : 08               [ 3]>            php         ;save flags
12431
2c97 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12432
                            >            trap_ne
12433
2c9a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12434
                            >
12435
2c9c : 68               [ 4]>            pla         ;load status
12436
                            >            eor_flag $ff-fnz
12437
2c9d : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12438
                            >
12439
2c9f : dd5702           [ 4]>            cmp absflo,x    ;test flags
12440
                            >            trap_ne     ;
12441
2ca2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12442
                            >
12443
 
12444
2ca4 : ca               [ 2]         dex
12445
2ca5 : 1002             [ 3]         bpl tand6
12446
 
12447
2ca7 : a203             [ 2]         ldx #3      ;zp,x
12448
2ca9 :                       tand6
12449
                                     set_ax  absANa,0
12450
                            >            load_flag 0
12451
2ca9 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12452
                            >
12453
2cab : 48               [ 3]>            pha         ;use stack to load status
12454
2cac : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12455
2caf : 28               [ 4]>            plp
12456
 
12457
2cb0 : 351c             [ 4]         and zpAN,x
12458
                                     tst_ax  absrlo,absflo,0
12459
2cb2 : 08               [ 3]>            php         ;save flags
12460
2cb3 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12461
                            >            trap_ne
12462
2cb6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12463
                            >
12464
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  216
12465
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12466
 
12467
2cb8 : 68               [ 4]>            pla         ;load status
12468
                            >            eor_flag 0
12469
2cb9 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12470
                            >
12471
2cbb : dd5702           [ 4]>            cmp absflo,x    ;test flags
12472
                            >            trap_ne     ;
12473
2cbe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12474
                            >
12475
 
12476
2cc0 : ca               [ 2]         dex
12477
2cc1 : 10e6             [ 3]         bpl tand6
12478
2cc3 : a203             [ 2]         ldx #3
12479
2cc5 :                       tand7
12480
                                     set_ax  absANa,$ff
12481
                            >            load_flag $ff
12482
2cc5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12483
                            >
12484
2cc7 : 48               [ 3]>            pha         ;use stack to load status
12485
2cc8 : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12486
2ccb : 28               [ 4]>            plp
12487
 
12488
2ccc : 351c             [ 4]         and zpAN,x
12489
                                     tst_ax  absrlo,absflo,$ff-fnz
12490
2cce : 08               [ 3]>            php         ;save flags
12491
2ccf : dd5302           [ 4]>            cmp absrlo,x    ;test result
12492
                            >            trap_ne
12493
2cd2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12494
                            >
12495
2cd4 : 68               [ 4]>            pla         ;load status
12496
                            >            eor_flag $ff-fnz
12497
2cd5 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12498
                            >
12499
2cd7 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12500
                            >            trap_ne     ;
12501
2cda : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12502
                            >
12503
 
12504
2cdc : ca               [ 2]         dex
12505
2cdd : 10e6             [ 3]         bpl tand7
12506
 
12507
2cdf : a203             [ 2]         ldx #3      ;abs,x
12508
2ce1 :                       tand8
12509
                                     set_ax  absANa,0
12510
                            >            load_flag 0
12511
2ce1 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12512
                            >
12513
2ce3 : 48               [ 3]>            pha         ;use stack to load status
12514
2ce4 : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12515
2ce7 : 28               [ 4]>            plp
12516
 
12517
2ce8 : 3d3f02           [ 4]         and absAN,x
12518
                                     tst_ax  absrlo,absflo,0
12519
2ceb : 08               [ 3]>            php         ;save flags
12520
2cec : dd5302           [ 4]>            cmp absrlo,x    ;test result
12521
                            >            trap_ne
12522
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  217
12523
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12524
 
12525
2cef : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12526
                            >
12527
2cf1 : 68               [ 4]>            pla         ;load status
12528
                            >            eor_flag 0
12529
2cf2 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12530
                            >
12531
2cf4 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12532
                            >            trap_ne     ;
12533
2cf7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12534
                            >
12535
 
12536
2cf9 : ca               [ 2]         dex
12537
2cfa : 10e5             [ 3]         bpl tand8
12538
2cfc : a203             [ 2]         ldx #3
12539
2cfe :                       tand9
12540
                                     set_ax  absANa,$ff
12541
                            >            load_flag $ff
12542
2cfe : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12543
                            >
12544
2d00 : 48               [ 3]>            pha         ;use stack to load status
12545
2d01 : bd4b02           [ 4]>            lda absANa,x    ;precharge accu
12546
2d04 : 28               [ 4]>            plp
12547
 
12548
2d05 : 3d3f02           [ 4]         and absAN,x
12549
                                     tst_ax  absrlo,absflo,$ff-fnz
12550
2d08 : 08               [ 3]>            php         ;save flags
12551
2d09 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12552
                            >            trap_ne
12553
2d0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12554
                            >
12555
2d0e : 68               [ 4]>            pla         ;load status
12556
                            >            eor_flag $ff-fnz
12557
2d0f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12558
                            >
12559
2d11 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12560
                            >            trap_ne     ;
12561
2d14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12562
                            >
12563
 
12564
2d16 : ca               [ 2]         dex
12565
2d17 : 10e5             [ 4]         bpl tand9
12566
 
12567
2d19 : a003             [ 2]         ldy #3      ;abs,y
12568
2d1b :                       tand10
12569
                                     set_ay  absANa,0
12570
                            >            load_flag 0
12571
2d1b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12572
                            >
12573
2d1d : 48               [ 3]>            pha         ;use stack to load status
12574
2d1e : b94b02           [ 4]>            lda absANa,y    ;precharge accu
12575
2d21 : 28               [ 4]>            plp
12576
 
12577
2d22 : 393f02           [ 4]         and absAN,y
12578
                                     tst_ay  absrlo,absflo,0
12579
2d25 : 08               [ 3]>            php         ;save flags
12580
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  218
12581
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12582
 
12583
2d26 : d95302           [ 4]>            cmp absrlo,y    ;test result
12584
                            >            trap_ne     ;
12585
2d29 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12586
                            >
12587
2d2b : 68               [ 4]>            pla         ;load status
12588
                            >            eor_flag 0
12589
2d2c : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12590
                            >
12591
2d2e : d95702           [ 4]>            cmp absflo,y    ;test flags
12592
                            >            trap_ne
12593
2d31 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12594
                            >
12595
 
12596
2d33 : 88               [ 2]         dey
12597
2d34 : 10e5             [ 3]         bpl tand10
12598
2d36 : a003             [ 2]         ldy #3
12599
2d38 :                       tand11
12600
                                     set_ay  absANa,$ff
12601
                            >            load_flag $ff
12602
2d38 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12603
                            >
12604
2d3a : 48               [ 3]>            pha         ;use stack to load status
12605
2d3b : b94b02           [ 4]>            lda absANa,y    ;precharge accu
12606
2d3e : 28               [ 4]>            plp
12607
 
12608
2d3f : 393f02           [ 4]         and absAN,y
12609
                                     tst_ay  absrlo,absflo,$ff-fnz
12610
2d42 : 08               [ 3]>            php         ;save flags
12611
2d43 : d95302           [ 4]>            cmp absrlo,y    ;test result
12612
                            >            trap_ne     ;
12613
2d46 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12614
                            >
12615
2d48 : 68               [ 4]>            pla         ;load status
12616
                            >            eor_flag $ff-fnz
12617
2d49 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12618
                            >
12619
2d4b : d95702           [ 4]>            cmp absflo,y    ;test flags
12620
                            >            trap_ne
12621
2d4e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12622
                            >
12623
 
12624
2d50 : 88               [ 2]         dey
12625
2d51 : 10e5             [ 3]         bpl tand11
12626
 
12627
2d53 : a206             [ 2]         ldx #6      ;(zp,x)
12628
2d55 : a003             [ 2]         ldy #3
12629
2d57 :                       tand12
12630
                                     set_ay  absANa,0
12631
                            >            load_flag 0
12632
2d57 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12633
                            >
12634
2d59 : 48               [ 3]>            pha         ;use stack to load status
12635
2d5a : b94b02           [ 4]>            lda absANa,y    ;precharge accu
12636
2d5d : 28               [ 4]>            plp
12637
 
12638
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  219
12639
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12640
 
12641
2d5e : 213a             [ 6]         and (indAN,x)
12642
                                     tst_ay  absrlo,absflo,0
12643
2d60 : 08               [ 3]>            php         ;save flags
12644
2d61 : d95302           [ 4]>            cmp absrlo,y    ;test result
12645
                            >            trap_ne     ;
12646
2d64 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12647
                            >
12648
2d66 : 68               [ 4]>            pla         ;load status
12649
                            >            eor_flag 0
12650
2d67 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12651
                            >
12652
2d69 : d95702           [ 4]>            cmp absflo,y    ;test flags
12653
                            >            trap_ne
12654
2d6c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12655
                            >
12656
 
12657
2d6e : ca               [ 2]         dex
12658
2d6f : ca               [ 2]         dex
12659
2d70 : 88               [ 2]         dey
12660
2d71 : 10e4             [ 3]         bpl tand12
12661
2d73 : a206             [ 2]         ldx #6
12662
2d75 : a003             [ 2]         ldy #3
12663
2d77 :                       tand13
12664
                                     set_ay  absANa,$ff
12665
                            >            load_flag $ff
12666
2d77 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12667
                            >
12668
2d79 : 48               [ 3]>            pha         ;use stack to load status
12669
2d7a : b94b02           [ 4]>            lda absANa,y    ;precharge accu
12670
2d7d : 28               [ 4]>            plp
12671
 
12672
2d7e : 213a             [ 6]         and (indAN,x)
12673
                                     tst_ay  absrlo,absflo,$ff-fnz
12674
2d80 : 08               [ 3]>            php         ;save flags
12675
2d81 : d95302           [ 4]>            cmp absrlo,y    ;test result
12676
                            >            trap_ne     ;
12677
2d84 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12678
                            >
12679
2d86 : 68               [ 4]>            pla         ;load status
12680
                            >            eor_flag $ff-fnz
12681
2d87 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12682
                            >
12683
2d89 : d95702           [ 4]>            cmp absflo,y    ;test flags
12684
                            >            trap_ne
12685
2d8c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12686
                            >
12687
 
12688
2d8e : ca               [ 2]         dex
12689
2d8f : ca               [ 2]         dex
12690
2d90 : 88               [ 2]         dey
12691
2d91 : 10e4             [ 3]         bpl tand13
12692
 
12693
2d93 : a003             [ 2]         ldy #3      ;(zp),y
12694
2d95 :                       tand14
12695
                                     set_ay  absANa,0
12696
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  220
12697
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12698
 
12699
                            >            load_flag 0
12700
2d95 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12701
                            >
12702
2d97 : 48               [ 3]>            pha         ;use stack to load status
12703
2d98 : b94b02           [ 4]>            lda absANa,y    ;precharge accu
12704
2d9b : 28               [ 4]>            plp
12705
 
12706
2d9c : 313a             [ 5]         and (indAN),y
12707
                                     tst_ay  absrlo,absflo,0
12708
2d9e : 08               [ 3]>            php         ;save flags
12709
2d9f : d95302           [ 4]>            cmp absrlo,y    ;test result
12710
                            >            trap_ne     ;
12711
2da2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12712
                            >
12713
2da4 : 68               [ 4]>            pla         ;load status
12714
                            >            eor_flag 0
12715
2da5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12716
                            >
12717
2da7 : d95702           [ 4]>            cmp absflo,y    ;test flags
12718
                            >            trap_ne
12719
2daa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12720
                            >
12721
 
12722
2dac : 88               [ 2]         dey
12723
2dad : 10e6             [ 3]         bpl tand14
12724
2daf : a003             [ 2]         ldy #3
12725
2db1 :                       tand15
12726
                                     set_ay  absANa,$ff
12727
                            >            load_flag $ff
12728
2db1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12729
                            >
12730
2db3 : 48               [ 3]>            pha         ;use stack to load status
12731
2db4 : b94b02           [ 4]>            lda absANa,y    ;precharge accu
12732
2db7 : 28               [ 4]>            plp
12733
 
12734
2db8 : 313a             [ 5]         and (indAN),y
12735
                                     tst_ay  absrlo,absflo,$ff-fnz
12736
2dba : 08               [ 3]>            php         ;save flags
12737
2dbb : d95302           [ 4]>            cmp absrlo,y    ;test result
12738
                            >            trap_ne     ;
12739
2dbe : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12740
                            >
12741
2dc0 : 68               [ 4]>            pla         ;load status
12742
                            >            eor_flag $ff-fnz
12743
2dc1 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12744
                            >
12745
2dc3 : d95702           [ 4]>            cmp absflo,y    ;test flags
12746
                            >            trap_ne
12747
2dc6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12748
                            >
12749
 
12750
2dc8 : 88               [ 2]         dey
12751
2dc9 : 10e6             [ 3]         bpl tand15
12752
                                     next_test
12753
2dcb : ad0002           [ 4]>            lda test_case   ;previous test
12754
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  221
12755
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12756
 
12757
2dce : c926             [ 2]>            cmp #test_num
12758
                            >            trap_ne         ;test is out of sequence
12759
2dd0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12760
                            >
12761
0027 =                      >test_num = test_num + 1
12762
2dd2 : a927             [ 2]>            lda #test_num   ;*** this tests' number
12763
2dd4 : 8d0002           [ 4]>            sta test_case
12764
                            >            ;check_ram       ;uncomment to find altered RAM after each test
12765
 
12766
 
12767
                             ; EOR
12768
2dd7 : a203             [ 2]         ldx #3      ;immediate - self modifying code
12769
2dd9 : b520             [ 4] teor    lda zpEO,x
12770
2ddb : 8de62d           [ 4]         sta teori1
12771
                                     set_ax  absEOa,0
12772
                            >            load_flag 0
12773
2dde : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12774
                            >
12775
2de0 : 48               [ 3]>            pha         ;use stack to load status
12776
2de1 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12777
2de4 : 28               [ 4]>            plp
12778
 
12779
2de6 =                       teori1  equ *+1     ;target for immediate operand
12780
2de5 : 4963             [ 2]         eor #99
12781
                                     tst_ax  absrlo,absflo,0
12782
2de7 : 08               [ 3]>            php         ;save flags
12783
2de8 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12784
                            >            trap_ne
12785
2deb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12786
                            >
12787
2ded : 68               [ 4]>            pla         ;load status
12788
                            >            eor_flag 0
12789
2dee : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12790
                            >
12791
2df0 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12792
                            >            trap_ne     ;
12793
2df3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12794
                            >
12795
 
12796
2df5 : ca               [ 2]         dex
12797
2df6 : 10e1             [ 3]         bpl teor
12798
2df8 : a203             [ 2]         ldx #3
12799
2dfa : b520             [ 4] teor1   lda zpEO,x
12800
2dfc : 8d072e           [ 4]         sta teori2
12801
                                     set_ax  absEOa,$ff
12802
                            >            load_flag $ff
12803
2dff : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12804
                            >
12805
2e01 : 48               [ 3]>            pha         ;use stack to load status
12806
2e02 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12807
2e05 : 28               [ 4]>            plp
12808
 
12809
2e07 =                       teori2  equ *+1     ;target for immediate operand
12810
2e06 : 4963             [ 2]         eor #99
12811
                                     tst_ax  absrlo,absflo,$ff-fnz
12812
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  222
12813
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12814
 
12815
2e08 : 08               [ 3]>            php         ;save flags
12816
2e09 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12817
                            >            trap_ne
12818
2e0c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12819
                            >
12820
2e0e : 68               [ 4]>            pla         ;load status
12821
                            >            eor_flag $ff-fnz
12822
2e0f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12823
                            >
12824
2e11 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12825
                            >            trap_ne     ;
12826
2e14 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12827
                            >
12828
 
12829
2e16 : ca               [ 2]         dex
12830
2e17 : 10e1             [ 4]         bpl teor1
12831
 
12832
2e19 : a203             [ 2]         ldx #3      ;zp
12833
2e1b : b520             [ 4] teor2    lda zpEO,x
12834
2e1d : 850c             [ 3]         sta zpt
12835
                                     set_ax  absEOa,0
12836
                            >            load_flag 0
12837
2e1f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12838
                            >
12839
2e21 : 48               [ 3]>            pha         ;use stack to load status
12840
2e22 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12841
2e25 : 28               [ 4]>            plp
12842
 
12843
2e26 : 450c             [ 3]         eor zpt
12844
                                     tst_ax  absrlo,absflo,0
12845
2e28 : 08               [ 3]>            php         ;save flags
12846
2e29 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12847
                            >            trap_ne
12848
2e2c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12849
                            >
12850
2e2e : 68               [ 4]>            pla         ;load status
12851
                            >            eor_flag 0
12852
2e2f : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12853
                            >
12854
2e31 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12855
                            >            trap_ne     ;
12856
2e34 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12857
                            >
12858
 
12859
2e36 : ca               [ 2]         dex
12860
2e37 : 10e2             [ 3]         bpl teor2
12861
2e39 : a203             [ 2]         ldx #3
12862
2e3b : b520             [ 4] teor3   lda zpEO,x
12863
2e3d : 850c             [ 3]         sta zpt
12864
                                     set_ax  absEOa,$ff
12865
                            >            load_flag $ff
12866
2e3f : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12867
                            >
12868
2e41 : 48               [ 3]>            pha         ;use stack to load status
12869
2e42 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12870
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  223
12871
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12872
 
12873
2e45 : 28               [ 4]>            plp
12874
 
12875
2e46 : 450c             [ 3]         eor zpt
12876
                                     tst_ax  absrlo,absflo,$ff-fnz
12877
2e48 : 08               [ 3]>            php         ;save flags
12878
2e49 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12879
                            >            trap_ne
12880
2e4c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12881
                            >
12882
2e4e : 68               [ 4]>            pla         ;load status
12883
                            >            eor_flag $ff-fnz
12884
2e4f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12885
                            >
12886
2e51 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12887
                            >            trap_ne     ;
12888
2e54 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12889
                            >
12890
 
12891
2e56 : ca               [ 2]         dex
12892
2e57 : 10e2             [ 3]         bpl teor3
12893
 
12894
2e59 : a203             [ 2]         ldx #3      ;abs
12895
2e5b : b520             [ 4] teor4   lda zpEO,x
12896
2e5d : 8d0302           [ 4]         sta abst
12897
                                     set_ax  absEOa,0
12898
                            >            load_flag 0
12899
2e60 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12900
                            >
12901
2e62 : 48               [ 3]>            pha         ;use stack to load status
12902
2e63 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12903
2e66 : 28               [ 4]>            plp
12904
 
12905
2e67 : 4d0302           [ 4]         eor abst
12906
                                     tst_ax  absrlo,absflo,0
12907
2e6a : 08               [ 3]>            php         ;save flags
12908
2e6b : dd5302           [ 4]>            cmp absrlo,x    ;test result
12909
                            >            trap_ne
12910
2e6e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12911
                            >
12912
2e70 : 68               [ 4]>            pla         ;load status
12913
                            >            eor_flag 0
12914
2e71 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12915
                            >
12916
2e73 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12917
                            >            trap_ne     ;
12918
2e76 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12919
                            >
12920
 
12921
2e78 : ca               [ 2]         dex
12922
2e79 : 10e0             [ 3]         bpl teor4
12923
2e7b : a203             [ 2]         ldx #3
12924
2e7d : b520             [ 4] teor5   lda zpEO,x
12925
2e7f : 8d0302           [ 4]         sta abst
12926
                                     set_ax  absEOa,$ff
12927
                            >            load_flag $ff
12928
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  224
12929
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12930
 
12931
2e82 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12932
                            >
12933
2e84 : 48               [ 3]>            pha         ;use stack to load status
12934
2e85 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12935
2e88 : 28               [ 4]>            plp
12936
 
12937
2e89 : 4d0302           [ 4]         eor abst
12938
                                     tst_ax  absrlo,absflo,$ff-fnz
12939
2e8c : 08               [ 3]>            php         ;save flags
12940
2e8d : dd5302           [ 4]>            cmp absrlo,x    ;test result
12941
                            >            trap_ne
12942
2e90 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12943
                            >
12944
2e92 : 68               [ 4]>            pla         ;load status
12945
                            >            eor_flag $ff-fnz
12946
2e93 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
12947
                            >
12948
2e95 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12949
                            >            trap_ne     ;
12950
2e98 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12951
                            >
12952
 
12953
2e9a : ca               [ 2]         dex
12954
2e9b : 1002             [ 3]         bpl teor6
12955
 
12956
2e9d : a203             [ 2]         ldx #3      ;zp,x
12957
2e9f :                       teor6
12958
                                     set_ax  absEOa,0
12959
                            >            load_flag 0
12960
2e9f : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
12961
                            >
12962
2ea1 : 48               [ 3]>            pha         ;use stack to load status
12963
2ea2 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12964
2ea5 : 28               [ 4]>            plp
12965
 
12966
2ea6 : 5520             [ 4]         eor zpEO,x
12967
                                     tst_ax  absrlo,absflo,0
12968
2ea8 : 08               [ 3]>            php         ;save flags
12969
2ea9 : dd5302           [ 4]>            cmp absrlo,x    ;test result
12970
                            >            trap_ne
12971
2eac : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12972
                            >
12973
2eae : 68               [ 4]>            pla         ;load status
12974
                            >            eor_flag 0
12975
2eaf : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
12976
                            >
12977
2eb1 : dd5702           [ 4]>            cmp absflo,x    ;test flags
12978
                            >            trap_ne     ;
12979
2eb4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
12980
                            >
12981
 
12982
2eb6 : ca               [ 2]         dex
12983
2eb7 : 10e6             [ 3]         bpl teor6
12984
2eb9 : a203             [ 2]         ldx #3
12985
2ebb :                       teor7
12986
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  225
12987
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
12988
 
12989
                                     set_ax  absEOa,$ff
12990
                            >            load_flag $ff
12991
2ebb : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
12992
                            >
12993
2ebd : 48               [ 3]>            pha         ;use stack to load status
12994
2ebe : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
12995
2ec1 : 28               [ 4]>            plp
12996
 
12997
2ec2 : 5520             [ 4]         eor zpEO,x
12998
                                     tst_ax  absrlo,absflo,$ff-fnz
12999
2ec4 : 08               [ 3]>            php         ;save flags
13000
2ec5 : dd5302           [ 4]>            cmp absrlo,x    ;test result
13001
                            >            trap_ne
13002
2ec8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13003
                            >
13004
2eca : 68               [ 4]>            pla         ;load status
13005
                            >            eor_flag $ff-fnz
13006
2ecb : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13007
                            >
13008
2ecd : dd5702           [ 4]>            cmp absflo,x    ;test flags
13009
                            >            trap_ne     ;
13010
2ed0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13011
                            >
13012
 
13013
2ed2 : ca               [ 2]         dex
13014
2ed3 : 10e6             [ 3]         bpl teor7
13015
 
13016
2ed5 : a203             [ 2]         ldx #3      ;abs,x
13017
2ed7 :                       teor8
13018
                                     set_ax  absEOa,0
13019
                            >            load_flag 0
13020
2ed7 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13021
                            >
13022
2ed9 : 48               [ 3]>            pha         ;use stack to load status
13023
2eda : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
13024
2edd : 28               [ 4]>            plp
13025
 
13026
2ede : 5d4302           [ 4]         eor absEO,x
13027
                                     tst_ax  absrlo,absflo,0
13028
2ee1 : 08               [ 3]>            php         ;save flags
13029
2ee2 : dd5302           [ 4]>            cmp absrlo,x    ;test result
13030
                            >            trap_ne
13031
2ee5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13032
                            >
13033
2ee7 : 68               [ 4]>            pla         ;load status
13034
                            >            eor_flag 0
13035
2ee8 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13036
                            >
13037
2eea : dd5702           [ 4]>            cmp absflo,x    ;test flags
13038
                            >            trap_ne     ;
13039
2eed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13040
                            >
13041
 
13042
2eef : ca               [ 2]         dex
13043
2ef0 : 10e5             [ 3]         bpl teor8
13044
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  226
13045
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13046
 
13047
2ef2 : a203             [ 2]         ldx #3
13048
2ef4 :                       teor9
13049
                                     set_ax  absEOa,$ff
13050
                            >            load_flag $ff
13051
2ef4 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13052
                            >
13053
2ef6 : 48               [ 3]>            pha         ;use stack to load status
13054
2ef7 : bd4f02           [ 4]>            lda absEOa,x    ;precharge accu
13055
2efa : 28               [ 4]>            plp
13056
 
13057
2efb : 5d4302           [ 4]         eor absEO,x
13058
                                     tst_ax  absrlo,absflo,$ff-fnz
13059
2efe : 08               [ 3]>            php         ;save flags
13060
2eff : dd5302           [ 4]>            cmp absrlo,x    ;test result
13061
                            >            trap_ne
13062
2f02 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13063
                            >
13064
2f04 : 68               [ 4]>            pla         ;load status
13065
                            >            eor_flag $ff-fnz
13066
2f05 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13067
                            >
13068
2f07 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13069
                            >            trap_ne     ;
13070
2f0a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13071
                            >
13072
 
13073
2f0c : ca               [ 2]         dex
13074
2f0d : 10e5             [ 4]         bpl teor9
13075
 
13076
2f0f : a003             [ 2]         ldy #3      ;abs,y
13077
2f11 :                       teor10
13078
                                     set_ay  absEOa,0
13079
                            >            load_flag 0
13080
2f11 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13081
                            >
13082
2f13 : 48               [ 3]>            pha         ;use stack to load status
13083
2f14 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
13084
2f17 : 28               [ 4]>            plp
13085
 
13086
2f18 : 594302           [ 4]         eor absEO,y
13087
                                     tst_ay  absrlo,absflo,0
13088
2f1b : 08               [ 3]>            php         ;save flags
13089
2f1c : d95302           [ 4]>            cmp absrlo,y    ;test result
13090
                            >            trap_ne     ;
13091
2f1f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13092
                            >
13093
2f21 : 68               [ 4]>            pla         ;load status
13094
                            >            eor_flag 0
13095
2f22 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13096
                            >
13097
2f24 : d95702           [ 4]>            cmp absflo,y    ;test flags
13098
                            >            trap_ne
13099
2f27 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13100
                            >
13101
 
13102
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  227
13103
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13104
 
13105
2f29 : 88               [ 2]         dey
13106
2f2a : 10e5             [ 3]         bpl teor10
13107
2f2c : a003             [ 2]         ldy #3
13108
2f2e :                       teor11
13109
                                     set_ay  absEOa,$ff
13110
                            >            load_flag $ff
13111
2f2e : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13112
                            >
13113
2f30 : 48               [ 3]>            pha         ;use stack to load status
13114
2f31 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
13115
2f34 : 28               [ 4]>            plp
13116
 
13117
2f35 : 594302           [ 4]         eor absEO,y
13118
                                     tst_ay  absrlo,absflo,$ff-fnz
13119
2f38 : 08               [ 3]>            php         ;save flags
13120
2f39 : d95302           [ 4]>            cmp absrlo,y    ;test result
13121
                            >            trap_ne     ;
13122
2f3c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13123
                            >
13124
2f3e : 68               [ 4]>            pla         ;load status
13125
                            >            eor_flag $ff-fnz
13126
2f3f : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13127
                            >
13128
2f41 : d95702           [ 4]>            cmp absflo,y    ;test flags
13129
                            >            trap_ne
13130
2f44 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13131
                            >
13132
 
13133
2f46 : 88               [ 2]         dey
13134
2f47 : 10e5             [ 3]         bpl teor11
13135
 
13136
2f49 : a206             [ 2]         ldx #6      ;(zp,x)
13137
2f4b : a003             [ 2]         ldy #3
13138
2f4d :                       teor12
13139
                                     set_ay  absEOa,0
13140
                            >            load_flag 0
13141
2f4d : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13142
                            >
13143
2f4f : 48               [ 3]>            pha         ;use stack to load status
13144
2f50 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
13145
2f53 : 28               [ 4]>            plp
13146
 
13147
2f54 : 4142             [ 6]         eor (indEO,x)
13148
                                     tst_ay  absrlo,absflo,0
13149
2f56 : 08               [ 3]>            php         ;save flags
13150
2f57 : d95302           [ 4]>            cmp absrlo,y    ;test result
13151
                            >            trap_ne     ;
13152
2f5a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13153
                            >
13154
2f5c : 68               [ 4]>            pla         ;load status
13155
                            >            eor_flag 0
13156
2f5d : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13157
                            >
13158
2f5f : d95702           [ 4]>            cmp absflo,y    ;test flags
13159
                            >            trap_ne
13160
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  228
13161
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13162
 
13163
2f62 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13164
                            >
13165
 
13166
2f64 : ca               [ 2]         dex
13167
2f65 : ca               [ 2]         dex
13168
2f66 : 88               [ 2]         dey
13169
2f67 : 10e4             [ 3]         bpl teor12
13170
2f69 : a206             [ 2]         ldx #6
13171
2f6b : a003             [ 2]         ldy #3
13172
2f6d :                       teor13
13173
                                     set_ay  absEOa,$ff
13174
                            >            load_flag $ff
13175
2f6d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13176
                            >
13177
2f6f : 48               [ 3]>            pha         ;use stack to load status
13178
2f70 : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
13179
2f73 : 28               [ 4]>            plp
13180
 
13181
2f74 : 4142             [ 6]         eor (indEO,x)
13182
                                     tst_ay  absrlo,absflo,$ff-fnz
13183
2f76 : 08               [ 3]>            php         ;save flags
13184
2f77 : d95302           [ 4]>            cmp absrlo,y    ;test result
13185
                            >            trap_ne     ;
13186
2f7a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13187
                            >
13188
2f7c : 68               [ 4]>            pla         ;load status
13189
                            >            eor_flag $ff-fnz
13190
2f7d : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13191
                            >
13192
2f7f : d95702           [ 4]>            cmp absflo,y    ;test flags
13193
                            >            trap_ne
13194
2f82 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13195
                            >
13196
 
13197
2f84 : ca               [ 2]         dex
13198
2f85 : ca               [ 2]         dex
13199
2f86 : 88               [ 2]         dey
13200
2f87 : 10e4             [ 3]         bpl teor13
13201
 
13202
2f89 : a003             [ 2]         ldy #3      ;(zp),y
13203
2f8b :                       teor14
13204
                                     set_ay  absEOa,0
13205
                            >            load_flag 0
13206
2f8b : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13207
                            >
13208
2f8d : 48               [ 3]>            pha         ;use stack to load status
13209
2f8e : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
13210
2f91 : 28               [ 4]>            plp
13211
 
13212
2f92 : 5142             [ 5]         eor (indEO),y
13213
                                     tst_ay  absrlo,absflo,0
13214
2f94 : 08               [ 3]>            php         ;save flags
13215
2f95 : d95302           [ 4]>            cmp absrlo,y    ;test result
13216
                            >            trap_ne     ;
13217
2f98 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13218
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  229
13219
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13220
 
13221
                            >
13222
2f9a : 68               [ 4]>            pla         ;load status
13223
                            >            eor_flag 0
13224
2f9b : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13225
                            >
13226
2f9d : d95702           [ 4]>            cmp absflo,y    ;test flags
13227
                            >            trap_ne
13228
2fa0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13229
                            >
13230
 
13231
2fa2 : 88               [ 2]         dey
13232
2fa3 : 10e6             [ 3]         bpl teor14
13233
2fa5 : a003             [ 2]         ldy #3
13234
2fa7 :                       teor15
13235
                                     set_ay  absEOa,$ff
13236
                            >            load_flag $ff
13237
2fa7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13238
                            >
13239
2fa9 : 48               [ 3]>            pha         ;use stack to load status
13240
2faa : b94f02           [ 4]>            lda absEOa,y    ;precharge accu
13241
2fad : 28               [ 4]>            plp
13242
 
13243
2fae : 5142             [ 5]         eor (indEO),y
13244
                                     tst_ay  absrlo,absflo,$ff-fnz
13245
2fb0 : 08               [ 3]>            php         ;save flags
13246
2fb1 : d95302           [ 4]>            cmp absrlo,y    ;test result
13247
                            >            trap_ne     ;
13248
2fb4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13249
                            >
13250
2fb6 : 68               [ 4]>            pla         ;load status
13251
                            >            eor_flag $ff-fnz
13252
2fb7 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13253
                            >
13254
2fb9 : d95702           [ 4]>            cmp absflo,y    ;test flags
13255
                            >            trap_ne
13256
2fbc : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13257
                            >
13258
 
13259
2fbe : 88               [ 2]         dey
13260
2fbf : 10e6             [ 3]         bpl teor15
13261
                                     next_test
13262
2fc1 : ad0002           [ 4]>            lda test_case   ;previous test
13263
2fc4 : c927             [ 2]>            cmp #test_num
13264
                            >            trap_ne         ;test is out of sequence
13265
2fc6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13266
                            >
13267
0028 =                      >test_num = test_num + 1
13268
2fc8 : a928             [ 2]>            lda #test_num   ;*** this tests' number
13269
2fca : 8d0002           [ 4]>            sta test_case
13270
                            >            ;check_ram       ;uncomment to find altered RAM after each test
13271
 
13272
 
13273
                             ; OR
13274
2fcd : a203             [ 2]         ldx #3      ;immediate - self modifying code
13275
2fcf : b518             [ 4] tora    lda zpOR,x
13276
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  230
13277
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13278
 
13279
2fd1 : 8ddc2f           [ 4]         sta torai1
13280
                                     set_ax  absORa,0
13281
                            >            load_flag 0
13282
2fd4 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13283
                            >
13284
2fd6 : 48               [ 3]>            pha         ;use stack to load status
13285
2fd7 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13286
2fda : 28               [ 4]>            plp
13287
 
13288
2fdc =                       torai1  equ *+1     ;target for immediate operand
13289
2fdb : 0963             [ 2]         ora #99
13290
                                     tst_ax  absrlo,absflo,0
13291
2fdd : 08               [ 3]>            php         ;save flags
13292
2fde : dd5302           [ 4]>            cmp absrlo,x    ;test result
13293
                            >            trap_ne
13294
2fe1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13295
                            >
13296
2fe3 : 68               [ 4]>            pla         ;load status
13297
                            >            eor_flag 0
13298
2fe4 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13299
                            >
13300
2fe6 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13301
                            >            trap_ne     ;
13302
2fe9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13303
                            >
13304
 
13305
2feb : ca               [ 2]         dex
13306
2fec : 10e1             [ 3]         bpl tora
13307
2fee : a203             [ 2]         ldx #3
13308
2ff0 : b518             [ 4] tora1   lda zpOR,x
13309
2ff2 : 8dfd2f           [ 4]         sta torai2
13310
                                     set_ax  absORa,$ff
13311
                            >            load_flag $ff
13312
2ff5 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13313
                            >
13314
2ff7 : 48               [ 3]>            pha         ;use stack to load status
13315
2ff8 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13316
2ffb : 28               [ 4]>            plp
13317
 
13318
2ffd =                       torai2  equ *+1     ;target for immediate operand
13319
2ffc : 0963             [ 2]         ora #99
13320
                                     tst_ax  absrlo,absflo,$ff-fnz
13321
2ffe : 08               [ 3]>            php         ;save flags
13322
2fff : dd5302           [ 4]>            cmp absrlo,x    ;test result
13323
                            >            trap_ne
13324
3002 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13325
                            >
13326
3004 : 68               [ 4]>            pla         ;load status
13327
                            >            eor_flag $ff-fnz
13328
3005 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13329
                            >
13330
3007 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13331
                            >            trap_ne     ;
13332
300a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13333
                            >
13334
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  231
13335
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13336
 
13337
 
13338
300c : ca               [ 2]         dex
13339
300d : 10e1             [ 4]         bpl tora1
13340
 
13341
300f : a203             [ 2]         ldx #3      ;zp
13342
3011 : b518             [ 4] tora2    lda zpOR,x
13343
3013 : 850c             [ 3]         sta zpt
13344
                                     set_ax  absORa,0
13345
                            >            load_flag 0
13346
3015 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13347
                            >
13348
3017 : 48               [ 3]>            pha         ;use stack to load status
13349
3018 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13350
301b : 28               [ 4]>            plp
13351
 
13352
301c : 050c             [ 3]         ora zpt
13353
                                     tst_ax  absrlo,absflo,0
13354
301e : 08               [ 3]>            php         ;save flags
13355
301f : dd5302           [ 4]>            cmp absrlo,x    ;test result
13356
                            >            trap_ne
13357
3022 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13358
                            >
13359
3024 : 68               [ 4]>            pla         ;load status
13360
                            >            eor_flag 0
13361
3025 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13362
                            >
13363
3027 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13364
                            >            trap_ne     ;
13365
302a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13366
                            >
13367
 
13368
302c : ca               [ 2]         dex
13369
302d : 10e2             [ 3]         bpl tora2
13370
302f : a203             [ 2]         ldx #3
13371
3031 : b518             [ 4] tora3   lda zpOR,x
13372
3033 : 850c             [ 3]         sta zpt
13373
                                     set_ax  absORa,$ff
13374
                            >            load_flag $ff
13375
3035 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13376
                            >
13377
3037 : 48               [ 3]>            pha         ;use stack to load status
13378
3038 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13379
303b : 28               [ 4]>            plp
13380
 
13381
303c : 050c             [ 3]         ora zpt
13382
                                     tst_ax  absrlo,absflo,$ff-fnz
13383
303e : 08               [ 3]>            php         ;save flags
13384
303f : dd5302           [ 4]>            cmp absrlo,x    ;test result
13385
                            >            trap_ne
13386
3042 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13387
                            >
13388
3044 : 68               [ 4]>            pla         ;load status
13389
                            >            eor_flag $ff-fnz
13390
3045 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13391
                            >
13392
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  232
13393
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13394
 
13395
3047 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13396
                            >            trap_ne     ;
13397
304a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13398
                            >
13399
 
13400
304c : ca               [ 2]         dex
13401
304d : 10e2             [ 3]         bpl tora3
13402
 
13403
304f : a203             [ 2]         ldx #3      ;abs
13404
3051 : b518             [ 4] tora4   lda zpOR,x
13405
3053 : 8d0302           [ 4]         sta abst
13406
                                     set_ax  absORa,0
13407
                            >            load_flag 0
13408
3056 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13409
                            >
13410
3058 : 48               [ 3]>            pha         ;use stack to load status
13411
3059 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13412
305c : 28               [ 4]>            plp
13413
 
13414
305d : 0d0302           [ 4]         ora abst
13415
                                     tst_ax  absrlo,absflo,0
13416
3060 : 08               [ 3]>            php         ;save flags
13417
3061 : dd5302           [ 4]>            cmp absrlo,x    ;test result
13418
                            >            trap_ne
13419
3064 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13420
                            >
13421
3066 : 68               [ 4]>            pla         ;load status
13422
                            >            eor_flag 0
13423
3067 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13424
                            >
13425
3069 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13426
                            >            trap_ne     ;
13427
306c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13428
                            >
13429
 
13430
306e : ca               [ 2]         dex
13431
306f : 10e0             [ 3]         bpl tora4
13432
3071 : a203             [ 2]         ldx #3
13433
3073 : b518             [ 4] tora5   lda zpOR,x
13434
3075 : 8d0302           [ 4]         sta abst
13435
                                     set_ax  absORa,$ff
13436
                            >            load_flag $ff
13437
3078 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13438
                            >
13439
307a : 48               [ 3]>            pha         ;use stack to load status
13440
307b : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13441
307e : 28               [ 4]>            plp
13442
 
13443
307f : 0d0302           [ 4]         ora abst
13444
                                     tst_ax  absrlo,absflo,$ff-fnz
13445
3082 : 08               [ 3]>            php         ;save flags
13446
3083 : dd5302           [ 4]>            cmp absrlo,x    ;test result
13447
                            >            trap_ne
13448
3086 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13449
                            >
13450
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  233
13451
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13452
 
13453
3088 : 68               [ 4]>            pla         ;load status
13454
                            >            eor_flag $ff-fnz
13455
3089 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13456
                            >
13457
308b : dd5702           [ 4]>            cmp absflo,x    ;test flags
13458
                            >            trap_ne     ;
13459
308e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13460
                            >
13461
 
13462
3090 : ca               [ 2]         dex
13463
3091 : 1002             [ 3]         bpl tora6
13464
 
13465
3093 : a203             [ 2]         ldx #3      ;zp,x
13466
3095 :                       tora6
13467
                                     set_ax  absORa,0
13468
                            >            load_flag 0
13469
3095 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13470
                            >
13471
3097 : 48               [ 3]>            pha         ;use stack to load status
13472
3098 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13473
309b : 28               [ 4]>            plp
13474
 
13475
309c : 1518             [ 4]         ora zpOR,x
13476
                                     tst_ax  absrlo,absflo,0
13477
309e : 08               [ 3]>            php         ;save flags
13478
309f : dd5302           [ 4]>            cmp absrlo,x    ;test result
13479
                            >            trap_ne
13480
30a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13481
                            >
13482
30a4 : 68               [ 4]>            pla         ;load status
13483
                            >            eor_flag 0
13484
30a5 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13485
                            >
13486
30a7 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13487
                            >            trap_ne     ;
13488
30aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13489
                            >
13490
 
13491
30ac : ca               [ 2]         dex
13492
30ad : 10e6             [ 3]         bpl tora6
13493
30af : a203             [ 2]         ldx #3
13494
30b1 :                       tora7
13495
                                     set_ax  absORa,$ff
13496
                            >            load_flag $ff
13497
30b1 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13498
                            >
13499
30b3 : 48               [ 3]>            pha         ;use stack to load status
13500
30b4 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13501
30b7 : 28               [ 4]>            plp
13502
 
13503
30b8 : 1518             [ 4]         ora zpOR,x
13504
                                     tst_ax  absrlo,absflo,$ff-fnz
13505
30ba : 08               [ 3]>            php         ;save flags
13506
30bb : dd5302           [ 4]>            cmp absrlo,x    ;test result
13507
                            >            trap_ne
13508
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  234
13509
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13510
 
13511
30be : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13512
                            >
13513
30c0 : 68               [ 4]>            pla         ;load status
13514
                            >            eor_flag $ff-fnz
13515
30c1 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13516
                            >
13517
30c3 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13518
                            >            trap_ne     ;
13519
30c6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13520
                            >
13521
 
13522
30c8 : ca               [ 2]         dex
13523
30c9 : 10e6             [ 3]         bpl tora7
13524
 
13525
30cb : a203             [ 2]         ldx #3      ;abs,x
13526
30cd :                       tora8
13527
                                     set_ax  absORa,0
13528
                            >            load_flag 0
13529
30cd : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13530
                            >
13531
30cf : 48               [ 3]>            pha         ;use stack to load status
13532
30d0 : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13533
30d3 : 28               [ 4]>            plp
13534
 
13535
30d4 : 1d3b02           [ 4]         ora absOR,x
13536
                                     tst_ax  absrlo,absflo,0
13537
30d7 : 08               [ 3]>            php         ;save flags
13538
30d8 : dd5302           [ 4]>            cmp absrlo,x    ;test result
13539
                            >            trap_ne
13540
30db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13541
                            >
13542
30dd : 68               [ 4]>            pla         ;load status
13543
                            >            eor_flag 0
13544
30de : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13545
                            >
13546
30e0 : dd5702           [ 4]>            cmp absflo,x    ;test flags
13547
                            >            trap_ne     ;
13548
30e3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13549
                            >
13550
 
13551
30e5 : ca               [ 2]         dex
13552
30e6 : 10e5             [ 3]         bpl tora8
13553
30e8 : a203             [ 2]         ldx #3
13554
30ea :                       tora9
13555
                                     set_ax  absORa,$ff
13556
                            >            load_flag $ff
13557
30ea : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13558
                            >
13559
30ec : 48               [ 3]>            pha         ;use stack to load status
13560
30ed : bd4702           [ 4]>            lda absORa,x    ;precharge accu
13561
30f0 : 28               [ 4]>            plp
13562
 
13563
30f1 : 1d3b02           [ 4]         ora absOR,x
13564
                                     tst_ax  absrlo,absflo,$ff-fnz
13565
30f4 : 08               [ 3]>            php         ;save flags
13566
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  235
13567
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13568
 
13569
30f5 : dd5302           [ 4]>            cmp absrlo,x    ;test result
13570
                            >            trap_ne
13571
30f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13572
                            >
13573
30fa : 68               [ 4]>            pla         ;load status
13574
                            >            eor_flag $ff-fnz
13575
30fb : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13576
                            >
13577
30fd : dd5702           [ 4]>            cmp absflo,x    ;test flags
13578
                            >            trap_ne     ;
13579
3100 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13580
                            >
13581
 
13582
3102 : ca               [ 2]         dex
13583
3103 : 10e5             [ 4]         bpl tora9
13584
 
13585
3105 : a003             [ 2]         ldy #3      ;abs,y
13586
3107 :                       tora10
13587
                                     set_ay  absORa,0
13588
                            >            load_flag 0
13589
3107 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13590
                            >
13591
3109 : 48               [ 3]>            pha         ;use stack to load status
13592
310a : b94702           [ 4]>            lda absORa,y    ;precharge accu
13593
310d : 28               [ 4]>            plp
13594
 
13595
310e : 193b02           [ 4]         ora absOR,y
13596
                                     tst_ay  absrlo,absflo,0
13597
3111 : 08               [ 3]>            php         ;save flags
13598
3112 : d95302           [ 4]>            cmp absrlo,y    ;test result
13599
                            >            trap_ne     ;
13600
3115 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13601
                            >
13602
3117 : 68               [ 4]>            pla         ;load status
13603
                            >            eor_flag 0
13604
3118 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13605
                            >
13606
311a : d95702           [ 4]>            cmp absflo,y    ;test flags
13607
                            >            trap_ne
13608
311d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13609
                            >
13610
 
13611
311f : 88               [ 2]         dey
13612
3120 : 10e5             [ 3]         bpl tora10
13613
3122 : a003             [ 2]         ldy #3
13614
3124 :                       tora11
13615
                                     set_ay  absORa,$ff
13616
                            >            load_flag $ff
13617
3124 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13618
                            >
13619
3126 : 48               [ 3]>            pha         ;use stack to load status
13620
3127 : b94702           [ 4]>            lda absORa,y    ;precharge accu
13621
312a : 28               [ 4]>            plp
13622
 
13623
312b : 193b02           [ 4]         ora absOR,y
13624
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  236
13625
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13626
 
13627
                                     tst_ay  absrlo,absflo,$ff-fnz
13628
312e : 08               [ 3]>            php         ;save flags
13629
312f : d95302           [ 4]>            cmp absrlo,y    ;test result
13630
                            >            trap_ne     ;
13631
3132 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13632
                            >
13633
3134 : 68               [ 4]>            pla         ;load status
13634
                            >            eor_flag $ff-fnz
13635
3135 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13636
                            >
13637
3137 : d95702           [ 4]>            cmp absflo,y    ;test flags
13638
                            >            trap_ne
13639
313a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13640
                            >
13641
 
13642
313c : 88               [ 2]         dey
13643
313d : 10e5             [ 3]         bpl tora11
13644
 
13645
313f : a206             [ 2]         ldx #6      ;(zp,x)
13646
3141 : a003             [ 2]         ldy #3
13647
3143 :                       tora12
13648
                                     set_ay  absORa,0
13649
                            >            load_flag 0
13650
3143 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13651
                            >
13652
3145 : 48               [ 3]>            pha         ;use stack to load status
13653
3146 : b94702           [ 4]>            lda absORa,y    ;precharge accu
13654
3149 : 28               [ 4]>            plp
13655
 
13656
314a : 014a             [ 6]         ora (indOR,x)
13657
                                     tst_ay  absrlo,absflo,0
13658
314c : 08               [ 3]>            php         ;save flags
13659
314d : d95302           [ 4]>            cmp absrlo,y    ;test result
13660
                            >            trap_ne     ;
13661
3150 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13662
                            >
13663
3152 : 68               [ 4]>            pla         ;load status
13664
                            >            eor_flag 0
13665
3153 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13666
                            >
13667
3155 : d95702           [ 4]>            cmp absflo,y    ;test flags
13668
                            >            trap_ne
13669
3158 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13670
                            >
13671
 
13672
315a : ca               [ 2]         dex
13673
315b : ca               [ 2]         dex
13674
315c : 88               [ 2]         dey
13675
315d : 10e4             [ 3]         bpl tora12
13676
315f : a206             [ 2]         ldx #6
13677
3161 : a003             [ 2]         ldy #3
13678
3163 :                       tora13
13679
                                     set_ay  absORa,$ff
13680
                            >            load_flag $ff
13681
3163 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13682
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  237
13683
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13684
 
13685
                            >
13686
3165 : 48               [ 3]>            pha         ;use stack to load status
13687
3166 : b94702           [ 4]>            lda absORa,y    ;precharge accu
13688
3169 : 28               [ 4]>            plp
13689
 
13690
316a : 014a             [ 6]         ora (indOR,x)
13691
                                     tst_ay  absrlo,absflo,$ff-fnz
13692
316c : 08               [ 3]>            php         ;save flags
13693
316d : d95302           [ 4]>            cmp absrlo,y    ;test result
13694
                            >            trap_ne     ;
13695
3170 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13696
                            >
13697
3172 : 68               [ 4]>            pla         ;load status
13698
                            >            eor_flag $ff-fnz
13699
3173 : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13700
                            >
13701
3175 : d95702           [ 4]>            cmp absflo,y    ;test flags
13702
                            >            trap_ne
13703
3178 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13704
                            >
13705
 
13706
317a : ca               [ 2]         dex
13707
317b : ca               [ 2]         dex
13708
317c : 88               [ 2]         dey
13709
317d : 10e4             [ 3]         bpl tora13
13710
 
13711
317f : a003             [ 2]         ldy #3      ;(zp),y
13712
3181 :                       tora14
13713
                                     set_ay  absORa,0
13714
                            >            load_flag 0
13715
3181 : a900             [ 2]>            lda #0             ;allow test to change I-flag (no mask)
13716
                            >
13717
3183 : 48               [ 3]>            pha         ;use stack to load status
13718
3184 : b94702           [ 4]>            lda absORa,y    ;precharge accu
13719
3187 : 28               [ 4]>            plp
13720
 
13721
3188 : 114a             [ 5]         ora (indOR),y
13722
                                     tst_ay  absrlo,absflo,0
13723
318a : 08               [ 3]>            php         ;save flags
13724
318b : d95302           [ 4]>            cmp absrlo,y    ;test result
13725
                            >            trap_ne     ;
13726
318e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13727
                            >
13728
3190 : 68               [ 4]>            pla         ;load status
13729
                            >            eor_flag 0
13730
3191 : 4930             [ 2]>            eor #0|fao         ;invert expected flags + always on bits
13731
                            >
13732
3193 : d95702           [ 4]>            cmp absflo,y    ;test flags
13733
                            >            trap_ne
13734
3196 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13735
                            >
13736
 
13737
3198 : 88               [ 2]         dey
13738
3199 : 10e6             [ 3]         bpl tora14
13739
319b : a003             [ 2]         ldy #3
13740
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  238
13741
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13742
 
13743
319d :                       tora15
13744
                                     set_ay  absORa,$ff
13745
                            >            load_flag $ff
13746
319d : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
13747
                            >
13748
319f : 48               [ 3]>            pha         ;use stack to load status
13749
31a0 : b94702           [ 4]>            lda absORa,y    ;precharge accu
13750
31a3 : 28               [ 4]>            plp
13751
 
13752
31a4 : 114a             [ 5]         ora (indOR),y
13753
                                     tst_ay  absrlo,absflo,$ff-fnz
13754
31a6 : 08               [ 3]>            php         ;save flags
13755
31a7 : d95302           [ 4]>            cmp absrlo,y    ;test result
13756
                            >            trap_ne     ;
13757
31aa : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13758
                            >
13759
31ac : 68               [ 4]>            pla         ;load status
13760
                            >            eor_flag $ff-fnz
13761
31ad : 497d             [ 2]>            eor #$ff-fnz|fao         ;invert expected flags + always on bits
13762
                            >
13763
31af : d95702           [ 4]>            cmp absflo,y    ;test flags
13764
                            >            trap_ne
13765
31b2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13766
                            >
13767
 
13768
31b4 : 88               [ 2]         dey
13769
31b5 : 10e6             [ 3]         bpl tora15
13770
                                 if I_flag = 3
13771
31b7 : 58               [ 2]         cli
13772
                                 endif
13773
 
13774
31b8 :                       bin_test
13775
                                 if skip_bin_test = 1
13776
31b8 : 4c2032           [ 3]         jmp dec_test
13777
                                 else
13778
                                     lda #test_num
13779
                                     sta test_case
13780
                                 endif
13781
 
13782
                                     next_test
13783
31bb : ad0002           [ 4]>            lda test_case   ;previous test
13784
31be : c928             [ 2]>            cmp #test_num
13785
                            >            trap_ne         ;test is out of sequence
13786
31c0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13787
                            >
13788
0029 =                      >test_num = test_num + 1
13789
31c2 : a929             [ 2]>            lda #test_num   ;*** this tests' number
13790
31c4 : 8d0002           [ 4]>            sta test_case
13791
                            >            ;check_ram       ;uncomment to find altered RAM after each test
13792
 
13793
 
13794
 
13795
                             ; full binary add/subtract test
13796
                             ; iterates through all combinations of operands and carry input
13797
                             ; uses increments/decrements to predict result & result flags
13798
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  239
13799
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13800
 
13801
31c7 : d8               [ 2]         cld
13802
31c8 : a20e             [ 2]         ldx #ad2        ;for indexed test
13803
31ca : a0ff             [ 2]         ldy #$ff        ;max range
13804
31cc : a900             [ 2]         lda #0          ;start with adding zeroes & no carry
13805
31ce : 850c             [ 3]         sta adfc        ;carry in - for diag
13806
31d0 : 850d             [ 3]         sta ad1         ;operand 1 - accumulator
13807
31d2 : 850e             [ 3]         sta ad2         ;operand 2 - memory or immediate
13808
31d4 : 8d0302           [ 4]         sta ada2        ;non zp
13809
31d7 : 850f             [ 3]         sta adrl        ;expected result bits 0-7
13810
31d9 : 8510             [ 3]         sta adrh        ;expected result bit 8 (carry out)
13811
31db : a9ff             [ 2]         lda #$ff        ;complemented operand 2 for subtract
13812
31dd : 8512             [ 3]         sta sb2
13813
31df : 8d0402           [ 4]         sta sba2        ;non zp
13814
31e2 : a902             [ 2]         lda #2          ;expected Z-flag
13815
31e4 : 8511             [ 3]         sta adrf
13816
31e6 : 18               [ 2] tadd    clc             ;test with carry clear
13817
31e7 : 200334           [ 6]         jsr chkadd
13818
31ea : e60c             [ 5]         inc adfc        ;now with carry
13819
31ec : e60f             [ 5]         inc adrl        ;result +1
13820
31ee : 08               [ 3]         php             ;save N & Z from low result
13821
31ef : 08               [ 3]         php
13822
31f0 : 68               [ 4]         pla             ;accu holds expected flags
13823
31f1 : 2982             [ 2]         and #$82        ;mask N & Z
13824
31f3 : 28               [ 4]         plp
13825
31f4 : d002             [ 3]         bne tadd1
13826
31f6 : e610             [ 5]         inc adrh        ;result bit 8 - carry
13827
31f8 : 0510             [ 3] tadd1   ora adrh        ;merge C to expected flags
13828
31fa : 8511             [ 3]         sta adrf        ;save expected flags except overflow
13829
31fc : 38               [ 2]         sec             ;test with carry set
13830
31fd : 200334           [ 6]         jsr chkadd
13831
3200 : c60c             [ 5]         dec adfc        ;same for operand +1 but no carry
13832
3202 : e60d             [ 5]         inc ad1
13833
3204 : d0e0             [ 4]         bne tadd        ;iterate op1
13834
3206 : a900             [ 2]         lda #0          ;preset result to op2 when op1 = 0
13835
3208 : 8510             [ 3]         sta adrh
13836
320a : ee0302           [ 6]         inc ada2
13837
320d : e60e             [ 5]         inc ad2
13838
320f : 08               [ 3]         php             ;save NZ as operand 2 becomes the new result
13839
3210 : 68               [ 4]         pla
13840
3211 : 2982             [ 2]         and #$82        ;mask N00000Z0
13841
3213 : 8511             [ 3]         sta adrf        ;no need to check carry as we are adding to 0
13842
3215 : c612             [ 5]         dec sb2         ;complement subtract operand 2
13843
3217 : ce0402           [ 6]         dec sba2
13844
321a : a50e             [ 3]         lda ad2
13845
321c : 850f             [ 3]         sta adrl
13846
321e : d0c6             [ 4]         bne tadd        ;iterate op2
13847
 
13848
3220 :                       dec_test
13849
                                 if skip_dec_test = 1
13850
3220 : 4ccf32           [ 3]         jmp success
13851
                                 else
13852
                                     lda #test_num
13853
                                     sta test_case
13854
                                 endif
13855
 
13856
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  240
13857
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13858
 
13859
                                     next_test
13860
3223 : ad0002           [ 4]>            lda test_case   ;previous test
13861
3226 : c929             [ 2]>            cmp #test_num
13862
                            >            trap_ne         ;test is out of sequence
13863
3228 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13864
                            >
13865
002a =                      >test_num = test_num + 1
13866
322a : a92a             [ 2]>            lda #test_num   ;*** this tests' number
13867
322c : 8d0002           [ 4]>            sta test_case
13868
                            >            ;check_ram       ;uncomment to find altered RAM after each test
13869
 
13870
 
13871
                             ; decimal add/subtract test
13872
                             ; *** WARNING - tests documented behavior only! ***
13873
                             ;   only valid BCD operands are tested, N V Z flags are ignored
13874
                             ; iterates through all valid combinations of operands and carry input
13875
                             ; uses increments/decrements to predict result & carry flag
13876
322f : f8               [ 2]         sed
13877
3230 : a20e             [ 2]         ldx #ad2        ;for indexed test
13878
3232 : a0ff             [ 2]         ldy #$ff        ;max range
13879
3234 : a999             [ 2]         lda #$99        ;start with adding 99 to 99 with carry
13880
3236 : 850d             [ 3]         sta ad1         ;operand 1 - accumulator
13881
3238 : 850e             [ 3]         sta ad2         ;operand 2 - memory or immediate
13882
323a : 8d0302           [ 4]         sta ada2        ;non zp
13883
323d : 850f             [ 3]         sta adrl        ;expected result bits 0-7
13884
323f : a901             [ 2]         lda #1          ;set carry in & out
13885
3241 : 850c             [ 3]         sta adfc        ;carry in - for diag
13886
3243 : 8510             [ 3]         sta adrh        ;expected result bit 8 (carry out)
13887
3245 : a900             [ 2]         lda #0          ;complemented operand 2 for subtract
13888
3247 : 8512             [ 3]         sta sb2
13889
3249 : 8d0402           [ 4]         sta sba2        ;non zp
13890
324c : 38               [ 2] tdad    sec             ;test with carry set
13891
324d : 20d232           [ 6]         jsr chkdad
13892
3250 : c60c             [ 5]         dec adfc        ;now with carry clear
13893
3252 : a50f             [ 3]         lda adrl        ;decimal adjust result
13894
3254 : d008             [ 3]         bne tdad1       ;skip clear carry & preset result 99 (9A-1)
13895
3256 : c610             [ 5]         dec adrh
13896
3258 : a999             [ 2]         lda #$99
13897
325a : 850f             [ 3]         sta adrl
13898
325c : d012             [ 3]         bne tdad3
13899
325e : 290f             [ 2] tdad1   and #$f         ;lower nibble mask
13900
3260 : d00c             [ 3]         bne tdad2       ;no decimal adjust needed
13901
3262 : c60f             [ 5]         dec adrl        ;decimal adjust (?0-6)
13902
3264 : c60f             [ 5]         dec adrl
13903
3266 : c60f             [ 5]         dec adrl
13904
3268 : c60f             [ 5]         dec adrl
13905
326a : c60f             [ 5]         dec adrl
13906
326c : c60f             [ 5]         dec adrl
13907
326e : c60f             [ 5] tdad2   dec adrl        ;result -1
13908
3270 : 18               [ 2] tdad3   clc             ;test with carry clear
13909
3271 : 20d232           [ 6]         jsr chkdad
13910
3274 : e60c             [ 5]         inc adfc        ;same for operand -1 but with carry
13911
3276 : a50d             [ 3]         lda ad1         ;decimal adjust operand 1
13912
3278 : f015             [ 3]         beq tdad5       ;iterate operand 2
13913
327a : 290f             [ 2]         and #$f         ;lower nibble mask
13914
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  241
13915
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13916
 
13917
327c : d00c             [ 3]         bne tdad4       ;skip decimal adjust
13918
327e : c60d             [ 5]         dec ad1         ;decimal adjust (?0-6)
13919
3280 : c60d             [ 5]         dec ad1
13920
3282 : c60d             [ 5]         dec ad1
13921
3284 : c60d             [ 5]         dec ad1
13922
3286 : c60d             [ 5]         dec ad1
13923
3288 : c60d             [ 5]         dec ad1
13924
328a : c60d             [ 5] tdad4   dec ad1         ;operand 1 -1
13925
328c : 4c4c32           [ 3]         jmp tdad        ;iterate op1
13926
 
13927
328f : a999             [ 2] tdad5   lda #$99        ;precharge op1 max
13928
3291 : 850d             [ 3]         sta ad1
13929
3293 : a50e             [ 3]         lda ad2         ;decimal adjust operand 2
13930
3295 : f030             [ 3]         beq tdad7       ;end of iteration
13931
3297 : 290f             [ 2]         and #$f         ;lower nibble mask
13932
3299 : d018             [ 3]         bne tdad6       ;skip decimal adjust
13933
329b : c60e             [ 5]         dec ad2         ;decimal adjust (?0-6)
13934
329d : c60e             [ 5]         dec ad2
13935
329f : c60e             [ 5]         dec ad2
13936
32a1 : c60e             [ 5]         dec ad2
13937
32a3 : c60e             [ 5]         dec ad2
13938
32a5 : c60e             [ 5]         dec ad2
13939
32a7 : e612             [ 5]         inc sb2         ;complemented decimal adjust for subtract (?9+6)
13940
32a9 : e612             [ 5]         inc sb2
13941
32ab : e612             [ 5]         inc sb2
13942
32ad : e612             [ 5]         inc sb2
13943
32af : e612             [ 5]         inc sb2
13944
32b1 : e612             [ 5]         inc sb2
13945
32b3 : c60e             [ 5] tdad6   dec ad2         ;operand 2 -1
13946
32b5 : e612             [ 5]         inc sb2         ;complemented operand for subtract
13947
32b7 : a512             [ 3]         lda sb2
13948
32b9 : 8d0402           [ 4]         sta sba2        ;copy as non zp operand
13949
32bc : a50e             [ 3]         lda ad2
13950
32be : 8d0302           [ 4]         sta ada2        ;copy as non zp operand
13951
32c1 : 850f             [ 3]         sta adrl        ;new result since op1+carry=00+carry +op2=op2
13952
32c3 : e610             [ 5]         inc adrh        ;result carry
13953
32c5 : d085             [ 3]         bne tdad        ;iterate op2
13954
32c7 : d8               [ 2] tdad7   cld
13955
 
13956
32c8 : ad0002           [ 4]         lda test_case
13957
32cb : c92a             [ 2]         cmp #test_num
13958
                                     trap_ne         ;test is out of sequence
13959
32cd : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13960
 
13961
 
13962
                             ; final RAM integrity test
13963
                             ;   verifies that none of the previous tests has altered RAM outside of the
13964
                             ;   designated write areas.
13965
                                     check_ram
13966
                            >            ;RAM check disabled - RAM size not set
13967
 
13968
                             ; *** DEBUG INFO ***
13969
                             ; to debug checksum errors uncomment check_ram in the next_test macro to
13970
                             ; narrow down the responsible opcode.
13971
                             ; may give false errors when monitor, OS or other background activity is
13972
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  242
13973
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
13974
 
13975
                             ; allowed during previous tests.
13976
 
13977
 
13978
 
13979
                             ; S U C C E S S ************************************************
13980
                             ; -------------
13981
32cf : 4c0004           [ 3] success jmp start       ;if you get here everything went well
13982
                             ; -------------
13983
                             ; S U C C E S S ************************************************
13984
 
13985
                             ; core subroutine of the decimal add/subtract test
13986
                             ; *** WARNING - tests documented behavior only! ***
13987
                             ;   only valid BCD operands are tested, N V Z flags are ignored
13988
                             ; iterates through all valid combinations of operands and carry input
13989
                             ; uses increments/decrements to predict result & carry flag
13990
32d2 :                       chkdad
13991
                             ; decimal ADC / SBC zp
13992
32d2 : 08               [ 3]         php             ;save carry for subtract
13993
32d3 : a50d             [ 3]         lda ad1
13994
32d5 : 650e             [ 3]         adc ad2         ;perform add
13995
32d7 : 08               [ 3]         php
13996
32d8 : c50f             [ 3]         cmp adrl        ;check result
13997
                                     trap_ne         ;bad result
13998
32da : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
13999
 
14000
32dc : 68               [ 4]         pla             ;check flags
14001
32dd : 2901             [ 2]         and #1          ;mask carry
14002
32df : c510             [ 3]         cmp adrh
14003
                                     trap_ne         ;bad carry
14004
32e1 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14005
 
14006
32e3 : 28               [ 4]         plp
14007
32e4 : 08               [ 3]         php             ;save carry for next add
14008
32e5 : a50d             [ 3]         lda ad1
14009
32e7 : e512             [ 3]         sbc sb2         ;perform subtract
14010
32e9 : 08               [ 3]         php
14011
32ea : c50f             [ 3]         cmp adrl        ;check result
14012
                                     trap_ne         ;bad result
14013
32ec : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14014
 
14015
32ee : 68               [ 4]         pla             ;check flags
14016
32ef : 2901             [ 2]         and #1          ;mask carry
14017
32f1 : c510             [ 3]         cmp adrh
14018
                                     trap_ne         ;bad flags
14019
32f3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14020
 
14021
32f5 : 28               [ 4]         plp
14022
                             ; decimal ADC / SBC abs
14023
32f6 : 08               [ 3]         php             ;save carry for subtract
14024
32f7 : a50d             [ 3]         lda ad1
14025
32f9 : 6d0302           [ 4]         adc ada2        ;perform add
14026
32fc : 08               [ 3]         php
14027
32fd : c50f             [ 3]         cmp adrl        ;check result
14028
                                     trap_ne         ;bad result
14029
32ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14030
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  243
14031
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14032
 
14033
 
14034
3301 : 68               [ 4]         pla             ;check flags
14035
3302 : 2901             [ 2]         and #1          ;mask carry
14036
3304 : c510             [ 3]         cmp adrh
14037
                                     trap_ne         ;bad carry
14038
3306 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14039
 
14040
3308 : 28               [ 4]         plp
14041
3309 : 08               [ 3]         php             ;save carry for next add
14042
330a : a50d             [ 3]         lda ad1
14043
330c : ed0402           [ 4]         sbc sba2        ;perform subtract
14044
330f : 08               [ 3]         php
14045
3310 : c50f             [ 3]         cmp adrl        ;check result
14046
                                     trap_ne         ;bad result
14047
3312 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14048
 
14049
3314 : 68               [ 4]         pla             ;check flags
14050
3315 : 2901             [ 2]         and #1          ;mask carry
14051
3317 : c510             [ 3]         cmp adrh
14052
                                     trap_ne         ;bad carry
14053
3319 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14054
 
14055
331b : 28               [ 4]         plp
14056
                             ; decimal ADC / SBC #
14057
331c : 08               [ 3]         php             ;save carry for subtract
14058
331d : a50e             [ 3]         lda ad2
14059
331f : 8d2533           [ 4]         sta chkdadi     ;self modify immediate
14060
3322 : a50d             [ 3]         lda ad1
14061
3325 =                       chkdadi = * + 1         ;operand of the immediate ADC
14062
3324 : 6900             [ 2]         adc #0          ;perform add
14063
3326 : 08               [ 3]         php
14064
3327 : c50f             [ 3]         cmp adrl        ;check result
14065
                                     trap_ne         ;bad result
14066
3329 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14067
 
14068
332b : 68               [ 4]         pla             ;check flags
14069
332c : 2901             [ 2]         and #1          ;mask carry
14070
332e : c510             [ 3]         cmp adrh
14071
                                     trap_ne         ;bad carry
14072
3330 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14073
 
14074
3332 : 28               [ 4]         plp
14075
3333 : 08               [ 3]         php             ;save carry for next add
14076
3334 : a512             [ 3]         lda sb2
14077
3336 : 8d3c33           [ 4]         sta chkdsbi     ;self modify immediate
14078
3339 : a50d             [ 3]         lda ad1
14079
333c =                       chkdsbi = * + 1         ;operand of the immediate SBC
14080
333b : e900             [ 2]         sbc #0          ;perform subtract
14081
333d : 08               [ 3]         php
14082
333e : c50f             [ 3]         cmp adrl        ;check result
14083
                                     trap_ne         ;bad result
14084
3340 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14085
 
14086
3342 : 68               [ 4]         pla             ;check flags
14087
3343 : 2901             [ 2]         and #1          ;mask carry
14088
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  244
14089
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14090
 
14091
3345 : c510             [ 3]         cmp adrh
14092
                                     trap_ne         ;bad carry
14093
3347 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14094
 
14095
3349 : 28               [ 4]         plp
14096
                             ; decimal ADC / SBC zp,x
14097
334a : 08               [ 3]         php             ;save carry for subtract
14098
334b : a50d             [ 3]         lda ad1
14099
334d : 7500             [ 4]         adc 0,x         ;perform add
14100
334f : 08               [ 3]         php
14101
3350 : c50f             [ 3]         cmp adrl        ;check result
14102
                                     trap_ne         ;bad result
14103
3352 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14104
 
14105
3354 : 68               [ 4]         pla             ;check flags
14106
3355 : 2901             [ 2]         and #1          ;mask carry
14107
3357 : c510             [ 3]         cmp adrh
14108
                                     trap_ne         ;bad carry
14109
3359 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14110
 
14111
335b : 28               [ 4]         plp
14112
335c : 08               [ 3]         php             ;save carry for next add
14113
335d : a50d             [ 3]         lda ad1
14114
335f : f504             [ 4]         sbc sb2-ad2,x   ;perform subtract
14115
3361 : 08               [ 3]         php
14116
3362 : c50f             [ 3]         cmp adrl        ;check result
14117
                                     trap_ne         ;bad result
14118
3364 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14119
 
14120
3366 : 68               [ 4]         pla             ;check flags
14121
3367 : 2901             [ 2]         and #1          ;mask carry
14122
3369 : c510             [ 3]         cmp adrh
14123
                                     trap_ne         ;bad carry
14124
336b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14125
 
14126
336d : 28               [ 4]         plp
14127
                             ; decimal ADC / SBC abs,x
14128
336e : 08               [ 3]         php             ;save carry for subtract
14129
336f : a50d             [ 3]         lda ad1
14130
3371 : 7df501           [ 4]         adc ada2-ad2,x  ;perform add
14131
3374 : 08               [ 3]         php
14132
3375 : c50f             [ 3]         cmp adrl        ;check result
14133
                                     trap_ne         ;bad result
14134
3377 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14135
 
14136
3379 : 68               [ 4]         pla             ;check flags
14137
337a : 2901             [ 2]         and #1          ;mask carry
14138
337c : c510             [ 3]         cmp adrh
14139
                                     trap_ne         ;bad carry
14140
337e : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14141
 
14142
3380 : 28               [ 4]         plp
14143
3381 : 08               [ 3]         php             ;save carry for next add
14144
3382 : a50d             [ 3]         lda ad1
14145
3384 : fdf601           [ 4]         sbc sba2-ad2,x  ;perform subtract
14146
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  245
14147
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14148
 
14149
3387 : 08               [ 3]         php
14150
3388 : c50f             [ 3]         cmp adrl        ;check result
14151
                                     trap_ne         ;bad result
14152
338a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14153
 
14154
338c : 68               [ 4]         pla             ;check flags
14155
338d : 2901             [ 2]         and #1          ;mask carry
14156
338f : c510             [ 3]         cmp adrh
14157
                                     trap_ne         ;bad carry
14158
3391 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14159
 
14160
3393 : 28               [ 4]         plp
14161
                             ; decimal ADC / SBC abs,y
14162
3394 : 08               [ 3]         php             ;save carry for subtract
14163
3395 : a50d             [ 3]         lda ad1
14164
3397 : 790401           [ 4]         adc ada2-$ff,y  ;perform add
14165
339a : 08               [ 3]         php
14166
339b : c50f             [ 3]         cmp adrl        ;check result
14167
                                     trap_ne         ;bad result
14168
339d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14169
 
14170
339f : 68               [ 4]         pla             ;check flags
14171
33a0 : 2901             [ 2]         and #1          ;mask carry
14172
33a2 : c510             [ 3]         cmp adrh
14173
                                     trap_ne         ;bad carry
14174
33a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14175
 
14176
33a6 : 28               [ 4]         plp
14177
33a7 : 08               [ 3]         php             ;save carry for next add
14178
33a8 : a50d             [ 3]         lda ad1
14179
33aa : f90501           [ 4]         sbc sba2-$ff,y  ;perform subtract
14180
33ad : 08               [ 3]         php
14181
33ae : c50f             [ 3]         cmp adrl        ;check result
14182
                                     trap_ne         ;bad result
14183
33b0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14184
 
14185
33b2 : 68               [ 4]         pla             ;check flags
14186
33b3 : 2901             [ 2]         and #1          ;mask carry
14187
33b5 : c510             [ 3]         cmp adrh
14188
                                     trap_ne         ;bad carry
14189
33b7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14190
 
14191
33b9 : 28               [ 4]         plp
14192
                             ; decimal ADC / SBC (zp,x)
14193
33ba : 08               [ 3]         php             ;save carry for subtract
14194
33bb : a50d             [ 3]         lda ad1
14195
33bd : 6144             [ 6]         adc (lo adi2-ad2,x) ;perform add
14196
33bf : 08               [ 3]         php
14197
33c0 : c50f             [ 3]         cmp adrl        ;check result
14198
                                     trap_ne         ;bad result
14199
33c2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14200
 
14201
33c4 : 68               [ 4]         pla             ;check flags
14202
33c5 : 2901             [ 2]         and #1          ;mask carry
14203
33c7 : c510             [ 3]         cmp adrh
14204
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  246
14205
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14206
 
14207
                                     trap_ne         ;bad carry
14208
33c9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14209
 
14210
33cb : 28               [ 4]         plp
14211
33cc : 08               [ 3]         php             ;save carry for next add
14212
33cd : a50d             [ 3]         lda ad1
14213
33cf : e146             [ 6]         sbc (lo sbi2-ad2,x) ;perform subtract
14214
33d1 : 08               [ 3]         php
14215
33d2 : c50f             [ 3]         cmp adrl        ;check result
14216
                                     trap_ne         ;bad result
14217
33d4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14218
 
14219
33d6 : 68               [ 4]         pla             ;check flags
14220
33d7 : 2901             [ 2]         and #1          ;mask carry
14221
33d9 : c510             [ 3]         cmp adrh
14222
                                     trap_ne         ;bad carry
14223
33db : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14224
 
14225
33dd : 28               [ 4]         plp
14226
                             ; decimal ADC / SBC (abs),y
14227
33de : 08               [ 3]         php             ;save carry for subtract
14228
33df : a50d             [ 3]         lda ad1
14229
33e1 : 7156             [ 5]         adc (adiy2),y   ;perform add
14230
33e3 : 08               [ 3]         php
14231
33e4 : c50f             [ 3]         cmp adrl        ;check result
14232
                                     trap_ne         ;bad result
14233
33e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14234
 
14235
33e8 : 68               [ 4]         pla             ;check flags
14236
33e9 : 2901             [ 2]         and #1          ;mask carry
14237
33eb : c510             [ 3]         cmp adrh
14238
                                     trap_ne         ;bad carry
14239
33ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14240
 
14241
33ef : 28               [ 4]         plp
14242
33f0 : 08               [ 3]         php             ;save carry for next add
14243
33f1 : a50d             [ 3]         lda ad1
14244
33f3 : f158             [ 5]         sbc (sbiy2),y   ;perform subtract
14245
33f5 : 08               [ 3]         php
14246
33f6 : c50f             [ 3]         cmp adrl        ;check result
14247
                                     trap_ne         ;bad result
14248
33f8 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14249
 
14250
33fa : 68               [ 4]         pla             ;check flags
14251
33fb : 2901             [ 2]         and #1          ;mask carry
14252
33fd : c510             [ 3]         cmp adrh
14253
                                     trap_ne         ;bad carry
14254
33ff : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14255
 
14256
3401 : 28               [ 4]         plp
14257
3402 : 60               [ 6]         rts
14258
 
14259
                             ; core subroutine of the full binary add/subtract test
14260
                             ; iterates through all combinations of operands and carry input
14261
                             ; uses increments/decrements to predict result & result flags
14262
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  247
14263
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14264
 
14265
3403 : a511             [ 3] chkadd  lda adrf        ;add V-flag if overflow
14266
3405 : 2983             [ 2]         and #$83        ;keep N-----ZC / clear V
14267
3407 : 48               [ 3]         pha
14268
3408 : a50d             [ 3]         lda ad1         ;test sign unequal between operands
14269
340a : 450e             [ 3]         eor ad2
14270
340c : 300a             [ 3]         bmi ckad1       ;no overflow possible - operands have different sign
14271
340e : a50d             [ 3]         lda ad1         ;test sign equal between operands and result
14272
3410 : 450f             [ 3]         eor adrl
14273
3412 : 1004             [ 3]         bpl ckad1       ;no overflow occured - operand and result have same sign
14274
3414 : 68               [ 4]         pla
14275
3415 : 0940             [ 2]         ora #$40        ;set V
14276
3417 : 48               [ 3]         pha
14277
3418 : 68               [ 4] ckad1   pla
14278
3419 : 8511             [ 3]         sta adrf        ;save expected flags
14279
                             ; binary ADC / SBC zp
14280
341b : 08               [ 3]         php             ;save carry for subtract
14281
341c : a50d             [ 3]         lda ad1
14282
341e : 650e             [ 3]         adc ad2         ;perform add
14283
3420 : 08               [ 3]         php
14284
3421 : c50f             [ 3]         cmp adrl        ;check result
14285
                                     trap_ne         ;bad result
14286
3423 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14287
 
14288
3425 : 68               [ 4]         pla             ;check flags
14289
3426 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14290
3428 : c511             [ 3]         cmp adrf
14291
                                     trap_ne         ;bad flags
14292
342a : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14293
 
14294
342c : 28               [ 4]         plp
14295
342d : 08               [ 3]         php             ;save carry for next add
14296
342e : a50d             [ 3]         lda ad1
14297
3430 : e512             [ 3]         sbc sb2         ;perform subtract
14298
3432 : 08               [ 3]         php
14299
3433 : c50f             [ 3]         cmp adrl        ;check result
14300
                                     trap_ne         ;bad result
14301
3435 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14302
 
14303
3437 : 68               [ 4]         pla             ;check flags
14304
3438 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14305
343a : c511             [ 3]         cmp adrf
14306
                                     trap_ne         ;bad flags
14307
343c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14308
 
14309
343e : 28               [ 4]         plp
14310
                             ; binary ADC / SBC abs
14311
343f : 08               [ 3]         php             ;save carry for subtract
14312
3440 : a50d             [ 3]         lda ad1
14313
3442 : 6d0302           [ 4]         adc ada2        ;perform add
14314
3445 : 08               [ 3]         php
14315
3446 : c50f             [ 3]         cmp adrl        ;check result
14316
                                     trap_ne         ;bad result
14317
3448 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14318
 
14319
344a : 68               [ 4]         pla             ;check flags
14320
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  248
14321
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14322
 
14323
344b : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14324
344d : c511             [ 3]         cmp adrf
14325
                                     trap_ne         ;bad flags
14326
344f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14327
 
14328
3451 : 28               [ 4]         plp
14329
3452 : 08               [ 3]         php             ;save carry for next add
14330
3453 : a50d             [ 3]         lda ad1
14331
3455 : ed0402           [ 4]         sbc sba2        ;perform subtract
14332
3458 : 08               [ 3]         php
14333
3459 : c50f             [ 3]         cmp adrl        ;check result
14334
                                     trap_ne         ;bad result
14335
345b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14336
 
14337
345d : 68               [ 4]         pla             ;check flags
14338
345e : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14339
3460 : c511             [ 3]         cmp adrf
14340
                                     trap_ne         ;bad flags
14341
3462 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14342
 
14343
3464 : 28               [ 4]         plp
14344
                             ; binary ADC / SBC #
14345
3465 : 08               [ 3]         php             ;save carry for subtract
14346
3466 : a50e             [ 3]         lda ad2
14347
3468 : 8d6e34           [ 4]         sta chkadi      ;self modify immediate
14348
346b : a50d             [ 3]         lda ad1
14349
346e =                       chkadi  = * + 1         ;operand of the immediate ADC
14350
346d : 6900             [ 2]         adc #0          ;perform add
14351
346f : 08               [ 3]         php
14352
3470 : c50f             [ 3]         cmp adrl        ;check result
14353
                                     trap_ne         ;bad result
14354
3472 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14355
 
14356
3474 : 68               [ 4]         pla             ;check flags
14357
3475 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14358
3477 : c511             [ 3]         cmp adrf
14359
                                     trap_ne         ;bad flags
14360
3479 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14361
 
14362
347b : 28               [ 4]         plp
14363
347c : 08               [ 3]         php             ;save carry for next add
14364
347d : a512             [ 3]         lda sb2
14365
347f : 8d8534           [ 4]         sta chksbi      ;self modify immediate
14366
3482 : a50d             [ 3]         lda ad1
14367
3485 =                       chksbi  = * + 1         ;operand of the immediate SBC
14368
3484 : e900             [ 2]         sbc #0          ;perform subtract
14369
3486 : 08               [ 3]         php
14370
3487 : c50f             [ 3]         cmp adrl        ;check result
14371
                                     trap_ne         ;bad result
14372
3489 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14373
 
14374
348b : 68               [ 4]         pla             ;check flags
14375
348c : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14376
348e : c511             [ 3]         cmp adrf
14377
                                     trap_ne         ;bad flags
14378
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  249
14379
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14380
 
14381
3490 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14382
 
14383
3492 : 28               [ 4]         plp
14384
                             ; binary ADC / SBC zp,x
14385
3493 : 08               [ 3]         php             ;save carry for subtract
14386
3494 : a50d             [ 3]         lda ad1
14387
3496 : 7500             [ 4]         adc 0,x         ;perform add
14388
3498 : 08               [ 3]         php
14389
3499 : c50f             [ 3]         cmp adrl        ;check result
14390
                                     trap_ne         ;bad result
14391
349b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14392
 
14393
349d : 68               [ 4]         pla             ;check flags
14394
349e : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14395
34a0 : c511             [ 3]         cmp adrf
14396
                                     trap_ne         ;bad flags
14397
34a2 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14398
 
14399
34a4 : 28               [ 4]         plp
14400
34a5 : 08               [ 3]         php             ;save carry for next add
14401
34a6 : a50d             [ 3]         lda ad1
14402
34a8 : f504             [ 4]         sbc sb2-ad2,x   ;perform subtract
14403
34aa : 08               [ 3]         php
14404
34ab : c50f             [ 3]         cmp adrl        ;check result
14405
                                     trap_ne         ;bad result
14406
34ad : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14407
 
14408
34af : 68               [ 4]         pla             ;check flags
14409
34b0 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14410
34b2 : c511             [ 3]         cmp adrf
14411
                                     trap_ne         ;bad flags
14412
34b4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14413
 
14414
34b6 : 28               [ 4]         plp
14415
                             ; binary ADC / SBC abs,x
14416
34b7 : 08               [ 3]         php             ;save carry for subtract
14417
34b8 : a50d             [ 3]         lda ad1
14418
34ba : 7df501           [ 4]         adc ada2-ad2,x  ;perform add
14419
34bd : 08               [ 3]         php
14420
34be : c50f             [ 3]         cmp adrl        ;check result
14421
                                     trap_ne         ;bad result
14422
34c0 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14423
 
14424
34c2 : 68               [ 4]         pla             ;check flags
14425
34c3 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14426
34c5 : c511             [ 3]         cmp adrf
14427
                                     trap_ne         ;bad flags
14428
34c7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14429
 
14430
34c9 : 28               [ 4]         plp
14431
34ca : 08               [ 3]         php             ;save carry for next add
14432
34cb : a50d             [ 3]         lda ad1
14433
34cd : fdf601           [ 4]         sbc sba2-ad2,x  ;perform subtract
14434
34d0 : 08               [ 3]         php
14435
34d1 : c50f             [ 3]         cmp adrl        ;check result
14436
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  250
14437
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14438
 
14439
                                     trap_ne         ;bad result
14440
34d3 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14441
 
14442
34d5 : 68               [ 4]         pla             ;check flags
14443
34d6 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14444
34d8 : c511             [ 3]         cmp adrf
14445
                                     trap_ne         ;bad flags
14446
34da : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14447
 
14448
34dc : 28               [ 4]         plp
14449
                             ; binary ADC / SBC abs,y
14450
34dd : 08               [ 3]         php             ;save carry for subtract
14451
34de : a50d             [ 3]         lda ad1
14452
34e0 : 790401           [ 4]         adc ada2-$ff,y  ;perform add
14453
34e3 : 08               [ 3]         php
14454
34e4 : c50f             [ 3]         cmp adrl        ;check result
14455
                                     trap_ne         ;bad result
14456
34e6 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14457
 
14458
34e8 : 68               [ 4]         pla             ;check flags
14459
34e9 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14460
34eb : c511             [ 3]         cmp adrf
14461
                                     trap_ne         ;bad flags
14462
34ed : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14463
 
14464
34ef : 28               [ 4]         plp
14465
34f0 : 08               [ 3]         php             ;save carry for next add
14466
34f1 : a50d             [ 3]         lda ad1
14467
34f3 : f90501           [ 4]         sbc sba2-$ff,y  ;perform subtract
14468
34f6 : 08               [ 3]         php
14469
34f7 : c50f             [ 3]         cmp adrl        ;check result
14470
                                     trap_ne         ;bad result
14471
34f9 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14472
 
14473
34fb : 68               [ 4]         pla             ;check flags
14474
34fc : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14475
34fe : c511             [ 3]         cmp adrf
14476
                                     trap_ne         ;bad flags
14477
3500 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14478
 
14479
3502 : 28               [ 4]         plp
14480
                             ; binary ADC / SBC (zp,x)
14481
3503 : 08               [ 3]         php             ;save carry for subtract
14482
3504 : a50d             [ 3]         lda ad1
14483
3506 : 6144             [ 6]         adc (lo adi2-ad2,x) ;perform add
14484
3508 : 08               [ 3]         php
14485
3509 : c50f             [ 3]         cmp adrl        ;check result
14486
                                     trap_ne         ;bad result
14487
350b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14488
 
14489
350d : 68               [ 4]         pla             ;check flags
14490
350e : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14491
3510 : c511             [ 3]         cmp adrf
14492
                                     trap_ne         ;bad flags
14493
3512 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14494
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  251
14495
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14496
 
14497
 
14498
3514 : 28               [ 4]         plp
14499
3515 : 08               [ 3]         php             ;save carry for next add
14500
3516 : a50d             [ 3]         lda ad1
14501
3518 : e146             [ 6]         sbc (lo sbi2-ad2,x) ;perform subtract
14502
351a : 08               [ 3]         php
14503
351b : c50f             [ 3]         cmp adrl        ;check result
14504
                                     trap_ne         ;bad result
14505
351d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14506
 
14507
351f : 68               [ 4]         pla             ;check flags
14508
3520 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14509
3522 : c511             [ 3]         cmp adrf
14510
                                     trap_ne         ;bad flags
14511
3524 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14512
 
14513
3526 : 28               [ 4]         plp
14514
                             ; binary ADC / SBC (abs),y
14515
3527 : 08               [ 3]         php             ;save carry for subtract
14516
3528 : a50d             [ 3]         lda ad1
14517
352a : 7156             [ 5]         adc (adiy2),y   ;perform add
14518
352c : 08               [ 3]         php
14519
352d : c50f             [ 3]         cmp adrl        ;check result
14520
                                     trap_ne         ;bad result
14521
352f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14522
 
14523
3531 : 68               [ 4]         pla             ;check flags
14524
3532 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14525
3534 : c511             [ 3]         cmp adrf
14526
                                     trap_ne         ;bad flags
14527
3536 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14528
 
14529
3538 : 28               [ 4]         plp
14530
3539 : 08               [ 3]         php             ;save carry for next add
14531
353a : a50d             [ 3]         lda ad1
14532
353c : f158             [ 5]         sbc (sbiy2),y   ;perform subtract
14533
353e : 08               [ 3]         php
14534
353f : c50f             [ 3]         cmp adrl        ;check result
14535
                                     trap_ne         ;bad result
14536
3541 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14537
 
14538
3543 : 68               [ 4]         pla             ;check flags
14539
3544 : 29c3             [ 2]         and #$c3        ;mask NV----ZC
14540
3546 : c511             [ 3]         cmp adrf
14541
                                     trap_ne         ;bad flags
14542
3548 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14543
 
14544
354a : 28               [ 4]         plp
14545
354b : 60               [ 6]         rts
14546
 
14547
                             ; target for the jump absolute test
14548
354c : 88               [ 2]         dey
14549
354d : 88               [ 2]         dey
14550
354e :                       test_far
14551
354e : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
14552
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  252
14553
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14554
 
14555
354f : 88               [ 2]         dey
14556
3550 : 88               [ 2]         dey
14557
3551 : 88               [ 2]         dey
14558
3552 : 28               [ 4]         plp
14559
                                     trap_cs         ;flags loaded?
14560
3553 : b0fe             [ 3]>        bcs *           ;failed carry set
14561
 
14562
                                     trap_vs
14563
3555 : 70fe             [ 3]>        bvs *           ;failed overflow set
14564
 
14565
                                     trap_mi
14566
3557 : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
14567
 
14568
                                     trap_eq
14569
3559 : f0fe             [ 3]>        beq *           ;failed equal (zero)
14570
 
14571
355b : c946             [ 2]         cmp #'F'        ;registers loaded?
14572
                                     trap_ne
14573
355d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14574
 
14575
355f : e041             [ 2]         cpx #'A'
14576
                                     trap_ne
14577
3561 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14578
 
14579
3563 : c04f             [ 2]         cpy #('R'-3)
14580
                                     trap_ne
14581
3565 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14582
 
14583
3567 : 48               [ 3]         pha             ;save a,x
14584
3568 : 8a               [ 2]         txa
14585
3569 : 48               [ 3]         pha
14586
356a : ba               [ 2]         tsx
14587
356b : e0fd             [ 2]         cpx #$fd        ;check SP
14588
                                     trap_ne
14589
356d : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14590
 
14591
356f : 68               [ 4]         pla             ;restore x
14592
3570 : aa               [ 2]         tax
14593
                                     set_stat $ff
14594
                            >            load_flag $ff
14595
3571 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
14596
                            >
14597
3573 : 48               [ 3]>            pha         ;use stack to load status
14598
3574 : 28               [ 4]>            plp
14599
 
14600
3575 : 68               [ 4]         pla             ;restore a
14601
3576 : e8               [ 2]         inx             ;return registers with modifications
14602
3577 : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1
14603
3579 : 4cf707           [ 3]         jmp far_ret
14604
 
14605
                             ; target for the jump indirect test
14606
                                     align
14607
357c : 8535                  ptr_tst_ind dw test_ind
14608
357e : 4c08                  ptr_ind_ret dw ind_ret
14609
                                     trap            ;runover protection
14610
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  253
14611
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14612
 
14613
3580 : 4c8035           [ 3]>        jmp *           ;failed anyway
14614
 
14615
3583 : 88               [ 2]         dey
14616
3584 : 88               [ 2]         dey
14617
3585 :                       test_ind
14618
3585 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
14619
3586 : 88               [ 2]         dey
14620
3587 : 88               [ 2]         dey
14621
3588 : 88               [ 2]         dey
14622
3589 : 28               [ 4]         plp
14623
                                     trap_cs         ;flags loaded?
14624
358a : b0fe             [ 3]>        bcs *           ;failed carry set
14625
 
14626
                                     trap_vs
14627
358c : 70fe             [ 3]>        bvs *           ;failed overflow set
14628
 
14629
                                     trap_mi
14630
358e : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
14631
 
14632
                                     trap_eq
14633
3590 : f0fe             [ 3]>        beq *           ;failed equal (zero)
14634
 
14635
3592 : c949             [ 2]         cmp #'I'        ;registers loaded?
14636
                                     trap_ne
14637
3594 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14638
 
14639
3596 : e04e             [ 2]         cpx #'N'
14640
                                     trap_ne
14641
3598 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14642
 
14643
359a : c041             [ 2]         cpy #('D'-3)
14644
                                     trap_ne
14645
359c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14646
 
14647
359e : 48               [ 3]         pha             ;save a,x
14648
359f : 8a               [ 2]         txa
14649
35a0 : 48               [ 3]         pha
14650
35a1 : ba               [ 2]         tsx
14651
35a2 : e0fd             [ 2]         cpx #$fd        ;check SP
14652
                                     trap_ne
14653
35a4 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14654
 
14655
35a6 : 68               [ 4]         pla             ;restore x
14656
35a7 : aa               [ 2]         tax
14657
                                     set_stat $ff
14658
                            >            load_flag $ff
14659
35a8 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
14660
                            >
14661
35aa : 48               [ 3]>            pha         ;use stack to load status
14662
35ab : 28               [ 4]>            plp
14663
 
14664
35ac : 68               [ 4]         pla             ;restore a
14665
35ad : e8               [ 2]         inx             ;return registers with modifications
14666
35ae : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1
14667
35b0 : 6c7e35           [ 6]         jmp (ptr_ind_ret)
14668
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  254
14669
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14670
 
14671
                                     trap            ;runover protection
14672
35b3 : 4cb335           [ 3]>        jmp *           ;failed anyway
14673
 
14674
 
14675
                             ; target for the jump subroutine test
14676
35b6 : 88               [ 2]         dey
14677
35b7 : 88               [ 2]         dey
14678
35b8 :                       test_jsr
14679
35b8 : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
14680
35b9 : 88               [ 2]         dey
14681
35ba : 88               [ 2]         dey
14682
35bb : 88               [ 2]         dey
14683
35bc : 28               [ 4]         plp
14684
                                     trap_cs         ;flags loaded?
14685
35bd : b0fe             [ 3]>        bcs *           ;failed carry set
14686
 
14687
                                     trap_vs
14688
35bf : 70fe             [ 3]>        bvs *           ;failed overflow set
14689
 
14690
                                     trap_mi
14691
35c1 : 30fe             [ 3]>        bmi *           ;failed minus (bit 7 set)
14692
 
14693
                                     trap_eq
14694
35c3 : f0fe             [ 3]>        beq *           ;failed equal (zero)
14695
 
14696
35c5 : c94a             [ 2]         cmp #'J'        ;registers loaded?
14697
                                     trap_ne
14698
35c7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14699
 
14700
35c9 : e053             [ 2]         cpx #'S'
14701
                                     trap_ne
14702
35cb : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14703
 
14704
35cd : c04f             [ 2]         cpy #('R'-3)
14705
                                     trap_ne
14706
35cf : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14707
 
14708
35d1 : 48               [ 3]         pha             ;save a,x
14709
35d2 : 8a               [ 2]         txa
14710
35d3 : 48               [ 3]         pha
14711
35d4 : ba               [ 2]         tsx             ;sp -4? (return addr,a,x)
14712
35d5 : e0fb             [ 2]         cpx #$fb
14713
                                     trap_ne
14714
35d7 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14715
 
14716
35d9 : adff01           [ 4]         lda $1ff        ;propper return on stack
14717
35dc : c908             [ 2]         cmp #hi(jsr_ret)
14718
                                     trap_ne
14719
35de : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14720
 
14721
35e0 : adfe01           [ 4]         lda $1fe
14722
35e3 : c982             [ 2]         cmp #lo(jsr_ret)
14723
                                     trap_ne
14724
35e5 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14725
 
14726
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  255
14727
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14728
 
14729
                                     set_stat $ff
14730
                            >            load_flag $ff
14731
35e7 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
14732
                            >
14733
35e9 : 48               [ 3]>            pha         ;use stack to load status
14734
35ea : 28               [ 4]>            plp
14735
 
14736
35eb : 68               [ 4]         pla             ;pull x,a
14737
35ec : aa               [ 2]         tax
14738
35ed : 68               [ 4]         pla
14739
35ee : e8               [ 2]         inx             ;return registers with modifications
14740
35ef : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1
14741
35f1 : 60               [ 6]         rts
14742
                                     trap            ;runover protection
14743
35f2 : 4cf235           [ 3]>        jmp *           ;failed anyway
14744
 
14745
 
14746
                             ;trap in case of unexpected IRQ, NMI, BRK, RESET - BRK test target
14747
35f5 :                       nmi_trap
14748
                                     trap            ;check stack for conditions at NMI
14749
35f5 : 4cf535           [ 3]>        jmp *           ;failed anyway
14750
 
14751
35f8 :                       res_trap
14752
                                     trap            ;unexpected RESET
14753
35f8 : 4cf835           [ 3]>        jmp *           ;failed anyway
14754
 
14755
 
14756
35fb : 88               [ 2]         dey
14757
35fc : 88               [ 2]         dey
14758
35fd :                       irq_trap                ;BRK test or unextpected BRK or IRQ
14759
35fd : 08               [ 3]         php             ;either SP or Y count will fail, if we do not hit
14760
35fe : 88               [ 2]         dey
14761
35ff : 88               [ 2]         dey
14762
3600 : 88               [ 2]         dey
14763
                                     ;next 4 traps could be caused by unexpected BRK or IRQ
14764
                                     ;check stack for BREAK and originating location
14765
                                     ;possible jump/branch into weeds (uninitialized space)
14766
3601 : c942             [ 2]         cmp #'B'        ;registers loaded?
14767
                                     trap_ne
14768
3603 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14769
 
14770
3605 : e052             [ 2]         cpx #'R'
14771
                                     trap_ne
14772
3607 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14773
 
14774
3609 : c048             [ 2]         cpy #('K'-3)
14775
                                     trap_ne
14776
360b : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14777
 
14778
360d : 850a             [ 3]         sta irq_a       ;save registers during break test
14779
360f : 860b             [ 3]         stx irq_x
14780
3611 : ba               [ 2]         tsx             ;test break on stack
14781
3612 : bd0201           [ 4]         lda $102,x
14782
                                     cmp_flag 0      ;break test should have B=1
14783
3615 : c930             [ 2]>            cmp #(0      |fao)&m8    ;expected flags + always on bits
14784
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  256
14785
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14786
 
14787
 
14788
                                     trap_ne         ; - no break flag on stack
14789
3617 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14790
 
14791
3619 : 68               [ 4]         pla
14792
361a : c934             [ 2]         cmp #$34        ;should have added interrupt disable
14793
                                     trap_ne
14794
361c : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14795
 
14796
361e : ba               [ 2]         tsx
14797
361f : e0fc             [ 2]         cpx #$fc        ;sp -3? (return addr, flags)
14798
                                     trap_ne
14799
3621 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14800
 
14801
3623 : adff01           [ 4]         lda $1ff        ;propper return on stack
14802
3626 : c908             [ 2]         cmp #hi(brk_ret)
14803
                                     trap_ne
14804
3628 : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14805
 
14806
362a : adfe01           [ 4]         lda $1fe
14807
                             ;        cmp #lo(brk_ret)
14808
362d : c9b8             [ 2]         cmp #lo(brk_ret - 1)    ; M65C02 treats JSR and traps (NMI, BRK/IRQ, RST) the same; add one to
14809
                                     trap_ne
14810
362f : d0fe             [ 3]>        bne *           ;failed not equal (non zero)
14811
 
14812
                                     set_stat $ff
14813
                            >            load_flag $ff
14814
3631 : a9ff             [ 2]>            lda #$ff             ;allow test to change I-flag (no mask)
14815
                            >
14816
3633 : 48               [ 3]>            pha         ;use stack to load status
14817
3634 : 28               [ 4]>            plp
14818
 
14819
3635 : a60b             [ 3]         ldx irq_x
14820
3637 : e8               [ 2]         inx             ;return registers with modifications
14821
3638 : a50a             [ 3]         lda irq_a
14822
363a : 49aa             [ 2]         eor #$aa        ;N=1, V=1, Z=0, C=1 but original flags should be restored
14823
363c : 40               [ 6]         rti
14824
                                     trap            ;runover protection
14825
363d : 4c3d36           [ 3]>        jmp *           ;failed anyway
14826
 
14827
 
14828
                             ;copy of data to initialize BSS segment
14829
                                 if load_data_direct != 1
14830
                             zp_init
14831
                             zp1_    db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
14832
                             zp7f_   db  $7f             ;test pattern for compare
14833
                             ;logical zeropage operands
14834
                             zpOR_   db  0,$1f,$71,$80   ;test pattern for OR
14835
                             zpAN_   db  $0f,$ff,$7f,$80 ;test pattern for AND
14836
                             zpEO_   db  $ff,$0f,$8f,$8f ;test pattern for EOR
14837
                             ;indirect addressing pointers
14838
                             ind1_   dw  abs1            ;indirect pointer to pattern in absolute memory
14839
                                     dw  abs1+1
14840
                                     dw  abs1+2
14841
                                     dw  abs1+3
14842
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  257
14843
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14844
 
14845
                                     dw  abs7f
14846
                             inw1_   dw  abs1-$f8        ;indirect pointer for wrap-test pattern
14847
                             indt_   dw  abst            ;indirect pointer to store area in absolute memory
14848
                                     dw  abst+1
14849
                                     dw  abst+2
14850
                                     dw  abst+3
14851
                             inwt_   dw  abst-$f8        ;indirect pointer for wrap-test store
14852
                             indAN_  dw  absAN           ;indirect pointer to AND pattern in absolute memory
14853
                                     dw  absAN+1
14854
                                     dw  absAN+2
14855
                                     dw  absAN+3
14856
                             indEO_  dw  absEO           ;indirect pointer to EOR pattern in absolute memory
14857
                                     dw  absEO+1
14858
                                     dw  absEO+2
14859
                                     dw  absEO+3
14860
                             indOR_  dw  absOR           ;indirect pointer to OR pattern in absolute memory
14861
                                     dw  absOR+1
14862
                                     dw  absOR+2
14863
                                     dw  absOR+3
14864
                             ;add/subtract indirect pointers
14865
                             adi2_   dw  ada2            ;indirect pointer to operand 2 in absolute memory
14866
                             sbi2_   dw  sba2            ;indirect pointer to complemented operand 2 (SBC)
14867
                             adiy2_  dw  ada2-$ff        ;with offset for indirect indexed
14868
                             sbiy2_  dw  sba2-$ff
14869
                             zp_end
14870
                                 if (zp_end - zp_init) != (zp_bss_end - zp_bss)
14871
                                     ;force assembler error if size is different
14872
                                     ERROR ERROR ERROR   ;mismatch between bss and zeropage data
14873
                                 endif
14874
                             data_init
14875
                             abs1_   db  $c3,$82,$41,0   ;test patterns for LDx BIT ROL ROR ASL LSR
14876
                             abs7f_  db  $7f             ;test pattern for compare
14877
                             ;loads
14878
                             fLDx_   db  fn,fn,0,fz      ;expected flags for load
14879
                             ;shifts
14880
                             rASL_                       ;expected result ASL & ROL -carry
14881
                             rROL_   db  $86,$04,$82,0   ; "
14882
                             rROLc_  db  $87,$05,$83,1   ;expected result ROL +carry
14883
                             rLSR_                       ;expected result LSR & ROR -carry
14884
                             rROR_   db  $61,$41,$20,0   ; "
14885
                             rRORc_  db  $e1,$c1,$a0,$80 ;expected result ROR +carry
14886
                             fASL_                       ;expected flags for shifts
14887
                             fROL_   db  fnc,fc,fn,fz    ;no carry in
14888
                             fROLc_  db  fnc,fc,fn,0     ;carry in
14889
                             fLSR_
14890
                             fROR_   db  fc,0,fc,fz      ;no carry in
14891
                             fRORc_  db  fnc,fn,fnc,fn   ;carry in
14892
                             ;increments (decrements)
14893
                             rINC_   db  $7f,$80,$ff,0,1 ;expected result for INC/DEC
14894
                             fINC_   db  0,fn,fn,fz,0    ;expected flags for INC/DEC
14895
                             ;logical memory operand
14896
                             absOR_  db  0,$1f,$71,$80   ;test pattern for OR
14897
                             absAN_  db  $0f,$ff,$7f,$80 ;test pattern for AND
14898
                             absEO_  db  $ff,$0f,$8f,$8f ;test pattern for EOR
14899
                             ;logical accu operand
14900
AS65 Assembler for R6502 [1.42].  Copyright 1994-2007, Frank A. Kingswood                                                 Page  258
14901
---------------------------------------------------------- 65c02_ft.a65 -----------------------------------------------------------
14902
 
14903
                             absORa_ db  0,$f1,$1f,0     ;test pattern for OR
14904
                             absANa_ db  $f0,$ff,$ff,$ff ;test pattern for AND
14905
                             absEOa_ db  $ff,$f0,$f0,$0f ;test pattern for EOR
14906
                             ;logical results
14907
                             absrlo_ db  0,$ff,$7f,$80
14908
                             absflo_ db  fz,fn,0,fn
14909
                             data_end
14910
                                 if (data_end - data_init) != (data_bss_end - data_bss)
14911
                                     ;force assembler error if size is different
14912
                                     ERROR ERROR ERROR   ;mismatch between bss and data
14913
                                 endif
14914
 
14915
                             vec_init
14916
                                     dw  nmi_trap
14917
                                     dw  res_trap
14918
                                     dw  irq_trap
14919
                             vec_bss equ $fffa
14920
                                 endif                   ;end of RAM init data
14921
 
14922
                                 if (load_data_direct = 1) & (ROM_vectors = 1)
14923
fffa =                               org $fffa       ;vectors
14924
fffa : f535                          dw  nmi_trap
14925
fffc : f835                          dw  res_trap
14926
fffe : fd35                          dw  irq_trap
14927
                                 endif
14928
 
14929
fffa =                               end start
14930
 
14931
No errors in pass 2.
14932
Wrote binary from address $0000 through $ffff.
14933
Total size 65536 bytes.
14934
Program start address is at $0400 (1024).
14935
 

powered by: WebSVN 2.1.0

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