Low Level Interrupt Processing - Introduction

Chapter 9 - Interrupt Processing in XINU


We've already looked into some aspects of interrupts, especially the low-level aspects (for example, why an interrupt happens, what sequence of events occurs during the generation and acknowledgment of an interrupt, etc). This chapter takes a good look at the software that responds to an interrupt by calling the appropriate routine.

Before we begin, we need to remember the following:

  1. When an interrupt occurs, the hardware saves the current PC and PS on the stack, and then pops the PC and PS stored in the interrupt dispatch table entry identified by the interrupt vector.
  2. The interrupt routine needs to call a special return instruction (not the usual one that returns from a subroutine) to return from interrupt processing. This instruction restores the pushed PC and PS in a single step.
  3. Some assembly is required because the ISR (interrupt service routine) may need to manipulate registers, and because the special RTI (return from interrupt) instruction is not generally callable from a high-level language.
1