Shop OBEX P1 Docs P2 Docs Learn Events
Multiple programmig slots — Parallax Forums

Multiple programmig slots

mmorelandmmoreland Posts: 89
edited 2011-10-26 15:08 in General Discussion
Is it possible to return to a specific place in the code of slot 0 from one of the other 7 slots available on a BS2p rather than returning to the first directive on the slot 0 page? I'm using the command "Run 1 (or 2, 3, 4...etc)" to go to slots from slot 0 and "Run 0" to return, but in all cases, the commands are executed from the beginning of the directives on the pages to which the program is directed. Is there a finer way to manage the movement back and forth?

Comments

  • ZootZoot Posts: 2,227
    edited 2011-10-26 15:08
    Yes. Basically you set up a global variable that is loaded with a return slot and "task". The first code instruction in every slot read that value and decide if the program should jump to a particular location in the slot and continue running.

    See a good writeup of this technique here:

    http://emesystems.com/BS2SX.htm#Crossbank

    I usually use a scratchpad variable -- with GET and PUT -- rather than a "normal" variable, to conserve global variable space.
Sign In or Register to comment.