View Single Post
Old 20 May 2008, 09:32   #11
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
Quote:
Originally Posted by alexh View Post
That is exactly what I do. Before fetching the next opcode, I "check" the interrupt status. If a bit is set, I use an address from vector table to fetch the next opcode.

But at that point I've just finished executing the instruction at the current PC.
And this is specifically the bit which I don't get. At the point where you check the interrupt status, I would expect the PC to always point to the instruction that is next in line for execution.

If the PC still points to the latest instruction which was executed, then it means that the instruction has just been executed, but the PC has not been updated. This will only happen if updating of the PC is not considered to be part of the execution of the instruction.

What am I (we?) missing here?
Kalms is offline  
 
Page generated in 0.04700 seconds with 11 queries