Nios® V Processor Software Developer Handbook

ID 743810
Date 10/06/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 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. (This is not implemented in MicroC/OS-II HAL firmware.)
  • Restores the stack pointer (if a separate exception stack is used).
  • Exits by issuing an MRET (exception return to machine mode) instruction.