Shop OBEX P1 Docs P2 Docs Learn Events
GOSUB and change slot — Parallax Forums

GOSUB and change slot

ArchiverArchiver Posts: 46,084
edited 2002-02-11 13:07 in General Discussion
Hi,
I use Stamp2p 40.
I use the GOSUB instrution in slot 0, and then with RUN 1
change to slot1, running my program1, then go back to slot 0,
with a flag going in the GOSUB instruction
and terminate with RETURN.
...........................
The Stamp1 use b12 and b13 for the GOSUB instruction
How dos the stamp2p manage? I did not find out.
Do I have to backup und restore the address for GOSUB?
And where in the memory is it saved?.
If somebody would like to explain or give a link
I am thankful Heinz

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-02-11 13:07
    You should plan your programs so that you don't change slots in the middle of
    a subroutine as there is no way to manually manipulate the RETURN address
    stack in the Stamp.

    -- Jon Williams
    -- Parallax


    In a message dated 2/11/02 5:40:28 AM Central Standard Time, hschwenk@g...
    writes:


    > I use Stamp2p 40.
    > I use the GOSUB instrution in slot 0, and then with RUN 1
    > change to slot1, running my program1, then go back to slot 0,
    > with a flag going in the GOSUB instruction
    > and terminate with RETURN.
    > ...........................
    > The Stamp1 use b12 and b13 for the GOSUB instruction
    > How dos the stamp2p manage? I did not find out.
    > Do I have to backup und restore the address for GOSUB?
    > And where in the memory is it saved?.
    > If somebody would like to explain or give a link
    > I am thankful




    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.