0% found this document useful (0 votes)
1K views

Interrupt Structure and Processing of 8086

The document discusses interrupts in the 8086 microprocessor. It describes how interrupts work by temporarily suspending program execution to handle a different task before returning. When an interrupt occurs, the processor finishes the current instruction and jumps to an interrupt service routine (ISR). After the ISR finishes, it returns to the main program using an IRET instruction. The 8086 has 256 interrupt types divided into dedicated, reserved, and user interrupts. It uses an interrupt vector table to store the addresses of ISR routines.

Uploaded by

kpenchal615
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Interrupt Structure and Processing of 8086

The document discusses interrupts in the 8086 microprocessor. It describes how interrupts work by temporarily suspending program execution to handle a different task before returning. When an interrupt occurs, the processor finishes the current instruction and jumps to an interrupt service routine (ISR). After the ISR finishes, it returns to the main program using an IRET instruction. The 8086 has 256 interrupt types divided into dedicated, reserved, and user interrupts. It uses an interrupt vector table to store the addresses of ISR routines.

Uploaded by

kpenchal615
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

Microprocessors

Interrupt structure of 8086


and Interrupt Vector Table

K. Penchalaiah
Associate Professor
Dept. of ECE
8086 microprocessor
Interrupt: it is defined as breaking normal sequence of
program execution temporarily (suspends program execution),
to work on a different task and then return to its previous task.

Whenever an interrupt occurs the processor completes


the execution of the current instruction and starts the
execution of an Interrupt Service Routine (ISR).

After the execution of ISR, control returns back to the


main routine where it was interrupted.

2
8086 microprocessor
Interrupt:

Main Program Interrupt Service Routine


______
______ ISR
______ _____
______ _____
______ _____
______ _____
_____
Interrupt ______ _____
______ _____
______ _____
______ _____
______ _____
_____ _____
_____
IRET
END

3
8086 microprocessor
Types of Interrupts:

4
8086 microprocessor
Sources of Interrupt:

8086 allows normal program to be interrupted in the


following ways.

1. An external signal applied to NMI/ INTR pin.


2. A special instruction execution (INTn).
3. occurrence of Error condition (Divide by 0).
4. A trap interrupt.

5
8086 microprocessor
Interrupt in 8086: There are 256 Interrupt types in 8086.
these are divided into three groups
1.Dedicated interrupts(0-4): first 5 interrupts
2.Reserved interrupts (5-32): next 27 interrupts
3.Interrupts available to user (33-255): remaining 224 int.

Hardware Interrupt :
An External signal applied to the NMI or INTR input
is referred to as External or Hardware Interrupts.
Software Interrupt:
An Interrupt is execution of the interrupt instruction
INTn is referred to as Internal or Software Interrupts.
Where ‘n’ is the interrupt type that can be any value
Between 00H and FFH.(i. e 0 - 255) 6
Processing of Interrupt of by 8086:
ISR
Main program
Push PSW
Clear IF
Clear TF .
Push CS .
Push IP
Fetch ISR address Processing
from IVT of
Interrupt
Interrupt
.
POP IP .
POP CS
POP PSW
IRET 7
Processing of Interrupt of by 8086:
after execution of every instruction it checks if any interrupt has
been requested.
1. It decrements the stack pointer by 2 and Pushes the
Flag Register(PSW) contents on to stack.
2. It Disables the 8086 INTR Interrupt pin by clearing the
interrupt flag (IF) in the flag register.
3. It resets the Trap flag (TF) in the flag register.
4. It decrements the stack pointer by 2 and Pushes the
code segment Register contents on to stack.
5. It decrements the stack pointer by 2 and Pushes the
Instruction Pointer Register contents on to stack.
6. It does an Indirect Jump to the start of the program to
8
respond to the interrupt.
Interrupt Vector Table
• When the 8086 response to an interrupt it goes to four
memory locations to get the CS and IP values for the
start of the interrupt service routine(ISR).
• The first 1KB of memory from 00000h to 003FFH is set
aside as a table for starting address of interrupt
service routine.
• Since 4 bytes are required to store the CS and IP values
for each ISR.
• The starting address of ISR is often called the interrupt
vector or interrupt pointer.
• So, the table is referred to as Interrupt Vector
Table(IVT). 9
Interrupt Vector Table

10
Interrupt Vector Table
• The interrupt vector table is used to store interrupt vectors
and consists of total of 256 vectors (represented as 0-255
in Hexa 00H - FFH).

• If interrupt TYPE 02H is received by the 8086, then it goes


to memory location02HX 04= 00008H.

IP Low 00008H
IP High 00009H
CS Low 0000AH
CS High 0000BH

11
Interrupt Vector Table
these are divided into three groups

1.Dedicated interrupts(0-4): The lowest five interrupts are


dedicated to specific interrupts.

TYPE 00H Divide by zero(0).


TYPE 01H Single step execution for debugging of program.
TYPE 02H represents NMI and is used in power failure
conditions.
TYPE 03H represents a break-point interrupt (1- byte
instruction).
TYPE 04H is the overflow interrupt.

•Reserved interrupts (5-32): next 27 interrupts


•Interrupts available to user (33-255): remaining 224 int.
12
Interrupt Acknowledgement cycle
When the 8086 responds to INTR input signal, different
from response to other interrupts.

13
Interrupt Acknowledgement cycle
When the 8086 responds to INTR input signal, different
from response to other interrupts.

14
Interrupt Acknowledgement cycle
When the 8086 responds to INTR input signal, different
from response to other interrupts.

15
Interrupt priorities in 8086
When two or more interrupts occurs at the same time,
the highest priority interrupt is served by the 8086.

16

You might also like