Shop OBEX P1 Docs P2 Docs Learn Events
Multislot programs — Parallax Forums

Multislot programs

EscamoteurEscamoteur Posts: 12
edited 2008-02-07 14:01 in BASIC Stamp
Hi,

do I understand it right, that the RUN command switches to another slot and allways starts the program there from the beginning?

There is no such thing like a GOSUB to another slot and then RETURN to the calling slot?

All slots share the same RAM, so that writing to variables in one slot overwrites that in another one, right?

If I want to implement GOSUB like slot switching I would need to store my last program position in scratch pad RAM before the RUN and have at the beginning of my program an ON GOSUB which is based on that value?

Are there any documents about using multiple slot programming?

Best

Thomas

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-02-07 14:01
    Thomas -

    What you say is basically all true with some minor modifications. When you say:

    "All slots share the same RAM, so that writing to variables in one slot overwrites that in another one, right?"

    That presumes you have placed the variable allocations in the same order in each slot, as you should have done. If not, variables can easily get clobbered.

    Here are some references, tutorials and examples for multi-bank programming:

    From Dr. Tracy Allen's web site -
    http://www.emesystems.com/BS2SX.htm

    Nuts & Volts Magazine Column 87 from the following web page:
    http://www.parallax.com/Resources/NutsVoltsColumns/NutsVoltsVolume3/tabid/445/Default.aspx

    That should get you started.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is no pleasure in having nothing to do;
    the fun is in having lots to do, and not doing it!
Sign In or Register to comment.