Skip to main content

Interrupt and fixed ISR flow of actions

Short answer

An interrupt suspends main program execution; after completing the current instruction and saving PC and flags, the processor loads a fixed ISR address (e.g. 16). The ISR services the device by reading data, then a return-from-interrupt instruction restores PC and flags to resume. Multiple devices sharing the fixed ISR require polling within the ISR to identify the source.

What is interrupt? Explain the summary of flow of actions of interrupt driven I/O using fixed ISR location.

An interrupt is a signal from a peripheral (or an internal event) that makes the processor suspend the program it is running, execute a special routine called the interrupt service routine (ISR) and then return to the interrupted program. It lets the processor respond to events without wasting time polling.

Flow of actions with a fixed ISR location

In this scheme the ISR always starts at a fixed address known to the processor (e.g. 16), so the peripheral does not need to provide any address.

  1. The processor is executing its main program (e.g. at address 100).
  2. The peripheral has data and asserts the interrupt request Int.
  3. The processor completes the current instruction, saves the return address (PC = 100) and flags, and disables further interrupts.
  4. The processor loads the PC with the fixed ISR address (PC = 16). No vector is needed from the peripheral, although some systems still send an acknowledge (Inta).
  5. The ISR executes: it reads data from the peripheral register (e.g. R0 = Reg) and writes it into memory (M[500] = R0); it may first save any registers it modifies.
  6. The ISR finishes with a return-from-interrupt instruction. The processor restores the PC (100) and flags, and the main program resumes.
 main program --Int--> save PC --> PC = fixed ISR address
        ^                              |
        +------ restore PC <-- ISR runs, then RETI

If several devices share the one fixed ISR, the ISR must poll them to find out which one interrupted.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Embedded System chapter 5 questions →