RedPower CPU Instruction Table

 x0x1x2x3x4x5x6x7x8x9xAxBxCxDxExF
0xBRKORA (Ind,X)NXTORA r,STSB ZpORA ZpASL ZpORA r,RPHPORA #ASL ARHITSB AbsORA AbsASL AbsMUL Zp
1xBPL RelORA (Ind),YORA (Ind)ORA (r,S),YTRB ZpORA Zp,XASL Zp,XORA (r,R),YCLCORA Abs,YINC ARHXTRB AbsORA Abs,XASL Abs,XMUL Zp,X
2xJSR AbsAND (Ind,X)ENTAND r,SBIT ZpAND ZpROL ZpAND r,RPLPAND #ROL ARLIBIT AbsAND AbsROL AbsMUL Abs
3xBMI RelAND (Ind),YAND (Ind)AND (r,S),YBIT Zp,XAND Zp,XROL Zp,XAND (r,R),YSECAND Abs,YDEC ARLXBIT Abs,XAND Abs,XROL Abs,XMUL Abs,X
4xRTIEOR (Ind,X)NXAEOR r,SREA AbsEOR ZpLSR ZpEOR r,RPHAEOR #LSR ARHAJMP AbsEOR AbsLSR AbsDIV Zp
5xBVC RelEOR (Ind),YEOR (Ind)EOR (r,S),YREI (Zp)EOR Zp,XLSR Zp,XEOR (r,R),YCLIEOR Abs,YPHYRHYTXIEOR Abs,XLSR Abs,XDIV Zp,X
6xRTSADC (Ind,X)PER RelADC r,SSTZ ZpADC ZpROR ZpADC r,RPLAADC #ROR ARLAJMP (Ind)ADC AbsROR AbsDIV Abs
7xBVS RelADC (Ind),YADC (Ind)ADC (r,S),YSTZ Zp,XADC Zp,XROR Zp,XADC (r,R),YSEIADC Abs,YPLYRLYJMP (Abs,X)ADC Abs,XROR Abs,XDIV Abs,X
8xBRA RelSTA (Ind,X)RER RelSTA r,SSTY ZpSTA ZpSTX ZpSTA r,RDEYBIT #TXATXRSTY AbsSTA AbsSTX AbsZEA
9xBCC RelSTA (Ind),YSTA (Ind)STA (r,S),YSTY Zp,XSTA Zp,XSTX Zp,YSTA (r,R),YTYASTA Abs,YTXSTXYSTZ AbsSTA Abs,XSTZ Abs,XSEA
AxLDY #LDA (Ind,X)LDX #LDA r,SLDY ZpLDA ZpLDX ZpLDA r,RTAYLDA #TAXTRXLDY AbsLDA AbsLDX AbsTDA
BxBCS RelLDA (Ind),YLDA (Ind)LDA (r,S),YLDY Zp,XLDA Zp,XLDX Zp,YLDA (r,R),YCLVLDA Abs,YTSXTYXLDY Abs,XLDA Abs,XLDX Abs,YTAD
CxCPY #CMP (Ind,X)REP #CMP r,SCPY ZpCMP ZpDEC ZpCMP r,RINYCMP #DEXWAICPY AbsCMP AbsDEC AbsPLD
DxBNE RelCMP (Ind),YCMP (Ind)CMP (r,S),YPEI (Zp)CMP Zp,XDEC Zp,XCMP (r,R),YCLDCMP Abs,YPHXSTPTIXCMP Abs,XDEC Abs,XPHD
ExCPX #SBC (Ind,X)SEP #SBC r,SCPX ZpSBC ZpINC ZpSBC r,RINXSBC #NOPXBACPX AbsSBC AbsINC AbsMMU
FxBEQ RelSBC (Ind),YSBC (Ind)SBC (r,S),YPEA AbsSBC Zp,XINC Zp,XSBC (r,R),YSEDSBC Abs,YPLXXCEJSR (Abs,X)SBC Abs,XINC Abs,X 

Key: 6502 Base Instructions 65C02 Instructions 65C816 Instructions 65EL02 Instructions

An assembler is available here: ACME for RedPower.

Instruction Listing

Standard 6502 Instructions

Arithmetic

ADCAdd with carryN,V,Z,C
CMPCompare accumulatorN,Z,C
CPXCompare X registerN,Z,C
CPYCompare Y registerN,Z,C
DECDecrement memory locationN,Z
DEXDecrement X registerN,Z
DEYDecrement Y registerN,Z
SBCSubtract with carryN,V,Z,C

Load/Store

LDALoad accumulatorN,Z
LDXLoad X registerN,Z
LDYLoad Y registerN,Z
STAStore accumulator 
STXStore X register 
STYStore Y register 
TAXTransfer accumulator to XN,Z
TAYTransfer accumulator to YN,Z
TSXTransfer stack pointer to XN,Z
TXATransfer X to accumulatorN,Z
TXSTransfer X to stack pointerN,Z
TYATransfer Y to accumulatorN,Z

Logical

ANDLogical ANDN,Z
ASLArithmatic shift leftN,Z,C
BITBit testN,V,Z
BIT #Bit test immediateZ
EORExclusive ORN,Z
LSRLogical shift rightN,Z,C
ORALogical ORN,Z
ROLRotate leftN,Z,C
RORRotate leftN,Z,C

Branching

BCCBranch if carry flag clear 
BCSBranch if carry flag set 
BEQBranch if zero flag set 
BMIBranch if negative flag set 
BNEBranch if zero flag clear 
BPLBranch if negative flag clear 
BVCBranch if overflow flag clear 
BVSBranch if overflow flag set 
BRABranch always 

Jumps and Calls

JMPJump 
JSRJump saving return 
RTSReturn from subroutine 
RTIReturn from interruptAll

Flag Manipulation

CLCClear carry flagC
CLDClear decimal flagD
CLIClear interrupt disable flagI
CLVClear overflow flagV
SECSet carry flagC
SEDSet decimal flagD
SEISet interrupt disable flagI

System

BRKForce an interruptB
NOPNo operation 

Stack Operations

PHAPush accumulator on stack 
PHPPush processor status on stack 
PHXPush X register on stack 
PHYPush Y register on stack 
PLAPull accumulator from stackN,Z
PLPPull processor status from stackAll
PLXPull X register from stackN,Z
PLYPull Y register from stackN,Z

65C02 Instructions

STZStore 0 
TRBTest and Reset BitsZ
TSBTest and Set BitsZ
STPHalt and Catch Fire 
WAIWait for Interrupt 

65C816 Instructions

PEAPush effective address 
PEIPush effective indirect address 
PERPush effective relative address 
REPReset FlagsAll
SEPSet FlagsAll
TXYTransfer X to YN,Z
TYXTransfer Y to XN,Z
XBAExchange A bytes 
XCEExchange C and E flagsC,E

65EL02 Instructions

ENTEnter word, RHI, I=PC+2, PC=(PC) 
NXANext word into A, A=(I), I=I+1/I=I+2 
NXTNext word, PC=(I), I=I+2 
TXRTransfer X to RN,Z
TRXTransfer R to XN,Z
TXITransfer X to IN,Z
TIXTransfer I to XN,Z
RHAPush accumulator to R stack 
RLAPull accumulator from R stackN,Z
RHXPush X register to R stack 
RLXPull X register from R stackN,Z
RHYPush Y register to R stack 
RLYPull Y register from R stackN,Z
RHIPush I register to R stack 
RLIPull I register from R stackN,Z
RERPush effective relative address to R stack 
MMUPrefix for MMU manipulation 

Math Extensions

MULSigned multiply A into D:AN,Z,O
DIVSigned divide D:A, quotient in A, remainder in DN,Z,O
ZEAZero extend A into D:A 
SEASign extend A into D:A 
TADTransfer A to DN,Z
TDATransfer D to AN,Z
PHDPush D register on stack 
PLDPull D register from stackN,Z