Lecture 3
Lecture 3
Introduction
An instruction is a binary pattern designed
inside a microprocessor to perform a specific
function.
The entire group of instructions that a
microprocessor supports is called Instruction
Set.
8085 has 246 instructions.
2
Each instruction is represented by an 8-bit
binary value.
These 8-bits of binary value is called Op-Code
or Instruction Byte.
3
Classification of Instruction Set
• Data Transfer Instruction
• Arithmetic Instructions
• Logical Instructions
• Branching Instructions
• Control Instructions
4
Syntax
Data Transfer Instructions
• These instructions move data between
registers, or between memory and registers.
• These instructions copy data from source to
destination.
• While copying, the contents of source are not
modified.
6
Data Transfer Instructions
• This instruction copies the contents of the
source register into the destination register.
• The contents of the source register are not
altered.
• If one of the operands is a memory location,
its location is specified by the contents of the
HL registers.
7
Data Transfer Instructions
Data Transfer Instructions
Data Transfer Instructions
10
Data Transfer Instructions
•Example: LDAX B
•The contents of the designated register pair (BC) point to a memory location.
•This instruction copies the contents of that memory location into the
accumulator.
•The contents of either the register pair or the memory location are not altered.
Data Transfer Instructions
13
Data Transfer Instructions
14
Data Transfer Instructions
15
Data Transfer Instructions
Example: STAX B
(A)-(M) 2001H
16
Data Transfer Instructions
17
Data Transfer Instructions
Example: XCHG
18
Data Transfer Instructions
Example: PCHL
19
Data Transfer Instructions
Example: SPHL
20
Data Transfer Instructions
21
Data Transfer Instructions
Example: OUT 78 H
22
Arithmetic Instructions
• These instructions perform the operations
like:
– Addition
– Subtraction
– Increment
– Decrement
23
Addition
• Any 8-bit number, or the contents of register, or
the contents of memory location can be added to
the contents of accumulator.
• The result (sum) is stored in the accumulator.
• No two other 8-bit registers can be added
directly.
• Example: The contents of register B cannot be
added directly to the contents of register C.
24
Subtraction
• Any 8-bit number, or the contents of register, or the
contents of memory location can be subtracted from
the contents of accumulator.
• The result is stored in the accumulator.
• Subtraction is performed in 2’s complement form.
• If the result is negative, it is stored in 2’s complement
form.
• No two other 8-bit registers can be subtracted directly.
25
Increment / Decrement
• The 8-bit contents of a register or a memory
location can be incremented or decremented
by 1.
• The 16-bit contents of a register pair can be
incremented or decremented by 1.
• Increment or decrement can be performed on
any register or a memory location.
26
Arithmetic Instructions
Logical Instructions
• These instructions perform various logical operations with the
contents of the accumulator.
Branching Instructions
• This group of instructions alters the sequence of
program execution either conditionally or
unconditionally
Jump Conditionally
30
Branching Instructions
33
Branching Instructions
36
Branching Instructions
38
Machine Control Instructions
• These instructions control machine functions such as Halt,
Interrupt, or do nothing.