Implement test for 4502 extensions.

Fix numerous bugs revealed through tests, some more remain.
This commit is contained in:
gardners 2014-02-08 02:51:42 +10:30
parent 591fc2fe35
commit dcc37f5751
5 changed files with 432 additions and 306 deletions

View File

@ -12,524 +12,525 @@
# the tables in tools/opcodes. Edit those tables, not these.
# Names of addressing modes
modes = ["Implied", # 0
"Immediate", # 1
"Immediate.W", # 2
"Zero Page", # 3
"Zero Page, X", # 4
"Zero Page, Y", # 5
"Absolute", # 6
"Absolute, X", # 7
"Absolute, Y", # 8
"(Absolute)", # 9
"(Absolute, X)", # 10
"(Absolute), Y", # 11
"(Zero Page)", # 12
"(Zero Page, X)", # 13
"(Zero Page), Y", # 14
"(Zero Page, SP), Y", # 15
"(Zero Page), Z", # 16
"Relative", # 17
"RelativeLong", # 18
"Zero Page, Relative"] # 19
modes = ["Implied",
"Immediate",
"ImmediateLong",
"Zero Page",
"Zero Page, X",
"Zero Page, Y",
"Absolute",
"Absolute, X",
"Absolute, Y",
"(Absolute)",
"(Absolute, X)",
"(Absolute), Y",
"(Absolute), Z",
"(Zero Page)",
"(Zero Page, X)",
"(Zero Page), Y",
"(Zero Page, SP), Y",
"(Zero Page), Z",
"Relative",
"RelativeLong",
"Zero Page, Relative"]
# Lengths of the argument
lengths = [0, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2]
lengths = [0, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2]
opcodes = {
'adc': [None, 0x69, None, 0x65, 0x75, None, 0x6D, 0x7D,
0x79, None, None, None, None, 0x61, 0x71, None, None, None, None, None],
0x79, None, None, None, None, None, 0x61, 0x71, None, None, None, None, None],
'adc.w': [None, None, None, None, None, None, 0x6D, 0x7D,
0x79, None, None, None, None, None, None, None, None, None, None, None],
0x79, None, None, None, None, None, None, None, None, None, None, None, None],
'and': [None, 0x29, None, 0x25, 0x35, None, 0x2D, 0x3D,
0x39, None, None, None, None, 0x21, 0x31, None, None, None, None, None],
0x39, None, None, None, None, None, 0x21, 0x31, None, None, None, None, None],
'and.w': [None, None, None, None, None, None, 0x2D, 0x3D,
0x39, None, None, None, None, None, None, None, None, None, None, None],
0x39, None, None, None, None, None, None, None, None, None, None, None, None],
'asl': [0x0A, None, None, 0x06, 0x16, None, 0x0E, 0x1E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'asl.w': [None, None, None, None, None, None, 0x0E, 0x1E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'bcc': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x90, None, None],
None, None, None, None, None, None, None, None, None, None, 0x90, None, None],
'bcs': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0xB0, None, None],
None, None, None, None, None, None, None, None, None, None, 0xB0, None, None],
'beq': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0xF0, None, None],
None, None, None, None, None, None, None, None, None, None, 0xF0, None, None],
'bit': [None, None, None, 0x24, None, None, 0x2C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'bit.w': [None, None, None, None, None, None, 0x2C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'bmi': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x30, None, None],
None, None, None, None, None, None, None, None, None, None, 0x30, None, None],
'bne': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0xD0, None, None],
None, None, None, None, None, None, None, None, None, None, 0xD0, None, None],
'bpl': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x10, None, None],
None, None, None, None, None, None, None, None, None, None, 0x10, None, None],
'brk': [0x00, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'bvc': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x50, None, None],
None, None, None, None, None, None, None, None, None, None, 0x50, None, None],
'bvs': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x70, None, None],
None, None, None, None, None, None, None, None, None, None, 0x70, None, None],
'clc': [0x18, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'cld': [0xD8, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'cli': [0x58, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'clv': [0xB8, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'cmp': [None, 0xC9, None, 0xC5, 0xD5, None, 0xCD, 0xDD,
0xD9, None, None, None, None, 0xC1, 0xD1, None, None, None, None, None],
0xD9, None, None, None, None, None, 0xC1, 0xD1, None, None, None, None, None],
'cmp.w': [None, None, None, None, None, None, 0xCD, 0xDD,
0xD9, None, None, None, None, None, None, None, None, None, None, None],
0xD9, None, None, None, None, None, None, None, None, None, None, None, None],
'cpx': [None, 0xE0, None, 0xE4, None, None, 0xEC, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'cpx.w': [None, None, None, None, None, None, 0xEC, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'cpy': [None, 0xC0, None, 0xC4, None, None, 0xCC, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'cpy.w': [None, None, None, None, None, None, 0xCC, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dec': [None, None, None, 0xC6, 0xD6, None, 0xCE, 0xDE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dec.w': [None, None, None, None, None, None, 0xCE, 0xDE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dex': [0xCA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dey': [0x88, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'eor': [None, 0x49, None, 0x45, 0x55, None, 0x4D, 0x5D,
0x59, None, None, None, None, 0x41, 0x51, None, None, None, None, None],
0x59, None, None, None, None, None, 0x41, 0x51, None, None, None, None, None],
'eor.w': [None, None, None, None, None, None, 0x4D, 0x5D,
0x59, None, None, None, None, None, None, None, None, None, None, None],
0x59, None, None, None, None, None, None, None, None, None, None, None, None],
'inc': [None, None, None, 0xE6, 0xF6, None, 0xEE, 0xFE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'inc.w': [None, None, None, None, None, None, 0xEE, 0xFE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'inx': [0xE8, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'iny': [0xC8, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'jmp': [None, None, None, None, None, None, 0x4C, None,
None, 0x6C, None, None, None, None, None, None, None, None, None, None],
None, 0x6C, None, None, None, None, None, None, None, None, None, None, None],
'jsr': [None, None, None, None, None, None, 0x20, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'lda': [None, 0xA9, None, 0xA5, 0xB5, None, 0xAD, 0xBD,
0xB9, None, None, None, None, 0xA1, 0xB1, None, None, None, None, None],
0xB9, None, None, None, None, None, 0xA1, 0xB1, None, None, None, None, None],
'lda.w': [None, None, None, None, None, None, 0xAD, 0xBD,
0xB9, None, None, None, None, None, None, None, None, None, None, None],
0xB9, None, None, None, None, None, None, None, None, None, None, None, None],
'ldx': [None, 0xA2, None, 0xA6, None, 0xB6, 0xAE, None,
0xBE, None, None, None, None, None, None, None, None, None, None, None],
0xBE, None, None, None, None, None, None, None, None, None, None, None, None],
'ldx.w': [None, None, None, None, None, None, 0xAE, None,
0xBE, None, None, None, None, None, None, None, None, None, None, None],
0xBE, None, None, None, None, None, None, None, None, None, None, None, None],
'ldy': [None, 0xA0, None, 0xA4, 0xB4, None, 0xAC, 0xBC,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ldy.w': [None, None, None, None, None, None, 0xAC, 0xBC,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'lsr': [0x4A, None, None, 0x46, 0x56, None, 0x4E, 0x5E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'lsr.w': [None, None, None, None, None, None, 0x4E, 0x5E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'nop': [0xEA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ora': [None, 0x09, None, 0x05, 0x15, None, 0x0D, 0x1D,
0x19, None, None, None, None, 0x01, 0x11, None, None, None, None, None],
0x19, None, None, None, None, None, 0x01, 0x11, None, None, None, None, None],
'ora.w': [None, None, None, None, None, None, 0x0D, 0x1D,
0x19, None, None, None, None, None, None, None, None, None, None, None],
0x19, None, None, None, None, None, None, None, None, None, None, None, None],
'pha': [0x48, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'php': [0x08, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'pla': [0x68, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'plp': [0x28, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rol': [0x2A, None, None, 0x26, 0x36, None, 0x2E, 0x3E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rol.w': [None, None, None, None, None, None, 0x2E, 0x3E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ror': [0x6A, None, None, 0x66, 0x76, None, 0x6E, 0x7E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ror.w': [None, None, None, None, None, None, 0x6E, 0x7E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rti': [0x40, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rts': [0x60, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sbc': [None, 0xE9, None, 0xE5, 0xF5, None, 0xED, 0xFD,
0xF9, None, None, None, None, 0xE1, 0xF1, None, None, None, None, None],
0xF9, None, None, None, None, None, 0xE1, 0xF1, None, None, None, None, None],
'sbc.w': [None, None, None, None, None, None, 0xED, 0xFD,
0xF9, None, None, None, None, None, None, None, None, None, None, None],
0xF9, None, None, None, None, None, None, None, None, None, None, None, None],
'sec': [0x38, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sed': [0xF8, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sei': [0x78, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sta': [None, None, None, 0x85, 0x95, None, 0x8D, 0x9D,
0x99, None, None, None, None, 0x81, 0x91, None, None, None, None, None],
0x99, None, None, None, None, None, 0x81, 0x91, None, None, None, None, None],
'sta.w': [None, None, None, None, None, None, 0x8D, 0x9D,
0x99, None, None, None, None, None, None, None, None, None, None, None],
0x99, None, None, None, None, None, None, None, None, None, None, None, None],
'stx': [None, None, None, 0x86, None, 0x96, 0x8E, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'stx.w': [None, None, None, None, None, None, 0x8E, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sty': [None, None, None, 0x84, 0x94, None, 0x8C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sty.w': [None, None, None, None, None, None, 0x8C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tax': [0xAA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tay': [0xA8, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tsx': [0xBA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'txa': [0x8A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'txs': [0x9A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tya': [0x98, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
}
undocops = {
'anc': [None, 0x0B, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ane': [None, 0x8B, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'arr': [None, 0x6B, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'asr': [None, 0x4B, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dcp': [None, None, None, 0xC7, 0xD7, None, 0xCF, 0xDF,
0xDB, None, None, None, None, 0xC3, 0xD3, None, None, None, None, None],
0xDB, None, None, None, None, None, 0xC3, 0xD3, None, None, None, None, None],
'isb': [None, None, None, 0xE7, 0xF7, None, 0xEF, 0xFF,
0xFB, None, None, None, None, 0xE3, 0xF3, None, None, None, None, None],
0xFB, None, None, None, None, None, 0xE3, 0xF3, None, None, None, None, None],
'las': [None, None, None, None, None, None, None, None,
0xBB, None, None, None, None, None, None, None, None, None, None, None],
0xBB, None, None, None, None, None, None, None, None, None, None, None, None],
'lax': [None, None, None, 0xA7, None, 0xB7, 0xAF, None,
0xBF, None, None, None, None, 0xA3, 0xB3, None, None, None, None, None],
0xBF, None, None, None, None, None, 0xA3, 0xB3, None, None, None, None, None],
'lxa': [None, 0xAB, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'nop': [0xEA, None, None, 0x04, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rla': [None, None, None, 0x27, 0x37, None, 0x2F, 0x3F,
0x3B, None, None, None, None, 0x23, 0x33, None, None, None, None, None],
0x3B, None, None, None, None, None, 0x23, 0x33, None, None, None, None, None],
'rra': [None, None, None, 0x67, 0x77, None, 0x6F, 0x7F,
0x7B, None, None, None, None, 0x63, 0x73, None, None, None, None, None],
0x7B, None, None, None, None, None, 0x63, 0x73, None, None, None, None, None],
'sax': [None, None, None, 0x87, None, 0x97, 0x8F, None,
None, None, None, None, None, 0x83, None, None, None, None, None, None],
None, None, None, None, None, None, 0x83, None, None, None, None, None, None],
'sbx': [None, 0xCB, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sha': [None, None, None, None, None, None, None, None,
0x9F, None, None, None, None, None, 0x93, None, None, None, None, None],
0x9F, None, None, None, None, None, None, 0x93, None, None, None, None, None],
'shs': [None, None, None, None, None, None, None, None,
0x9B, None, None, None, None, None, None, None, None, None, None, None],
0x9B, None, None, None, None, None, None, None, None, None, None, None, None],
'shx': [None, None, None, None, None, None, None, None,
0x9E, None, None, None, None, None, None, None, None, None, None, None],
0x9E, None, None, None, None, None, None, None, None, None, None, None, None],
'slo': [None, None, None, 0x07, 0x17, None, 0x0F, 0x1F,
0x1B, None, None, None, None, 0x03, 0x13, None, None, None, None, None],
0x1B, None, None, None, None, None, 0x03, 0x13, None, None, None, None, None],
'sre': [None, None, None, 0x47, 0x57, None, 0x4F, 0x5F,
0x5B, None, None, None, None, 0x43, 0x53, None, None, None, None, None],
0x5B, None, None, None, None, None, 0x43, 0x53, None, None, None, None, None],
}
c02extensions = {
'adc': [None, 0x69, None, 0x65, 0x75, None, 0x6D, 0x7D,
0x79, None, None, None, 0x72, 0x61, 0x71, None, None, None, None, None],
0x79, None, None, None, None, 0x72, 0x61, 0x71, None, None, None, None, None],
'and': [None, 0x29, None, 0x25, 0x35, None, 0x2D, 0x3D,
0x39, None, None, None, 0x32, 0x21, 0x31, None, None, None, None, None],
0x39, None, None, None, None, 0x32, 0x21, 0x31, None, None, None, None, None],
'bbr0': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x0F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x0F],
'bbr1': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x1F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x1F],
'bbr2': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x2F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x2F],
'bbr3': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x3F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x3F],
'bbr4': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x4F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x4F],
'bbr5': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x5F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x5F],
'bbr6': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x6F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x6F],
'bbr7': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x7F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x7F],
'bbs0': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x8F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x8F],
'bbs1': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x9F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x9F],
'bbs2': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xAF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xAF],
'bbs3': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xBF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xBF],
'bbs4': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xCF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xCF],
'bbs5': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xDF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xDF],
'bbs6': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xEF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xEF],
'bbs7': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xFF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xFF],
'bit': [None, 0x89, None, 0x24, 0x34, None, 0x2C, 0x3C,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'bra': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x80, None, None],
None, None, None, None, None, None, None, None, None, None, 0x80, None, None],
'cmp': [None, 0xC9, None, 0xC5, 0xD5, None, 0xCD, 0xDD,
0xD9, None, None, None, 0xD2, 0xC1, 0xD1, None, None, None, None, None],
0xD9, None, None, None, None, 0xD2, 0xC1, 0xD1, None, None, None, None, None],
'dea': [0x3A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dec': [0x3A, None, None, 0xC6, 0xD6, None, 0xCE, 0xDE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'eor': [None, 0x49, None, 0x45, 0x55, None, 0x4D, 0x5D,
0x59, None, None, None, 0x52, 0x41, 0x51, None, None, None, None, None],
0x59, None, None, None, None, 0x52, 0x41, 0x51, None, None, None, None, None],
'ina': [0x1A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'inc': [0x1A, None, None, 0xE6, 0xF6, None, 0xEE, 0xFE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'jmp': [None, None, None, None, None, None, 0x4C, None,
None, 0x6C, 0x7C, None, None, None, None, None, None, None, None, None],
None, 0x6C, 0x7C, None, None, None, None, None, None, None, None, None, None],
'lda': [None, 0xA9, None, 0xA5, 0xB5, None, 0xAD, 0xBD,
0xB9, None, None, None, 0xB2, 0xA1, 0xB1, None, None, None, None, None],
0xB9, None, None, None, None, 0xB2, 0xA1, 0xB1, None, None, None, None, None],
'ora': [None, 0x09, None, 0x05, 0x15, None, 0x0D, 0x1D,
0x19, None, None, None, 0x12, 0x01, 0x11, None, None, None, None, None],
0x19, None, None, None, None, 0x12, 0x01, 0x11, None, None, None, None, None],
'phx': [0xDA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'phy': [0x5A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'plx': [0xFA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ply': [0x7A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb0': [None, None, None, 0x07, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb1': [None, None, None, 0x17, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb2': [None, None, None, 0x27, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb3': [None, None, None, 0x37, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb4': [None, None, None, 0x47, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb5': [None, None, None, 0x57, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb6': [None, None, None, 0x67, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb7': [None, None, None, 0x77, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sbc': [None, 0xE9, None, 0xE5, 0xF5, None, 0xED, 0xFD,
0xF9, None, None, None, 0xF2, 0xE1, 0xF1, None, None, None, None, None],
0xF9, None, None, None, None, 0xF2, 0xE1, 0xF1, None, None, None, None, None],
'smb0': [None, None, None, 0x87, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb1': [None, None, None, 0x97, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb2': [None, None, None, 0xA7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb3': [None, None, None, 0xB7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb4': [None, None, None, 0xC7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb5': [None, None, None, 0xD7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb6': [None, None, None, 0xE7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb7': [None, None, None, 0xF7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sta': [None, None, None, 0x85, 0x95, None, 0x8D, 0x9D,
0x99, None, None, None, 0x92, 0x81, 0x91, None, None, None, None, None],
0x99, None, None, None, None, 0x92, 0x81, 0x91, None, None, None, None, None],
'stp': [0xDB, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'stz': [None, None, None, 0x64, 0x74, None, 0x9C, 0x9E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'stz.w': [None, None, None, None, None, None, 0x9C, 0x9E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'trb': [None, None, None, 0x14, None, None, 0x1C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'trb.w': [None, None, None, None, None, None, 0x1C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tsb': [None, None, None, 0x04, None, None, 0x0C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tsb.w': [None, None, None, None, None, None, 0x0C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'wai': [0xCB, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
}
csg4502extensions = {
'adc': [None, 0x69, None, 0x65, 0x75, None, 0x6D, 0x7D,
0x79, None, None, None, None, 0x61, 0x71, None, 0x72, None, None, None],
0x79, None, None, None, None, None, 0x61, 0x71, None, 0x72, None, None, None],
'and': [None, 0x29, None, 0x25, 0x35, None, 0x2D, 0x3D,
0x39, None, None, None, None, 0x21, 0x31, None, 0x32, None, None, None],
0x39, None, None, None, None, None, 0x21, 0x31, None, 0x32, None, None, None],
'asr': [0x43, None, None, None, 0x54, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'asw': [None, None, None, None, None, None, 0xCB, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'bbr0': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x0F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x0F],
'bbr1': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x1F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x1F],
'bbr2': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x2F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x2F],
'bbr3': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x3F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x3F],
'bbr4': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x4F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x4F],
'bbr5': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x5F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x5F],
'bbr6': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x6F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x6F],
'bbr7': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x7F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x7F],
'bbs0': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x8F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x8F],
'bbs1': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0x9F],
None, None, None, None, None, None, None, None, None, None, None, None, 0x9F],
'bbs2': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xAF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xAF],
'bbs3': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xBF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xBF],
'bbs4': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xCF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xCF],
'bbs5': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xDF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xDF],
'bbs6': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xEF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xEF],
'bbs7': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, 0xFF],
None, None, None, None, None, None, None, None, None, None, None, None, 0xFF],
'bcc': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x90, 0x93, None],
None, None, None, None, None, None, None, None, None, None, 0x90, 0x93, None],
'bcs': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0xB0, 0xB3, None],
None, None, None, None, None, None, None, None, None, None, 0xB0, 0xB3, None],
'beq': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0xF0, 0xF3, None],
None, None, None, None, None, None, None, None, None, None, 0xF0, 0xF3, None],
'bit': [None, 0x89, None, 0x24, 0x34, None, 0x2C, 0x3C,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'bmi': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x30, 0x33, None],
None, None, None, None, None, None, None, None, None, None, 0x30, 0x33, None],
'bne': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0xD0, 0xD3, None],
None, None, None, None, None, None, None, None, None, None, 0xD0, 0xD3, None],
'bpl': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x10, 0x13, None],
None, None, None, None, None, None, None, None, None, None, 0x10, 0x13, None],
'bra': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x80, 0x83, None],
None, None, None, None, None, None, None, None, None, None, 0x80, 0x83, None],
'bsr': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, 0x63, None],
None, None, None, None, None, None, None, None, None, None, None, 0x63, None],
'bvc': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x50, 0x53, None],
None, None, None, None, None, None, None, None, None, None, 0x50, 0x53, None],
'bvs': [None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, 0x70, 0x73, None],
None, None, None, None, None, None, None, None, None, None, 0x70, 0x73, None],
'cle': [0x02, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'cmp': [None, 0xC9, None, 0xC5, 0xD5, None, 0xCD, 0xDD,
0xD9, None, None, None, None, 0xC1, 0xD1, None, 0xD2, None, None, None],
0xD9, None, None, None, None, None, 0xC1, 0xD1, None, 0xD2, None, None, None],
'cpz': [None, 0xC2, None, 0xD4, None, None, 0xDC, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dea': [0x3A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dec': [0x3A, None, None, 0xC6, 0xD6, None, 0xCE, 0xDE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dew': [None, None, None, None, None, None, 0xC3, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'dez': [0x3B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'eom': [0xEA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'eor': [None, 0x49, None, 0x45, 0x55, None, 0x4D, 0x5D,
0x59, None, None, None, None, 0x41, 0x51, None, 0x52, None, None, None],
0x59, None, None, None, None, None, 0x41, 0x51, None, 0x52, None, None, None],
'inc': [0x1A, None, None, 0xE6, 0xF6, None, 0xEE, 0xFE,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'inw': [None, None, None, None, None, None, 0xE3, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'inz': [0x1B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'jmp': [None, None, None, None, None, None, 0x4C, None,
None, 0x6C, 0x7C, None, None, None, None, None, None, None, None, None],
None, 0x6C, 0x7C, None, None, None, None, None, None, None, None, None, None],
'jsr': [None, None, None, None, None, None, 0x20, None,
None, 0x22, 0x23, None, None, None, None, None, None, None, None, None],
None, 0x22, 0x23, None, None, None, None, None, None, None, None, None, None],
'lda': [None, 0xA9, None, 0xA5, 0xB5, None, 0xAD, 0xBD,
0xB9, None, None, None, None, 0xA1, 0xB1, 0xE2, 0xB2, None, None, None],
0xB9, None, None, None, None, None, 0xA1, 0xB1, 0xE2, 0xB2, None, None, None],
'ldz': [None, 0xA3, None, None, None, None, 0xAB, 0xBB,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'map': [0x5C, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'neg': [0x42, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ora': [None, 0x09, None, 0x05, 0x15, None, 0x0D, 0x1D,
0x19, None, None, None, None, 0x01, 0x11, None, 0x12, None, None, None],
0x19, None, None, None, None, None, 0x01, 0x11, None, 0x12, None, None, None],
'phw': [None, None, 0xF4, None, None, None, 0xFC, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'phx': [0xDA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'phy': [0x5A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'phz': [0xDB, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'plx': [0xFA, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'ply': [0x7A, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'plz': [0xFB, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb0': [None, None, None, 0x07, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb1': [None, None, None, 0x17, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb2': [None, None, None, 0x27, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb3': [None, None, None, 0x37, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb4': [None, None, None, 0x47, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb5': [None, None, None, 0x57, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb6': [None, None, None, 0x67, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rmb7': [None, None, None, 0x77, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'row': [None, None, None, None, None, None, 0xEB, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'rts': [0x60, 0x62, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sbc': [None, 0xE9, None, 0xE5, 0xF5, None, 0xED, 0xFD,
0xF9, None, None, None, 0xF2, 0xE1, 0xF1, None, None, None, None, None],
0xF9, None, None, None, None, 0xF2, 0xE1, 0xF1, None, None, None, None, None],
'see': [0x03, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb0': [None, None, None, 0x87, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb1': [None, None, None, 0x97, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb2': [None, None, None, 0xA7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb3': [None, None, None, 0xB7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb4': [None, None, None, 0xC7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb5': [None, None, None, 0xD7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb6': [None, None, None, 0xE7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'smb7': [None, None, None, 0xF7, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'sta': [None, None, None, 0x85, 0x95, None, 0x8D, 0x9D,
0x99, None, None, None, None, 0x81, 0x91, 0x82, 0x92, None, None, None],
0x99, None, None, None, None, None, 0x81, 0x91, 0x82, 0x92, None, None, None],
'stx': [None, None, None, 0x86, None, 0x96, 0x8E, None,
0x9B, None, None, None, None, None, None, None, None, None, None, None],
0x9B, None, None, None, None, None, None, None, None, None, None, None, None],
'sty': [None, None, None, 0x84, 0x94, None, 0x8C, 0x8B,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'stz': [None, None, None, 0x64, 0x74, None, 0x9C, 0x9E,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tab': [0x5B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'taz': [0x4B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tba': [0x7B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'trb': [None, None, None, 0x14, None, None, 0x1C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tsb': [None, None, None, 0x04, None, None, 0x0C, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tsy': [0x0B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tys': [0x2B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
'tza': [0x6B, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None],
None, None, None, None, None, None, None, None, None, None, None, None, None],
}

View File

@ -323,6 +323,9 @@ class PCTracker(Pass):
def visitImmediate(self, node, env):
env.incPC(2)
def visitImmediateLong(self, node, env):
env.incPC(2)
def visitIndirectX(self, node, env):
env.incPC(2)
@ -374,6 +377,9 @@ class PCTracker(Pass):
def visitAbsIndY(self, node, env):
env.incPC(3)
def visitAbsIndZ(self, node, env):
env.incPC(3)
def visitMemory(self, node, env):
env.incPC(3)
@ -711,6 +717,9 @@ class NormalizeModes(Pass):
def visitPointerY(self, node, env):
node.nodetype = "AbsIndY"
def visitPointerZ(self, node, env):
node.nodetype = "AbsIndZ"
def visitUnknown(self, node, env):
pass
@ -852,6 +861,7 @@ class Assembler(Pass):
"($%04X)",
"($%04X, X)",
"($%04X), Y",
"($%04X), Z",
"($%02X)",
"($%02X, X)",
"($%02X), Y",
@ -918,6 +928,9 @@ class Assembler(Pass):
def visitImmediate(self, node, env):
self.assemble(node, Ops.modes.index("Immediate"), env)
def visitImmediateLong(self, node, env):
self.assemble(node, Ops.modes.index("ImmediateLong"), env)
def visitZeroPage(self, node, env):
self.assemble(node, Ops.modes.index("Zero Page"), env)
@ -945,6 +958,9 @@ class Assembler(Pass):
def visitAbsIndY(self, node, env):
self.assemble(node, Ops.modes.index("(Absolute), Y"), env)
def visitAbsIndZ(self, node, env):
self.assemble(node, Ops.modes.index("(Absolute), Z"), env)
def visitZPIndirect(self, node, env):
self.assemble(node, Ops.modes.index("(Zero Page)"), env)

View File

@ -17,53 +17,55 @@ prologue = '"""' + """Opcodes file.
# the tables in tools/opcodes. Edit those tables, not these.
# Names of addressing modes
modes = ["Implied", # 0
"Immediate", # 1
"Immediate.W", # 2
"Zero Page", # 3
"Zero Page, X", # 4
"Zero Page, Y", # 5
"Absolute", # 6
"Absolute, X", # 7
"Absolute, Y", # 8
"(Absolute)", # 9
"(Absolute, X)", # 10
"(Absolute), Y", # 11
"(Zero Page)", # 12
"(Zero Page, X)", # 13
"(Zero Page), Y", # 14
"(Zero Page, SP), Y", # 15
"(Zero Page), Z", # 16
"Relative", # 17
"RelativeLong", # 18
"Zero Page, Relative"] # 19
modes = ["Implied",
"Immediate",
"ImmediateLong",
"Zero Page",
"Zero Page, X",
"Zero Page, Y",
"Absolute",
"Absolute, X",
"Absolute, Y",
"(Absolute)",
"(Absolute, X)",
"(Absolute), Y",
"(Absolute), Z",
"(Zero Page)",
"(Zero Page, X)",
"(Zero Page), Y",
"(Zero Page, SP), Y",
"(Zero Page), Z",