Nios® V Processor Software Developer Handbook

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

9.2.3.2.2.2. Return from Traps

Once a trap is serviced, and the ISR or exception handler returns to the trap handler, 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.
  • Restores mepc and mcause register values onto the stack.
  • Restores the stack pointer (if a separate exception stack is used).
  • Exits by issuing an MRET (exception return in machine mode) instruction.