22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 5-1. 6502 Instruction Set Listing<br />

Instruction Addressing Modes' Function Flags<br />

IMM ABS ZPG Z,X Z,Y A,X A,Y I,X I,Y ACC2 REL<br />

LDA 2 4 3 4 4 4 6 5 Load A NZ<br />

STA 4 3 4 5 5 6 6 Store A<br />

LDX 2 4 3 4 4 Load index X NZ<br />

LDY 2 4 3 4 4 Load index Y NZ<br />

STX 4 3 4 Store index X<br />

STY 4 3 4 Store index Y<br />

ADC 2 4 3 4 4 4 6 5 Add to A with carry NZVC<br />

SBC 2 4 3 4 4 4 6 5 Subtract from A w/carry NZ VC<br />

AND 2 4 3 4 4 4 6 5 And to A NZ<br />

ORA 2 4 3 4 4 4 6 5 Logical or to A NZ<br />

EOR 2 4 3 4 4 4 6 5 Exclusive or to A NZ<br />

CMP 2 4 3 4 4 4 6 5 Compare with A NZC<br />

CPX 2 4 3 Compare with X<br />

CPY 2 4 3 Compare with Y<br />

INC DEC 6 5 6 7 Increment, decrement NZ<br />

INXINY 2 Increment X and Y NZ<br />

DEX DEY 2 Decrement X and Y NZ<br />

ASL LSR 6 5 7 6 2 Shift left or right NZ C<br />

ROL ROR 6 5 7 6 2 Rotate left or right NZ C<br />

BxS BxC 2 Branch conditionally<br />

on any flag<br />

CLx SEx 2 Set or clear any flag Note 3<br />

JMP 3 5 Jump unconditionally<br />

JSR 6 Jump to subroutine Note 4<br />

RTS RTI 6 Return from subroutine NoteS<br />

PHA PHP 3 Push A, push status<br />

PLA PLP 4 Pull A, pull status Note 6<br />

TXA TXA 2 Transfer index to A NZ<br />

TAX TAY 2 Transfer A to index NZ<br />

TXS 2 X to stack pointer<br />

TSX 2 Stack pointer to X NZ<br />

NOP 2 No operation<br />

Notes:<br />

1 Numbers in this column are execution times with a 1-MHz clOCk. 4 Jump to subroutine does not save the flags; however, an interrupt does save<br />

2 Accumulator addressing mode also covers implied addressing. them.<br />

3 Flags that may be set or cleared directly are: carry, overflow, interrupt enable, decimal 5 Return from interrupt restores the flags.<br />

mode. 6 PLA sets Nand Z flags; PLP loads status from the stack.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!