Add the NOP Zero Page undocumented opcode.

This seems to be one of the preferred undocced ops in the Atari
2600 VCS development community.
This commit is contained in:
Michael C. Martin 2012-05-29 18:18:33 -07:00
parent 196cb47f05
commit af50326e39
5 changed files with 373 additions and 364 deletions

View File

@ -7,6 +7,10 @@
# You may use, modify, and distribute this file under the MIT # You may use, modify, and distribute this file under the MIT
# license: See README for details. # license: See README for details.
# DO NOT EDIT THIS FILE DIRECTLY.
# This file was automatically generated by gensets.py based on the
# the tables in tools/opcodes. Edit those tables, not these.
# Names of addressing modes # Names of addressing modes
modes = ["Implied", # 0 modes = ["Implied", # 0
"Immediate", # 1 "Immediate", # 1
@ -96,6 +100,7 @@ undocops = {
'las': [None, None, None, None, None, None, None, 0xBB, None, None, None, None, None, None, None], 'las': [None, None, None, None, None, None, None, 0xBB, None, None, None, None, None, None, None],
'lax': [None, None, 0xA7, None, 0xB7, 0xAF, None, 0xBF, None, None, None, None, 0xA3, 0xB3, None], 'lax': [None, None, 0xA7, None, 0xB7, 0xAF, None, 0xBF, None, None, None, None, 0xA3, 0xB3, None],
'lxa': [None, 0xAB, None, None, None, None, None, None, None, None, None, None, None, None, None], 'lxa': [None, 0xAB, None, None, None, None, None, None, None, None, None, None, None, None, None],
'nop': [0xEA, None, 0x04, None, None, None, None, None, None, None, None, None, None, None, None],
'rla': [None, None, 0x27, 0x37, None, 0x2F, 0x3F, 0x3B, None, None, None, None, 0x23, 0x33, None], 'rla': [None, None, 0x27, 0x37, None, 0x2F, 0x3F, 0x3B, None, None, None, None, 0x23, 0x33, None],
'rra': [None, None, 0x67, 0x77, None, 0x6F, 0x7F, 0x7B, None, None, None, None, 0x63, 0x73, None], 'rra': [None, None, 0x67, 0x77, None, 0x6F, 0x7F, 0x7B, None, None, None, None, 0x63, 0x73, None],
'sax': [None, None, 0x87, None, 0x97, 0x8F, None, None, None, None, None, None, 0x83, None, None], 'sax': [None, None, 0x87, None, 0x97, 0x8F, None, None, None, None, None, None, 0x83, None, None],

View File

@ -1 +1 @@
 ##''///3377;;;???CCGGKKOOOSSWW[[[___ccggkkooossww{{{儍噰媼弿彄摋棝洓灋灍煙Ё<EFBC83><D081><EFBFBD>撤坊换靠棵们撬讼舷佑鬃圹圻哌沣珑镲矬篦鼷<E7AFA6><E9BCB7><EFBFBD><EFBFBD>  ##''///3377;;;???CCGGKKOOOSSWW[[[___ccggkkooossww{{{儍噰媼弿彄摋棝洓灋灍煙Ё<EFBC83><D081><EFBFBD>撤坊换靠棵们撬讼舷佑鬃圹圻哌沣珑镲矬篦鼷<E7AFA6><E9BCB7><EFBFBD><EFBFBD>

View File

@ -1,78 +1,79 @@
; Test file for base 6510 undocumented opcode compliance ; Test file for base 6510 undocumented opcode compliance
; This odd little source file uses every addressing mode ; This odd little source file uses every addressing mode
; of every opcode, and uses the opcode itself as the argument ; of every opcode, and uses the opcode itself as the argument
; to each instruction that takes one. The resulting binary's ; to each instruction that takes one. The resulting binary's
; bytes are thus in strictly increasing numerical order. ; bytes are thus in strictly increasing numerical order.
; Many mnemonics have multiple opcodes with identical ; Many mnemonics have multiple opcodes with identical
; effects; Ophis chooses one of them and the arguments ; effects; Ophis chooses one of them and the arguments
; herein assume that any assembler will choose as Ophis ; herein assume that any assembler will choose as Ophis
; does. ; does.
; This file also doesn't include the 6502's *documented* ; This file also doesn't include the 6502's *documented*
; opcodes - see testbase.oph for those. ; opcodes - see testbase.oph for those.
SLO ($03, X) SLO ($03, X)
SLO $07 NOP $04
ANC #$0B SLO $07
SLO $0F0F ANC #$0B
SLO ($13), Y SLO $0F0F
SLO $17, X SLO ($13), Y
SLO $1B1B, Y SLO $17, X
SLO $1F1F, X SLO $1B1B, Y
RLA ($23, X) SLO $1F1F, X
RLA $27 RLA ($23, X)
RLA $2F2F RLA $27
RLA ($33), Y RLA $2F2F
RLA $37, X RLA ($33), Y
RLA $3B3B, Y RLA $37, X
RLA $3F3F, X RLA $3B3B, Y
SRE ($43, X) RLA $3F3F, X
SRE $47 SRE ($43, X)
ASR #$4B SRE $47
SRE $4F4F ASR #$4B
SRE ($53), Y SRE $4F4F
SRE $57, X SRE ($53), Y
SRE $5B5B, Y SRE $57, X
SRE $5F5F, X SRE $5B5B, Y
RRA ($63, X) SRE $5F5F, X
RRA $67 RRA ($63, X)
ARR #$6B RRA $67
RRA $6F6F ARR #$6B
RRA ($73), Y RRA $6F6F
RRA $77, X RRA ($73), Y
RRA $7B7B, Y RRA $77, X
RRA $7F7F, X RRA $7B7B, Y
SAX ($83, X) RRA $7F7F, X
SAX $87 SAX ($83, X)
ANE #$8B SAX $87
SAX $8F8F ANE #$8B
SHA ($93), Y SAX $8F8F
SAX $97, Y SHA ($93), Y
SHS $9B9B, Y SAX $97, Y
SHX $9E9E, Y SHS $9B9B, Y
SHA $9F9F, Y SHX $9E9E, Y
LAX ($A3, X) SHA $9F9F, Y
LAX $A7 LAX ($A3, X)
LXA #$AB LAX $A7
LAX $AFAF LXA #$AB
LAX ($B3), Y LAX $AFAF
LAX $B7, Y LAX ($B3), Y
LAS $BBBB, Y LAX $B7, Y
LAX $BFBF, Y LAS $BBBB, Y
DCP ($C3, X) LAX $BFBF, Y
DCP $C7 DCP ($C3, X)
SBX #$CB DCP $C7
DCP $CFCF SBX #$CB
DCP ($D3), Y DCP $CFCF
DCP $D7, X DCP ($D3), Y
DCP $DBDB, Y DCP $D7, X
DCP $DFDF, X DCP $DBDB, Y
ISB ($E3, X) DCP $DFDF, X
ISB $E7 ISB ($E3, X)
ISB $EFEF ISB $E7
ISB ($F3), Y ISB $EFEF
ISB $F7, X ISB ($F3), Y
ISB $FBFB, Y ISB $F7, X
ISB $FFFF, X ISB $FBFB, Y
ISB $FFFF, X

View File

@ -3,31 +3,35 @@ import sys
verbose = 0 verbose = 0
prologue = '"""' + """Opcodes file. prologue = '"""' +"""Opcodes file.
Tables for the assembly of 6502-family instructions, mapping Tables for the assembly of 6502-family instructions, mapping
opcodes and addressing modes to binary instructions.""" + '"""' + """ opcodes and addressing modes to binary instructions.""" + '"""' + """
# Copyright 2002 Michael C. Martin. # Copyright 2002-2012 Michael C. Martin and additional contributors.
# You may use, modify, and distribute this file under the BSD # You may use, modify, and distribute this file under the MIT
# license: See LICENSE.txt for details. # license: See README for details.
# DO NOT EDIT THIS FILE DIRECTLY.
# This file was automatically generated by gensets.py based on the
# the tables in tools/opcodes. Edit those tables, not these.
# Names of addressing modes # Names of addressing modes
modes = ["Implied", # 0 modes = ["Implied", # 0
"Immediate", # 1 "Immediate", # 1
"Zero Page", # 2 "Zero Page", # 2
"Zero Page, X", # 3 "Zero Page, X", # 3
"Zero Page, Y", # 4 "Zero Page, Y", # 4
"Absolute", # 5 "Absolute", # 5
"Absolute, X", # 6 "Absolute, X", # 6
"Absolute, Y", # 7 "Absolute, Y", # 7
"(Absolute)", # 8 "(Absolute)", # 8
"(Absolute, X)", # 9 "(Absolute, X)", # 9
"(Absolute), Y", # 10 "(Absolute), Y", # 10
"(Zero Page)", # 11 "(Zero Page)", # 11
"(Zero Page, X)", # 12 "(Zero Page, X)", # 12
"(Zero Page), Y", # 13 "(Zero Page), Y", # 13
"Relative"] # 14 "Relative"] # 14
# Lengths of the argument # Lengths of the argument
lengths = [0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1] lengths = [0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1]
@ -35,20 +39,20 @@ lengths = [0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1]
# These values should match the ones in the prologue string. # These values should match the ones in the prologue string.
modes = ["Implied", # 0 modes = ["Implied", # 0
"Immediate", # 1 "Immediate", # 1
"Zero Page", # 2 "Zero Page", # 2
"Zero Page, X", # 3 "Zero Page, X", # 3
"Zero Page, Y", # 4 "Zero Page, Y", # 4
"Absolute", # 5 "Absolute", # 5
"Absolute, X", # 6 "Absolute, X", # 6
"Absolute, Y", # 7 "Absolute, Y", # 7
"(Absolute)", # 8 "(Absolute)", # 8
"(Absolute, X)", # 9 "(Absolute, X)", # 9
"(Absolute), Y", # 10 "(Absolute), Y", # 10
"(Zero Page)", # 11 "(Zero Page)", # 11
"(Zero Page, X)", # 12 "(Zero Page, X)", # 12
"(Zero Page), Y", # 13 "(Zero Page), Y", # 13
"Relative"] # 14 "Relative"] # 14
flatmodes = [x.lower() for x in modes] flatmodes = [x.lower() for x in modes]
@ -150,4 +154,3 @@ if __name__=='__main__':
dump_map (instruction_map, ' ' * (len(field) + 4)) dump_map (instruction_map, ' ' * (len(field) + 4))
print "%s}" % (' ' * (len(field) + 3)) print "%s}" % (' ' * (len(field) + 3))
print "" print ""

View File

@ -1,256 +1,256 @@
00: BRK - Implied 00: BRK - Implied
01: ORA - (Zero Page, X) 01: ORA - (Zero Page, X)
02: 02:
03: SLO - (Zero Page, X) 03: SLO - (Zero Page, X)
04: 04: NOP - Zero Page
05: ORA - Zero Page 05: ORA - Zero Page
06: ASL - Zero Page 06: ASL - Zero Page
07: SLO - Zero Page 07: SLO - Zero Page
08: PHP - Implied 08: PHP - Implied
09: ORA - Immediate 09: ORA - Immediate
0A: ASL - Implied 0A: ASL - Implied
0B: ANC - Immediate 0B: ANC - Immediate
0C: 0C:
0D: ORA - Absolute 0D: ORA - Absolute
0E: ASL - Absolute 0E: ASL - Absolute
0F: SLO - Absolute 0F: SLO - Absolute
10: BPL - Relative 10: BPL - Relative
11: ORA - (Zero Page), Y 11: ORA - (Zero Page), Y
12: 12:
13: SLO - (Zero Page), Y 13: SLO - (Zero Page), Y
14: 14:
15: ORA - Zero Page, X 15: ORA - Zero Page, X
16: ASL - Zero Page, X 16: ASL - Zero Page, X
17: SLO - Zero Page, X 17: SLO - Zero Page, X
18: CLC - Implied 18: CLC - Implied
19: ORA - Absolute, Y 19: ORA - Absolute, Y
1A: 1A:
1B: SLO - Absolute, Y 1B: SLO - Absolute, Y
1C: 1C:
1D: ORA - Absolute, X 1D: ORA - Absolute, X
1E: ASL - Absolute, X 1E: ASL - Absolute, X
1F: SLO - Absolute, X 1F: SLO - Absolute, X
20: JSR - Absolute 20: JSR - Absolute
21: AND - (Zero Page, X) 21: AND - (Zero Page, X)
22: 22:
23: RLA - (Zero Page, X) 23: RLA - (Zero Page, X)
24: BIT - Zero Page 24: BIT - Zero Page
25: AND - Zero Page 25: AND - Zero Page
26: ROL - Zero Page 26: ROL - Zero Page
27: RLA - Zero Page 27: RLA - Zero Page
28: PLP - Implied 28: PLP - Implied
29: AND - Immediate 29: AND - Immediate
2A: ROL - Implied 2A: ROL - Implied
2B: 2B:
2C: BIT - Absolute 2C: BIT - Absolute
2D: AND - Absolute 2D: AND - Absolute
2E: ROL - Absolute 2E: ROL - Absolute
2F: RLA - Absolute 2F: RLA - Absolute
30: BMI - Relative 30: BMI - Relative
31: AND - (Zero Page), Y 31: AND - (Zero Page), Y
32: 32:
33: RLA - (Zero Page), Y 33: RLA - (Zero Page), Y
34: 34:
35: AND - Zero Page, X 35: AND - Zero Page, X
36: ROL - Zero Page, X 36: ROL - Zero Page, X
37: RLA - Zero Page, X 37: RLA - Zero Page, X
38: SEC - Implied 38: SEC - Implied
39: AND - Absolute, Y 39: AND - Absolute, Y
3A: 3A:
3B: RLA - Absolute, Y 3B: RLA - Absolute, Y
3C: 3C:
3D: AND - Absolute, X 3D: AND - Absolute, X
3E: ROL - Absolute, X 3E: ROL - Absolute, X
3F: RLA - Absolute, X 3F: RLA - Absolute, X
40: RTI - Implied 40: RTI - Implied
41: EOR - (Zero Page, X) 41: EOR - (Zero Page, X)
42: 42:
43: SRE - (Zero Page, X) 43: SRE - (Zero Page, X)
44: 44:
45: EOR - Zero Page 45: EOR - Zero Page
46: LSR - Zero Page 46: LSR - Zero Page
47: SRE - Zero Page 47: SRE - Zero Page
48: PHA - Implied 48: PHA - Implied
49: EOR - Immediate 49: EOR - Immediate
4A: LSR - Implied 4A: LSR - Implied
4B: ASR - Immediate 4B: ASR - Immediate
4C: JMP - Absolute 4C: JMP - Absolute
4D: EOR - Absolute 4D: EOR - Absolute
4E: LSR - Absolute 4E: LSR - Absolute
4F: SRE - Absolute 4F: SRE - Absolute
50: BVC - Relative 50: BVC - Relative
51: EOR - (Zero Page), Y 51: EOR - (Zero Page), Y
52: 52:
53: SRE - (Zero Page), Y 53: SRE - (Zero Page), Y
54: 54:
55: EOR - Zero Page, X 55: EOR - Zero Page, X
56: LSR - Zero Page, X 56: LSR - Zero Page, X
57: SRE - Zero Page, X 57: SRE - Zero Page, X
58: CLI - Implied 58: CLI - Implied
59: EOR - Absolute, Y 59: EOR - Absolute, Y
5A: 5A:
5B: SRE - Absolute, Y 5B: SRE - Absolute, Y
5C: 5C:
5D: EOR - Absolute, X 5D: EOR - Absolute, X
5E: LSR - Absolute, X 5E: LSR - Absolute, X
5F: SRE - Absolute, X 5F: SRE - Absolute, X
60: RTS - Implied 60: RTS - Implied
61: ADC - (Zero Page, X) 61: ADC - (Zero Page, X)
62: 62:
63: RRA - (Zero Page, X) 63: RRA - (Zero Page, X)
64: 64:
65: ADC - Zero Page 65: ADC - Zero Page
66: ROR - Zero Page 66: ROR - Zero Page
67: RRA - Zero Page 67: RRA - Zero Page
68: PLA - Implied 68: PLA - Implied
69: ADC - Immediate 69: ADC - Immediate
6A: ROR - Implied 6A: ROR - Implied
6B: ARR - Immediate 6B: ARR - Immediate
6C: JMP - (Absolute) 6C: JMP - (Absolute)
6D: ADC - Absolute 6D: ADC - Absolute
6E: ROR - Absolute 6E: ROR - Absolute
6F: RRA - Absolute 6F: RRA - Absolute
70: BVS - Relative 70: BVS - Relative
71: ADC - (Zero Page), Y 71: ADC - (Zero Page), Y
72: 72:
73: RRA - (Zero Page), Y 73: RRA - (Zero Page), Y
74: 74:
75: ADC - Zero Page, X 75: ADC - Zero Page, X
76: ROR - Zero Page, X 76: ROR - Zero Page, X
77: RRA - Zero Page, X 77: RRA - Zero Page, X
78: SEI - Implied 78: SEI - Implied
79: ADC - Absolute, Y 79: ADC - Absolute, Y
7A: 7A:
7B: RRA - Absolute, Y 7B: RRA - Absolute, Y
7C: 7C:
7D: ADC - Absolute, X 7D: ADC - Absolute, X
7E: ROR - Absolute, X 7E: ROR - Absolute, X
7F: RRA - Absolute, X 7F: RRA - Absolute, X
80: 80:
81: STA - (Zero Page, X) 81: STA - (Zero Page, X)
82: 82:
83: SAX - (Zero Page, X) 83: SAX - (Zero Page, X)
84: STY - Zero Page 84: STY - Zero Page
85: STA - Zero Page 85: STA - Zero Page
86: STX - Zero Page 86: STX - Zero Page
87: SAX - Zero Page 87: SAX - Zero Page
88: DEY - Implied 88: DEY - Implied
89: 89:
8A: TXA - Implied 8A: TXA - Implied
8B: ANE - Immediate 8B: ANE - Immediate
8C: STY - Absolute 8C: STY - Absolute
8D: STA - Absolute 8D: STA - Absolute
8E: STX - Absolute 8E: STX - Absolute
8F: SAX - Absolute 8F: SAX - Absolute
90: BCC - Relative 90: BCC - Relative
91: STA - (Zero Page), Y 91: STA - (Zero Page), Y
92: 92:
93: SHA - (Zero Page), Y 93: SHA - (Zero Page), Y
94: STY - Zero Page, X 94: STY - Zero Page, X
95: STA - Zero Page, X 95: STA - Zero Page, X
96: STX - Zero Page, Y 96: STX - Zero Page, Y
97: SAX - Zero Page, Y 97: SAX - Zero Page, Y
98: TYA - Implied 98: TYA - Implied
99: STA - Absolute, Y 99: STA - Absolute, Y
9A: TXS - Implied 9A: TXS - Implied
9B: SHS - Absolute, Y 9B: SHS - Absolute, Y
9C: 9C:
9D: STA - Absolute, X 9D: STA - Absolute, X
9E: SHX - Absolute, Y 9E: SHX - Absolute, Y
9F: SHA - Absolute, Y 9F: SHA - Absolute, Y
A0: LDY - Immediate A0: LDY - Immediate
A1: LDA - (Zero Page, X) A1: LDA - (Zero Page, X)
A2: LDX - Immediate A2: LDX - Immediate
A3: LAX - (Zero Page, X) A3: LAX - (Zero Page, X)
A4: LDY - Zero Page A4: LDY - Zero Page
A5: LDA - Zero Page A5: LDA - Zero Page
A6: LDX - Zero Page A6: LDX - Zero Page
A7: LAX - Zero Page A7: LAX - Zero Page
A8: TAY - Implied A8: TAY - Implied
A9: LDA - Immediate A9: LDA - Immediate
AA: TAX - Implied AA: TAX - Implied
AB: LXA - Immediate AB: LXA - Immediate
AC: LDY - Absolute AC: LDY - Absolute
AD: LDA - Absolute AD: LDA - Absolute
AE: LDX - Absolute AE: LDX - Absolute
AF: LAX - Absolute AF: LAX - Absolute
B0: BCS - Relative B0: BCS - Relative
B1: LDA - (Zero Page), Y B1: LDA - (Zero Page), Y
B2: B2:
B3: LAX - (Zero Page), Y B3: LAX - (Zero Page), Y
B4: LDY - Zero Page, X B4: LDY - Zero Page, X
B5: LDA - Zero Page, X B5: LDA - Zero Page, X
B6: LDX - Zero Page, Y B6: LDX - Zero Page, Y
B7: LAX - Zero Page, Y B7: LAX - Zero Page, Y
B8: CLV - Implied B8: CLV - Implied
B9: LDA - Absolute, Y B9: LDA - Absolute, Y
BA: TSX - Implied BA: TSX - Implied
BB: LAS - Absolute, Y BB: LAS - Absolute, Y
BC: LDY - Absolute, X BC: LDY - Absolute, X
BD: LDA - Absolute, X BD: LDA - Absolute, X
BE: LDX - Absolute, Y BE: LDX - Absolute, Y
BF: LAX - Absolute, Y BF: LAX - Absolute, Y
C0: CPY - Immediate C0: CPY - Immediate
C1: CMP - (Zero Page, X) C1: CMP - (Zero Page, X)
C2: C2:
C3: DCP - (Zero Page, X) C3: DCP - (Zero Page, X)
C4: CPY - Zero Page C4: CPY - Zero Page
C5: CMP - Zero Page C5: CMP - Zero Page
C6: DEC - Zero Page C6: DEC - Zero Page
C7: DCP - Zero Page C7: DCP - Zero Page
C8: INY - Implied C8: INY - Implied
C9: CMP - Immediate C9: CMP - Immediate
CA: DEX - Implied CA: DEX - Implied
CB: SBX - Immediate CB: SBX - Immediate
CC: CPY - Absolute CC: CPY - Absolute
CD: CMP - Absolute CD: CMP - Absolute
CE: DEC - Absolute CE: DEC - Absolute
CF: DCP - Absolute CF: DCP - Absolute
D0: BNE - Relative D0: BNE - Relative
D1: CMP - (Zero Page), Y D1: CMP - (Zero Page), Y
D2: D2:
D3: DCP - (Zero Page), Y D3: DCP - (Zero Page), Y
D4: D4:
D5: CMP - Zero Page, X D5: CMP - Zero Page, X
D6: DEC - Zero Page, X D6: DEC - Zero Page, X
D7: DCP - Zero Page, X D7: DCP - Zero Page, X
D8: CLD - Implied D8: CLD - Implied
D9: CMP - Absolute, Y D9: CMP - Absolute, Y
DA: DA:
DB: DCP - Absolute, Y DB: DCP - Absolute, Y
DC: DC:
DD: CMP - Absolute, X DD: CMP - Absolute, X
DE: DEC - Absolute, X DE: DEC - Absolute, X
DF: DCP - Absolute, X DF: DCP - Absolute, X
E0: CPX - Immediate E0: CPX - Immediate
E1: SBC - (Zero Page, X) E1: SBC - (Zero Page, X)
E2: E2:
E3: ISB - (Zero Page, X) E3: ISB - (Zero Page, X)
E4: CPX - Zero Page E4: CPX - Zero Page
E5: SBC - Zero Page E5: SBC - Zero Page
E6: INC - Zero Page E6: INC - Zero Page
E7: ISB - Zero Page E7: ISB - Zero Page
E8: INX - Implied E8: INX - Implied
E9: SBC - Immediate E9: SBC - Immediate
EA: NOP - Implied EA: NOP - Implied
EB: EB:
EC: CPX - Absolute EC: CPX - Absolute
ED: SBC - Absolute ED: SBC - Absolute
EE: INC - Absolute EE: INC - Absolute
EF: ISB - Absolute EF: ISB - Absolute
F0: BEQ - Relative F0: BEQ - Relative
F1: SBC - (Zero Page), Y F1: SBC - (Zero Page), Y
F2: F2:
F3: ISB - (Zero Page), Y F3: ISB - (Zero Page), Y
F4: F4:
F5: SBC - Zero Page, X F5: SBC - Zero Page, X
F6: INC - Zero Page, X F6: INC - Zero Page, X
F7: ISB - Zero Page, X F7: ISB - Zero Page, X
F8: SED - Implied F8: SED - Implied
F9: SBC - Absolute, Y F9: SBC - Absolute, Y
FA: FA:
FB: ISB - Absolute, Y FB: ISB - Absolute, Y
FC: FC:
FD: SBC - Absolute, X FD: SBC - Absolute, X
FE: INC - Absolute, X FE: INC - Absolute, X
FF: ISB - Absolute, X FF: ISB - Absolute, X