In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: Hi Dan, Paul, Peter; [quote="dkemppai"] Are the PC Shadow Stack (accessed via the secret instructions) and normal PC stack different? I find references on [url=http://www.sxlist.com]www.sxlist.com[/url] that says the PC Shadow stack used by PushPC is 2 levels deep, while the SK-Key Manual makes reference to the PC Stack being 8 levels deep (with the stack extended). If I pushPC ($04B) the contents to M and W to the stack, is this the same stack as used by the interrupt call instructions? Are they different? Any implications of me using PushPC and possible gotcha's you guys are aware of. Dan, the 8 level call stack is a totally different and separate animal from the 2 level shadow stacks used by the interrupt service. And yes, you can do what you are suggesting, but as Peter Verkaik pointed out, there are simpler ways to accomplish it, provided you are prepared to have a jump table in some lower half segment. There are some very complicated "gotcha" issues dealing with what appears to be a simple pre-loaded RETI. In particular when interrupts are active, and interrupts in the middle of a SKIP instruction. Too hard to explain in simple terms. [b]Paul said..[/b][b].[/b] he used them to force switching between processes (using the call stack if I remember correctly). Paul; The call stack itself was not used, but the call instruction was. I have since made conceptual changes as well as corrections to the code. Peter; I agree with your approach in general, but for coding convenience I would put all the "called subroutine jumps" together at one low half segment of memory. Realizing of course that @ (page) instructions are likely required as part of the jumps in that table. Cheers, Peter (pjv) [/quote] [/quote] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=80504#m80569 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)