Nios® V Processor Software Developer Handbook

ID 743810
Date 10/06/2025
Public
Document Table of Contents

9.2.2.2.2. Interrupt Service Routine

Upon an interrupt, the CLINT-Vectored passes control to the ISR according to the interrupt vector (in vector table). The interrupt vector is calculated from the addition of the vector table base address with four times the interrupt cause number.

The ISR performs the following tasks:
  • Saves the necessary register values onto the stack
  • Executes the servicing tasks related to the interrupt

Once the ISR completes, it performs the following tasks:

  • Restores all the registers from the stack
  • Exits by issuing an MRET (trap returns to machine mode) instruction
Figure 21. ISR in CLINT-Vectored

For more information about registering an ISR, refer to the topic Interrupt Service Routines and Exception Handler.