- Asked 2/14
- 2074 Bhadra · 2 marks
- 2070 Magh · 6 marks
Sequence of steps when interrupt occurs
Short answer
Device sends request; CPU finishes instruction, if allowed acknowledges; pushes return address and flags disabling interrupts; obtains ISR address (fixed or from IVT); executes ISR, saving registers; returns with IRET/RET restoring context.
Write down the general sequence of steps followed when an interrupt occurs.
When a device requests an interrupt, the processor follows this sequence.
- The device sends an interrupt request signal (for example INTR).
- The processor finishes the instruction that is being executed. It does not stop in the middle of an instruction.
- The processor checks whether the interrupt is allowed (the interrupt-enable flag is set and no higher-priority interrupt is in service).
- It sends an interrupt acknowledge signal (INTA') to the device.
- It saves the current status: the contents of the program counter (return address) and, in the 8086, the flags, are pushed onto the stack. Further interrupts are disabled.
- It finds the address of the interrupt service routine (ISR). This is either fixed (RST, TRAP in 8085) or taken from the interrupt vector table using the type number (8086).
- The PC (CS:IP) is loaded with that address, and the ISR executes. The ISR saves any registers it uses and services the device.
- The ISR ends with a return instruction (RET in 8085, IRET in 8086). The saved values are popped from the stack; on the 8085 the ISR executes EI before RET to enable interrupts again, while IRET on the 8086 restores IF with the flags.
- The processor continues the interrupted program from the next instruction.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- IVT in 8086 and ISR execution sequence · Microprocessor, chapter 5
- Interrupt processing steps · Embedded System, chapter 5
- IC manufacturing steps; top-down F = xz + y · Embedded System, chapter 8
- Sequence of call steps in SS7 · Telecommunications, chapter 5
- Interrupt driven data transfer · Instrumentation II, chapter 1 · asked 2×