Forum Discussion
Altera_Forum
Honored Contributor
11 years agoMissing instruction execution when interrupt is received
My project is written in assembly. When I receive an IRQ, the program immediately goes to the exception section, but when returning it goes to the next instruction after the previous instruction. I k...
Altera_Forum
Honored Contributor
10 years agoUpon entering exception, the Exception Address (EA) register take and store the PC+4 value. Performing a direct eret will result in Nios to continue to execute code at PC+4. Therefore, you will need to decrement by 4 the EA register before the eret so that Nios can re-execute the instruction that has taken the interrupt at the first place.
I think that should already handled by the Nios II HAL code. Of course, if you are not using this, you must be a very advanced user.