DEPARTMENT OF TECHNICAL EDUCATION
ANDHRA PRADESH
Name : A. Usha Rani
Designation : Lecturer
Branch : Electronics & Communication Engg.
Institute : GPT for Women, Bheemunipatnam
Year/Semester : IV Semester
Subject : Microprocessors
Subject code : CM 405
Topic : Interrupts and Assembly Language
Programming
Duration : 100 minutes
Subtopic : Interrupt And Its Need, Classification
Of Interrupts, Sources Of Interrupt
Teaching Aids : PPT
Revised by :[Link],Lecturer,GPT, Nizamabad
9CM405.26TO27 1
Objectives
On completion of this period, you would be able to
understand
• Interrupt and its need
• Classification of interrupts
• Sources of interrupt in 8086
9CM405.26TO27 2
What Is An Interrupt ?
• The process of deviating the normal sequence of
program execution of the processor for the purpose of
getting some kind of service from it
9CM405.26TO27 3
Need For Interrupt
• A device requires some service from the processor, e.g.
a key board has data to send to the processor
OR
• The processor informs its requirement of data, say from
Hard Disk
• As and when the data is ready with the device, it
interrupts the processor to indicate its readiness to
transfer data
9CM405.26TO27 4
Interrupt Process
• Person using the keyboard types one character per
second
• Microprocessor can execute some other software during
that period
• Keyboard interrupts the processor
• Microprocessor initiates data transfer
9CM405.26TO27 5
• Interrupts are useful for efficient data transfer between
processor and peripheral
• Processor time is effectively utilized
9CM405.26TO27 6
What Microprocessor Will Do When Interrupt
Comes ?
• On receiving the interrupt signal, microprocessor stops
the current program execution
• Saves its status on stack
• Renders service to the interrupting device by executing
an appropriate Interrupt Service Procedure (ISP)
• Then it resumes normal program execution
9CM405.26TO27 7
Classification Of Interrupts
According to the source of interrupt
• Hardware interrupts
• Software interrupts
9CM405.26TO27 8
Hardware interrupts
•Interrupts initiated by external hardware or peripherals
Ex: interrupts coming to 8086 on INTR and NMI pins
9CM405.26TO27 9
Software Interrupts
•Instructions inserted at desired locations in a program
Ex: INT 40H
9CM405.26TO27 10
According to the starting address of Interrupt
service
• Vectored interrupts
• Non-Vectored interrupts
9CM405.26TO27 11
Vectored Interrupt
When the interrupt comes, the program control automatically
branches to a specific address (called vector address)
9CM405.26TO27 12
Non- Vectored Interrupts
Interrupting device should supply the address of
Interrupt Service Routine
9CM405.26TO27 13
According to the ability to accept interrupt
request
• Maskable interrupts
• Non-Maskable interrupts
9CM405.26TO27 14
Maskable Interrupts
Interrupts that can be either accepted or rejected
by the processor
Ex : INTR of 8086
9CM405.26TO27 15
Non- maskable interrupts
Interrupts whose request has to be definitely accepted
( or cannot be ignored ) by the processor
Ex : NMI of 8086
9CM405.26TO27 16
Vector address
The address where ISR is starting in memory
9CM405.26TO27 17
Enabling And Disabling The Interrupts
When an interrupt comes, we can make the processor to
either accept or reject the interrupts with the help of
Interrupt Enable (IE) flag
• If interrupt flag is set, Interrupts are enabled
• If interrupt flag is reset, Interrupts are ignored
9CM405.26TO27 18
Summary
We have discussed about
• What is an Interrupt
• Its need
• Classification based on different factors
• Hardware & Software interrupts
• Vectored & Non-vectored interrupts
• Maskable & Non-maskable interrupts
• Enabling and disabling of interrupts in 8086
9CM405.26TO27 19
Quiz
1. Interrupt is useful for
a) Data transfer between memory and processor
b) Data transfer between registers
c) Efficient data transfer between processor and
Peripheral
d) All of the above
9CM405.26TO27 20
2. Maskable Interrupt means
a) Interrupt that must be accepted always
b) Interrupt that can be accepted or rejected
c) Interrupt that must be rejected always
d) Moving the interrupt
9CM405.26TO27 21
3. Hard ware Interrupt means
a) Interrupt initiated by an external device
b) Interrupt initiated by an instruction
c) Interrupt that must be rejected always
d) Interrupt that must be accepted always
9CM405.26TO27 22
4. In 8086, Interrupt can come from
a) An external device over the pins NMI and INTR
b) Execution of an instruction INT n
c) An exceptional condition during program execution
d) All of the above
9CM405.26TO27 23
Frequently asked questions
1. What is an Interrupt? Explain its need
2. Classify the interrupts of 8086.
3. What are the sources of Interrupts in 8086 ?
4. What are hardware Interrupts and software Interrupts ?
5. What is interrupt service routine (ISR) ?
9CM405.26TO27 24
9CM405.26TO27 25