0% found this document useful (0 votes)
7 views

Lecture 3

The document describes the instruction set of the 8085 microprocessor. It discusses that the 8085 has 246 instructions that are 8-bits long. The instructions are classified into different types including data transfer instructions, arithmetic instructions, logical instructions, branching instructions, and machine control instructions. Data transfer instructions move data between registers and memory. Arithmetic instructions perform operations like addition and subtraction.

Uploaded by

S 201
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lecture 3

The document describes the instruction set of the 8085 microprocessor. It discusses that the 8085 has 246 instructions that are 8-bits long. The instructions are classified into different types including data transfer instructions, arithmetic instructions, logical instructions, branching instructions, and machine control instructions. Data transfer instructions move data between registers and memory. Arithmetic instructions perform operations like addition and subtraction.

Uploaded by

S 201
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Instruction Set of 8085

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

 The 8-bit data is stored in the destination register or


memory.

 If the operand is a memory location, its location is specified


by the contents of the H-L registers.

 Example: MVI E, 1AH or MVI M, 2BH

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

 This instruction loads 16-bit data in the register


pair.

 Example: LXI H, 2034 H

13
Data Transfer Instructions

 This instruction copies the contents of memory


location pointed out by 16-bit address into register L.

 It copies the contents of next memory location into


register H.

 Example: LHLD 2040 H

14
Data Transfer Instructions

 The contents of accumulator are copied into the


memory location specified by the operand.

 Example: STA 2500 H

15
Data Transfer Instructions

 The contents of accumulator are copied into


the memory location specified by the contents
of the register pair.

 Example: STAX B

Suppose, (B)=20H, (C)=01H

(A)-(M) 2001H

16
Data Transfer Instructions

 The contents of register L are stored into memory


location specified by the 16-bit address.

 The contents of register H are stored into the next


memory location.

 Example: SHLD 2550 H

17
Data Transfer Instructions

 The contents of register H are exchanged with the


contents of register D.

 The contents of register L are exchanged with the


contents of register E.

 Example: XCHG

18
Data Transfer Instructions

 The contents of registers H and L are copied into


the program counter (PC).

 The contents of H are placed as the high-order


byte and the contents of L as the low-order byte.

 Example: PCHL

19
Data Transfer Instructions

 This instruction loads the contents of H-L pair into


SP.

 Example: SPHL

20
Data Transfer Instructions

 The contents of I/O port are copied into


accumulator.
 Example: IN 8C H

21
Data Transfer Instructions

 The contents of accumulator are copied into the I/O


port.

 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

The program sequence is transferred to the memory


location specified by the 16-bit address given in the
operand.
Before the transfer, the address of the next instruction
after CALL (the contents of the program counter) is
pushed onto the stack.
Example: CALL 2034 H. 31
Branching Instructions

The program sequence is transferred to the memory 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.
32
Call Conditionally

33
Branching Instructions

 The program sequence is transferred from the


subroutine to the calling program.
 The two bytes from the top of the stack are copied
into the program counter, and program execution
begins at the new address.
Example: RET.
34
Branching Instructions

The program sequence is transferred from the


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. 35
Return Conditionally

36
Branching Instructions

 The RST instruction jumps the control to one of eight


memory locations depending upon the number.
 These are used as software instructions in a program
to transfer program execution to one of the eight
locations.
Example: RST 3.
37
Restart Address Table

38
Machine Control Instructions
• These instructions control machine functions such as Halt,
Interrupt, or do nothing.

You might also like