In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: Hi All; I'd like to pipe in here as I have some experience at this. The 8 level CALL STACK is totally independent of the 2 level SHADOW STACKS, and the CALL STACK is not accessible under program control in any manner that I have been able to determine. As Peter V indicates, the desired action could be simulated by saving a return address prior to jumping to (calling) the subroutine, and then returning from the subroutine via pushing the saved return address on the M:W registers and forcing the return jump via the RETI instruction. There is caution to be used here as there are also hidden STATUS bits that get effected on executing a RETI. Paul; Your description is not correct; pushPC loads M:W into the PCshadow, and popPC does the reverse. It takes a RETI to trigger the jump, but of course all other shadows are then also popped, thereby changing the whole state of the processor. As an answer to Armored Cars' original post, my recommendation for the casual programmer is to just use the standard call/return instructions if at all possible. The other approaches, while possible as in the RTOS I have written, are quite involved. 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=94157#m94228 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)