Introduction To Microprocessor
Introduction To Microprocessor
MICROPROCESSOR
10/19/2019 1
REFERENCES:
10/19/2019 2
Microprocessor
• A microprocessor (sometimes abbreviated µP)
is a Programmable digital integrated electronic
component which consists of arithmetic and
logical circuits, registers ,timing and control
circuits so that it can be used as a CPU of a
microcomputers
10/19/2019 3
Microcomputer or Computer
A computer is a digital electronic device which
accepts input information and process it
according to a procedure called program
stored in its memory and provides output as
per the program.
10/19/2019 4
Mircocontroller
Microcontroller is a programmable integrated
circuit which consists of Arithmetic and
Logical circuits, registers, timing and control
unit and small capacity memory and interface
circuitry for connecting external circuits.
10/19/2019 5
Microcomputer Block Diagram
INTRODUCTION
• COMPUTER GENERATIONS:-
• First Generation Computers(1940-1956)
• VACUUM TUBES .e.g.:-ENIAC(Electronic Numerical Integrator
and Calculator)
• EDVAC:-Electronic discrete Variable Automatic Computer.
• EDSAC: Electronic Delay Storage Automatic Computer.
• UNIVAC-1: Universal Accounting Computer Setup.
10/19/2019 7
Computer Second Generation
• SECOND GENERATION(1956-1963)
• TRANSISTORS - A semiconductor device
• IBM 1401, IBM 608
10/19/2019 8
COMPUTER GENERATIONS
• THIRD GENERATION(1964-1971)
• INTEGRATED CIRCUITS:-
(CHIPS),(Registers,capacitors,Transistors)
• IBM-360,ICL-1900,IBM-370,VAX-750.
• Programming Language:- BASIC
10/19/2019 9
COMPUTER GENERATIONS
• FOURTH GENERATION(1971-Present)
• MICROPROCESSORS.
• LSIC(Large Scale Integrated Circuits) built on
single Chip called as MICROPROCESSORS.
• VLSIC(Very Large scale integrated Circuits)
• E.g.:- PC.
10/19/2019 10
COMPUTER GENERATIONS
• FIFTH GENERATION:-PRESENT and BEYOND
• ARTIFICIAL INTELLIGENCE.
• YEAR-1990-Fifth Generation Computers Started.
• QUANTUM COMPUTATION,MOLECULAR,NANOTECHNOLOGY.
• Goal:- To develop computer that respond to natural language
input and are capable of learning and self-organization.
10/19/2019 11
HISTORY OF
MICROPROCESSORS
• Fairchild Semiconductors (founded in 1957) invented the first IC in 1959.
10/19/2019 12
Generation of Microprocessor
• FIRST GENERATION MICROPROCESSOR:-
• Ted Hoff of INTEL Corporation developed
Controlled Processor in 1969.
• Intel 4004:-
• Introduced in 1971.
• PMOS Technology.
• Device: CALCULATOR
10/19/2019 13
Generation of Microprocessor
• Intel 4040:-
• Introduced in 1971.
10/19/2019 14
Generation of Microprocessor
•INTEL-8008
•Introduced in 1972.
•It was first 8-bit MP.
•Could execute 50,000
instructions per second
10/19/2019 15
Generation of Microprocessor
2nd Generation
• Started in Year-1973.
• Intel 8080
• It was also 8-bit MP.
• NMOS TECHNOLOGY.
10/19/2019 16
Generation of Microprocessor
2nd Generation
Intel 8085
Introduced in 1977.
It was also 8-bit MP.
Could execute 7,69,230 instructions
per second.
It could access 64 KB of memory.
It had 256 instructions.
Over 100 million copies were sold
10/19/2019 17
Generation of Microprocessor
2nd Generation
• FEATURES OF SECOND GENERATION:-
• LARGE CHIP SIZE(170*200) WITH 40 PINS.
• MORE CHIP ON DECODING CIRCUITS.
• ABLITY TO ADDRESS LARGE MEMORY SPACE(64KB) AND I/O PORTS
(256).
• MORE POWERFUL INSTRUCTION SET.
• Dissipate less power.
• Better INTERUPT HANDLING FACILITIES.
• CYCLE TIME REDUCED TO HALF (1.3 TO 9 n.s)
• LESS SUPPORT CHIPS REQUIRED.
• USED SINGLE POWER SUPPLY.
10/19/2019 18
Generation of Microprocessor
2nd Generation
10/19/2019 19
Generation of Microprocessor
3rd Generation
• Intel 8086
• Introduced in 1978.
10/19/2019 20
Generation of Microprocessor
3rd Generation
• Intel 8088
• Introduced in 1979.
10/19/2019 21
Generation of Microprocessor
3rd Generation
Intel 80186 & 80188
•Introduced in 1982.
•They were 16-bit MPs.
•They had additional components like:
•Interrupt Controller
•Clock Generator
•Local Bus Controller
•Counters
10/19/2019 22
Generation of Microprocessor
4th Generation
• Intel 80286
Introduced in 1982.
10/19/2019 23
Generation of Microprocessor
4th Generation
• Intel 80386
• Introduced in 1986.
• Different versions:
• 80386 SX
• 80386 EX
10/19/2019 24
Generation of Microprocessor
4th Generation
Intel 80486
• Introduced in 1989.
10/19/2019 25
Generation of Microprocessor
5th Generation(1993-onwards)
• Intel Pentium
• Introduced in March 22,1993.
• Cache memory:
• 8 KB for instructions.
• 8 KB for data
10/19/2019 26
Generation of Microprocessor
THE PENTIUM PRO
• Intel Pentium Pro
• Introduced in 1995.
• Cache memory:
• 8 KB for instructions.
• 8 KB for data.
• Level 3 cache is now the name for the extra cache built into
motherboards between the microprocessor and the main memory.
10/19/2019 28
Generation of Microprocessor
THE PENTIUM SERIES
• Intel Pentium II Xeon
• Introduced in 1998.
10/19/2019 29
Generation of Microprocessor
THE PENTIUM SERIES
• Intel Pentium III
• Introduced in 1999.
10/19/2019 30
Generation of Microprocessor
THE PENTIUM SERIES
• Intel Pentium IV
• Introduced in 2000.
10/19/2019 31
Generation of Microprocessor
THE PENTIUM SERIES
• Intel Dual Core
• Introduced in 2006.
10/19/2019 32
Generation of Microprocessor
THE PENTIUM SERIES
• Intel Core 2 Duo
• Introduced in 2006.
10/19/2019 33
The Intel family of Processors
10/19/2019 34
• Advanced Micro Devices, Inc. (AMD)
• It is an American multinational semiconductor company based in
Sunnyvale, California USA.
• products include microprocessors, motherboard chipsets, embedded
processors and graphics processors for servers, workstations and
personal computers, and processor technologies for handheld
devices, digital television, automobiles, game consoles, and other
embedded systems applications.
10/19/2019 35
APPLICATIONS OF
MICROPROCESSOR
1. Microprocessors used in everything from the smallest embedded systems
and handheld devices to the largest mainframes and supercomputers.
2. Embedded system:- An embedded system is a computer system designed
to perform one or a few dedicated functions often with real-time
computing constraints. It is embedded as part of a complete device often
including hardware and mechanical parts. By contrast, a general-purpose
computer, such as a personal computer (PC), is designed to be flexible and
to meet a wide range of end-user needs. Embedded systems control many
devices in common use today.
Embedded systems are controlled by one or more main processing cores
that are typically either microcontrollers or digital signal processors
(DSP).The key characteristic, however, is being dedicated to handle a
particular task, which may require very powerful processors.
10/19/2019 36
APPLICATIONS OF
MICROPROCESSOR
10/19/2019 37
APPLICATIONS OF
MICROPROCESSOR
• The embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the
reliability and performance.
• Embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory
controllers, or the systems controlling nuclear power plants. Complexity
varies from low, with a single microcontroller chip, to very high with
multiple units, peripherals and networks mounted inside a large chassis or
enclosure.
10/19/2019 38
APPLICATIONS OF
MICROPROCESSOR
• The Intel Core i7 microprocessor in aerospace
and defense applications .
• Today, micro processors are included in almost any electronically device: computers, and any
computer-like device such as mobile phones, PDAs, digital video cameras or recorders, digital
cameras, etc. Microprocessors are also used in many cars (or: vehicles in general), domestic
appliances like washing machines, refrigerators, microwave ovens or coffee makers.
Basically, almost any electronic device, or device that uses electronics, employs some form of
a micro processor.
The group of devices using micro processors even extends to those devices that were
traditionally pure electrical, or electro-mechanic, devices such as light switches or light bulb
holders, thermostatic radiator valves.
•
10/19/2019 39
APPLICATIONS OF
MICROPROCESSOR
• iPhone :- There are actually 2 microprocessors in the iPhone:
The processor and the baseband. The baseband controls
wireless functions of the iPhone such as Bluetooth and
telephone connection. This processor is a resource to the main
processor which is used to control the user interface and
higher-level systems of the Phone, such as applications that the
user is likely to interact with.
10/19/2019 40
Difference between a microprocessor and a
microcontroller?
10/19/2019 41
Microcontroller combines onto
the same microchip.
• The CPU core (microprocessor) .
• Memory (both ROM and RAM) .
• Some parallel digital I/O
• Also, a microcontroller is part of an
embedded system, which is essentially
the whole circuit board.
10/19/2019 42
BLOCK DIAGRAM OF
INTEL 8085
10/19/2019 43
Introduction to 8085
• Introduced in 1977.
• It is 8-bit MP.
10/19/2019 44
Block Diagram of 8085
10/19/2019 45
Three Units of 8085
• Processing Unit
• Instruction Unit
10/19/2019 46
Processing Unit
10/19/2019 47
Instruction Unit
• Instruction Register
• Instruction Decoder
• Timing and Control Unit
10/19/2019 48
Storage and Interface Unit
• Stack Pointer
• Program Counter
• Increment/Decrement Register
• Address Latch
• Address/Data Latch
10/19/2019 49
Three Other Units
• Interrupt Controller
• Serial I/O Controller
• Power Supply
10/19/2019 50
Accumulator
10/19/2019 51
Arithmetic & Logic Unit (ALU)
• It performs various arithmetic and logic
operations.
• The data is available in accumulator and
temporary/general purpose registers.
• Arithmetic Operations:
– Addition, Subtraction, Increment, Decrement etc.
• Logic Operations:
– AND, OR, X-OR, Complement etc.
10/19/2019 52
Temporary Register
• It is an 8-bit register.
• It is used to store temporary 8-bit operand
from general purpose register.
• It is also used to store intermediate results.
10/19/2019 53
Status Flags
• Status Flags are set of flip-flops which are
used to check the status of Accumulator after
the operation is performed.
10/19/2019 54
Status Flags
• S = Sign Flag
• Z = Zero Flag
• AC = Auxiliary Carry Flag
• P = Parity Flag
• CY = Carry Flag
10/19/2019 55
Status Flags
• Sign Flag (S):
– It tells the sign of result stored in Accumulator after the operation is
performed.
– MSB(7th bit) of 8 bit number will tell sign. Rest of bit’s will tell
magnitude.(same in case of 16 bit or 32 bit).
10/19/2019 56
Status Flags
• Zero Flag (Z):
– It tells whether the result stored in Accumulator is zero or not after the operation is
performed.
10/19/2019 57
Status Flags
• Auxiliary Carry Flag (AC):
– It is used in BCD operations.
– ADD CB+E9=B4.
10/19/2019 58
Status Flags
• Parity Flag (P):
– It tells the parity of data stored in Accumulator after
execution of airthmatic or logical operations..
10/19/2019 59
Program Status Word (PSW)
• The contents of Accumulator and Status Flags
clubbed together is known as Program Status
Word (PSW).
• It is a 16-bit word.
10/19/2019 60
Instruction Register
• It is used to hold the current instruction which
the microprocessor is about to execute.
• It is an 8-bit register.
10/19/2019 61
Instruction Decoder
• It interprets the instruction stored in
instruction register.
• It generates various machine cycles depending
upon the instruction.
• The machine cycles are then given to the
Timing and Control Unit.
10/19/2019 62
Timing and Control Unit
• It controls all the operations of
microprocessor and peripheral devices.
• Depending upon the machine cycles received
from Instruction Decoder, it generates 12
control signals:
– S0 and S1 (Status Signals).
10/19/2019 63
Timing and Control Unit
– RD (Read, active low).
– IO/M (Input-Output/Memory).
– READY
– RESET IN
– RESET OUT
– CLK OUT
10/19/2019 64
General Purpose Registers
• There are 6 general purpose registers, namely B, C, D, E, H, L.
10/19/2019 65
Program Counter
• It is used to hold the address of next
instruction to be executed.
• It is a 16-bit register.
• The microprocessor increments the value of
Program Counter after the execution of the
current instruction, so that, it always points to
the next instruction.
10/19/2019 66
Stack Pointer
• It holds the address of top most item in the
stack.
• It is also 16-bit register.
• Any portion of memory can be used as stack.
10/19/2019 67
Increment/Decrement Register
• This register is used to increment or
decrement the value of Stack Pointer.
• During PUSH operation, the value of Stack
Pointer is incremented.
• During POP operation, the value of Stack
Pointer is decremented.
10/19/2019 68
Address Latch
• It is group of 8 buffers.
• The upper-byte of 16-bit address is stored in
this latch.
• And then it is made available to the peripheral
devices.
10/19/2019 69
Address/Data Latch
• The lower-byte of address and 8-bit of data are
multiplexed.
• It holds either lower-byte of address or 8-bits of data.
• This is decided by ALE (Address Latch Enable) signal.
• If ALE = 1 then
– Address/Data Latch contains lower-byte of address.
• If ALE = 0 then
– It contains 8-bit data.
10/19/2019 70
Serial I/O Controller
• It is used to convert serial data into parallel
and parallel data into serial.
• Microprocessor works with 8-bit parallel data.
• Serial I/O devices works with serial transfer of
data.
• Therefore, this unit is the interface between
microprocessor and serial I/O devices.
10/19/2019 71
Interrupt Controller
• It is used to handle the interrupts.
• There are 5 interrupt signals in 8085:
– TRAP
– RST 7.5
– RST 6.5
– RST 5.5
– INTR
10/19/2019 72
Interrupt Controller
• Interrupt controller receives these interrupts
according to their priority and applies them to
the microprocessor.
• There is one outgoing signal INTA which is
called Interrupt Acknowledge.
10/19/2019 73
Power Supply
• This unit provides +5V power supply to the
microprocessor.
• The microprocessor needs +5V power supply
for its operation.
10/19/2019 74
How to increase speed of
Operation of 8085?
• The main use is to hold data which is Frequently used.
• It increases the speed of program execution. The data in Microprocessor can be
stored in memory OR GENERAL PURPOSE registers. If the data is present in
memory the mpu has to perform an operation of memory read. This data is taken
by microprocessor, The required operation is performed and result is stored back
to memory. To store result in memory the microprocessor has to perform one
more operation of memory WRITE. So there are two operations involved in
using memory to hold data.
• But if data is present in general purpose register there is no operation involved.
As the general purpose registers are part of microprocessor architecture, the
microprocessor doesn’t have to perform any external memory read and write
operation. Thus the time required to execute program using general purpose
register is very less as compared to program using memory.
10/19/2019 75
PIN-Diagram of 8085
• Introduction to 8085
It was introduced in 1977.
It is 8-bit microprocessor.
Its actual name is 8085 A.
It is single NMOS device.
It contains 6200 transistors approx.
Its dimensions are
164 mm x 222 mm.
It is having 40 pins Dual-Inline-Package (DIP).
10/19/2019 76
Introduction to 8085
It has three advanced versions:
◦ 8085 AH
◦ 8085 AH2
◦ 8085 AH1
10/19/2019 77
Introduction to 8085
10/19/2019 79
Pin Diagram of 8085
10/19/2019 80
X1 & X2
Pin 1 and Pin 2 (Input)
These are also called Crystal
Input Pins.
10/19/2019 81
Crystal
• A crystal oscillator is an electronic oscillator circuit that uses
the mechanical resonance of a vibrating crystal of piezoelectric
material to create an electrical signal with a very precise
frequency. This frequency is commonly used to keep track of
time (as in quartz wristwatches), to provide a stable clock
signal for digital integrated circuits, and to stabilize
frequencies for radio transmitters and receivers. The most
common type of piezoelectric resonator used is the quartz
crystal, so oscillator circuits designed around them became
known as "crystal oscillators."
10/19/2019 82
X1 & X2
Pin 1 and Pin 2 (Input)
• Intel 8085 needs 3.07 MHz frequency as a clock signal. generally we know
that,clock frequency is half of the crystal frequency. so we connect crystal
between pin no 1 & 2 in order to make 6.14 MHz frequency accurately. so
that we have crystal frequency of 3.07 MHz for Intel 8085 microprocessor.
• Because of high stability, large Q (Quality Factor) & the frequency that
doesn’t drift with aging. Crystal is used as a clock source most of the times.
10/19/2019 83
RESET IN and RESET OUT
Pin 36 (Input) and Pin 3 (Output)
RESET IN:
10/19/2019 84
RESET IN and RESET OUT
Pin 36 (Input) and Pin 3 (Output)
Resetting the
microprocessor means:
10/19/2019 85
RESET IN and RESET OUT
Pin 36 (Input) and Pin 3 (Output)
RESET OUT:
◦ It is an output signal.
10/19/2019 86
SID and SOD
Pin 4 (Input) and Pin 5 (Output)
SID (Serial Input Data):
10/19/2019 87
SID and SOD
Pin 4 (Input) and Pin 5 (Output)
SOD (Serial Output Data):
10/19/2019 88
8085 Interrupts
TRAP
RST7.5
RST6.5
RST 5.5 8085
INTR
INTA
89
Interrupt Pins
Interrupt:
10/19/2019 90
Sequence of Steps Whenever There is an
Interrupt
Microprocessor completes execution of current
instruction of the program.
10/19/2019 92
Five Hardware Interrupts in 8085
TRAP
RST 7.5
RST 6.5
RST 5.5
INTR
10/19/2019 93
Classification of Interrupts
• Maskable and Non-Maskable
10/19/2019 94
MASKING
• Disabling of interrupt is called MASKING.
• When interrupt are to be used they are
enabled by Software using the instruction
ENABLE INTERUPT.[EI].The instruction DISABLE
INTERRUPT [DI] is used to disable interupts.
10/19/2019 95
Maskable Interrupts
10/19/2019 96
Maskable Interrupts
• List of Maskable Interrupts:
• RST 7.5
• RST 6.5
• RST 5.5
• INTR
10/19/2019 97
Non-Maskable Interrupts
10/19/2019 98
Vectored Interrupts
10/19/2019 99
Vectored Interrupts
• List of vectored interrupts:
• RST 7.5
• RST 6.5
• RST 5.5
• TRAP
10/19/2019 100
Vectored Interrupts
The addresses to which program control
goes:
Name Vectored Address
RST 7.5 003C H (7.5 x 0008 H)
RST 6.5 0034 H (6.5 x 0008 H)
RST 5.5 002C H (5.5 x 0008 H)
TRAP 0024 H (4.5 x 0008 H)
10/19/2019 102
Edge Triggered Interrupts
10/19/2019 103
Level Triggered Interrupts
The interrupts which are triggered at high
or low level are called level triggered
interrupts.
RST 6.5
RST 5.5
INTR
10/19/2019 105
Priority Based Interrupts
• Priority of interrupts:
Interrupt Priority
TRAP 1
RST 7.5 2
RST 6.5 3
RST 5.5 4
INTR 5
10/19/2019 106
TRAP
Pin 6 (Input)
It is an non-maskable interrupt.
It has the highest priority.
It cannot be disabled.
It is both edge and level
triggered.
It means TRAP signal must go
from low to high.
And must remain high for a
certain period of time.
TRAP is usually used for power
failure and emergency shutoff.
10/19/2019 107
RST 7.5
Pin 7 (Input)
It is a maskable interrupt.
It has the second highest
priority.
It is positive edge triggered
only.
The internal flip-flop is
triggered by the rising
edge.
The flip-flop remains high
until it is cleared by RESET
IN.
10/19/2019 108
RST 6.5
Pin 8 (Input)
It is a maskable interrupt.
It has the third highest
priority.
It is level triggered only.
The pin has to be held high
for a specific period of
time.
RST 6.5 can be enabled by
EI instruction.
It can be disabled by DI
instruction.
10/19/2019 109
RST 5.5
Pin 9 (Input)
It is a maskable
interrupt.
It has the fourth highest
priority.
It is also level triggered.
The pin has to be held
high for a specific period
of time.
This interrupt is very
similar to RST 6.5.
10/19/2019 110
INTR
Pin 10 (Input)
It is a maskable interrupt.
It has the lowest priority.
It is also level triggered.
It is a general purpose
interrupt.
By general purpose we
mean that it can be used to
vector microprocessor to
any specific subroutine
having any address.
10/19/2019 111
INTA
Pin 11 (Output)
It stands for interrupt
acknowledge.
It is an out going signal.
It is an active low signal.
Low output on this pin
indicates that
microprocessor has
acknowledged the INTR
request.
10/19/2019 112
Address and Data Pins
• Address Bus:
10/19/2019 113
Address and Data Pins
• Data Bus:
10/19/2019 114
AD0 – AD7
Pin 19-12 (Bidirectional)
• These pins serve the dual
purpose of transmitting lower
order address and data byte.
10/19/2019 115
A8 – A15
Pin 21-28 (Unidirectional)
• These pins carry the higher
order of address bus.
• If ALE = 1 then
– Bus functions as address bus.
• If ALE = 0 then
– Bus functions as data bus.
10/19/2019 117
S0 and S1
Pin 29 (Output) and Pin 33 (Output)
• S0 and S1 are called Status
Pins.
S0 S1 Operation
0 0 Halt
0 1 Write
1 0 Read
1 1 Opcode Fetch
10/19/2019 118
IO/M
Pin 34 (Output)
• This pin tells whether I/O
or memory operation is
being performed.
• If IO/M = 1 then
– I/O operation is being
performed.
• If IO/M = 0 then
– Memory operation is being
performed.
10/19/2019 119
IO/M
Pin 34 (Output)
• The operation being performed is indicated by S0
and S1.
• If S0 = 0 and S1 = 1 then
– It indicates WRITE operation.
• If IO/M = 0 then
– It indicates Memory operation.
Operations IO/M S0 S1
Opcode Fetch 0 1 1
Memory Read 0 1 0
Memory Write 0 0 1
I/O Read 1 1 0
I/O Write 1 0 1
Interrupt Ack. 1 1 1
Halt High Impedance 0 0
10/19/2019 121
RD
Pin 32 (Output)
• RD stands for Read.
• It is an active low signal.
• It is a control signal used
for Read operation either
from memory or from
Input device.
• A low signal indicates that
data on the data bus must
be placed either from
selected memory location
or from input device.
10/19/2019 122
WR
Pin 31 (Output)
• WR stands for Write.
• It is also active low signal.
• It is a control signal used
for Write operation either
into memory or into
output device.
• A low signal indicates that
data on the data bus must
be written into selected
memory location or into
output device.
10/19/2019 123
READY
Pin 35 (Input)
• This pin is used to
synchronize slower
peripheral devices with
fast microprocessor.
• A low value causes the
microprocessor to enter
into wait state.
• The microprocessor
remains in wait state
until the input at this pin
goes high.
10/19/2019 124
HOLD
Pin 38 (Input)
• HOLD pin is used to
request the microprocessor
for DMA transfer.
• A high signal on this pin is a
request to microprocessor
to relinquish the hold on
buses.
• This request is sent by
DMA controller.
• Intel 8257 and Intel 8237
are two DMA controllers.
10/19/2019 125
HLDA
Pin 39 (Output)
• HLDA stands for Hold
Acknowledge.
• The microprocessor uses this
pin to acknowledge the
receipt of HOLD signal.
• When HLDA signal goes high,
address bus, data bus, RD,
WR, IO/M pins are tri-stated.
• This means they are cut-off
from external environment.
10/19/2019 126
HLDA
Pin 39 (Output)
• The control of these
buses goes to DMA
Controller.
• Control remains at DMA
Controller until HOLD is
held high.
• When HOLD goes low,
HLDA also goes low and
the microprocessor
takes control of the
buses.
10/19/2019 127
VSS and VCC
Pin 20 (Input) and Pin 40 (Input)
• +5V power supply is
connected to VCC.
• Ground signal is
connected to VSS.
10/19/2019 128
8085 Interrupts
• 5 interrupt pins
• Maskable
– INTR
– RST5.5, RST6.5, RST7.5
• Non-Maskable
– TRAP: cannot be disabled by instruction.
• TRAP has highest priority
• Once a interrupt is serviced all interrupts except
TRAP is disabled
10/19/2019 129
8085 Interrupts
• An interrupt is considered to be an emergency signal that
may be serviced.
– The Microprocessor may respond to it as soon as
possible.
10/19/2019 130
Interrupts
• Interrupt is a process where an external device can get the attention of the
microprocessor.
– The process starts from the I/O device
– The process is asynchronous.
• Classification of Interrupts
– Interrupts can be classified into two types:
• Maskable Interrupts (Can be delayed or Rejected)
• Non-Maskable Interrupts (Can not be delayed or Rejected)
133
TRAP
• TRAP is the only non-maskable interrupt.
– It does not need to be enabled because it cannot be
disabled.
• It has the highest priority amongst interrupts.
• It is edge and level sensitive.
– It needs to be high and stay high to be recognized.
– Once it is recognized, it won’t be recognized again until it
goes low, then high again.
10/19/2019 134
8085 Machine cycles
• The 8085 executes several types of instructions with each
requiring a different number of operations of different
types. However, the operations can be grouped into a small
set.
• The three main types are:
• Memory Read and Write.
• I/O Read and Write.
• Request Acknowledge.
10/19/2019 135
Opcode Fetch Machine Cycle
10/19/2019 136
Opcode Fetch Machine Cycle
• The high order byte of
program counter is placed
on the A8-A15 lines and it
remains there upto T3
state. The lower order
byte of program counter
is placed on the AD0-AD7
lines which remain there
only for T7.
10/19/2019 137
Opcode Fetch Machine Cycle
• During this state ,ALE gives
a positive pulse which
represent the content of
AD0-AD7 as an address.
The ALE signal is used to
latch the address to A0-A7.
• NO control signal is
generated in this sate.
10/19/2019 138
Opcode Fetch Machine Cycle
• Step 2(State T2):
• The contents of PC(Lower
address bus) will disappear
on AD0-AD7 lines, so that
the lines can be used as
data lines. The contents if
A0 – A7 are still available
for memory from external
latch.
10/19/2019 139
Opcode Fetch Machine Cycle
The control signal RD is
made LOW by the
processor which enables
the read circuit of
addressed memory device.
The memory device then
sends the contents on the
data bus i.e. AD0-AD7.
In addition to these operations
the MP increments PC by 1.
10/19/2019 140
Opcode Fetch Machine Cycle
• Step 3:- (State T3) : During
this clock cycle, the data
from memory i.e. OPCODE
is transferred to instruction
register and RD control
signal is made HIGH. Thus
RD disables the memory
device.
10/19/2019 141
Opcode Fetch Machine Cycle
• Step 4: (State T4): The
microprocessor performs only
internal operation. The OPCODE is
decoded by the CPU and upon
decoding 8085 knows all the
information about:
• (i) Whether it should enter T5 and T6
states.
• (ii) How many bytes of instruction it
is?
• If the instruction does not require T5
and T6 states, it will start or go to
next machine cycle.
10/19/2019 142
Timing diagram. of Memory cycle
T T T T T T
1 2 3 CLK 1 2 3
A15-A8
Data from
A7-A0 memory AD7-AD0 A7-A0
Data from
MPU
ALE
IO/M
RD WR
MEMRD MEMWR
READ Cycle WRITE Cycle
10/19/2019 143
READ Cycle
10/19/2019 144
READ Cycle
10/19/2019 145
READ Cycle
• Step -3 (State T3) :- In T3 State, data from
memory is transferred to 8085. 8085 accepts
this data and transfers control on internal data
bus and RD is made HIGH.
• Now where the data is transferred depends on
the instruction for which this machine cycle is
used. it is generally stored in general purpose
register.
10/19/2019 146
WRITE Cycle
10/19/2019 147
WRITE Cycle
• Step 2(T2) :- In T2 state the address on AD0-
AD7 i.e. A0-A7 is removed and data to be
stored in memory is transferred on these lines.
The control signals WR is made LOW will make
memory Active to accept the contents of data
bus. The accepted contents are stored at
selected location.
10/19/2019 148
WRITE Cycle
• Step3 (State T3):- In this state, data from data
bus is stored at memory location .WR is made
HIGH which deactivates memory and
microprocessor completes the machine cycle.
10/19/2019 149
ADDRESSING MODES OF 8085
10/19/2019 150
ADDRESSING MODES OF 8085
To perform any operation, we have to give the
corresponding instructions to the
microprocessor.
In each instruction, programmer has to specify
3 things:
Operation to be performed.
Address of source of data.
Address of destination of result.
10/19/2019 151
ADDRESSING MODES OF 8085
10/19/2019 152
ADDRESSING MODES OF 8085
Types of Addressing Modes
Intel 8085 uses the following addressing
modes:
1. Direct Addressing Mode
2. Register Addressing Mode
3. Register Indirect Addressing Mode
4. Immediate Addressing Mode
5. Implicit Addressing Mode
10/19/2019 153
ADDRESSING MODES OF 8085
1. Direct Addressing Mode
In this mode, the address of the operand is
given in the instruction itself.
LDA 2500 H Load the contents of memory location 2500 H in
accumulator.
10/19/2019 155
ADDRESSING MODES OF 8085
10/19/2019 156
ADDRESSING MODES OF 8085
4. Immediate Addressing Mode
In this mode, the operand is specified within
the instruction itself.
MVI A, 05 H Move 05 H in accumulator.
10/19/2019 158
INSTRUCTIONS SET OF 8085
10/19/2019 159
INSTRUCTIONS FOR 8085
10/19/2019 160
Data Transfer Group
Data transfer group of instructions copies data
from source to destination without modifying
the contents of source.
The various types of data transfer that are
possible between registers and memory
locations as follows:-
10/19/2019 161
Data Transfer Group
5. Between a Reg. Pair and the Stack Reg. Pair data Stack
Location
10/19/2019 162
Data Transfer Group
The Data Transfer group of instruction include
the Following Instructions:-
1. MOV Rd,Rs 9. LHLD address
2. MOV R,M 10. SHLD address
3. MOV M,R 11. LDAX Rp
4. MVI R,Data 12. STAX Rp
5. MVI M,Data 13. XCHG
6. LXI Rp,16-bit Data
7. LDA address
8. STA address
10/19/2019 163
Data Transfer Group
1. MOV Rd,Rs
Mnemonic MOV Rd,Rs
Operation Rd=Rs
No.of Bytes 1 byte
Machine Cycle 1 (OF)
10/19/2019 164
Data Transfer Group
Description:-
This instruction copies data from source
register Rs to destination Register Rd.
The source register Rs and destination
register Rd can be any general purpose
register like A,B,C,D,E,H or L.
The contents of Source register remain
unchanged.
10/19/2019 165
Data Transfer Group
2. MOV R,M
MNEMONIC MOV R,M
Operation R=M or R=(HL)
No.of Bytes 1 byte
Machine Cycle 2(OF+MR)
10/19/2019 167
Data Transfer Group
Description:-
This instruction Copies data from memory M to
register R.
The term M specifies the HL memory Pointer. The
content of HL register pair are used as the address of
Memory Location. The contents of that Memory
location are transferred to the specified register R.
The register R can be any General purpose register.
10/19/2019 168
Data Transfer Group
Example:-
MOV C,M
This instruction will copy the data from the memory location
pointed by HL register pair to C register.
Let the contents of HL register pair be 2000H,reg C=20H.At
the address 2000H:10H is stored. The HL register pair
contents are used as address.i.e HL=2000H.
The contents of memory location 2000H are copied to C
register, So Contents of Reg.C, Will change from 20H to 10H.
The contents of Memory location remain unchanged.
10/19/2019 169
Data Transfer Group
3. MOV M,R
MNEMONIC MOV M,R
Operation M=R or (HL)=R
No. of Bytes 1 byte
Machine cycles 2(OF+ MW)
10/19/2019 170
Data Transfer Group
Description
This instruction will copy the data from the register to
memory M.
The HL register pair is used as the memory pointer. The
contents of the specified register are copied o that memory
location pointed by HL Reg. Pair.
The specified register may be any general purpose
reg.A,B,C,D,E,H or L.
The contents of the specified register remains unchanged.
10/19/2019 171
Data Transfer Group
EXAMPLE:-MOV M,C
Let the content of HL pair are 2050H. Reg
C=05H, at the address 2050H=25h is stored.
On the instruction MOV M,C the data is
transferred from C to 2050H.
The contents of the Reg C are copied to
memory location 2050H,So contents of
Memory location 2050H will change from 25H
to 05H.
10/19/2019 172
Data Transfer Group
4. MVI R,Data
MNEMONIC MVI R,DATA
OPERATION R=DATA
No.of bytes 2 bytes
Machine cycle 2(OF+MR)
10/19/2019 173
Data Transfer Group
Description:-
This instruction moves the 8 bit immediate data to
the specified register.
The data is specified within the instruction.
It is a 2-byte instruction, so FIRST byte of
instruction will be OPCODE and second byte will be
8-bit data.
The Reg. R may be any General purpose register like
A,B,C,D,E,H or L.
10/19/2019 174
Data Transfer Group
EXAMPLE:-
MVI D,07
This instruction will load the immediate data
07H in Reg.D.
Let the contents of Reg D =10H.Then after
execution of instruction MVI D,O7H, the
contents of D will change from 10H to 07H.
10/19/2019 175
Data Transfer Group
5. MVI M,Data
MNEMONIC MVI M,DATA
10/19/2019 176
Data Transfer Group
Description:-
This instruction moves immediate data to
memory.
The HL register Pair is used as memory
Pointer. The contents of HL Reg. Pair are used
as memory address and immediate data is
transferred to that memory location.
10/19/2019 177
Data Transfer Group
Example:-
MVI H,10H
MVI L, 00H
MVI M,20H
When the instruction MVI M,2OH is executed
the data 20H will be stored in the memory
location addressed by HL pair register.ie
1000H.
10/19/2019 178
Data Transfer Group
6. LXI Rp,16-bit data
Mnemonic LXI Rp,16 bit data
Operation Rp=16 bit data
No.of bytes 3 bytes
Machine Cycle 3(OF+MR+MW)
10/19/2019 179
Data Transfer Group
Description:-
This instruction will load register pair with 16-bit
data.
This instruction loads 16-bit data specified within the
instruction to the specified register pair or stack
pointer.
In the instruction only high order register is specified
for register pair.ie if HL only H register will be
specified.
The register pair Rp can be BC,DE,HL or Stack pointer
SP.
10/19/2019 180
Data Transfer Group
Example:-
(i) LXI H,2030H
Load HL pair with 2030H.i.e 20H will be loaded
in register H and 30H will be loaded in reg L.
(ii) LXI SP,2000H
Load SP with 2000H.
10/19/2019 181
Data Transfer Group
7.LDA Address
MNEMONIC LDA Address
Operation A=(address)
No. of Bytes 3 bytes
Machine Cycles 4 (OF+MR+MR+MR)
10/19/2019 182
Data Transfer Group
Description:-
Load accumulator direct from Memory
This instruction copies the contents of the
memory location whose address is specified
in the instruction to the accumulator.
The contents of the memory location remain
unchanged.
10/19/2019 183
Data Transfer Group
Example:-
LDA 3000H
This instruction will load the accumulator with the
contents of memory location 3000H.
Let initially A=F0H,Contents of memory location
3000H=15H.
Then after the execution of instruction LDA 3000H
,the accumulator will be loaded with 15H.the
contents of accumulator will change form F0 to 15H.
10/19/2019 184
Data Transfer Group
8.STA Address
MNEMONIC STA address
OPERATION (address)=A
NO of Bytes 3 bytes
Machine Cycles 4(OF+MR+MR+MW)
10/19/2019 185
Data Transfer Group
Description:-
Store accumulator direct to memory.
This instruction will store the contents of the accumulator to
the memory location specified in the instruction.
The contents of memory location remain unchanged.
It is 3 byte instruction. The first byte is the opcode,second
byte is Lower order address and third byte is higher order
address.
10/19/2019 186
Data Transfer Group
Example:-
STA 2050H
This instruction will store contents of
accumulator at memory location 2050H.
10/19/2019 187
Data Transfer Group
9. LHLD Address
Mnemonic LHLD Address
Operation L= (address)
H=(address+1)
No. of bytes 3 bytes
Machine cycles 5(OF+MR+MR+MR+MR)
10/19/2019 188
Data Transfer Group
Description:-
Load HL pair directly from memory
This instruction loads the contents of the memory location to the H and L
registers. The address of memory is specified along with the instruction.
The contents of memory location whose address is specified in the
instruction are transferred to L register and the contents of the next
memory location i.e.(address+1) to the H register.
It is 3 byte instruction. The first byte is the opcode,second byte is the
lower order address and third byte is the higher order address.
10/19/2019 189
Data Transfer Group
Example:-
LHLD 2000H
Load HL pair from memory location 2000H and 2001H.
Let H=05H,L=04H at memory location 2000H and 2001H the
data 20H and 30H is stored.
The instruction LHLD will load the contents of memory
location 2000H to L reg. and contents of 2001H to H reg.
So the contents of register L will change from 04 to 20H and
contents of register H will change from 05H to 30H.
10/19/2019 190
Data Transfer Group
10. SHLD Address
Mnemonic SHLD Address
Operation (Address)=L register
(Address+1)= H register
No. of bytes 3 bytes
Machine cycle 5(OF+MR+MR+MW+MW)
10/19/2019 191
Data Transfer Group
Description:-
STORE HL PAIR DIRECT IN MEMORY
1. This instruction copies the contents of registers H and L to the memory
locations.
2. The address of memory location is specified along with the instruction.
3. The contents of L register are stored at the memory location whose
address is specified and the contents of the H register to the (address+1)
location.
4. It is a three byte instruction. The first byte is the opcode ,second byte is
the lower order address and third byte is the higher order address.
10/19/2019 192
Data Transfer Group
Example:-
SHLD 3000H
1. Store HL pair to memory location 3000 and 3001.
2. Let H=05,L=06,at memory locations 3000 and 3001
is stored and instruction SHLD 3000H is executed
,the contents register L is copied to 3000H and
contents of H register is copied to 3001H.
10/19/2019 193
Data Transfer Group
11. LDAX Rp
Mnemonic LDAX Rp
Operation A=(Rp)
No. Of bytes 1 byte
Machine cycles 2(OF+MR)
10/19/2019 194
Data Transfer Group
Description:-
Load accumulator indirect by using a memory
pointer.
1. This instruction copies the content of the memory location to the
accumulator.
2. The address of memory location is given by Rp register pair specified
along with the instruction .
3. The contents of the memory location remain unchanged.
10/19/2019 195
Data Transfer Group
Example:-
LDAX B
1. This instruction will load accumulator with the contents of
memory location whose address is given by the BC register.
2. Let A=1FH, B=20H,C=25H.at memory location 2025=56H is
stored.
3. Then after execution of instruction LDAX B,the accumulator
will be loaded with the contents of memory location 2025
i.e. 56H.
10/19/2019 196
Data Transfer Group
10/19/2019 197
Data Transfer Group
Description:-
Store accumulator indirect by using a memory
pointer
1. This instruction copies the contents of accumulator
to memory location.
2. The address of memory location is given by Rp
register pair specified along with the instruction.
3. The contents of the accumulator remain
unchanged.
10/19/2019 198
Data Transfer Group
Example:-
STAX D
1. This instruction will store contents of accumulator
to the memory location whose address is given by
the DE register Pair.
2. Let A= 1FH,D= 26H,E=08H,at memory location
2608:10 is stored.
3. Then after execution of STAX D instruction, the
memory location 2608 will contain IFH.
10/19/2019 199
Data Transfer Group
13. XCHG
Mnemonic XCHG
Operation H D L E
No. of bytes 1 byte
Machine Cycles 1(OF)
10/19/2019 200
Data Transfer Group
Description:-
Exchange the contents of HL with DE pair
1. This instruction exchanges the content of H
register with D register and L register with E
register.
Example:- XCHG
1. Let H =12H,L=11H,D=30H,E=40H, and the
instruction XCHG is executed.
10/19/2019 201
Arithmetic Instructions
These instructions perform the operations
like:
Addition
Subtraction
Increment
Decrement
10/19/2019 202
Arithmetic Instructions
Addition
Any 8-bit number, or the contents of register, or the
contents of memory location can be added to the
contents of accumulator.
10/19/2019 203
Arithmetic Instructions
Addition
Any 8-bit number, or the contents of register, or the
contents of memory location can be added to the
contents of accumulator.
10/19/2019 204
Arithmetic Instructions
Subtraction
Any 8-bit number, or the contents of register, or the contents
of memory location can be subtracted from the contents of
accumulator.
10/19/2019 205
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.
10/19/2019 206
Arithmetic Instructions
Opcode Operand Description
If the operand is memory location, its address is specified by H-L pair.
10/19/2019 207
Arithmetic Instructions
Opcode Operand Description
The contents of register or memory and Carry Flag (CY) are added to the contents
of accumulator.
If the operand is memory location, its address is specified by H-L pair.
Example: ADI 45 H
10/19/2019 209
Arithmetic Instructions
The 8-bit data and the Carry Flag (CY) are added to the
contents of accumulator.
Example: ACI 45 H
10/19/2019 210
Arithmetic Instructions
Example: DAD B
10/19/2019 211
Arithmetic Instructions
The contents of the register or memory location are subtracted from the
contents of the accumulator.
10/19/2019 212
Arithmetic Instructions
The contents of the register or memory location and Borrow Flag (i.e. CY)
are subtracted from the contents of the accumulator.
10/19/2019 213
Arithmetic Instructions
Example: SUI 45 H
10/19/2019 214
Arithmetic Instructions
The 8-bit data and the Borrow Flag (i.e. CY) is subtracted
from the contents of the accumulator.
Example: SBI 45 H
10/19/2019 215
Arithmetic Instructions
Example: INX H
10/19/2019 217
Arithmetic Instructions
Example: DCX H
10/19/2019 219
Logical Instructions
These instructions perform logical operations on data
stored in registers, memory and status flags.
10/19/2019 220
AND, OR, XOR
Any 8-bit data, or the contents of register, or
memory location can logically have
AND operation
OR operation
XOR operation
10/19/2019 222
Compare
Any 8-bit data, or the contents of register, or
memory location can be compares for:
Equality
Greater Than
Less Than
10/19/2019 224
Logical Instructions
10/19/2019 225
Logical Instructions
10/19/2019 226
Logical Instructions
10/19/2019 227
Logical Instructions
10/19/2019 228
Logical Instructions
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.
10/19/2019 229
Logical Instructions
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.
10/19/2019 231
Logical Instructions
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.
10/19/2019 232
Logical Instructions
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.
10/19/2019 234
Logical Instructions
10/19/2019 240
Logical Instructions
10/19/2019 241
Logical Instructions
10/19/2019 242
Branching Instructions
• The branching instruction alter the normal
sequential flow.
10/19/2019 243
Branching Instructions
Opcode Operand Description
10/19/2019 244
Branching Instructions
Opcode Operand Description
Jx 16-bit address Jump conditionally
Example: JZ 2034 H.
10/19/2019 245
Branching Instructions
• Example: JZ 2034 H.
• Let Z=0
• This instruction will cause a JUMP to an
address 2034 H.i.e PC will load with 2034 as
ZF=1.
10/19/2019 246
Jump Conditionally
10/19/2019 247
Branching Instructions
10/19/2019 248
Branching Instructions
10/19/2019 250
Branching Instructions
10/19/2019 253
Branching Instructions
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
10/19/2019 255
Control Instructions
• The control instructions control the operation
of microprocessor.
10/19/2019 256
Control Instructions
No operation is performed.
The instruction is fetched and decoded but no
operation is executed.
Example: NOP
10/19/2019 257
Control Instructions
10/19/2019 258
Control Instructions
10/19/2019 259
Control Instructions
10/19/2019 262
Control Instructions
10/19/2019 264