- Asked 3/14
- 2075 Baisakh · 4 marks
- 2071 Bhadra · 8 marks
- 2069 Poush · 6 marks
Interrupt processing in 8086
Short answer
For INTR, after current instruction if IF=1, 8086 runs two INTA' cycles; the second loads an 8-bit type number from PIC. It then pushes FLAGS, clears IF/TF, pushes CS:IP, loads new CS:IP from IVT at 4×type. After ISR, IRET restores. NMI uses fixed type 2, no INTA'.
Explain how a (hardware) interrupt is processed in 8086 microprocessor.
A hardware interrupt in the 8086 comes from an external device on the INTR pin (maskable, level-triggered) or the NMI pin (non-maskable, rising-edge triggered, type 2). The 8086 services it after finishing the current instruction.
INTR interrupt (maskable) – sequence
- An external device (usually through an 8259A PIC) raises INTR.
- At the end of the current instruction the 8086 checks INTR. It is accepted only if the interrupt flag IF = 1.
- The 8086 runs two INTA' (interrupt acknowledge) bus cycles. The first cycle tells the PIC that the request has been accepted. In the second cycle the PIC places the 8-bit interrupt type number (0–255) on D7–D0, and the 8086 reads it.
- The 8086 pushes the flag register on the stack (SP ← SP − 2).
- It clears IF and TF, so that no other INTR or single-stepping takes place inside the routine.
- It pushes CS, then IP (the return address of the next instruction).
- It multiplies the type number by 4 to get the vector address. It loads the new IP from addresses 4×type and 4×type + 1, and the new CS from 4×type + 2 and 4×type + 3 of the interrupt vector table.
- The interrupt service routine (ISR) executes. If nesting is wanted, the ISR executes STI.
- IRET at the end pops IP, CS and the flags, and the main program resumes.
NMI interrupt
- NMI is not affected by IF and needs no INTA' cycles and no external type number.
- The type is fixed as 2, so the vector is read from addresses 00008H–0000BH.
- The remaining steps (push flags, clear IF and TF, push CS and IP, load CS:IP, run the ISR, IRET) are the same.
- It is used for power failure and memory parity errors.
Device -> INTR ----------------> 8086
8086 -> INTA' (1st): "acknowledged"
8086 -> INTA' (2nd): PIC puts type n on D7-D0
Push FLAGS, CS, IP; IF=0, TF=0
IP <- [4n], CS <- [4n+2] -> run ISR -> IRET
Example: type 40H → vector at 4×40H = 0100H; the new IP is read from 00100H–00101H and CS from 00102H–00103H.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Hardware interrupts available in 8086 · Microprocessor, chapter 5
- Interrupt vector table and its use · Microprocessor, chapter 5 · asked 3×
- IVT in 8086 and ISR execution sequence · Microprocessor, chapter 5
- Interrupt vs polling; interrupts in 8085 · Microprocessor, chapter 5
- 8086 speed over 8-bit; major registers · Microprocessor, chapter 3
- Hardware vs software interrupts · Microprocessor, chapter 5
- Interrupt processing steps · Embedded System, chapter 5
- MIS vs DSS information and processing · Information System, chapter 4