Interrupt
Interrupt is a process where a normal program execution is interrupted by some
external signal or by a special instruction in the program.
The processor can be interrupted in the following ways:
1. by an external signal generated by a peripheral, such as Keyboard, Mouse,
Printer, etc.
2. by an internal signal generated by a special instruction in the program.
Types of Interrupt
[Link]
1. Hardware Interrupts – Triggered by external hardware via dedicated pins.
2. Software Interrupts – Triggered by the INT instruction (e.g., INT 21h for
DOS services)
Types of Hardware Interrupts:
A. Maskable Interrupts (INTR in 8086)
● Can be enabled/disabled (masked/unmasked) by the CPU using flags.
● Example: Keyboard input
B. Non-Maskable Interrupts (NMI)
● Cannot be disabled, used for high-priority or critical events.
● Example: Power failure signal, memory parity error
How do the interrupts work?
CASE 1: Maskable Hardware Interrupt (via INTR pin)
1. INTR pin is triggered (logic high).
2. 8086 finishes current instruction.
3. Checks IF flag (must be 1 to accept interrupt).
4. Sends INTA (Interrupt Acknowledge) signal, which becomes 0 and
Acknowledges the Interrupt. Receives the Interrupt number.
5. The Interrupt number is matched in the Interrupt Vector Table.|
6. The Interrupt Vector Table contains the address to a particular Interrupt
Service Routine (ISR) associated with the Interrupt number.
7. The ISR is executed. Processor goes back to its original work.
CASE 2: Non-Maskable Interrupt (via NMI pin)
1. NMI pin is activated (edge/level triggered).
2. 8086 finishes current instruction quickly. Status of the IF flag doesn’t matter.
Interrupt number directly received through the NMI pin.
3. The Interrupt number is matched in the Interrupt Vector Table.|
4. The Interrupt Vector Table contains the address to a particular Interrupt
Service Routine (ISR) associated with the Interrupt number.
5. The ISR is executed. Processor goes back to its original work.
CASE 3: Software Interrupt (INT n)
1. Instruction like INT 21H is executed
2. 8086 does not use pins (pure software).
3. According to Interrupt Number, address is looked up in Interrupt Vector
Table for the corresponding Interrupt Service Routine (ISR).
4. The ISR is executed accordingly.