You are on page 1of 98

8085 Instruction

Set
Subject : Microprocessor and microcontroller
Subject code : TIU-UEC-T210
Subject Teacher: Dr. Subhashis Roy, ECE Department.

8085 Instruction Set 1


Outline

 What is instruction set? Machine Cycles? T


state?
 How to calculate T state?
 Types of Instructions and elaborate
description with examples
 Summary and further study

8085 Instruction Set 2


8085 Instruction Set 3
Machine Cycles and T-state
 You can find Name of the instruction, Operation of
the instruction, Machine cycles, T-state.
 Machine cycles are sub part of any instruction.
 Machine cycles: It can be
 Opcode Fetch OF. It requires (4 T-states/6 T-states)
 Memory Read MR . It requires (3 T-state)
 Memory Write MW . It requires (3 T-state)
 Input/Output Read I/OR . It requires (3 T-state)
 Input/Output Write I/O W . It requires (3 T-state)

8085 Instruction Set 4


Contd…
 T state calculation:
 If Clock Frequency(f) of 8085 processor is 3.2
MHz, then the Clock Time period (T) is :
 T= 1/f =1/3.2MHz= 0.3125 micro second
 So T= 0.3125 micro Second
Now calculate the time required for different operations:
Machine cycle T state Time in micro sec.
Opcode fetch 4/6 1.25 / 1.875
Memory Read/Write 3 0.9375
I/O Read/Write 3 0.9375

8085 Instruction Set 5


8085 Instruction Set 6
8085 Instruction Set 7
8085 Instruction Set 8
8085 Instruction Set 9
8085 Instruction Set 10
8085 Instruction Set 11
8085 Instruction Set 12
8085 Instruction Set 13
8085 Instruction Set 14
8085 Instruction Set 15
8085 Instruction Set 16
8085 Instruction Set 17
8085 Instruction Set 18
Reference slide(SPHL EXPLAINED)

8085 Instruction Set 19


8085 Instruction Set 20
Reference slides (XTHL explained)

8085 Instruction Set 21


8085 Instruction Set 22
8085 Instruction Set 23
8085 Instruction Set 24
8085 Instruction Set 25
8085 Instruction Set 26
Reference
slides

8085 Instruction Set 27


Reference
slides

8085 Instruction Set 28


8085 Instruction Set 29
8085 Instruction Set 30
8085 Instruction Set 31
8085 Instruction Set 32
8085 Instruction Set 33
8085 Instruction Set 34
8085 Instruction Set 35
8085 Instruction Set 36
8085 Instruction Set 37
8085 Instruction Set 38
8085 Instruction Set 39
8085 Instruction Set 40
8085 Instruction Set 41
8085 Instruction Set 42
8085 Instruction Set 43
8085 Instruction Set 44
Reference
slides

8085 Instruction Set 45


Reference
slides

8085 Instruction Set 46


8085 Instruction Set 47
8085 Instruction Set 48
8085 Instruction Set 49
Here CY and Zero flags are used to show your results.

8085 Instruction Set 50


8085 Instruction Set 51
8085 Instruction Set 52
8085 Instruction Set 53
8085 Instruction Set 54
8085 Instruction Set 55
8085 Instruction Set 56
8085 Instruction Set 57
8085 Instruction Set 58
8085 Instruction Set 59
8085 Instruction Set 60
8085 Instruction Set 61
8085 Instruction Set 62
8085 Instruction Set 63
 circular Left shift

8085 Instruction Set 64


 circular right shift

8085 Instruction Set 65


RRC VS.
RAR

8085 Instruction Set 66


8085 Instruction Set 67
8085 Instruction Set 68
8085 Instruction Set 69
Reference
slides

8085 Instruction Set 70


8085 Instruction Set 71
8085 Instruction Set 72
8085 Instruction Set 73
8085 Instruction Set 74
8085 Instruction Set 75
8085 Instruction Set 76
Reference slide(CALL ins. diagram)

8085 Instruction Set 77


Reference slide(RET ins. diagram)

8085 Instruction Set 78


Reference
slides

8085 Instruction Set 79


Reference
slides

8085 Instruction Set 80


8085 Instruction Set 81
8085 Instruction Set 82
8085 Instruction Set 83
8085 Instruction Set 84
Instruction & Data Formats

8085 Instruction set can be classified


according to size (in bytes) as
1. 1-byte Instructions
2. 2-byte Instructions
3. 3-byte Instructions
1. One-byte Instructions

Includes Opcode and Operand in the same byte


Examples-

Opcode Operand Binary Code Hex Code


MOV C, A 0100 1111 4FH
ADD B 1000 0000 80H
HLT 0111 0110 76H
1. Two-byte Instructions

First byte specifies Operation Code


Second byte specifies Operand
Examples-

Opcode Operand Binary Code Hex Code


MVI A, 32H 0011 1110 3EH
0011 0010 32H
MVI B, F2H 0000 0110 06H
1111 0010 F2H
1. Three-byte Instructions

First byte specifies Operation Code


Second & Third byte specifies Operand
Examples-

Opcode Operand Binary Code Hex Code


LXI H, 2050H 0010 0001 21H
0101 0000 50H
0010 0000 20H
LDA 3070H 0011 1010 3AH
0111 0000 70H
0011 0000 30H
Summary – Data transfer

 MOV Move
 MVI Move Immediate
 LDA Load Accumulator Directly from Memory
 STA Store Accumulator Directly in Memory
 LHLD Load H & L Registers Directly from
Memory
 SHLD Store H & L Registers Directly in
Memory

8085 Instruction Set 89


Summary Data
transfer
 An 'X' in the name of a data transfer instruction implies that it
deals with a register pair (16-bits);

 LXI Load Register Pair with Immediate data


 LDAX Load Accumulator from Address in Register Pair
 STAX Store Accumulator in Address in Register Pair
 XCHG Exchange H & L with D & E
 XTHL Exchange Top of Stack with H & L

8085 Instruction Set 90


Summary - Arithmetic Group
 Add, Subtract, Increment / Decrement data in registers or memory.

 ADD Add to Accumulator


 ADI Add Immediate Data to Accumulator
 ADC Add to Accumulator Using Carry Flag
 ACI Add Immediate data to Accumulator Using Carry
 SUB Subtract from Accumulator
 SUI Subtract Immediate Data from Accumulator
 SBB Subtract from Accumulator Using Borrow (Carry) Flag
 SBI Subtract Immediate from
Accumulator Using Borrow (Carry)
 INR
Flag
 DCR Increment Specified Byte by One
 INX Decrement Specified Byte by One
 DCX Increment Register Pair by One
 DAD Decrement Register Pair by One
Double Register Add; Add Content of Register Pair to H & L
Register Pair 8085 Instruction Set 91
Summary Logical
 Group
This group performs logical (Boolean) operations on data in
registers and memory and on condition flags.
 These instructions enable you to set specific bits in the
accumulator ON or OFF.

 AN Logical AND with Accumulator


A Logical AND with Accumulator Using Immediate
 ANI Data
 ORA Logical OR with Accumulator
 OR Logical OR with Accumulator Using Immediate
Data
 XRA Exclusive Logical OR with Accumulator
 XRI Exclusive OR Using Immediate Data

8085 Instruction Set 92


 The Compare instructions compare the content of an 8-bit value with the
contents of the accumulator;

 CMP Compare
 CPI Compare Using Immediate Data

 The rotate instructions shift the contents of the accumulator one bit
position to the left or right:

 RLC Rotate Accumulator Left


 RRC Rotate Accumulator Right
 RAL Rotate Left Through Carry
 RAR Rotate Right Through Carry

 Complement and carry flag instructions:

 CMA Complement Accumulator


 CMC Complement Carry Flag Set
 STC Carry Flag

8085 Instruction Set 93


Summary - Branch
Group
 Unconditional branching
 JMP Jump
 CALL Call
 RET Return
 Conditions
 NZ Not Zero (Z = 0)
 Z Zero (Z = 1)
 NC No Carry (C = 0)
 C Carry (C = 1) Parity
 PO Odd (P = 0) Parity
 PE Even (P Plus (S = 0) = 1)
 P Minus (S = 1)
 M

 Conditional branching

8085 Instruction Set 94


Summary -
Stack
 PUSH Push Two bytes of Data onto the Stack
 POP Pop Two Bytes of Data off the Stack
 XTHL Exchange Top of Stack with H & L Move
 SPHL content of H & L to Stack Pointer

8085 Instruction Set 95


I/0 instructions

 IN Initiate Input Operation


 OUT Initiate Output Operation

8085 Instruction Set 96


Summary -Machine Control
instructions
 EI Enable Interrupt System
 DI Disable Interrupt System
 HLT Halt
 NOP No Operation

8085 Instruction Set 97


Thank you and best wishes

8085 Instruction Set 98

You might also like