NIOS2 exceptions...

Jun 15, 2005 1 Replies

Evening...


Seen in u-boot source code that before returning from an interrupt the return address is adjusted by "-4"...



And interestingly this needs to be done although the NIOS2 datasheets says that the address of the next instruction is saved...


thanx in advance rick


Yes, this is correct. The pc+4 of the interrupted instruction is saved by Nios II on an interrupt. So, you need to subtract 4 from this value to return back to the interrupted instruction and continue on.

+james+

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required