Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0478

Handle interrupts with an interrupt service routine

Trace how a system pauses a task, services an event and returns to the interrupted work.

Cambridge IGCSE Computer Science 0478 · Software · 2026–2028 Version 6 · 4.1

This sequence follows Cambridge IGCSE Computer Science 0478, 2026–2028 syllabus Version 6. It covers subject content sections 4.1–4.2 only. The separately published 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding.

Before you begin

  • No programming language is required. Be comfortable with place value and multiplication; each lesson introduces the computer-science notation it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

What happens to the current task when an interrupt is handled?

What you will learn

  • Describe how an interrupt is handled
  • Explain the role of an interrupt service routine
  • State what happens after the event is serviced

The system services the event and resumes work

When an interrupt is accepted, the processor pauses the current task and preserves enough state to continue later. The operating system identifies the event and runs an appropriate interrupt service routine (ISR).

Apply and check the rule

The ISR handles the event, such as recording a key press or responding to a fault. The system then restores the interrupted task's state and resumes it, unless the event requires the program to stop or report an error.

Pause and explain

After a normal input interrupt is serviced, what can happen?

Put the idea to work

Worked example

A key is pressed while a calculation is running. Outline the interrupt response.

Show the worked solution
  1. The keyboard signals a hardware interrupt.
  2. The processor pauses the calculation and the OS runs the keyboard's interrupt service routine (ISR).
  3. The key event is processed, then the calculation resumes.

Answer Pause the calculation, run the keyboard's interrupt service routine (ISR), process the key, and resume the calculation.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

State what an ISR does after a mouse movement generates an interrupt.

Give me a hint

It handles the event rather than the entire program.

Compare my reasoning
  1. The OS runs an appropriate ISR.
  2. The routine processes or records the mouse event.
  3. The interrupted task can then continue.

The ISR processes the mouse event; afterwards the system can resume the interrupted task.

Look for these in your work

  • ISR invoked
  • Event handled
  • Resume stated
2 · Independent

A software error interrupt requires the program to stop. Does the CPU still resume that same instruction sequence automatically? Explain.

Give me a hint

Recovery depends on the event, not just the existence of an ISR.

Compare my reasoning
  1. The ISR can identify or report the error.
  2. If the program cannot safely continue, the OS may terminate it or display an error.
  3. Resumption is not guaranteed for an unrecoverable fault.

No. The handler may report the error and stop the program; resumption depends on whether the event can be handled safely.

Look for these in your work

  • Error handled
  • Stop possibility
  • No false guarantee
3 · Transfer

A student says an interrupt makes the CPU forget its current work. Explain how the system can service an event and still continue the task.

Give me a hint

State must be preserved around the ISR.

Compare my reasoning
  1. The processor saves enough state before servicing the event.
  2. The ISR handles the event.
  3. The processor restores that state and continues the task if it remains valid.

The system preserves the task's state, runs the ISR, then restores the state and resumes work when safe.

Look for these in your work

  • State preservation
  • ISR role
  • Conditional resumption

Common mistakes

  • Saying an ISR is a separate output device
  • Assuming every interrupt permanently stops the current program
Recall without your notes

What can you explain now?

What is the purpose of an interrupt service routine?

Compare with the explanation

Handle the event that raised the interrupt

The ISR contains the steps needed to respond to a particular interrupt.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

What is the sequence from interrupt signal through ISR to a resumed task?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 6 syllabus, with worked explanations and guided, independent and transfer practice. This is mapped teaching coverage, not proof of full exam readiness. Three earlier starter lessons remain available but are not counted as syllabus-mapped teaching. Practical programming experience in an executable browser workspace, full timed-paper practice, human subject-teacher review and the separate 2029–2031 syllabus remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.