Professional Documents
Culture Documents
7 Instruction Set of 8085
7 Instruction Set of 8085
Instruction Byte.
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 2
Arithmetic Instructions
Logical Instructions Branching Instructions Control Instructions
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 3
destination.
While copying, the contents of source are not
modified.
www.eazynotes.com
12-Dec-11
Operand
Rd, Rs M, Rs Rd, M
Description
Copy from source to destination.
Operand
Rd, Data M, Data
Description
Move immediate 8-bit
memory.
If the operand is a memory location, its location is
Operand
B/D Register Pair
Description
Load accumulator indirect
location.
The contents of either the register pair or the memory location Example: LDAX B
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 8
Operand
Reg. pair, 16-bit data
Description
Load register pair immediate
www.eazynotes.com
12-Dec-11
Operand
16-bit address
Description
Load H-L registers direct
register H.
Example: LHLD 2040 H
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 10
Operand
16-bit address
Description
Store accumulator direct
www.eazynotes.com
12-Dec-11
11
Operand
Reg. pair
Description
Store accumulator indirect
www.eazynotes.com
12-Dec-11
12
Operand
16-bit address
Description
Store H-L registers direct
memory location.
Example: SHLD 2550 H
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 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 Maninder Kaur
www.eazynotes.com 12-Dec-11 14
Operand
None
Description
Copy H-L pair to the Stack Pointer (SP)
Example: SPHL
www.eazynotes.com
12-Dec-11
15
Operand
None
Description
Exchange HL with top of stack
Operand
None
Description
Load program counter with H-L contents
Operand
Reg. pair
Description
Push register pair onto stack
Operand
Reg. pair
Description
Pop stack to register pair
Operand
8-bit port address
Description
Copy data from accumulator to a port with 8bit address
port.
Example: OUT 78 H
www.eazynotes.com
12-Dec-11
20
Operand
8-bit port address
Description
Copy data to accumulator from a port with 8bit address
Example: IN 8C H
www.eazynotes.com
12-Dec-11
21
Arithmetic Instructions
These instructions perform the operations like:
Addition Subtract Increment Decrement
www.eazynotes.com
12-Dec-11
22
Addition
Any 8-bit number, or the contents of register, or the
www.eazynotes.com
12-Dec-11
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 Maninder Kaur
www.eazynotes.com 12-Dec-11 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
12-Dec-11
25
Arithmetic Instructions
Opcode
ADD R M
Operand
Description
Add register or memory to accumulator
accumulator.
www.eazynotes.com
12-Dec-11
26
Arithmetic Instructions
Opcode
ADC R M
Operand
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
12-Dec-11
27
Arithmetic Instructions
Opcode
ADI
Operand
8-bit data
Description
Add immediate to accumulator
addition.
Example: ADI 45 H
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 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 Maninder Kaur
www.eazynotes.com 12-Dec-11 29
Arithmetic Instructions
Opcode
DAD
Operand
Reg. pair
Description
Add register pair to H-L pair
The result is stored in H-L pair. If the result is larger than 16 bits, then CY is set.
Arithmetic Instructions
Opcode
SUB R M
Operand
Description
Subtract register or memory from accumulator
www.eazynotes.com
12-Dec-11
31
Arithmetic Instructions
Opcode
SBB R M
Operand
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
12-Dec-11
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 Maninder Kaur
www.eazynotes.com 12-Dec-11 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
Arithmetic Instructions
Opcode
INR R M
Operand
Description
Increment register or memory by 1
incremented by 1.
The result is stored in the same place. If the operand is a memory location, its address is specified
Arithmetic Instructions
Opcode
INX R
Operand
Description
Increment register pair by 1
www.eazynotes.com
12-Dec-11
36
Arithmetic Instructions
Opcode
DCR R M
Operand
Description
Decrement register or memory by 1
decremented by 1.
The result is stored in the same place. If the operand is a memory location, its address is specified
Arithmetic Instructions
Opcode
DCX R
Operand
Description
Decrement register pair by 1
www.eazynotes.com
12-Dec-11
38
Logical Instructions
These instructions perform logical operations on data
Rotate
Each bit in the accumulator can be shifted either left or
www.eazynotes.com
12-Dec-11
41
Compare
Any 8-bit data, or the contents of register, or memory
Complement
The contents of accumulator can be complemented.
Each 0 is replaced by 1 and each 1 is replaced by 0.
www.eazynotes.com
12-Dec-11
43
Logical Instructions
Opcode
CMP R M
Operand
Description
Compare register or memory with accumulator
Logical Instructions
Opcode
CMP R M
Operand
Description
Compare register or memory with accumulator
www.eazynotes.com
12-Dec-11
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
Logical Instructions
Opcode
CPI
Operand
8-bit data
Description
Compare immediate with accumulator
www.eazynotes.com
12-Dec-11
47
Logical Instructions
Opcode
ANA R M
Operand
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
Logical Instructions
Opcode
ANI
Operand
8-bit data
Description
Logical AND immediate with accumulator
CY is reset, AC is set.
Example: ANI 86H.
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 49
Logical Instructions
Opcode
ORA R M
Operand
Description
Logical OR register or memory with accumulator
The contents of the accumulator are logically ORed with the contents of the register or memory.
Logical Instructions
Opcode
ORI
Operand
8-bit data
Description
Logical OR immediate with accumulator
Logical Instructions
Opcode
XRA R M
Operand
Description
Logical XOR register or memory with accumulator
Logical Instructions
Opcode
XRI
Operand
8-bit data
Description
XOR immediate with accumulator
8-bit data.
The result is placed in the accumulator. S, Z, P are modified to reflect the result.
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.
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.
Logical Instructions
Opcode
RAL
Operand
None
Description
Rotate accumulator left through carry
Logical Instructions
Opcode
RAR
Operand
None
Description
Rotate accumulator right through carry
Logical Instructions
Opcode
CMA
Operand
None
Description
Complement accumulator
www.eazynotes.com
12-Dec-11
58
Logical Instructions
Opcode
CMC
Operand
None
Description
Complement carry
www.eazynotes.com
12-Dec-11
59
Logical Instructions
Opcode
STC
Operand
None Set carry
Description
www.eazynotes.com
12-Dec-11
60
Branching Instructions
The branching instruction alter the normal sequential
flow.
These instructions alter either unconditionally or
conditionally.
www.eazynotes.com
12-Dec-11
61
Branching Instructions
Opcode
JMP
Operand
16-bit address
Description
Jump unconditionally
www.eazynotes.com
12-Dec-11
62
Branching Instructions
Opcode
Jx
Operand
16-bit address
Description
Jump conditionally
location specified by the 16-bit address given in the operand based on the specified flag of the PSW.
Example: JZ 2034 H.
www.eazynotes.com
12-Dec-11
63
Jump Conditionally
Opcode
JC JNC JP
Description
Jump if Carry Jump if No Carry Jump if Positive
Status Flags
CY = 1 CY = 0 S=0
JM
JZ JNZ JPE JPO
Gursharan Singh Maninder Kaur
Jump if Minus
Jump if Zero Jump if No Zero Jump if Parity Even Jump if Parity Odd
S=1
Z=1 Z=0 P=1 P=0
www.eazynotes.com
12-Dec-11
64
Branching Instructions
Opcode
CALL
Operand
16-bit address
Description
Call unconditionally
CALL (the contents of the program counter) is pushed onto the stack.
Example: CALL 2034 H.
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 65
Branching Instructions
Opcode
Cx
Operand
16-bit address
Description
Call conditionally
location specified by the 16-bit address given in the operand based on the specified flag of the PSW.
Before the transfer, the address of the next instruction
after the call (the contents of the program counter) is pushed onto the stack.
Example: CZ 2034 H.
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 66
Call Conditionally
Opcode
CC CNC CP
Description
Call if Carry Call if No Carry Call if Positive
Status Flags
CY = 1 CY = 0 S=0
CM
CZ CNZ CPE CPO
Gursharan Singh Maninder Kaur
Call if Minus
Call if Zero Call if No Zero Call if Parity Even Call if Parity Odd
S=1
Z=1 Z=0 P=1 P=0
www.eazynotes.com
12-Dec-11
67
Branching Instructions
Opcode
RET
Operand
None
Description
Return unconditionally
the program counter, and program execution begins at the new address.
Example: RET.
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 68
Branching Instructions
Opcode
Rx
Operand
None
Description
Call conditionally
subroutine to the calling program based on the specified flag of the PSW.
The two bytes from the top of the stack are copied into
the program counter, and program execution begins at the new address.
Example: RZ.
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 69
Return Conditionally
Opcode
RC RNC RP
Description
Return if Carry Return if No Carry Return if Positive
Status Flags
CY = 1 CY = 0 S=0
RM
RZ RNZ RPE RPO
Gursharan Singh Maninder Kaur
Return if Minus
Return if Zero Return if No Zero Return if Parity Even Return if Parity Odd
S=1
Z=1 Z=0 P=1 P=0
www.eazynotes.com
12-Dec-11
70
Branching Instructions
Opcode
RST
Operand
07
Description
Restart (Software Interrupts)
Restart Address
0000 H 0008 H 0010 H
RST 3
RST 4 RST 5 RST 6 RST 7
Gursharan Singh Maninder Kaur
0018 H
0020 H 0028 H 0030 H 0038 H
www.eazynotes.com
12-Dec-11
72
Control Instructions
The control instructions control the operation of
microprocessor.
www.eazynotes.com
12-Dec-11
73
Control Instructions
Opcode
NOP
Operand
None No operation
Description
No operation is performed.
operation is executed.
Example: NOP
www.eazynotes.com
12-Dec-11
74
Control Instructions
Opcode
HLT
Operand
None Halt
Description
state.
Example: HLT
Gursharan Singh Maninder Kaur
www.eazynotes.com
12-Dec-11
75
Control Instructions
Opcode
DI
Operand
None
Description
Disable interrupt
www.eazynotes.com
12-Dec-11
76
Control Instructions
Opcode
EI
Operand
None Enable interrupt
Description
are enabled.
No flags are affected. This instruction is necessary to re-enable the
Control Instructions
Opcode
RIM
Operand
None
Description
Read Interrupt Mask
status of interrupts 7.5, 6.5, 5.5 and read serial data input bit.
The instruction loads eight bits in the accumulator
RIM Instruction
www.eazynotes.com
12-Dec-11
79
Control Instructions
Opcode
SIM
Operand
None
Description
Set Interrupt Mask
implement the 8085 interrupts 7.5, 6.5, 5.5, and serial data output.
The instruction interprets the accumulator contents as
follows.
Example: SIM
Gursharan Singh Maninder Kaur
www.eazynotes.com 12-Dec-11 80
SIM Instruction
www.eazynotes.com
12-Dec-11
81