-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path6502bf.fbf
More file actions
3119 lines (2752 loc) · 55 KB
/
Copy path6502bf.fbf
File metadata and controls
3119 lines (2752 loc) · 55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- This is a 6502 emulator written in FuckBrainFuck (http://inshame.blogspot.com/search/label/My%20Progs%3A%20FuckBrainfuck)
-- It can therefore be compiled to BrainFuck code.
-- Copyright 2020 by Massimiliano "Maxi" Zattera
-- In order to work, this code assumes 16 bit unsigned cells with wrapping.
-- VERSION 5
-- -----------
-- Improves on V4
#linebreaks 72
#linemode DOS
-- -----------------------------------------------------------------------------------
-- MAIN VARIABLES
-- -----------------------------------------------------------------------------------
-- If TRUE, keep running
#dim running
-- Instruction Register with opcode to execute
#dim IR
-- Address of operand used in instructions
#dim operand_addr
-- CPU "ticks" (indeed it counts number of instructions being executed, for performance reasons)
#dim ticLo ticHi
-- 6502 registers
#dim P A X Y S
#dim N_flag V_flag I_flag Z_flag C_flag D_flag status
-- If not 0, signals a critical error that must terminate execution
-- 1 unsupported opcode
-- 2 unsupported BCD math operation
-- 3 unsupported SYSCALL code (illegal opcode $42 causes execution of a "SYStem CALL" which behavior depends on byte following illegal opcode).
-- 4 an infinite loop has been detected (JMP or JSR to itself).
#dim exception
-- -----------------------------------------------------------------------------------
-- SOME CONSTANTS
-- -----------------------------------------------------------------------------------
-- Used to pass fixed values to block calls (which require variables)
#dim CONST_1
set CONST_1 1
#dim CONST_64
set CONST_64 64
#dim CONST_128
set CONST_128 128
#dim CONST_255
set CONST_255 255
#dim CONST_FF00
set CONST_FF00 65280
-- -----------------------------------------------------------------------------------
-- CODE BLOCKS
-- -----------------------------------------------------------------------------------
#dim _doIf _doElse _ifCond _ifIR
-- Below blocks are used to implement an if...then...else statement that checks condition based on the value of IR register.
-- These blocks are used to speed up execution, rather then checking all opcodes one by one.
-- THis is needed because FBF lacks if...then...else and switch statements
-- IF (IR == _ifCond) THEN ...
#block _if_IR_eq_cond
copy IR _ifIR
moveto _doIf
brainfuck [-]+>[-] _doIf=1; _doElse=0;
brainfuck >[->-<] _ifCond = 0; _ifIR=_ifIR minus _ifCond
brainfuck >[<<+<->>>[-]] if (_ifIR != 0) {_doIf=0; _doElse=1; _ifIR=0}; pos in _ifCond
brainfuck <<<[ if (_doIf == 1)
returnfrom _doIf
#endblock
-- ... ELSE ...
#block _else
moveto _doElse
brainfuck [-]<[-] _doIf = _doElse = 0 (could have changed in the IF body) pos in _doIf
brainfuck ] end if clause
brainfuck >[ if (_doElse == 1)
returnfrom _doElse
#endblock
-- ... END if statement
#block _endif
moveto _doElse
brainfuck [-]] _doElse = 0 (could have changed in the ELSE body); end else clause
returnfrom _doElse
#endblock
-- ------------------
-- BITWISE FUNCTIONS
-- ------------------
-- Implementation of bitwise operations.
-- Original code: https://codegolf.stackexchange.com/questions/9178/bitwise-operators-in-brainfuck
-- Work area for the bitwise algorithms.
-- See each block to see how much workarea total they need
-- These MUST be consecutive cell for the algorithm to work
#dim _bw_c0 _bw_c1 _bw_c2 _bw_c3 _bw_c4 _bw_c5
#custom 53
-- Resets the working area for the bitwise algorithms.
-- This works only for 16 bit cells, 32 bit cells ill require a bigger workign area.
-- The implementation is a bit verbose (clears 59 cells), but we prefer to do it fast.
#block _clean_bw_wa
moveto _bw_c0
brainfuck [-]>[-]>[-]>[-]>[-]> [-]>[-]>[-]>[-]>[-]>
brainfuck [-]>[-]>[-]>[-]>[-]> [-]>[-]>[-]>[-]>[-]>
brainfuck [-]>[-]>[-]>[-]>[-]> [-]>[-]>[-]>[-]>[-]>
brainfuck [-]>[-]>[-]>[-]>[-]> [-]>[-]>[-]>[-]>[-]>
brainfuck [-]>[-]>[-]>[-]>[-]> [-]>[-]>[-]>[-]>[-]>
brainfuck [-]>[-]>[-]>[-]>[-]> [-]>[-]>[-]>[-]>
brainfuck <<<<< <<<<<
brainfuck <<<<< <<<<<
brainfuck <<<<< <<<<<
brainfuck <<<<< <<<<<
brainfuck <<<<< <<<<<
brainfuck <<<<< <<<<
returnfrom _bw_c0
#endblock
#block NOT _not_a _not_res
-- Assumes A is in cell 0, stores NOT A in cell 1, pointer starts and ends in cell 0.
-- Uses only 2 cells; notice that this algorithm will take forever for 32 bit cells.
set _bw_c1 0
copy _not_a _bw_c0
moveto _bw_c0
brainfuck +[>-<-]
returnfrom _bw_c0
copy _bw_c1 _not_res
#endblock
#block ROL _rol_a _rol_res
-- Assumes A is in cell 0, stores A ROL 1 in cell 1, pointer starts and ends in cell 0.
-- Uses 59 cells, regardless their size.
_clean_bw_wa
copy _rol_a _bw_c0
moveto _bw_c0
brainfuck [>++[>>]<[>+>]<<-]
returnfrom _bw_c0
copy _bw_c1 _rol_res
#endblock
#block OR _or_a _or_b _or_res
-- Assumes A and B are in cells 1 and 2, stores A OR B in cell 2, pointer starts in cell 0 and ends in cell 5.
-- Uses 59 16-bit cells or 106 32-bit cells.
_clean_bw_wa
copy _or_a _bw_c1
copy _or_b _bw_c2
moveto _bw_c0
brainfuck -[[>>>>>>[>>>]++[-<<<]<<<-]>]>>>[<]>[[>[>+<-]>[<<<<<<+>>>>>>[-]]>]+[<[<<<++>>>-]<<]>>]
returnfrom _bw_c5
copy _bw_c2 _or_res
#endblock
#block AND _and_a _and_b _and_res
-- Assumes A and B are in cells 1 and 2, stores A AND B in cell 4, pointer starts in cell 0 and ends in cell 5.
-- Uses 59 16-bit cells or 106 32-bit cells.
_clean_bw_wa
copy _and_a _bw_c1
copy _and_b _bw_c2
moveto _bw_c0
brainfuck -[[>>>>>>[>>>]++[-<<<]<<<-]>]>>>[<]>[[>[>[<<<<+>>>>-]<-]>+>]<[<[<<<++>>>-]<<]]
returnfrom _bw_c5
copy _bw_c4 _and_res
#endblock
#block XOR _xor_a _xor_b _xor_res
-- Assumes A and B are in cells 1 and 2, stores A XOR B in cell 2, pointer starts in cell 0 and ends in cell 5.
-- Uses 59 16-bit cells or 106 32-bit cells.
_clean_bw_wa
copy _xor_a _bw_c1
copy _xor_b _bw_c2
moveto _bw_c0
brainfuck -[[>>>>>>[>>>]++[-<<<]<<<-]>]>>>[<]>[[>[>-<-]>[<<<<<<+>>>>>>[-]]>]+[<[<<<++>>>-]<<]>>]
returnfrom _bw_c5
copy _bw_c2 _xor_res
#endblock
-- Shifts left (multiplies by 2)
-- IT FAILS IF THE RESULTS CAUSES AN OVERFLOW (but it is fast)
-- USES ONLY 2 CELLS
#block SHL _shl_a _shl_res
copy _shl_a _bw_c0
moveto _bw_c1
brainfuck [-]<[->++<]
returnfrom _bw_c0
copy _bw_c1 _shl_res
#endblock
-- Shifts left by 4 positions (multiplies by 16)
-- IT FAILS IF THE RESULTS CAUSES AN OVERFLOW (but it is fast)
-- USES ONLY 2 CELLS
#block SHL_4 _shl4_a _shl4_res
copy _shl4_a _bw_c0
moveto _bw_c1
brainfuck [-]<[->++++ ++++ ++++ ++++<]
returnfrom _bw_c0
copy _bw_c1 _shl4_res
#endblock
-- Shifts left by 7 positions (multiplies by 128)
-- IT FAILS IF THE RESULTS CAUSES AN OVERFLOW (but it is fast)
-- USES ONLY 2 CELLS
#block SHL_7 _shl7_a _shl7_res
copy _shl7_a _bw_c0
moveto _bw_c1
brainfuck [-]<[->++++ ++++ ++++ ++++<]
brainfuck >[-<++++ ++++>]
returnfrom _bw_c1
copy _bw_c0 _shl7_res
#endblock
-- Shifts left by 8 positions (multiplies by 256)
-- IT FAILS IF THE RESULTS CAUSES AN OVERFLOW (but it is fast)
-- USES ONLY 2 CELLS
#block SHL_8 _shl8_a _shl8_res
copy _shl8_a _bw_c0
moveto _bw_c1
brainfuck [-]<[->++++ ++++ ++++ ++++<]
brainfuck >[-<++++ ++++ ++++ ++++>]
returnfrom _bw_c1
copy _bw_c0 _shl8_res
#endblock
-- ------------------
-- OUTPUT
-- ------------------
-- Local variables for output blocks
#dim _outv_0 _outv_1 _outv_2 _outv_3 _outv_4
#custom 7
-- Print value of cell x as number for ANY sized cell (ie 8bit, 16bit, etc)
-- Original algorithm from: https://esolangs.org/wiki/Brainfuck_algorithms#Print_value_of_cell_x_as_number_for_ANY_sized_cell_.28ie_8bit.2C_16bit.2C_etc.29
-- Notice this uses _outv_N as working area, it expects 5 of them to be available and contogue.
#block out _o_v
-- Clean working area
moveto _outv_1
brainfuck [-]>[-]>[-]>[-]>[-]> [-]>[-]>[-]>[-]>[-]> [-]>
brainfuck <<<<< <<<<< <
returnfrom _outv_1
copy _o_v _outv_0
moveto _outv_0
brainfuck [>>+>+<<<-]>>>[<<<+>>>-]<<+>[<->[>++++++++++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]
brainfuck ++++++++[<++++++>-]>[<<+>>-]>[<<+>>-]<<]>]<[->>++++++++[<++++++>-]]<[.[-]<]<
returnfrom _outv_0
#endblock
-- Prints value of a cell (16 bit) as decimal number, then goes newline
#block out_ln _ol_v
out _ol_v
line
#endblock
-- Prints value of a cell (16 bit) as hex number
#block out16 _o16_v
msg $
copy _o16_v _outv_0
set _outv_1 4
uneq _outv_1 0
div _outv_0 4096 _outv_2
mod _outv_0 4096 _outv_0
SHL_4 _outv_0 _outv_0
inc _outv_2 '0'
comp _outv_2 '9' _outv_3
ifeq _outv_3 0
inc _outv_2 7
end
print _outv_2
dec _outv_1 1
end
#endblock
-- Prints value of a cell (16 bit) as number, then goes newline
#block out_ln16 _ol16_v
out16 _ol16_v
line
#endblock
-- Prints value of a cell (8 bit) as binary number
#block out_byte_2 _ob2_v
copy _ob2_v _outv_0
set _outv_1 8
uneq _outv_1 0
comp _outv_0 127 _outv_2
ifeq _outv_2 0
msg 1
end
ifnoteq _outv_2 0
msg 0
end
SHL _outv_0 _outv_0
mod _outv_0 256 _outv_0
dec _outv_1 1
end
#endblock
-- Prints value of a cell (8 bit) as binary number
#block out_ln_byte_2 _olb2_v
out_byte_2 _olb2_v
line
#endblock
-- Dumps 6502 registers
#block dump
line
msg P:
tab
out16 P
tab
out_ln P
msg IR:
tab
out16 IR
tab
out_ln IR
msg A:
tab
out16 A
tab
out_ln A
msg X:
tab
out16 X
tab
out_ln X
msg Y:
tab
out16 Y
tab
out_ln Y
msg SP:
tab
out16 S
tab
out_ln S
msg Status:
tab
msg NV-BDIZC
line
tab
set_status B_flag
out_byte_2 status
line
#endblock
-- --------------------
-- LOAD OPERAND ADDRESS
-- --------------------
-- Local variables
#dim _addrv_0 _addrv_1
-- Below blocks set the operand_addr variable, based on corresponding 6502 indexing mode.
-- P (program counter) is also incremented accordingly.
#block addr_immediate
inc P 1
copy P operand_addr
inc P 1
#endblock
#block addr_absolute
inc P 1
rtable mem P _addrv_1
inc P 1
rtable mem P operand_addr
SHL_8 operand_addr operand_addr
add operand_addr _addrv_1 operand_addr
inc P 1
#endblock
#block addr_zero_page
inc P 1
rtable mem P operand_addr
inc P 1
#endblock
-- Pass X or Y to be used as index
#block addr_absolute_indexed _lai_XY
inc P 1
rtable mem P _addrv_1
inc P 1
rtable mem P operand_addr
SHL_8 operand_addr operand_addr
add operand_addr _addrv_1 operand_addr
add operand_addr _lai_XY operand_addr
inc P 1
#endblock
-- Pass X or Y to be used as index
#block addr_zero_page_indexed _lzpi_XY
inc P 1
rtable mem P operand_addr
add operand_addr _lzpi_XY operand_addr
mod operand_addr 256 operand_addr
inc P 1
#endblock
#block addr_indexed_indirect_X
-- In indexed indirect addressing (referred to as (Indirect, X)),
-- the second byte of the instruction is added to the contents of the X index register,
-- discarding the carry.
inc P 1
rtable mem P _addrv_0
add _addrv_0 X _addrv_0
mod _addrv_0 256 _addrv_0
-- The result of this addition points to a memory location on page zero
-- whose contents is the low order eight bits of the effective address.
rtable mem _addrv_0 _addrv_1
-- The next memory location in page zero contains the high order eight bits
-- of the effective address. Both memory locations specifying the high and low order bytes of the
-- effective address must be in page zero.
inc _addrv_0 1
mod _addrv_0 256 _addrv_0
rtable mem _addrv_0 operand_addr
SHL_8 operand_addr operand_addr
add operand_addr _addrv_1 operand_addr
inc P 1
#endblock
#block addr_indirect_indexed_Y
-- In indirect indexed addressing (referred to as (Indirect), Y), the second byte
-- of the instruction points to a memory location in page zero.
inc P 1
rtable mem P _addrv_0
-- The contents of this memory location
-- is added to the contents of the Y index register, the result being the low order eight bits of the
-- effective address.
rtable mem _addrv_0 _addrv_1
-- The carry from this addition is added to the contents of the next page zero
-- memory location, the result being the high order eight bits of the effective address.
inc _addrv_0 1
mod _addrv_0 256 _addrv_0
rtable mem _addrv_0 operand_addr
SHL_8 operand_addr operand_addr
add operand_addr _addrv_1 operand_addr
add operand_addr Y operand_addr
inc P 1
#endblock
-- ------------------
-- STATUS & STACK
-- ------------------
-- Local variables
#dim _stsv_0 _stsv_1
-- Set "status" register, based on content of single status flags.
-- This is used to push the status register into the stack.
#block set_status
copy N_flag status
SHL status status
add V_flag status status
SHL status status
-- bit 5 is always 1
add 1 status status
SHL status status
-- B flag does not really exist in the CPU, it is pushed as 1 by BRK & PHP or 0 by IRQ / NMI
-- Always pushes B flag as 1, since we do not have hardware interrupts
add 1 status status
SHL status status
add D_flag status status
SHL status status
add I_flag status status
SHL status status
add Z_flag status status
SHL status status
add C_flag status status
#endblock
-- Set flags based on content of "status" register.
-- This is used to pop the status register from the stack.
#block set_flags
copy status _stsv_1
set C_flag 0
mod _stsv_1 2 _stsv_0
div _stsv_1 2 _stsv_1
ifnoteq _stsv_0 0
set C_flag 1
end
set Z_flag 0
mod _stsv_1 2 _stsv_0
div _stsv_1 2 _stsv_1
ifnoteq _stsv_0 0
set Z_flag 1
end
set I_flag 0
mod _stsv_1 2 _stsv_0
div _stsv_1 2 _stsv_1
ifnoteq _stsv_0 0
set I_flag 1
end
set D_flag 0
mod _stsv_1 2 _stsv_0
ifnoteq _stsv_0 0
set D_flag 1
end
-- Bit 5 and B flag are ignored
div _stsv_1 8 _stsv_1
set V_flag 0
mod _stsv_1 2 _stsv_0
div _stsv_1 2 _stsv_1
ifnoteq _stsv_0 0
set V_flag 1
end
set N_flag 0
mod _stsv_1 2 _stsv_0
ifnoteq _stsv_0 0
set N_flag 1
end
#endblock
-- Sets N flag if the argument is negative
#block update_N _un_v
set N_flag 0
comp _un_v 127 _stsv_0
ifeq _stsv_0 0
set N_flag 1
end
#endblock
-- Sets Z flag if the argument is zero
#block update_Z _uz_v
set Z_flag 0
ifeq _uz_v 0
set Z_flag 1
end
#endblock
-- Push a byte into the stack
#block push_stack _ph_b
add 256 S _stsv_0
wtable mem _stsv_0 _ph_b
dec S 1
mod S 256 S
#endblock
-- Pops a byte from the stack
#block pop_stack _pl_b
inc S 1
mod S 256 S
add 256 S _stsv_0
rtable mem _stsv_0 _pl_b
#endblock
-- ------------------
-- EMULATE 6502 CODE
-- ------------------
-- Local variables.
#dim tmp0 tmp1 tmp2 tmp3 tmp4
-- Resets CPU
#block reset
-- Loads memory, including various jump vectors
load_memory
-- In reality, the stack pointer could be anywhere on the stack after reset.
-- This seems closer to actual behavior.
set S 253
-- Loads P with reset vector
set P 0
rtable mem 65533 P
SHL_8 P P
rtable mem 65532 tmp0
add P tmp0 P
-- Clears flags
set status 0
set_flags
set A 0
set X 0
set Y 0
#endblock
-- Read instruction pointed by the program counter into IR
#block read_opcode
-- msg P:
-- out16 P
rtable mem P IR
-- space
-- msg IR:
-- out_ln16 IR
#endblock
-- If a critical error happened, handle it
#block handle_exceptions
ifnoteq exception 0
line
ifeq exception 1
line
msg *ERROR* Unrecognized opcode:
tab
out_ln IR
end
ifeq exception 2
line
msg *ERROR* BCD mode not implemented.
end
ifeq exception 3
line
msg *ERROR* Unrecognized SYSCALL opcode:
tab
rtable mem P tmp0
out_ln tmp0
end
ifeq exception 4
line
msg *LOOP* detected
end
set running FALSE
end
#endblock
-- This block is responsible for executing the instruction contained in IR
-- It uses a custom if...then...else block to make up for a similar statement or switch this are missing in FBF.
-- Looks a bit messy because of identation.
#block execute_opcode
set _ifCond 208
_if_IR_eq_cond
BNE_relative
_else
set _ifCond 173
_if_IR_eq_cond
LDA_abs
_else
set _ifCond 41
_if_IR_eq_cond
AND_imm
_else
set _ifCond 16
_if_IR_eq_cond
BPL_relative
_else
set _ifCond 168
_if_IR_eq_cond
TAY_implied
_else
set _ifCond 240
_if_IR_eq_cond
BEQ_relative
_else
set _ifCond 165
_if_IR_eq_cond
LDA_zp
_else
set _ifCond 197
_if_IR_eq_cond
CMP_zp
_else
set _ifCond 48
_if_IR_eq_cond
BMI_relative
_else
set _ifCond 32
_if_IR_eq_cond
JSR_abs
_else
set _ifCond 96
_if_IR_eq_cond
RTS_implied
_else
set _ifCond 202
_if_IR_eq_cond
DEX_implied
_else
set _ifCond 189
_if_IR_eq_cond
LDA_abs_x
_else
set _ifCond 44
_if_IR_eq_cond
BIT_abs
_else
set _ifCond 205
_if_IR_eq_cond
CMP_abs
_else
set _ifCond 201
_if_IR_eq_cond
CMP_imm
_else
set _ifCond 133
_if_IR_eq_cond
STA_zp
_else
set _ifCond 141
_if_IR_eq_cond
STA_abs
_else
set _ifCond 166
_if_IR_eq_cond
LDX_zp
_else
set _ifCond 185
_if_IR_eq_cond
LDA_abs_y
_else
set _ifCond 198
_if_IR_eq_cond
DEC_zp
_else
set _ifCond 169
_if_IR_eq_cond
LDA_imm
_else
set _ifCond 230
_if_IR_eq_cond
INC_zp
_else
set _ifCond 24
_if_IR_eq_cond
CLC_implied
_else
set _ifCond 170
_if_IR_eq_cond
TAX_implied
_else
set _ifCond 152
_if_IR_eq_cond
TYA_implied
_else
set _ifCond 138
_if_IR_eq_cond
TXA_implied
_else
set _ifCond 136
_if_IR_eq_cond
DEY_implied
_else
set _ifCond 108
_if_IR_eq_cond
JMP_(abs)
_else
set _ifCond 145
_if_IR_eq_cond
STA_(ind)_y
_else
set _ifCond 74
_if_IR_eq_cond
LSR_accum
_else
set _ifCond 9
_if_IR_eq_cond
ORA_imm
_else
set _ifCond 144
_if_IR_eq_cond
BCC_relative
_else
set _ifCond 153
_if_IR_eq_cond
STA_abs_y
_else
set _ifCond 200
_if_IR_eq_cond
INY_implied
_else
set _ifCond 181
_if_IR_eq_cond
LDA_zp_x
_else
set _ifCond 72
_if_IR_eq_cond
PHA_implied
_else
set _ifCond 104
_if_IR_eq_cond
PLA_implied
_else
set _ifCond 10
_if_IR_eq_cond
ASL_accum
_else
set _ifCond 76
_if_IR_eq_cond
JMP_abs
_else
set _ifCond 162
_if_IR_eq_cond
LDX_imm
_else
set _ifCond 157
_if_IR_eq_cond
STA_abs_x
_else
set _ifCond 177
_if_IR_eq_cond
LDA_(ind)_y
_else
set _ifCond 160
_if_IR_eq_cond
LDY_imm
_else
set _ifCond 88
_if_IR_eq_cond
CLI_implied
_else
set _ifCond 176
_if_IR_eq_cond
BCS_relative
_else
set _ifCond 102
_if_IR_eq_cond
ROR_zp
_else
set _ifCond 70
_if_IR_eq_cond
LSR_zp
_else
set _ifCond 80
_if_IR_eq_cond
BVC_relative
_else
set _ifCond 105
_if_IR_eq_cond
ADC_imm
_else
set _ifCond 174
_if_IR_eq_cond
LDX_abs
_else
set _ifCond 192
_if_IR_eq_cond
CPY_imm
_else
set _ifCond 164
_if_IR_eq_cond
LDY_zp
_else
set _ifCond 232
_if_IR_eq_cond
INX_implied
_else
set _ifCond 221
_if_IR_eq_cond
CMP_abs_x
_else
set _ifCond 120
_if_IR_eq_cond
SEI_implied
_else
set _ifCond 149
_if_IR_eq_cond
STA_zp_x
_else
set _ifCond 228
_if_IR_eq_cond
CPX_zp
_else
set _ifCond 56
_if_IR_eq_cond
SEC_implied
_else
set _ifCond 42
_if_IR_eq_cond
ROL_accum
_else
set _ifCond 233
_if_IR_eq_cond
SBC_imm
_else
set _ifCond 132
_if_IR_eq_cond
STY_zp
_else
set _ifCond 224
_if_IR_eq_cond
CPX_imm
_else
set _ifCond 134
_if_IR_eq_cond
STX_zp
_else
set _ifCond 5
_if_IR_eq_cond
ORA_zp
_else
set _ifCond 73
_if_IR_eq_cond
EOR_imm
_else
set _ifCond 109
_if_IR_eq_cond
ADC_abs
_else
set _ifCond 206
_if_IR_eq_cond
DEC_abs
_else
set _ifCond 172
_if_IR_eq_cond
LDY_abs
_else
set _ifCond 184
_if_IR_eq_cond
CLV_implied
_else
set _ifCond 125
_if_IR_eq_cond
ADC_abs_x
_else
set _ifCond 64
_if_IR_eq_cond
RTI_implied
_else
set _ifCond 101
_if_IR_eq_cond
ADC_zp
_else
set _ifCond 186
_if_IR_eq_cond
TSX_implied
_else
set _ifCond 29
_if_IR_eq_cond
ORA_abs_x
_else
set _ifCond 180
_if_IR_eq_cond
LDY_zp_x
_else
set _ifCond 222
_if_IR_eq_cond
DEC_abs_x
_else
set _ifCond 81
_if_IR_eq_cond
EOR_(ind)_y
_else
set _ifCond 237
_if_IR_eq_cond
SBC_abs
_else
set _ifCond 78
_if_IR_eq_cond
LSR_abs
_else
set _ifCond 188
_if_IR_eq_cond
LDY_abs_x
_else
set _ifCond 38
_if_IR_eq_cond
ROL_zp
_else
set _ifCond 217
_if_IR_eq_cond
CMP_abs_y
_else
set _ifCond 238
_if_IR_eq_cond