8085 Instruction Set
8085 Instruction Set
8085
Instruction Set of
8085
⚫ An instruction is a binary pattern designed inside a microprocessor
to perform a specific function.
• Arithmetic Instructions
• Logical Instructions
• Branching Instructions
• Control Instructions
Data Transfer
Instructions
• These instructions move data between registers, or between
memory and registers.
⚫ Example: MOV B, C
⚫ MOV B, M
⚫ MOV M, C
Data Transfer
Instructions
Opcode Operand Description
MVI Rd, Data Move immediate 8-bit
M, Data
⚫ MVI M, 57H
Data Transfer
Instructions
Opcode Operand Description
LXI Reg. pair, 16-bit Load register pair immediate
data
⚫ Example: LDAX B
Data Transfer
Instructions
Opcode Operand Description
LHLD 16-bit address Load H-L registers direct
⚫ Example: STAX B
Data Transfer
Instructions
Opcode Operand Description
SHLD 16-bit address Store H-L registers direct
⚫ Example: XCHG
Arithmetic
Instructions
• These instructions perform the operations like:
• Addition
• Subtract
• Increment
• Decrement
Additio
n
• Any 8-bit number, or the contents of register, or the contents of
memory location can be added to the contents of accumulator.
⚫ The contents of register or memory and Carry Flag (CY) are added to the
contents of accumulator.
⚫ Example: ADI 45 H
Arithmetic
Instructions
Opcode Operand Description
ACI 8-bit data Add immediate to accumulator with carry
⚫ The 8-bit data and the Carry Flag (CY) are added to the
contents of accumulator.
⚫ Example: ACI 45 H
Arithmetic
Instructions
Opcode Operand Description
DAD Reg. pair Add register pair to H-L pair
⚫ Example: DAD B
Arithmetic
Instructions
Opcode Operand Description
SUB R Subtract register or memory from accumulator
M
⚫ The contents of the register or memory location are subtracted from the
contents of the accumulator.
⚫ The contents of the register or memory location and Borrow Flag (i.e. CY)
are subtracted from the contents of the accumulator.
⚫ Example: SUI 45 H
Arithmetic
Instructions
Opcode Operand Description
SBI 8-bit data Subtract immediate from accumulator with
borrow
⚫ The 8-bit data and the Borrow Flag (i.e. CY) is subtracted
from the contents of the accumulator.
⚫ Example: SBI 45 H
Arithmetic
Instructions
Opcode Operand Description
INR R Increment register or memory by 1
M
⚫ Example: INX H
Arithmetic
Instructions
Opcode Operand Description
DCR R Decrement register or memory by 1
M
⚫ Example: DCX H
Logical
Instructions
• These instructions perform logical operations on data stored in
registers, memory and status flags.
• AND operation
• OR operation
• XOR operation
• Each bit in the accumulator can be shifted either left or right to the
next position.
Compar
e
• Any 8-bit data, or the contents of register, or memory location can be
compares for:
• Equality
• Greater Than
• Less Than
⚫ 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 contents
of H-L pair.
⚫ S, Z, P are modified to reflect the result of the operation.
⚫ CY is reset and AC is set.
⚫ Example: ANA B or ANA M.
Logical
Instructions
Opcode Operand Description
ANI 8-bit data Logical AND immediate with accumulator
⚫ The contents of the accumulator are XORed with the contents of the register or memory.
⚫ If the operand is a memory location, its address is specified by the contents of H-L pair.
⚫ The contents of the accumulator are logically ORed with the contents of the register or
memory.
⚫ If the operand is a memory location, its address is specified by the contents of H-L pair.
⚫ The contents of the accumulator are XORed 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 of the operation.
⚫ CY and AC are reset.
⚫ Example: XRA B or XRA M.
Logical
Instructions
Opcode Operand Description
XRI 8-bit data XOR immediate with accumulator
⚫ Example: CMA.
Logical
Instructions
Opcode Operand Description
CMC None Complement carry
⚫ The Carry fl ag is
complemented.
⚫ No other fl ags are affected.
⚫ Example: CMC.
Logical
Instructions
Opcode Operand Description
STC None Set carry
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
Control
Instructions
• The control instructions control the operation of microprocessor.
Control
Instructions
Opcode Operand Description
NOP None No operation
⚫ No operation is performed.
⚫ Example: DI
Control
Instructions
Opcode Operand Description
EI None Enable interrupt