In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: Hello Electronic; The secret PUSHPC/POPPC operate on the two level program counter shadow stack..... NOT on any subroutine/call/ret stack. In order to return from interrupt to a place different than the interrupted code, ALL the shadow stacks (PC, STATUS, FSR, W) need to be primed with the desired or appropriate contents, and then a RETI is issued. That then pops the primed shadow contents into the real registers. There are some other non-trivial issues such as what happens when an interrupt occurred during a SKIP instruction, and what about the M register. As I stated earlier, in its full implementation there is a fair bit of complexity to this, and is not for beginners .... not to imply that you are a beginner, just a caution. Cheers, Peter (pjv) ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=162350#m163187 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)