ข้ามไปยังเนื้อหา

Labs · 9618 AS 4.1 · A2 16.1

การรบกวน (Interrupts)

Be the CPU. Devices send interrupts while a program runs. Check the interrupt register after every cycle, compare priorities, save the PC on the stack and run the right ISR.

5 levelsFree bench

In the exam

Exam questions on what this lab teaches, with the points that gain marks.

9618/11 May/June 2023 · Question 65 marks

A key is pressed on a keyboard, and this generates an interrupt. Explain how the computer handles the interrupt.

Points that gain marks

  1. An interrupt flag is set in the interrupt register.
  2. The register is checked at the end of the current fetch–execute cycle (or the start of the next one).
  3. The CPU checks whether the interrupt has a higher priority than the current process.
  4. If it does, the contents of the registers are saved on the stack.
  5. The interrupt service routine (ISR) for the key press is called, and the key's data is processed.
  6. The registers are restored from the stack, and control goes back to the process that was interrupted.

In this lab: Each step is a button here: the bit in the interrupt register, the check at the end of every cycle, the priority comparison, the PC pushed on the stack, the ISR's start address in the PC, and the pop that brings the old PC back.

9618/11 May/June 2022 · Question 6(a)(ii)5 marks

Describe when interrupts are detected in the F-E cycle and how the interrupts are handled.

Points that gain marks

  1. Detected at the start or end of each F-E cycle.
  2. The priority is checked: if it is lower than the current process, the F-E cycle continues.
  3. If higher, the state of the current process (the registers) is stored on the stack.
  4. The type of interrupt is identified and the right ISR is called.
  5. When the ISR finishes, check for further high-priority interrupts; otherwise load the registers back from the stack and continue.

In this lab: Levels 'One interrupt', 'Not urgent enough' and 'An interrupt in an ISR'.

IGCSE 0478/11 October/November 2025 · Question 6(b)(i)–(ii)2 marks

An interrupt is sent to the CPU every time a key is pressed on the keyboard. (i) Give the name of this type of interrupt. (ii) Give the name of the program that services the interrupt.

Points that gain marks

  1. (i) A hardware interrupt.
  2. (ii) An interrupt handler // an interrupt service routine (ISR).

In this lab: Level 'One interrupt'.

IGCSE 0478/12 October/November 2025 · Question 5(a)–(b)5 marks

An interrupt is sent to the CPU every time a mouse button is clicked. (a) Identify the name of this type of interrupt. (b) The interrupt is placed in a queue. Explain how the interrupt is serviced after it is placed in the queue.

Points that gain marks

  1. (a) A hardware interrupt.
  2. (b) The priority of the interrupt is checked. If it is higher, the current process is halted and stored on a stack; the interrupt is fetched, its source is checked, and the interrupt service routine (ISR) is called to process it.
  3. (b) If the priority is not higher, the CPU continues with the current process.

In this lab: Level 'One interrupt' (save the registers on the stack, run the ISR, restore) and 'Not urgent enough' (a lower priority waits).

The question as printed in the exam paper

More real experiments

All labs →

เข้าสู่ระบบหรือสร้างบัญชี

IGCSE, A-Level & AP