-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdisassembler.s
More file actions
718 lines (681 loc) · 17.1 KB
/
disassembler.s
File metadata and controls
718 lines (681 loc) · 17.1 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
; This file has a simple assembler and disassembler
; for 6502 code.
;
; The assembler words are the standard 6502 mnemonics
; in all uppercase, and are available from Forth.
; A tail like `.ZX` defines the addressing mode of the
; instruction.
; There are 139 instructions, so it would take a lot
; of space to include all of them in the dictionary. Instead,
; there's a table with 16 bits for each instruction, enough
; information to identify the instruction name and addressing
; mode.
.segment "TMP_CODE"
.macpack generic
.include "forth.inc"
.import DUP, FETCH, CFETCH, INCR, SWAP, DOT, DODOTQUOTE, RFIND, ASM
.importzp Stack, TMP1, TMP2, TMP3, TMP4
; To save space, the 3 letters and addressing mode of the
; instruction are stored in 4-bits each.
; Turns out we can almost fit all of the letters with
; just 16 possiblitiies for each one. (See below for the
; exceptions).
; See http://www.obelisk.me.uk/6502/addressing.html for an explanation
; of the different addressing modes.
.enum mode
impl = 0 ; no args
acc = $10 ; accumulator is arg, used for modifying instructions which can take A.
; 1 byte arg
imm = $20 ; immediate mode
rel = $30 ; relative mode, used by branch instructions
indx = $40 ; (indirect, x) addressing mode
indy = $50 ; (indirect), y addressing mode
zpg = $60 ; zero page
zpgx = $70 ; zero page, x
zpgy = $80 ; zero page, y
; 2 byte arg
ind = $90 ; (indirect), only used by jmp (indirect)
abs = $A0 ; absolute
absx = $B0 ; absolute, x
absy = $C0 ; absolute, y
.endenum
; Letters used in the instruction names.
; Checking all of the instruction names, these
; are the letters that can appear in each position
; of the name (with some exceptions).
;
; FirstLetter: .byte "ABCDEIJLNOPRSTxx"
; SecondLetter: .byte "ABCDEHILMNOPRSTV"
; ThirdLetter: .byte "ACDEIKLPQRSTVXYx"
; By re-arranging the letters, we can overlap the lists and save space:
SecondLetter:
.byte "HMV" ; only second
FirstLetter:
; Overlap of first and second
.byte "BNO"
ThirdLetter:
; Overlap of all 3
.byte "ACDEILPRST"
; Overlap of first and third
.byte "JKQ"
; Only third
.byte "VXY"
; The resulting lists look like this:
; FirstLetter: .byte "BNOACDEILPRSTJKQ"
; SecondLetter: .byte "HMVBNOACDEILPRST"
; ThirdLetter: .byte "ACDEILPRSTJKQVXY"
; Enum for first letter in an instruction
.enum l1
B
N
O
A_
C
D
E
I
L
P
R
S
T
J
K_unused
Q_unused
.endenum
; Enum for second letter in an instruction
; (Store in high nybble)
.enum l2
H = $00
M = $10
V = $20
B = $30
N = $40
O = $50
A_= $60
C = $70
D = $80
E = $90
I = $A0
L = $B0
P = $C0
R = $D0
S = $E0
T = $F0
.endenum
; Enum for third letter in an instruction
.enum l3
A_
C
D
E
I
L
P
R
S
T
J_unused
K
Q
V
X_
Y_
.endenum
message: .byte "(.')", $0A, ".byte ", $22, $0
; Handles disassembly of DODOTQUOTE, which takes
; its argument inline after the jsr DOTQUOTE
PrintString:
inx
inx
ldy #0
@loop:
lda message, y
bze @done
sta IO_PORT
iny
bne @loop
@done:
lda Stack, x
sta TMP1
lda Stack+1, x
sta TMP2
ldy #0
@loop2:
lda (TMP1), y
bze @done2
sta IO_PORT
iny
bne @loop2
@done2:
lda #'"'
sta IO_PORT
sty TMP1
sec
lda Stack, x
adc TMP1
sta Stack, x
lda Stack+1, x
adc #0
sta Stack+1, x
rts
; Prints the argument with the IP at the top of the stack,
; and a as the addressing mode, and returns the new IP.
PrintArg:
cmp #$1
ble @return ; no arg implied or accumulator instruction
pha
jsr DUP
pla
cmp #$9
bge @two ; modes >= $9 are two byte modes.
@one:
jsr INCR
jsr SWAP
jsr CFETCH
jmp DOT ; print one byte
@two:
jsr INCR
jsr INCR
jsr SWAP
jsr FETCH
; If the address is DOODOTQUOTE, then this is probably
; a JSR DODOTQUOTE call, so we should check the string
; that comes after it.
lda Stack, x
cmp #<DODOTQUOTE
bne :+
lda Stack+1, x
cmp #>DODOTQUOTE
bne :+
jmp PrintString
:
jsr RFIND
lda Stack, x
ora Stack+1, x
beq @notInDict
lda Stack+2, x
sta TMP1
lda Stack+3, x
sta TMP2
lda Stack, x
sta TMP3 ; save length in TMP3
ldy #0
@nameLoop:
lda (TMP1), y
sta IO_PORT
iny
cpy TMP3
bne @nameLoop
inx
inx
inx
inx
rts
@notInDict:
inx ; drop the zero length
inx
jmp DOT ; print just the bytes.
@return:
rts
; A lookup table for the ascii values of the
; l1, l2, and l3 enums.
LetterIndicesLo:
.byte <FirstLetter, <SecondLetter, <ThirdLetter
LetterIndicesHi:
.byte >FirstLetter, >SecondLetter, >ThirdLetter
; Given a zero-terminated string address in TMP1-2, parses the string as
; an instruction, returning the number of bytes of it takes up and the
; instruction number on the stack. Returns 0 on the stack if the instruction
; was not found.
.export ParseInstruction
ParseInstruction:
ldy #0
@instructionLoop:
lda LetterIndicesLo, y
sta TMP3
lda LetterIndicesHi, y
sta TMP4
tya
pha
lda (TMP1), y
bze @badLetter
jsr ParseLetter
bmi @badLetter
dex
sty Stack, x ; temporarily save on stack.
pla
tay
iny
cpy #3
bne @instructionLoop
; now the three bytes on the stack are the three letter indices.
lda (TMP1), y
beq @noTail
cmp #'.'
bne @notDot
iny
lda (TMP1), y ; get first letter of tail
dex
sta Stack, x ; store on stack
iny
lda (TMP1), y ; get second letter of tail
dex
sta Stack, x ; store on stack
@findMode:
ldy #0
@findModeLoop:
lda ModeBeg2, y
cmp Stack, x
bne :+
lda ModeBeg, y
cmp Stack+1, x
bne :+
sty Stack+1, x
inx ; put mode number on the stack.
bne @foundAll ; bra
:
iny
cpy #13
bne @findModeLoop ; bra
@badMode:
lda #5
pha
; fall-through
@badLetter:
pla ; get saved y value.
tay
; discard stack values.
cpy #0
beq @discardDone
@discardLoop:
inx
dey
bne @discardLoop
@discardDone:
@notDot:
lda #0
dex
dex
sta Stack, x
sta Stack+1, x
rts
@noTail:
; The three bytes bytes on the stack represent the letter indices,
; and the mode is either implied, relative, or absolute (these modes
; have no tail).
dex
lda #0
sta Stack, x
jsr CompactStack
ldy #0
@noTailLoop:
lda Instructions, y
cmp Stack+1, x
bne :+
lda Instructions_end, y
and #$F0
cmp #mode::impl
beq @ok
cmp #mode::rel
beq @ok
cmp #mode::abs
beq @ok
bne :+
@ok:
lda Instructions_end, y
and #$F
cmp Stack, x
bne :+
; Found the instruction!
beq @success
:
iny
cpy #192
bne @noTailLoop
@pushError:
lda #0
sta Stack, x
sta Stack+1, x
rts
@foundAll:
; The four bytes on the stack represent the letter indices
; and the mode.
jsr CompactStack
ldy #0
@foundAllLoop:
lda Instructions, y
cmp Stack+1, x
bne :+
lda Instructions_end, y
cmp Stack, x
bne :+
; Found the instruction!
beq @success
:
iny
cpy #192
bne @foundAllLoop
beq @pushError
@success:
; y is the instruction.
sty Stack, x
lda #0
sta Stack+1, x
dex
dex
lda #0
sta Stack+1, x
lda Instructions_end, y
lsr
lsr
lsr
lsr
cmp #1
ble @one
cmp #9
bge @three
@two:
lda #2
sta Stack, x
rts
@one:
lda #1
sta Stack, x
rts
@three:
lda #3
sta Stack, x
rts
CompactStack:
; Given four bytes on the stack are l1 l2 l3 m.
; Compact it to two bytes as 21 m3, one nibble
; for each.
lda Stack+2, x
asl
asl
asl
asl
ora Stack+3, x
sta Stack+3, x
lda Stack, x
asl
asl
asl
asl
ora Stack+1, x
sta Stack+2, x
inx
inx
rts
Illegal:
lda #'*'
sta IO_PORT ; print *
jsr DOT
lda #$0A ; '\n'
sta IO_PORT
rts
; Given a pointer to a list of up to 16 letters in TMP3-4,
; and a letter in A, returns the index of the letter in y.
; If not found, returns -1
ParseLetter:
ldy #0
@loop:
cmp (TMP3), y
beq @found
iny
cpy #16
bne @loop
ldy #$FF
@found:
rts
; After printing the instruction,
; print these characters, based on the mode.
; A zero means to print nothing.
; If the first character is non-zero, print a '.' to
; separate the mode from the instruction.
ModeBeg:
.byte 0, 'A', '#', 0, 'X', 'I', 'Z', 'Z', 'Z', 'I', 0, 'X', 'Y'
ModeBeg2:
.byte 0, 0, 0, 0, 'I', 'Y', 0, 'X', 'Y', 0, 0, 0, 0
; Given an address, prints that instruction and then
; returns the address of the next instruction.
.export Instruction
Instruction:
jsr DUP
jsr INCR
jsr SWAP
jsr CFETCH ; get the instruction byte
lda Stack, x
and #%11
cmp #%11
; All instructions which end in %11 are illegal
beq Illegal
; We can only have 16 different second letters, so
; add special cases for txa:$8A txs:$9A tya:$98
; so we eliminate X and Y as possible second letters.
lda Stack, x
ldy #0
cmp #$8A
beq @special_txa
cmp #$9A
beq @special_txs
cmp #$98
beq @special_tya
lsr
lsr
eor #$FF
sec
adc Stack, x ; Calculate ins - ins/4, because we ignore all %11 instructions
tay
lda Instructions_end, y ; get the last letter and addressing mode
pha ; save them
lda Instructions, y ; get the first two letters
pha ; save them
and #$F ; mask to get the first letter
tay
lda FirstLetter, y
sta IO_PORT
pla ; get the first two letters again
lsr
lsr
lsr
lsr
tay
lda SecondLetter, y
sta IO_PORT
pla
pha ; retrieve last letter and addressing mode
and #$F ; mask to get the last letter
tay
lda ThirdLetter, y
sta IO_PORT
pla
lsr
lsr
lsr
lsr
tay ; a is now the mode number
lda ModeBeg, y
beq :+
pha
lda #'.'
sta IO_PORT
pla
sta IO_PORT
:
lda ModeBeg2, y
beq :+
sta IO_PORT
:
lda #' '
sta IO_PORT
tya
pha
inx
inx ; drop the instruction, leaving the address of the next byte.
jsr PrintArg
pla
@newlineAndReturn:
lda #$0A ; '\n'
sta IO_PORT
rts
@special_txa:
iny
@special_tya:
iny
@special_txs:
; now y is 0 for txs, 1 for tya, and 2 for txa.
lda #'T'
sta IO_PORT
lda @special2, y
sta IO_PORT
lda @special3, y
sta IO_PORT
bne @newlineAndReturn ; bra
@special2:
.byte "XYX"
@special3:
.byte "SAA"
; The first two letters of each instruction,
; stored as a nibble each.
; Illegal instructions are represented as
; EEE because E was already present as a possible
; letter in all three positions.
; Each instruction with byte b is stored at
; index b - floor(b/4). This is because we
; skip all instructions that end with the bits
; 11, which are all illegal.
Instructions:
.byte l1::B|l2::R, l1::O|l2::R, l1::E|l2::E
.byte l1::E|l2::E, l1::O|l2::R, l1::A_|l2::S
.byte l1::P|l2::H, l1::O|l2::R, l1::A_|l2::S
.byte l1::E|l2::E, l1::O|l2::R, l1::A_|l2::S
.byte l1::B|l2::P, l1::O|l2::R, l1::E|l2::E
.byte l1::E|l2::E, l1::O|l2::R, l1::A_|l2::S
.byte l1::C|l2::L, l1::O|l2::R, l1::E|l2::E
.byte l1::E|l2::E, l1::O|l2::R, l1::A_|l2::S
.byte l1::J|l2::S, l1::A_|l2::N, l1::E|l2::E
.byte l1::B|l2::I, l1::A_|l2::N, l1::R|l2::O
.byte l1::P|l2::L, l1::A_|l2::N, l1::R|l2::O
.byte l1::B|l2::I, l1::A_|l2::N, l1::R|l2::O
.byte l1::B|l2::M, l1::A_|l2::N, l1::E|l2::E
.byte l1::E|l2::E, l1::A_|l2::N, l1::R|l2::O
.byte l1::S|l2::E, l1::A_|l2::N, l1::E|l2::E
.byte l1::E|l2::E, l1::A_|l2::N, l1::R|l2::O
.byte l1::R|l2::T, l1::E|l2::O, l1::E|l2::E
.byte l1::E|l2::E, l1::E|l2::O, l1::L|l2::S
.byte l1::P|l2::H, l1::E|l2::O, l1::L|l2::S
.byte l1::J|l2::M, l1::E|l2::O, l1::L|l2::S
.byte l1::B|l2::V, l1::E|l2::O, l1::E|l2::E
.byte l1::E|l2::E, l1::E|l2::O, l1::L|l2::S
.byte l1::C|l2::L, l1::E|l2::O, l1::E|l2::E
.byte l1::E|l2::E, l1::E|l2::O, l1::L|l2::S
.byte l1::R|l2::T, l1::A_|l2::D, l1::E|l2::E
.byte l1::E|l2::E, l1::A_|l2::D, l1::R|l2::O
.byte l1::P|l2::L, l1::A_|l2::D, l1::R|l2::O
.byte l1::J|l2::M, l1::A_|l2::D, l1::R|l2::O
.byte l1::B|l2::V, l1::A_|l2::D, l1::E|l2::E
.byte l1::E|l2::E, l1::A_|l2::D, l1::R|l2::O
.byte l1::S|l2::E, l1::A_|l2::D, l1::E|l2::E
.byte l1::E|l2::E, l1::A_|l2::D, l1::R|l2::O
.byte l1::E|l2::E, l1::S|l2::T, l1::E|l2::E
.byte l1::S|l2::T, l1::S|l2::T, l1::S|l2::T
.byte l1::D|l2::E, l1::E|l2::E, l1::E|l2::E
.byte l1::S|l2::T, l1::S|l2::T, l1::S|l2::T
.byte l1::B|l2::C, l1::S|l2::T, l1::E|l2::E
.byte l1::S|l2::T, l1::S|l2::T, l1::S|l2::T
.byte l1::E|l2::E, l1::S|l2::T, l1::E|l2::E
.byte l1::E|l2::E, l1::S|l2::T, l1::E|l2::E
.byte l1::L|l2::D, l1::L|l2::D, l1::L|l2::D
.byte l1::L|l2::D, l1::L|l2::D, l1::L|l2::D
.byte l1::T|l2::A_, l1::L|l2::D, l1::T|l2::A_
.byte l1::L|l2::D, l1::L|l2::D, l1::L|l2::D
.byte l1::B|l2::C, l1::L|l2::D, l1::E|l2::E
.byte l1::L|l2::D, l1::L|l2::D, l1::L|l2::D
.byte l1::C|l2::L, l1::L|l2::D, l1::T|l2::S
.byte l1::L|l2::D, l1::L|l2::D, l1::L|l2::D
.byte l1::C|l2::P, l1::C|l2::M, l1::E|l2::E
.byte l1::C|l2::P, l1::C|l2::M, l1::D|l2::E
.byte l1::I|l2::N, l1::C|l2::M, l1::D|l2::E
.byte l1::C|l2::P, l1::C|l2::M, l1::D|l2::E
.byte l1::B|l2::N, l1::C|l2::M, l1::E|l2::E
.byte l1::E|l2::E, l1::C|l2::M, l1::D|l2::E
.byte l1::C|l2::L, l1::C|l2::M, l1::E|l2::E
.byte l1::E|l2::E, l1::C|l2::M, l1::D|l2::E
.byte l1::C|l2::P, l1::S|l2::B, l1::E|l2::E
.byte l1::C|l2::P, l1::S|l2::B, l1::I|l2::N
.byte l1::I|l2::N, l1::S|l2::B, l1::N|l2::O
.byte l1::C|l2::P, l1::S|l2::B, l1::I|l2::N
.byte l1::B|l2::E, l1::S|l2::B, l1::E|l2::E
.byte l1::E|l2::E, l1::S|l2::B, l1::I|l2::N
.byte l1::S|l2::E, l1::S|l2::B, l1::E|l2::E
.byte l1::E|l2::E, l1::S|l2::B, l1::I|l2::N
; The last letter and addressing mode of each instruction.
; Each instruction with byte b is stored at index
; b - floor(b/4)
Instructions_end:
.byte l3::K|mode::imm, l3::A_|mode::indx, l3::E|mode::impl
.byte l3::E|mode::impl, l3::A_|mode::zpg, l3::L|mode::zpg
.byte l3::P|mode::impl, l3::A_|mode::imm, l3::L|mode::impl
.byte l3::E|mode::impl, l3::A_|mode::abs, l3::L|mode::abs
.byte l3::L|mode::rel, l3::A_|mode::indy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::A_|mode::zpgx, l3::L|mode::zpgx
.byte l3::C|mode::impl, l3::A_|mode::absy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::A_|mode::absx, l3::L|mode::absx
.byte l3::R|mode::abs, l3::D|mode::indx, l3::E|mode::impl
.byte l3::T|mode::zpg, l3::D|mode::zpg, l3::L|mode::zpg
.byte l3::P|mode::impl, l3::D|mode::imm, l3::L|mode::impl
.byte l3::T|mode::abs, l3::D|mode::abs, l3::L|mode::abs
.byte l3::I|mode::rel, l3::D|mode::indy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::D|mode::zpgx, l3::L|mode::zpgx
.byte l3::C|mode::impl, l3::D|mode::absy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::D|mode::absx, l3::L|mode::absx
.byte l3::I|mode::impl, l3::R|mode::indx, l3::E|mode::impl
.byte l3::E|mode::impl, l3::R|mode::zpg, l3::R|mode::zpg
.byte l3::A_|mode::impl, l3::R|mode::imm, l3::R|mode::acc
.byte l3::P|mode::abs, l3::R|mode::abs, l3::R|mode::abs
.byte l3::C|mode::rel, l3::R|mode::indy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::R|mode::zpgx, l3::R|mode::zpgx
.byte l3::I|mode::impl, l3::R|mode::absy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::R|mode::absx, l3::R|mode::absx
.byte l3::S|mode::impl, l3::C|mode::indx, l3::E|mode::impl
.byte l3::E|mode::impl, l3::C|mode::zpg, l3::R|mode::zpg
.byte l3::A_|mode::impl, l3::C|mode::imm, l3::R|mode::impl
.byte l3::P|mode::ind, l3::C|mode::abs, l3::R|mode::abs
.byte l3::S|mode::rel, l3::C|mode::indy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::C|mode::zpgx, l3::R|mode::zpgx
.byte l3::I|mode::impl, l3::C|mode::absy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::C|mode::absx, l3::R|mode::absx
.byte l3::E|mode::impl, l3::A_|mode::indx, l3::E|mode::impl
.byte l3::Y_|mode::zpg, l3::A_|mode::zpg, l3::X_|mode::zpg
.byte l3::Y_|mode::impl, l3::E|mode::impl, l3::A_|mode::impl
.byte l3::Y_|mode::abs, l3::A_|mode::abs, l3::X_|mode::abs
.byte l3::C|mode::rel, l3::A_|mode::indy, l3::E|mode::impl
.byte l3::Y_|mode::zpgx, l3::A_|mode::zpgx, l3::X_|mode::zpgy
.byte l3::A_|mode::impl, l3::A_|mode::absy, l3::S|mode::impl
.byte l3::E|mode::impl, l3::A_|mode::absx, l3::E|mode::impl
.byte l3::Y_|mode::imm, l3::A_|mode::indx, l3::X_|mode::imm
.byte l3::Y_|mode::zpg, l3::A_|mode::zpg, l3::X_|mode::zpg
.byte l3::Y_|mode::impl, l3::A_|mode::imm, l3::X_|mode::impl
.byte l3::Y_|mode::abs, l3::A_|mode::abs, l3::X_|mode::abs
.byte l3::S|mode::rel, l3::A_|mode::indy, l3::E|mode::impl
.byte l3::Y_|mode::zpgx, l3::A_|mode::zpgx, l3::X_|mode::zpgy
.byte l3::V|mode::impl, l3::A_|mode::absy, l3::X_|mode::impl
.byte l3::Y_|mode::absx, l3::A_|mode::absx, l3::X_|mode::absy
.byte l3::Y_|mode::imm, l3::P|mode::indx, l3::E|mode::impl
.byte l3::Y_|mode::zpg, l3::P|mode::zpg, l3::C|mode::zpg
.byte l3::Y_|mode::impl, l3::P|mode::imm, l3::X_|mode::impl
.byte l3::Y_|mode::abs, l3::P|mode::abs, l3::C|mode::abs
.byte l3::E|mode::rel, l3::P|mode::indy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::P|mode::zpgx, l3::C|mode::zpgx
.byte l3::D|mode::impl, l3::P|mode::absy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::P|mode::absx, l3::C|mode::absx
.byte l3::X_|mode::imm, l3::C|mode::indx, l3::E|mode::impl
.byte l3::X_|mode::zpg, l3::C|mode::zpg, l3::C|mode::zpg
.byte l3::X_|mode::impl, l3::C|mode::imm, l3::P|mode::impl
.byte l3::X_|mode::abs, l3::C|mode::abs, l3::C|mode::abs
.byte l3::Q|mode::rel, l3::C|mode::indy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::C|mode::zpgx, l3::C|mode::zpgx
.byte l3::D|mode::impl, l3::C|mode::absy, l3::E|mode::impl
.byte l3::E|mode::impl, l3::C|mode::absx, l3::C|mode::absx