Cambridge IGCSE Computer Science · Syllabus 0478 · Software
Interrupt Service Routine
What is Interrupt Service Routine?
An interrupt service routine is a specialised routine, held in memory, that is executed to service a particular interrupt. It performs the response the event requires, after which control returns to the interrupted process.
This definition is part of the Software chapter in Cambridge IGCSE Computer Science.
Interrupt Service Routine in context
Interrupt handling is a save, service, restore sandwich. The processor's state is saved so that nothing is lost; the interrupt service routine for that particular cause is located and executed, which services the event; then the saved state is restored and the interrupted program continues from exactly the point at which it stopped. Get those three words in that order and the sequence writes itself.
Common mistakes with Interrupt Service Routine
- M8. "An interrupt always closes the current program." Why it fails If it were true, moving the mouse would close your work. It also makes the whole save-and-restore mechanism pointless — why save a state you will never return to? Corrected model The current instruction completes, the state and return location are saved, the ISR runs, the state is restored, and the interrupted program resumes from where it stopped. A process only ends if the operating system decides that an unrecoverable fault requires it. Exam-safe sentence "After the interrupt service routine has finished, the saved state is restored and the interrupted program continues from the point at which it was interrupted." Show the retrieval checkHide the check Check: Why is the state saved at step 3 of interrupt handling?Answer: So that it can be restored at step 8 and the interrupted program resumed at step 9 exactly where it stopped.
- M11. "An ISR is an ordinary user application." Why it fails An application provides a service the user requires and is started when the user asks for it. An ISR is never started by a user, provides no user service, and exists solely to service one particular interrupt. Corrected model An interrupt service routine is a specialised routine executed to service a particular interrupt. Each cause has its own. When it finishes, control returns to the interrupted process. Exam-safe sentence "An interrupt service routine is a specialised routine that is executed to service a particular interrupt, after which control returns to the interrupted process." Show the retrieval checkHide the check Check: Is there one ISR for the whole computer, or more than one? Why does it matter?Answer: More than one — each cause has its own. That is why the interrupt must be identified before the correct routine can be located.

