8086 Microprocessor - Interrupts
8086 Microprocessor - Interrupts
Source:
‘Microprocessors and Interfacing’, by Douglas V Hall
Contents
Introduction
Interrupts
Types of Interrupts
Hardware Interrupts
Maskable and Non-maskable Interrupts
Software Interrupts
256 Interrupts
Conclusion
Introduction
The meaning of “interrupts” is to break the sequence
of operation.
While the microprocessor is executing a program, an
“interrupt” breaks the normal sequence of execution
of instructions, diverts its execution to some other
program called Interrupt Service Routine (ISR).
After executing, control returns the back again to the
main program.
Interrupt
Keeping moving until interrupted by the
sensor.
Interrupt received then do pre-defined
operation.
After finishing the interrupt service return to
normal operation i.e. keep moving forward
again.
The processor can be interrupted in the following ways –
• In response to an interrupt,
– the microprocessor stops executing its normal program &
of an instruction. e.g.,
Divide-by-zero interrupt: If we attempt to divide an operand by zero, the 8086
• Type 1: Single step or Trap – After the execution of each instruction when trap flag
set
• Type 8: Double Fault – Two separate interrupts occur during the same instruction
• Type 10: Invalid Task State Segment – TSS invalid (probably not initialized)
• Type 11: Segment not present – Descriptor P bit indicates segment not present or
invalid
• Type 12: Stack Segment Overrun – Stack segment not present or exceeded
• Type 13: General Protection – Protection violation in 286 (general protection fault)
• Type 18: Machine Check – Memory Management interrupt (Pentium and above)
• At the end of each instruction cycle, 8086
checks to see if any interrupts have been
requested.
• If an interrupt has been requested – the 8086
responds to the interrupt by stepping
through the following series of major actions:
1. It decrements the stack pointer by 2 and pushes
the flag register on the stack.
2. It disables the INTR interrupt input – 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 current code segment register contents on
the stack.
5. It decrements the stack pointer again by 2 and
pushes the current instruction pointer contents
on the stack.
• If the pressure goes above a preset limit, the sensor will send an
interrupt signal to the 8086.
– sound an alarm!
Example 2 –
it.