Interrupts in 8086
Learning Objectives
After going through this part of the lesson, you
will be able to:
➢ Understand what is Interrupt & Interrupt Vector Table.
➢ Explains the response of 8086 when an interrupt occurs.
What is an Interrupt
An interrupt is the method of processing the microprocessor
by peripheral device. An interrupt is used to cause a
temporary halt in the execution of program.
Interrupts
➢ Most microprocessors allow normal program
execution to be interrupted by some external
signal or by a special instruction in the program.
➢ An IRET instruction at the end of the interrupt
service procedure returns execution to the
interrupted program.
Sources of Interrupts
1. external signal applied to the non- mask able interrupt (NMI)
input pin or to the interrupt(INTR) input pin.
1. execution of the interrupt instruction.
1. some error condition produced in the 8086 by the execution of
an instruction
How Microprocessor knows about Interrupt
Occurrence
At the end of each instruction cycle, the 8086 checks to see if any
interrupts have been requested, the 8086 responds to the interrupt
By stepping through the following series of major actions.
How 8086 responds to Interrupts
1. It decrements the stack pointer by 2 and pushes the flag register
on the stack.
1. It disables the 8086 INTR interrupt input by clearing the
interrupt flag in the flag register.
1. It resets the trap flag in the flag register.
How 8086 responds to Interrupts
4. It decrements the stack pointer by 2 and pushes the current
code segment register contents on the stack.
4. It decrements the stack pointer again by 2 and pushes the
current instruction pointer contents on the stack.
4. It does an indirect far jump to the start of the procedure the
user has written to response to the interrupt.
8086 Interrupt Response
Main line program
Push Flags
Clear IF
Clear TF
Push CS
Push IP
Fetch ISR address
Pop IP
IRET
Pop CS
Pop Flags
Interrupt Vector Table
256 interrupts
1. 0-4 dedicated
2. 5-31 reserved for system
use
08-0FH -8259
10-1FH- BIOS
3. 32-255 available for users
20-3FH –DOS
40-FFH open
Interrupt Vector Table
➢ The table is used to locate the interrupt service routine
addresses for each of those interrupts.
➢ The Interrupt vector table is located in the first 1024 bytes of
memory at addresses 00000H-003FFH.It contains the
address(segment and offset)of the interrupt service provider.
➢ the call to interrupt service routine is similar to far procedure
call.
Dedicated Interrupts
1. DIVIDE-BY-ZERO INTERRUPT-TYPE 0.
1. SINGLE STEP INTERRUPT-TYPE 1.
1. NONMASKABLE INTERRUPT-TYPE 2.
1. BREAKPOINT/INT INSTRUCTION INTERRUPT-TYPE 3.
1. OVERFLOW INTERRUPT-TYPE4.
Reserved Interrupts
Interrupts 5-31 are reserved by Intel for use in most complex
microprocessors such as 80286,80386,80486.
08-0FH -8259A
10-1FH- BIOS
Int 17H
Available Interrupts
Interrupts 32-255 are available for you to use for Hardware or
Software interrupts.
20-3FH –DOS
40-FFH open
Summary
➢ Interrupt responses.
➢ Interrupt Vector table is used to load the starting address of the
ISRs.
➢ Types of Interrupts.
Source: Microprocessors and Interfacing,
Douglas V Hall, TMH publications.
Thank You