6502_Instruction_Set_Summary 6502 Instruction Set Summary

User Manual: 6502_Instruction_Set_Summary

Open the PDF directly: View PDF PDF.
Page Count: 4

Download6502_Instruction_Set_Summary 6502 Instruction Set Summary
Open PDF In BrowserView PDF
~

MOS TECHNOLOGY, INC.
Valley Forge Corporate Center
950 Rittenhouse Road
Norristown, Pa. 19401

MCS6500
SET

PROCESSOR

INS T'R U C T ION
SUMMARY

PROGRAMMING

i

MODEL

ACCUMULATOR

INDEX REGISTER

INDEX REGISTER
PCH

PCL

j

,
INlvl Ie 101' Izici

PROGRAM COUNTER

"PC"

STACK POINTER

"S"

PROCESSOR STATUS REG

"P"

CARRY
~ ZERO

1 = TRUE

1 '" RESULT ZERO

IRQ DISABLE

1 '" DISABLE

DECIMAL MODE

1 '" TRUE

BRKCOMMANO

OVERFLOW

1 z TRUE

NEGATIVE

1 = NEG.

INSTRUCTIONS
_EMOIIIC

ADC

I"UDI"'T£

OPERATION
A<-M'C _

A

14111,

OP

N #

1~9

, i1

8 C5

BRANCH ON

C~I

8EQ

BRANCH ON

~_1

8M'

BRANCH ON

N~

BRANCH ON

8 R K

ISe!F,g II

8 V 5

BRANCH ON V-I

OP

_

J 16; jJ

'c L D

A-.

C P Y

y-.

DEC

M-l_M

y,

'0'

C9

, , lc.~ , ..,'. e~
, , cc ,
,

6

e,

F7'(;';"

:,:

M _A

III

11.9

OP

x

30

,

N

3

i

,

AISOlUTE

#OPN

#

2

2 ~O 4

OPN

3 95

e

,

D

#

;,'

D;

, , IDD
,

3

'!'

"'CCUM.

OPN

, i ,

DE

, ,

IFE

,

D9

.,

, , ,
, , ,
, ,

I

,

, ,
, ,

Al

6

2

(lND)O

#

OP'"

#

;

"

,

, ,

i!.~"'GE,X

(lNo), Y
OPN

"

#

OPN

#

3"

'D ,

, ,

3

... IS....

US, X
OPN

,

#

OPN

3

;

#

OPN

#

IIiDIREeT

~PAGE.'"

#

OPN#

N

~~.4:2

.

OP ...

8E41~.

III

2E632615'lA"

A0 R

6EI 6

3 ,66 5

2 6A 2

6

1

5

11

2

IS

4

2

'0

4

3

tl

C

I

0

V

-

..

, ,

19

4

3

,,
, , ,

1

76

I"

,,,,,,.21 ATANSU,

CONDITION COOES

56615E73

2

"0

-

•

16e

IMPLIED

#

- - -

l

,,

j

0..,

-

1

I

,

, ,
", 6 ,

,

V

2

sa

"T S

,

, ..:.....:.

I

1

, I

lERO ~"'GE

D'

06, 6

2

i
11.5 1 3

,

E634652A21

19

N

,

I

nlA222AE43A632

lS R

-

CONDITION CODES

i!.~"'GE. V

OP N #

", ,

.. i

.'

1

3

AD , !3

IliIDlRtCT

OP N

j

.L
88

;

f6

#

,

,

.1.

Ie!.~

, .I

'0, ..

IMMEDIATE
O'fRATIOI

L O X " ....

3

,

T r

E8

dK

111010111:

OP N

"

3,1

; ,

3 C6

~E I 6

JUMP TO NEW LOC

RElATIVE

N #

3 ..'.'.:'.]

;"".,.'.,.. '

:

J M P

OP

,

'"
08 1

•. 3 ...~

1-'0'

~,

_M

'I'"

,1

CE

-x

" :6

OP N

j

'"

c.

X'I

';J~

,

!

I

'"

'"

M'"

2

, i'?.l ' -

;

1

J

1.

'NX

OP N

#

... as. V

AIS. X

i.PAGE.x

1#

;,;r; ,

.

'"

N~(I

:NC

OP N

",'

"
,~,

(lND).Y

-"

,

" ''i '"

DEY

, ,

OA

i

",MP

"""

61, 6

i

1'-'

OP' N

,"

'_D

C L.. '

#

I

2

:; I'

J 1;6

(lNO.X)

IMPLIED

OP N

NI_

,

,

ACCUM

OP

N

'"

1

8 PL

#

,,'1 6

~

AS L

N

6D!'

,.

~AGE

AISOlUT£ lERO
OP

6

2

7E 7

3

1

I" I'

,

2

I

F8

6

'D!' 3 las 3 ,

I
81

99

6 I 2

;

3

"'1,1,
AAI2

T5X

s .... x

TXS

x-s

I

1

, ,
9A

2

I

'" , ,

TVA
X

IF PAGE BOUNDRY IS CROSSED

INDEX,

x

..

ADD 1 TO "N" IF 6RANCH OCCURS TO SAME PAGE
ADO 2 TO 'N" IF 6RANCH OCCURS TO DIFFERENT PAGE
IF IN DECIMAL MODE Z FLAG IS INVAliD
ACCUMUlATOR MUST BE CHECIqe

CPX 2- .~.ge

~

lSR

PL~

~.p.9'I

Page

i"Of""

IMMEDIATE ADDRESSING - THE OPERAND IS CONTAINED IN THE SECOND BYTE OF
THE INSTRUCTION

ABS x

ABSOLUTE ADDRESSING - THE SECOND BYTE OF THE INSTRUCTION CONTAINS THE
8 LOW ORDER BITSOF THE EFFECTIVE ADDRESS THE THIRD BYTE CONTAINS THE
8 HIGH ORDER BITS OF THE EFFECTIVE ADDRESS

liND

ABS Y ABSOLUTE INDEXED THE EFFECTIVE ADDRESS IS FORMED BY AODING THE INDEX
TO THE SECOND AND THIRD BYTE OF THE INSTRUCTION
X~

INDEXED INDIRECT
THE SECOND BYTE OF THE INSTRUCTION IS ADDED TO THE
X INDEX, DISCARDING THE CARRY THE RESULTS POINTS TO A LOCATION ON
PAGE ZERO WHICH CONTAINS THE 8 LOW ORDER BITS OF THE EA THE NEXT 8YTE
CONTAINS THE B HIGH ORDER BITS

l PAGE ZERO PAGE ADDRESSING

SECOND BYTE CONTAINS THE 8 LOW ORDER BITS OF THE
EFFECTIVE ADDRESS THE 8 HIGH ORDER BITS ARE ZERO
ACCUMULATOR

ONE BYTE INSTRUCTION OPERATING ON THE ACCUMULATOR

l PAGE.X ~ PAGE Y ZERO PAGE INDEXED

THE SECOND BYTE OF THE INSTRUCTION IS
ADDED TO THE INDEX (CARRY IS DROPPEDI TO FORM THE LOW ORDER BYTE OF
THE EA T,iE HIGH ORDER BYTE OF THE EA IS ZE ROS

(lND~.Y

INDIRECT INDEXED - THE SECOND BYTE OF fHE INSTRUCTION POINTS TO A LOCA
- TION IN PAGE ZE-RQ- THE CONTE~TS OF THIS \~E"'10RY LOCATION IS ADDED TO THE
'0' INDEX THE RESUL T BEING THE LOW ORDER EIGHT BITS OF THE EA THE CARRY
FROM THIS OPERATION IS ADDED TO THE CONTE!\JTS OF THE IIJEXT PAGE ZERO
LOCATION THE RESULT BEI'lJG THE 8 HIGH ORDER BITS OF THE EA

_.

~SP

AFTER IAQ OR NMI

BUT BEFORE ATI

BEFORE I RO OR NMI

AND AFTER RTI

pc-

.,

pc-

_PCATTIMEORIRQOR
NMI • THIS INSTRUCTION

WI LL COMPLETE BEFORE
I
I
AVICEO

.

,

"

4

I

6

L--f-f--II 4

\1

7

•
•
,
0

F

F

F

F

F

F

A

3

NMI VECTOR

AOL

4

,

4

II

4

C

•

J

5

A

0

L

A

0

H

R

3

"

e
e

.,.."

JUMP TO SUBROUTINE

RETURN FROM SUBROUTINE TO
THIS LOCATION

SUBROUTINE MAIN

5

BODY

6
7

114118

AD H
F

1

RETURN FROM
INTERRUPT

RTI

RTS

"

RES VECTOR

ADL

F

F

F

0

ADH

F

F

F

e

AOL

05

F

F

F

FAD H

114

FIG.1

3

••
,• ,

INTERRUPT SERVICE
MAIN BODY

"

F

3
3

IRa. NMI. ATI, BRK OPERATION

lAO VECTOR

FIG.:Z

JSR, RTS OPERATION

RETURN FROM SUBROUTINE

ASCII CHARACTER SET (7-BIT CODE)

ASSEMBLER DIRECTIVES
• OPT· IF useD MUST BE THE FIRST EXECUTABLE STATEMENT IN THE PROGRAM.
• OPTIONS ARE:· IOPTIONS USTED ARE THE DEFAULT VALUE. TURNED OFF BY (NO) PREFIX.)
COUNT (COU OR CNT)· LIST ALL INSTRUCTIONS AND THEIR USAGE.
NOGENERATE (NOG) - DO NOT GENERATE MORE THAN ONE LINE OF CODE FOR ASCII STRINGS.
XREf (XflE)· PRODUCE A CROSS-REFERENCE LIST IN THE SYMBOL TABLE.
ERRORS (ERR)· CREATE AN ERROR FILE.
MEMORY (MEM) . CREATE AN ASSEMBLER OBJECT OUTPUT FILE.
LIST (LIS)· PRODUCE A FULL ASSEMBLY LISTING.
• BYTE· PRODUCES A SINGLE BYTE IN MEMORY EQUAL TO EACH OPERAND SPECIFIED.
• WORD· PRODUCES TWO BYTES IN MEMORY eQUAL TO EACH OPERAND SPECIFIED.

, •
• ,
,,, ,. ,
~
"
."
."
,
,, •
,
LSD

...

5

2

6

, 10

p

P

Q

q

NUL

OLE

SP

01)(111

SOH

DC'

I

1

,
•

0010

STX

DC2

0011

ETX

DC'

#

,

011010

EDT

DC.

S

4

0

T

5

0101

ENG

NAK

%

5

E

U

•

6

F

V

7

G

W

,

0000

2

2

A

B

R

C

S

b

d

01 HI

ACK

SYN

7

0111

BEL

ETB

• END - DEFINES THE END OF A SOURCE PROGRAM.

B

11100

BS

CAN

I

B

H

X

h

9

11101

HT

EM

I

9

I

Y

;

A

1010

LF

SUB

J

Z

j

K

[

k

L

\

I

M

]

m

LABELS:
LABELS BEGIN IN COLUMN 1 AND ARE SEPARATED FROM THE INSTRUCTION BY AT LEAST ONE SPACE.
LABELS CAN BE UP TO 6 ALPHANUMENIC CHARACTERS LONG AND MUST BEGIN WITH AN ALPHA CHARACTER.
A, X, Y, S, AND P ARE RESERVED AND CANNOT BE USED AS LABELS.
LABEL - EXPRESSION CAN BE USED TO EQUATE LABELS TO INSTRUCTIONS.
LABEL

*-*+

N CAN BE USED TO RESERVE AREAS IN MEMORY

CHARACTERS USED AS SPECIAL PREFIXES:
INDICATES AN ASSEMBLER 01 RECTIVE

#

SPECIFIES THE IMMEDIATE MODE OF ADDRESSING.
SPECIFIES A HEXADECIMAL CHARACTER.

"
'J(,

SPECIFIES AN OCTAL NUMBER.
SPECIFIES A BINARY NUMBER.
SPECIFIES AN ASCII LITERAL CHARACTER.

()

INDICATES INDIRECT ADDRESSING.
IN COLUMN 1 INDICATES A COMMENT.

B

10'1

VT

ESC

C

1199

FF

FS

0

11111

CR

GS

E

1119

SO

RS

F

1111

51

VS

,

.

<

-

I

>

,

N

0

-

.
"

6

• PAGE - ADVANCES THE LISTING TO THE TOP OF A NEW PAGE.

-... DEFINES THE BEGINNING OF A NEW PROGRAM COUNTER SEaUENCE.

7

,"

f

t

w

,
y

,
I

~

p

DEL



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.6
Linearized                      : No
Create Date                     : 2016:08:29 17:30:09-08:00
Modify Date                     : 2016:08:29 17:30:58-07:00
XMP Toolkit                     : Adobe XMP Core 4.2.1-c041 52.342996, 2008/05/07-21:37:19
Metadata Date                   : 2016:08:29 17:30:58-07:00
Producer                        : Adobe Acrobat 9.0 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:ecd704d9-dab5-054d-8056-eba1c9d51604
Instance ID                     : uuid:014892fb-0263-bc4b-9aa2-6b094e15d3b2
Page Layout                     : SinglePage
Page Mode                       : UseNone
Page Count                      : 4
EXIF Metadata provided by EXIF.tools

Navigation menu