Shop OBEX P1 Docs P2 Docs Learn Events
Tokenizer and Program Slots? — Parallax Forums

Tokenizer and Program Slots?

SamMSamM Posts: 24
edited 2007-10-23 01:58 in BASIC Stamp
Using the tokenizer library, is it possible to download code into a program slot (on multi-slot compatible stamps) other than the first slot (0) without having to overwrite the first slot? In other words, if I have two different programs, one destined for slot 0 and one for slot 1, can I tokenize them and send them to the stamp separately, or must the first code contain the stamp directive mentioning the code files for the program destined for slot 1?

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-10-17 16:23
    I'll separate the question into two parts.
    1) I don't know how to acheive that using the tokenizer library. It would be a very useful thing to do, also from the object loader generator.
    2) The download process does always proceed one slot at a time, and the slots are independent entities as far as download is concerned. The mechanics of this are well described. You do that from the IDE by choosing "current" rather than "all" or "modified" from the editor preferences panel. The Stache programmer can store multiple versions of programs and direct them to selected slots. It does that by capturing the output from a "current" setting in the IDE.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SamMSamM Posts: 24
    edited 2007-10-20 01:23
    The tokenizer docs seems to imply that code must be sent in slot0, slot 0 and 1, slot 0,1 and 2, etc. in that order, but nothing is mentioned about the possiblities of "skipping" a slot in the order. I wasn't aware that it could be done in the IDE, although that has no bearing on me in this case because I am doing everything from the tokenizer & custom code (no parallax IDE at all at this point).

    Can anyone from parallax shed any more light on this?
  • Jeff MartinJeff Martin Posts: 760
    edited 2007-10-22 16:39
    Hi,

    The tokenizer always treats things as just individual, unrelated, 2K-sized program slots.·

    The BASIC Stamp Editor, through it's $STAMP directive, limits you to creating a project that fills the slots from slot 0 towards slot 7, in order.· This is done partly to maintain simplicity.

    The download process, however, acts in a way similar to the tokenizer; it treats everything as individual, unrelated, 2k-sized program slots; with the only exception being that you have to tell it, near the start of the downloading of a slot, which slot (0 - 7) that you wish to target.· This allows single slots to be downloaded, or mutiple, non-contiguious slots if desired.

    The BASIC Stamp Editor's Generate Object Code feature·(as of v2.2.8, I believe) allows you to select which program slots you wish the object file to contain; so that the Stamp Loader can download just individual, or multiple, non-contiguous slots, if necessary.



    So, in summary; for the tokenizer, simply pass it whatever source code you want (doesn't matter which slot it is destined for) and save the resulting tokenized data for your IDE's download process.· Then, download each up-to-2K chuck of tokenized data into whichever slot you want to, in whatever order you want to, by following the process for downloading multiple slots as documented by the BASIC Stamp Download Protocol document, that you should have received along with the tokenizer.



    Thank you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Jeff Martin

    · Sr. Software Engineer
    · Parallax, Inc.
  • SamMSamM Posts: 24
    edited 2007-10-23 01:58
    Thank you, Jeff. I will attempt this with the tokenizer code myself next.
Sign In or Register to comment.