Nios® V Processor Software Developer Handbook

ID 743810
Date 4/07/2025
Public
Document Table of Contents

9.2.1.2.2.2. Return from Traps

Once a trap is serviced, and the ISR or exception handler returns to the trap handling code, it performs the following tasks:

  • Restores the registers from the stack.
    • Restores all the registers if the shadow register is disabled.
    • Restores the lower 16 general-purpose registers only if the shadow register is enabled. (This is not implemented in Altera HAL firmware.)
  • Restores the stack pointer (if a separate exception stack is used).
  • Exits by issuing an MRET (exception return in machine mode) instruction.