Interrupt Service Routine (ISR)

Computer Science: OCR A Level, topic 2.1.7

Interrupt Service Routine (ISR)

An interrupt service routine is a set of instructions that need to be done as part of an interrupt.

ISR

ISR

  • An interrupt service routine is a set of instructions that need to be done as part of an interrupt.
  • When an interrupt service routine has been completed, the CPU will go back to the set of instructions it was doing before.
Process

Process

  • As an interrupt arrives at the CPU it comes with a flag to indicate the priority of the interrupt.
  • This interrupt could be higher importance than the set of instructions it is currently working.
  • The interrupt pushes the current instruction and all the contents of the registers in the CPU to a stack.
Process cont.

Process cont.

  • The CPU will then complete the interrupt service routine and then load the registers back in from the stack and continue where it left off.
  • At the end of each fetch, decode, execute cycle, the CPU checks for interrupts and their priorities before continuing on.

Test yourself on Interrupt Service Routine (ISR)

  • At what point in the fetch, decode, execute cycle does the CPU check for interrupts and their priorities before continuing on?

Practise this topic for free