2012-06-01 17:25:48 +00:00
|
|
|
; Test file for base 6502 opcode compliance
|
|
|
|
; This odd little source file uses every addressing mode
|
|
|
|
; of every opcode, and uses the opcode itself as the argument
|
|
|
|
; to each instruction that takes one. The resulting binary's
|
|
|
|
; bytes are thus in strictly increasing numerical order.
|
|
|
|
|
|
|
|
BRK
|
|
|
|
ORA ($01, X)
|
|
|
|
ORA $05
|
|
|
|
ASL $06
|
|
|
|
PHP
|
|
|
|
ORA #$09
|
|
|
|
ASL
|
|
|
|
ORA $0D0D
|
|
|
|
ASL $0E0E
|
|
|
|
BPL ^+$12
|
|
|
|
ORA ($11), Y
|
|
|
|
ORA $15, X
|
|
|
|
ASL $16, X
|
|
|
|
CLC
|
|
|
|
ORA $1919, Y
|
|
|
|
ORA $1D1D, X
|
|
|
|
ASL $1E1E, X
|
|
|
|
JSR $2020
|
|
|
|
AND ($21, X)
|
|
|
|
BIT $24
|
|
|
|
AND $25
|
|
|
|
ROL $26
|
|
|
|
PLP
|
|
|
|
AND #$29
|
|
|
|
ROL
|
|
|
|
BIT $2C2C
|
|
|
|
AND $2D2D
|
|
|
|
ROL $2E2E
|
|
|
|
BMI ^+$32
|
|
|
|
AND ($31), Y
|
|
|
|
AND $35, X
|
|
|
|
ROL $36, X
|
|
|
|
SEC
|
|
|
|
AND $3939, Y
|
|
|
|
AND $3D3D, X
|
|
|
|
ROL $3E3E, X
|
|
|
|
RTI
|
|
|
|
EOR ($41, X)
|
|
|
|
EOR $45
|
|
|
|
LSR $46
|
|
|
|
PHA
|
|
|
|
EOR #$49
|
|
|
|
LSR
|
|
|
|
JMP $4C4C
|
|
|
|
EOR $4D4D
|
|
|
|
LSR $4E4E
|
|
|
|
BVC ^+$52
|
|
|
|
EOR ($51), Y
|
|
|
|
EOR $55, X
|
|
|
|
LSR $56, X
|
|
|
|
CLI
|
|
|
|
EOR $5959, Y
|
|
|
|
EOR $5D5D, X
|
|
|
|
LSR $5E5E, X
|
|
|
|
RTS
|
|
|
|
ADC ($61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