Professional Documents
Culture Documents
Instruction Set of 8085
Instruction Set of 8085
professorgstatla@gmail.com
www.eazynotes.com
Instruction Byte.
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
www.eazynotes.com
destination.
While copying, the contents of source are not
modified.
www.eazynotes.com
Operand
Rd, Rs
M, Rs
Rd, M
Description
Copy from source to destination.
www.eazynotes.com
Operand
Rd, Data
M, Data
Description
Move immediate 8-bit
memory.
If the operand is a memory location, its location is
www.eazynotes.com
Operand
16-bit address
Description
Load Accumulator
www.eazynotes.com
Operand
B/D Register
Pair
Description
Load accumulator indirect
location.
Example: LDAX B
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
Operand
Reg. pair, 16-bit
data
Description
Load register pair immediate
www.eazynotes.com
Operand
16-bit address
Description
Load H-L registers direct
register H.
Example: LHLD 2040 H
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
10
Operand
16-bit address
Description
Store accumulator direct
www.eazynotes.com
11
Operand
Reg. pair
Description
Store accumulator indirect
www.eazynotes.com
12
Operand
16-bit address
Description
Store H-L registers direct
memory location.
Example: SHLD 2550 H
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
13
Operand
None
Description
Exchange H-L with D-E
contents of register D.
The contents of register L are exchanged with the
contents of register E.
Example: XCHG
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
14
Operand
None
Description
Copy H-L pair to the Stack Pointer (SP)
www.eazynotes.com
15
Operand
None
Description
Exchange HL with top of stack
www.eazynotes.com
16
Operand
None
Description
Load program counter with H-L contents
www.eazynotes.com
17
Operand
Reg. pair
Description
Push register pair onto stack
www.eazynotes.com
18
Operand
Reg. pair
Description
Pop stack to register pair
www.eazynotes.com
19
Operand
8-bit port
address
Description
Copy data from accumulator to a port with 8bit address
port.
Example: OUT 78 H
www.eazynotes.com
20
Operand
8-bit port
address
Description
Copy data to accumulator from a port with 8bit address
www.eazynotes.com
21
Arithmetic Instructions
These instructions perform the operations like:
Addition
Subtract
Increment
Decrement
www.eazynotes.com
22
Addition
Any 8-bit number, or the contents of register, or the
www.eazynotes.com
23
Subtraction
Any 8-bit number, or the contents of register, or the
form.
No two other 8-bit registers can be subtracted directly.
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
24
Increment / Decrement
The 8-bit contents of a register or a memory location
incremented or decremented by 1.
Increment or decrement can be performed on any
www.eazynotes.com
25
Arithmetic Instructions
Opcode
ADD
Operand
R
M
Description
Add register or memory to accumulator
accumulator.
www.eazynotes.com
26
Arithmetic Instructions
Opcode
ADC
Operand
R
M
Description
Add register or memory to accumulator with
carry
The contents of register or memory and Carry Flag (CY) are added to
www.eazynotes.com
27
Arithmetic Instructions
Opcode
ADI
Operand
8-bit data
Description
Add immediate to accumulator
addition.
Example: ADI 45 H
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
28
Arithmetic Instructions
Opcode
ACI
Operand
8-bit data
Description
Add immediate to accumulator with carry
The 8-bit data and the Carry Flag (CY) are added to the
contents of accumulator.
The result is stored in accumulator.
All flags are modified to reflect the result of the addition.
Example: ACI 45 H
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
29
Arithmetic Instructions
Opcode
DAD
Operand
Reg. pair
Description
Add register pair to H-L pair
Example: DAD B
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
30
Arithmetic Instructions
Opcode
SUB
Operand
R
M
Description
Subtract register or memory from accumulator
www.eazynotes.com
31
Arithmetic Instructions
Opcode
SBB
Operand
R
M
Description
Subtract register or memory from accumulator
with borrow
The contents of the register or memory location and Borrow Flag (i.e.
www.eazynotes.com
32
Arithmetic Instructions
Opcode
SUI
Operand
8-bit data
Description
Subtract immediate from accumulator
accumulator.
The result is stored in accumulator.
All flags are modified to reflect the result of subtraction.
Example: SUI 45 H
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
33
Arithmetic Instructions
Opcode
SBI
Operand
8-bit data
Description
Subtract immediate from accumulator with
borrow
The 8-bit data and the Borrow Flag (i.e. CY) is subtracted
www.eazynotes.com
34
Arithmetic Instructions
Opcode
INR
Operand
R
M
Description
Increment register or memory by 1
incremented by 1.
The result is stored in the same place.
www.eazynotes.com
35
Arithmetic Instructions
Opcode
INX
Operand
R
Description
Increment register pair by 1
Example: INX H
www.eazynotes.com
36
Arithmetic Instructions
Opcode
DCR
Operand
R
M
Description
Decrement register or memory by 1
decremented by 1.
The result is stored in the same place.
www.eazynotes.com
37
Arithmetic Instructions
Opcode
DCX
Operand
R
Description
Decrement register pair by 1
Example: DCX H
www.eazynotes.com
38
Logical Instructions
These instructions perform logical operations on data
www.eazynotes.com
39
XOR operation
www.eazynotes.com
40
Rotate
Each bit in the accumulator can be shifted either left or
www.eazynotes.com
41
Compare
Any 8-bit data, or the contents of register, or memory
Less Than
www.eazynotes.com
42
Complement
The contents of accumulator can be complemented.
Each 0 is replaced by 1 and each 1 is replaced by 0.
www.eazynotes.com
43
Logical Instructions
Opcode
CMP
Operand
R
M
Description
Compare register or memory with
accumulator
www.eazynotes.com
44
Logical Instructions
Opcode
CMP
Operand
R
M
Description
Compare register or memory with
accumulator
www.eazynotes.com
45
Logical Instructions
Opcode
CPI
Operand
8-bit data
Description
Compare immediate with accumulator
accumulator.
The values being compared remain unchanged.
The result of the comparison is shown by setting the
www.eazynotes.com
46
Logical Instructions
Opcode
CPI
Operand
8-bit data
Description
Compare immediate with accumulator
www.eazynotes.com
47
Logical Instructions
Opcode
ANA
Operand
R
M
Description
Logical AND register or memory with
accumulator
The contents of the accumulator are logically ANDed with the contents
of register or memory.
The result is placed in the accumulator.
If the operand is a memory location, its address is specified by the
www.eazynotes.com
48
Logical Instructions
Opcode
ANI
Operand
8-bit data
Description
Logical AND immediate with accumulator
www.eazynotes.com
49
Logical Instructions
Opcode
ORA
Operand
R
M
Description
Logical OR register or memory with
accumulator
The contents of the accumulator are logically ORed with the contents of the register or
memory.
The result is placed in the accumulator.
If the operand is a memory location, its address is specified by the contents of H-L pair.
S, Z, P are modified to reflect the result.
CY and AC are reset.
Example: ORA B or ORA M.
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
50
Logical Instructions
Opcode
ORI
Operand
8-bit data
Description
Logical OR immediate with accumulator
www.eazynotes.com
51
Logical Instructions
Opcode
XRA
Operand
R
M
Description
Logical XOR register or memory with
accumulator
www.eazynotes.com
52
Logical Instructions
Opcode
XRI
Operand
8-bit data
Description
XOR immediate with accumulator
8-bit data.
The result is placed in the accumulator.
www.eazynotes.com
53
Logical Instructions
Opcode
RLC
Operand
None
Description
Rotate accumulator left
position.
Bit D7 is placed in the position of D0 as well as in the Carry
flag.
CY is modified according to bit D7.
S, Z, P, AC are not affected.
Example: RLC.
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
54
Logical Instructions
Opcode
RRC
Operand
None
Description
Rotate accumulator right
position.
Bit D0 is placed in the position of D7 as well as in the Carry
flag.
CY is modified according to bit D0.
S, Z, P, AC are not affected.
Example: RRC.
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
55
Logical Instructions
Opcode
RAL
Operand
None
Description
Rotate accumulator left through carry
www.eazynotes.com
56
Logical Instructions
Opcode
RAR
Operand
None
Description
Rotate accumulator right through carry
www.eazynotes.com
57
Logical Instructions
Opcode
CMA
Operand
None
Description
Complement accumulator
www.eazynotes.com
58
Logical Instructions
Opcode
CMC
Operand
None
Description
Complement carry
www.eazynotes.com
59
Logical Instructions
Opcode
STC
Operand
None
Description
Set carry
www.eazynotes.com
60
Branching Instructions
The branching instruction alter the normal sequential
flow.
These instructions alter either unconditionally or
conditionally.
www.eazynotes.com
61
Branching Instructions
Opcode
JMP
Operand
16-bit address
Description
Jump unconditionally
www.eazynotes.com
62
Branching Instructions
Opcode
Jx
Operand
16-bit address
Description
Jump conditionally
www.eazynotes.com
63
Jump Conditionally
Opcode
JC
Description
Status Flags
Jump if Carry
CY = 1
JNC
Jump if No Carry
CY = 0
JP
Jump if Positive
S=0
JM
Jump if Minus
S=1
JZ
Jump if Zero
Z=1
JNZ
Jump if No Zero
Z=0
JPE
P=1
JPO
P=0
www.eazynotes.com
64
Branching Instructions
Opcode
CALL
Operand
16-bit address
Description
Call unconditionally
www.eazynotes.com
65
Branching Instructions
Opcode
Cx
Operand
16-bit address
Description
Call conditionally
www.eazynotes.com
66
Call Conditionally
Opcode
CC
Description
Status Flags
Call if Carry
CY = 1
CNC
Call if No Carry
CY = 0
CP
Call if Positive
S=0
CM
Call if Minus
S=1
CZ
Call if Zero
Z=1
CNZ
Call if No Zero
Z=0
CPE
P=1
CPO
P=0
www.eazynotes.com
67
Branching Instructions
Opcode
RET
Operand
None
Description
Return unconditionally
www.eazynotes.com
68
Branching Instructions
Opcode
Rx
Operand
None
Description
Call conditionally
www.eazynotes.com
69
Return Conditionally
Opcode
RC
Description
Status Flags
Return if Carry
CY = 1
RNC
Return if No Carry
CY = 0
RP
Return if Positive
S=0
RM
Return if Minus
S=1
RZ
Return if Zero
Z=1
RNZ
Return if No Zero
Z=0
RPE
P=1
RPO
P=0
www.eazynotes.com
70
Branching Instructions
Opcode
RST
Operand
07
Description
Restart (Software Interrupts)
www.eazynotes.com
71
Instructions
Restart Address
RST 0
0000 H
RST 1
0008 H
RST 2
0010 H
RST 3
0018 H
RST 4
0020 H
RST 5
0028 H
RST 6
0030 H
RST 7
0038 H
www.eazynotes.com
72
Control Instructions
The control instructions control the operation of
microprocessor.
www.eazynotes.com
73
Control Instructions
Opcode
NOP
Operand
None
Description
No operation
No operation is performed.
The instruction is fetched and decoded but no
operation is executed.
Example: NOP
www.eazynotes.com
74
Control Instructions
Opcode
HLT
Operand
None
Description
Halt
state.
Example: HLT
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
75
Control Instructions
Opcode
DI
Operand
None
Description
Disable interrupt
www.eazynotes.com
76
Control Instructions
Opcode
EI
Operand
None
Description
Enable interrupt
are enabled.
No flags are affected.
www.eazynotes.com
77
Control Instructions
Opcode
RIM
Operand
None
Description
Read Interrupt Mask
www.eazynotes.com
78
RIM Instruction
www.eazynotes.com
79
Control Instructions
Opcode
SIM
Operand
None
Description
Set Interrupt Mask
follows.
Example: SIM
Gursharan Singh Tatla
professorgstatla@gmail.com
www.eazynotes.com
80
SIM Instruction
www.eazynotes.com
81