mos6502/resources/test/instructions.asm

154 lines
3.7 KiB
NASM

; Test of instructions for the decompiler
;
; This file is intended to be assembled and then
; used as an input to a test that decompiles the
; binary back to the text version of the instructions
ADC #$ab ; ADC Immediate
ADC $ab ; ADC ZeroPage
ADC $ab,X ; ADC ZeroPageX
ADC $abcd ; ADC Absolute
ADC $abcd,X; ADC AbsoluteX
ADC $abcd,Y; ADC AbsoluteY
ADC ($ab,X); ADC IndirectX
ADC ($ab),Y; ADC IndirectY
AND #$ab ; AND Immediate
AND $ab ; AND ZeroPage
AND $ab,X ; AND ZeroPageX
AND $abcd ; AND Absolute
AND $abcd,X; AND AbsoluteX
AND $abcd,Y; AND AbsoluteY
AND ($ab,X); AND IndirectX
AND ($ab),Y; AND IndirectY
ASL ; ASL Accumulator
ASL $ab ; ASL ZeroPage
ASL $ab,X ; ASL ZeroPageX
ASL $abcd ; ASL Absolute
ASL $abcd,X; ASL AbsoluteX
BCC $ab ; BCC Immediate
BCS $ab ; BCS Immediate
BEQ $ab ; BEQ Immediate
BIT $ab ; BIT ZeroPage
BIT $abcd ; BIT Absolute
BMI $ab ; BMI Immediate
BNE $ab ; BNI Immediate
BPL $ab ; BPL Immediate
BRK ; BRK
BVC $ab ; BVC Immediate
BVS $ab ; BVS Immediate
CLC ; CLC
CLD ; CLD
CLI ; CLI
CLV ; CLV
CMP #$ab ; CMP Immediate
CMP $ab ; CMP ZeroPage
CMP $ab,X ; CMP ZeroPageX
CMP $abcd ; CMP Absolute
CMP $abcd,X; CMP AbsoluteX
CMP $abcd,Y; CMP AbsoluteY
CMP ($ab,X); CMP IndirectX
CMP ($ab),Y; CMP IndirectY
CPX #$ab ; CPX Immediate
CPX $ab ; CPX ZeroPage
CPX $abcd ; CPX Absolute
CPY #$ab ; CPY Immediate
CPY $ab ; CPY ZeroPage
CPY $abcd ; CPY Absolute
DEC $ab ; DEC ZeroPage
DEC $ab,X ; DEC ZeroPageX
DEC $abcd ; DEC Absolute
DEC $abcd,X; DEC AbsoluteX
DEX ; DEX
DEY ; DEY
EOR #$ab ; EOR Immediate
EOR $ab ; EOR ZeroPage
EOR $ab,X ; EOR ZeroPageX
EOR $abcd ; EOR Absolute
EOR $abcd,X; EOR AbsoluteX
EOR $abcd,Y; EOR AbsoluteY
EOR ($ab,X); EOR IndirectX
EOR ($ab),Y; EOR IndirectY
INC $ab ; INC ZeroPage
INC $ab,X ; INC ZeroPage,X
INC $abcd ; INC Absolute
INC $abcd,X; INC AbsoluteX
INX ; INX
INY ; INY
JMP $abcd ; JMP Absolute
JMP ($abcd); JMP Indirect
JSR $abcd ; JSR Absolute
LDA #$ab ; LDA Immediate
LDA $ab ; LDA ZeroPage
LDA $ab,X ; LDA ZeroPageX
LDA $abcd ; LDA Absolute
LDA $abcd,X; LDA AbsoluteX
LDA $abcd,Y; LDA AbsoluteY
LDA ($ab,X); LDA IndirectX
LDA ($ab),Y; LDA IndirectY
LDX #$ab ; LDX Immediate
LDX $ab ; LDX ZeroPage
LDX $ab,Y ; LDX ZeroPageY
LDX $abcd ; LDX Absolute
LDX $abcd,Y; LDX AbsoluteY
LDY #$ab ; LDY Immediate
LDY $ab ; LDY ZeroPage
LDY $ab,X ; LDY ZeroPageX
LDY $abcd ; LDY Absolute
LDY $abcd,X; LDY AbsoluteX
LSR ; LSR Accumulator
LSR $ab ; LSR ZeroPage
LSR $ab,X ; LSR ZeroPageX
LSR $abcd ; LSR Absolute
LSR $abcd,X; LSR AbsoluteX
NOP ; The great and powerful NOP
ORA #$ab ; ORA Immediate
ORA $ab ; ORA ZeroPage
ORA $ab,X ; ORA ZeroPageX
ORA $abcd ; ORA Absolute
ORA $abcd,X; ORA AbsoluteX
ORA $abcd,Y; ORA AbsoluteY
ORA ($ab,X); ORA IndirectX
ORA ($ab),Y; ORA IndirectY
PHA ; PHA
PHP ; PHP
PLA ; PLA
PLP ; PLP
ROL ; ROL Accumulator
ROL $ab ; ROL ZeroPage
ROL $ab,X ; ROL ZeroPageX
ROL $abcd ; ROL Absolute
ROL $abcd,X; ROL AbsoluteX
ROR ; ROR Accumulator
ROR $ab ; ROR ZeroPage
ROR $ab,X ; ROR ZeroPageX
ROR $abcd ; ROR Absolute
ROR $abcd,X; ROR AbsoluteX
RTI ; Interrupt Return
RTS ; Subroutine Return