- 2069 Bhadra · 3+5 marks
IVT in 8086 and ISR execution sequence
Short answer
For an interrupt, the 8086 pushes FLAGS, CS, and IP, clears IF and TF, then reads IP and CS from the vector address 4×type and jumps to the ISR. The ISR ends with IRET, which pops the return address and flags.
Explain how the interrupt vector table is used in 8086 microprocessor. Show the complete instruction execution sequence when interrupt service routine is called.
Use of the interrupt vector table
The IVT occupies 00000H–003FFH and holds 256 four-byte vectors (IP then CS). For interrupt type n, the 8086 reads the new IP from address 4n and the new CS from 4n + 2. The type number comes from the INT n instruction, from a fixed value (types 0–4), or from the interrupt controller during the INTA' cycles of INTR. Because the table is in memory, the user can change a vector and so install his or her own ISR.
Complete sequence (example: INT 21H)
Assume SP = 1000H and the next instruction address is CS:IP.
- The 8086 fetches and decodes INT 21H (CDH 21H). IP now points to the next instruction.
- Push flags: SP ← SP − 2 = 0FFEH; flag register stored.
- Clear IF and TF (IF = 0, TF = 0) to disable INTR and single stepping.
- Push CS: SP ← 0FFCH.
- Push IP (return address): SP ← 0FFAH.
- Calculate the vector address: 21H × 4 = 0084H.
- IP ← word at 00084H, CS ← word at 00086H.
- The next instruction is fetched from the new CS:IP, i.e. the ISR starts.
- The ISR executes (it saves registers with PUSH if it uses them).
- IRET (CFH): pop IP (SP = 0FFCH), pop CS (SP = 0FFEH), pop flags (SP = 1000H). Original IF and TF are restored.
- The main program continues with the instruction after INT 21H.
Stack after step 5 (grows down)
SP -> 0FFAH : IP (return)
0FFCH : CS (return)
0FFEH : FLAGS
1000H : (old top)
For hardware INTR the sequence is the same, except that step 1 is replaced by two INTA' cycles that bring the type number.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- ISR, IVT and type 0 to 4 interrupts · Microprocessor, chapter 5
- Interrupt vector table and its use · Microprocessor, chapter 5 · asked 3×
- Interrupt processing in 8086 · Microprocessor, chapter 5 · asked 3×
- Sequence of steps when interrupt occurs · Microprocessor, chapter 5 · asked 2×
- 8086 ALP: multiplication table of a number · Microprocessor, chapter 3
- EI, DI, SIM, RIM and ISR address · Microprocessor, chapter 5
- IRQ, ISR, IVT, PUSH, POP, latency · Embedded System, chapter 5
- Interrupt and fixed ISR flow of actions · Embedded System, chapter 5
- Instruction cycle state diagram with interrupt · Computer Organization and Architecture, chapter 1 · asked 6×