Shop OBEX P1 Docs P2 Docs Learn Events
Using extra memory on BS2-SX ( — Parallax Forums

Using extra memory on BS2-SX (

ArchiverArchiver Posts: 46,084
edited 2003-05-23 01:12 in General Discussion
I just got my BS2-SX. Until now, I've been using a (original) BS2. My
program compiles on a (original) BS2 just fine. I put it on the BS2-
SX, and it needed some tweaking on serial port timers, and on timeout
values.

My problem is that on the BS2-SX, when I split it across
multiple "pages", it has a problem. It will not compile into tokens.
I get an error saying that any label not in the current "page" is
an "undefined label".

Here are the specifics of what I'm doing:

I have 4 files: "A-Robot1.bsx", "A-Robot2.bsx", "A-Robot3.bsx" and "A-
Robot4.bsx" If I open "A-Robot1.bsx" in the Parallax editor, then all
4 come up. The lables on the tabs at the top of the screen read "0:A-
Robot1.bsx", "1:A-Robot2.bsx", "2:A-Robot3.bsx" and "3:A-Robot4.bsx"

I've changed my directive in my first file ("A-Robot1.bsx") from the
default for a BS2-SX (obtained by clicking on the blue stamp)
to: "'{$STAMP BS2sx, A-Robot2.bsx, A-Robot3.bsx, A-Robot4.bsx}". I
have no directive on any of the other 3 files. ("A-Robot2.bsx", "A-
Robot3.bsx" and "A-Robot4.bsx")

The line that gives me an error is: "gosub rcServo". Before I cut-and-
pasted my program into 4 windows, it worked perfectly, with the BS2-
SX.

What am I doing wrong? Can I even make a call from one program window
to another? If I can not, the BS2-SX's extra memory is useless.

Andy@A...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-05-22 05:48
    So sorry, the BS2 technology only really handles
    2K bytes at a time. So, the SX handles the additional
    memory by bank-switching.

    What this means to you: You can 'run' the other
    2K partitions, but you can't "call" into them.

    Well, there are ways to do something which has the
    same effect. You'll have to look at the Parallax
    documentation to get the technique.

    But it's not very simple.

    --- In basicstamps@yahoogroups.com, "recycledelectro" <Yahoo@R...>
    wrote:
    > I just got my BS2-SX. Until now, I've been using a (original) BS2.
    My
    > program compiles on a (original) BS2 just fine. I put it on the BS2-
    > SX, and it needed some tweaking on serial port timers, and on
    timeout
    > values.
    >
    > My problem is that on the BS2-SX, when I split it across
    > multiple "pages", it has a problem. It will not compile into
    tokens.
    > I get an error saying that any label not in the current "page" is
    > an "undefined label".
    >
    > Here are the specifics of what I'm doing:
    >
    > I have 4 files: "A-Robot1.bsx", "A-Robot2.bsx", "A-Robot3.bsx"
    and "A-
    > Robot4.bsx" If I open "A-Robot1.bsx" in the Parallax editor, then
    all
    > 4 come up. The lables on the tabs at the top of the screen
    read "0:A-
    > Robot1.bsx", "1:A-Robot2.bsx", "2:A-Robot3.bsx" and "3:A-Robot4.bsx"
    >
    > I've changed my directive in my first file ("A-Robot1.bsx") from
    the
    > default for a BS2-SX (obtained by clicking on the blue stamp)
    > to: "'{$STAMP BS2sx, A-Robot2.bsx, A-Robot3.bsx, A-Robot4.bsx}". I
    > have no directive on any of the other 3 files. ("A-Robot2.bsx", "A-
    > Robot3.bsx" and "A-Robot4.bsx")
    >
    > The line that gives me an error is: "gosub rcServo". Before I cut-
    and-
    > pasted my program into 4 windows, it worked perfectly, with the BS2-
    > SX.
    >
    > What am I doing wrong? Can I even make a call from one program
    window
    > to another? If I can not, the BS2-SX's extra memory is useless.
    >
    > Andy@A...
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-22 13:36
    We have two issues here he needs to deal with. One is porting the BS2 code
    over to a BS2SX. This has absolutely nothing to do with the code segments as
    the BS2 has none. If it fits on a BS2, it will fit in one code segment of a
    BS2SX. There may be some tweaking involved on a few statements, but the code
    should run.

    Adding code and switching to the other code segments is entirely different.
    It would be foolish to attempt this until you get the original code working
    again. It does not make sense to throw in other issues until you take care
    of the first one.

    What the others have said are true -- each code segment is a separate deal,
    and when you jump to a new segment you start at the beginning (top) of the
    code. There are methods for passing things back and forth and jumping to
    certain places in the code. Someone probably has those messages archived and
    can direct you to them.


    Original Message
    From: "Allan Lane" <allan.lane@h...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, May 21, 2003 11:48 PM
    Subject: [noparse][[/noparse]basicstamps] Re: Using extra memory on BS2-SX ("undefined label"
    error)


    > So sorry, the BS2 technology only really handles
    > 2K bytes at a time. So, the SX handles the additional
    > memory by bank-switching.
    >
    > What this means to you: You can 'run' the other
    > 2K partitions, but you can't "call" into them.
    >
    > Well, there are ways to do something which has the
    > same effect. You'll have to look at the Parallax
    > documentation to get the technique.
    >
    > But it's not very simple.
    >
    > --- In basicstamps@yahoogroups.com, "recycledelectro" <Yahoo@R...>
    > wrote:
    > > I just got my BS2-SX. Until now, I've been using a (original) BS2.
    > My
    > > program compiles on a (original) BS2 just fine. I put it on the BS2-
    > > SX, and it needed some tweaking on serial port timers, and on
    > timeout
    > > values.
    > >
    > > My problem is that on the BS2-SX, when I split it across
    > > multiple "pages", it has a problem. It will not compile into
    > tokens.
    > > I get an error saying that any label not in the current "page" is
    > > an "undefined label".
    > >
    > > Here are the specifics of what I'm doing:
    > >
    > > I have 4 files: "A-Robot1.bsx", "A-Robot2.bsx", "A-Robot3.bsx"
    > and "A-
    > > Robot4.bsx" If I open "A-Robot1.bsx" in the Parallax editor, then
    > all
    > > 4 come up. The lables on the tabs at the top of the screen
    > read "0:A-
    > > Robot1.bsx", "1:A-Robot2.bsx", "2:A-Robot3.bsx" and "3:A-Robot4.bsx"
    > >
    > > I've changed my directive in my first file ("A-Robot1.bsx") from
    > the
    > > default for a BS2-SX (obtained by clicking on the blue stamp)
    > > to: "'{$STAMP BS2sx, A-Robot2.bsx, A-Robot3.bsx, A-Robot4.bsx}". I
    > > have no directive on any of the other 3 files. ("A-Robot2.bsx", "A-
    > > Robot3.bsx" and "A-Robot4.bsx")
    > >
    > > The line that gives me an error is: "gosub rcServo". Before I cut-
    > and-
    > > pasted my program into 4 windows, it worked perfectly, with the BS2-
    > > SX.
    > >
    > > What am I doing wrong? Can I even make a call from one program
    > window
    > > to another? If I can not, the BS2-SX's extra memory is useless.
    > >
    > > Andy@A...
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-22 14:02
    there was a nuts and volts article on multibank
    programming for the BS2e, BS2sx, or BS2p a while back
    that should get you up and running. link for download
    below:

    http://www.parallax.com/Downloads/Documentation/nv/v3/col/NV87-Multi_Bank_Progra\
    mming.pdf



    ross



    --- recycledelectro <Yahoo@R...>
    wrote:
    > I just got my BS2-SX. Until now, I've been using a
    > (original) BS2. My
    > program compiles on a (original) BS2 just fine. I
    > put it on the BS2-
    > SX, and it needed some tweaking on serial port
    > timers, and on timeout
    > values.
    >
    > My problem is that on the BS2-SX, when I split it
    > across
    > multiple "pages", it has a problem. It will not
    > compile into tokens.
    > I get an error saying that any label not in the
    > current "page" is
    > an "undefined label".
    >
    > Here are the specifics of what I'm doing:
    >
    > I have 4 files: "A-Robot1.bsx", "A-Robot2.bsx",
    > "A-Robot3.bsx" and "A-
    > Robot4.bsx" If I open "A-Robot1.bsx" in the Parallax
    > editor, then all
    > 4 come up. The lables on the tabs at the top of the
    > screen read "0:A-
    > Robot1.bsx", "1:A-Robot2.bsx", "2:A-Robot3.bsx" and
    > "3:A-Robot4.bsx"
    >
    > I've changed my directive in my first file
    > ("A-Robot1.bsx") from the
    > default for a BS2-SX (obtained by clicking on the
    > blue stamp)
    > to: "'{$STAMP BS2sx, A-Robot2.bsx, A-Robot3.bsx,
    > A-Robot4.bsx}". I
    > have no directive on any of the other 3 files.
    > ("A-Robot2.bsx", "A-
    > Robot3.bsx" and "A-Robot4.bsx")
    >
    > The line that gives me an error is: "gosub rcServo".
    > Before I cut-and-
    > pasted my program into 4 windows, it worked
    > perfectly, with the BS2-
    > SX.
    >
    > What am I doing wrong? Can I even make a call from
    > one program window
    > to another? If I can not, the BS2-SX's extra memory
    > is useless.
    >
    > Andy@A...
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________
    Do you Yahoo!?
    The New Yahoo! Search - Faster. Easier. Bingo.
    http://search.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-22 19:03
    Hi Andy,

    I have some information posted too about cross-bank "calls" at this URL:

    http://www.emesystems.com/BS2SX.htm

    BASICally, you have to create your own return stack and RUN the other
    bank with an index pointer to a routine there. The return stack
    contains an index pointer to the place you need to return to in the
    calling bank. The variables have to be defined the same way in each
    bank. It is a bit complicated, and you will have a much better time
    with it if you organize the program in a "paged" manner to begin
    with. You will inevitably end up with copies of commonly used snall
    routines in each bank that uses them.

    In my opinion, the BS2p and the BS2pe are vastly superior for most
    purposes for cross bank programming. You can access data via READ
    and WRITE in any bank without actually having to RUN the other bank.

    -- Tracy


    >I just got my BS2-SX. Until now, I've been using a (original) BS2. My
    >program compiles on a (original) BS2 just fine. I put it on the BS2-
    >SX, and it needed some tweaking on serial port timers, and on timeout
    >values.
    >
    >My problem is that on the BS2-SX, when I split it across
    >multiple "pages", it has a problem. It will not compile into tokens.
    >I get an error saying that any label not in the current "page" is
    >an "undefined label".
    >
    >Here are the specifics of what I'm doing:
    >
    >I have 4 files: "A-Robot1.bsx", "A-Robot2.bsx", "A-Robot3.bsx" and "A-
    >Robot4.bsx" If I open "A-Robot1.bsx" in the Parallax editor, then all
    >4 come up. The lables on the tabs at the top of the screen read "0:A-
    >Robot1.bsx", "1:A-Robot2.bsx", "2:A-Robot3.bsx" and "3:A-Robot4.bsx"
    >
    >I've changed my directive in my first file ("A-Robot1.bsx") from the
    >default for a BS2-SX (obtained by clicking on the blue stamp)
    >to: "'{$STAMP BS2sx, A-Robot2.bsx, A-Robot3.bsx, A-Robot4.bsx}". I
    >have no directive on any of the other 3 files. ("A-Robot2.bsx", "A-
    >Robot3.bsx" and "A-Robot4.bsx")
    >
    >The line that gives me an error is: "gosub rcServo". Before I cut-and-
    >pasted my program into 4 windows, it worked perfectly, with the BS2-
    >SX.
    >
    >What am I doing wrong? Can I even make a call from one program window
    >to another? If I can not, the BS2-SX's extra memory is useless.
    >
    >Andy@A...
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-23 01:12
    Summary: Rodent, no offense, but re-read my original post.

    --- In basicstamps@yahoogroups.com, "Rodent" <daweasel@s...> wrote:
    > We have two issues here he needs to deal with. One is porting the
    BS2 code
    > over to a BS2SX. This has absolutely nothing to do with the code
    segments as
    > the BS2 has none. If it fits on a BS2, it will fit in one code
    segment of a
    > BS2SX. There may be some tweaking involved on a few statements, but
    the code
    > should run.

    True! I did that, by changing 4 constants (timeouts for various
    serial ports.) The reason I went to a BS2-SX was to get more code
    space. I was at 97% and holding, so I got a Stamp with a bigger
    memory. I had redesigned my program to fit in 4 banks, and ***-U-ME-D
    that I could make calls across banks. Oooops. It was time to learn
    the BS2-S's screwed up memory system, and then to redesign.

    > Adding code and switching to the other code segments is entirely
    different.
    > It would be foolish to attempt this until you get the original code
    working
    > again. It does not make sense to throw in other issues until you
    take care
    > of the first one.

    My code worked just fine on the BS2-SX in a single bank, my question
    was about splitting it into multiple banks. I thought I said that
    (see below) but I'll try to be more clear next time.

    > > --- In basicstamps@yahoogroups.com, "recycledelectro" <Yahoo@R...>
    > > wrote:
    > > > I just got my BS2-SX. Until now, I've been using a (original)
    BS2.
    > > My
    > > > program compiles on a (original) BS2 just fine. I put it on the
    BS2-
    > > > SX, and it needed some tweaking on serial port timers, and on
    > > timeout
    > > > values.
    > > >
    > > > My problem is that on the BS2-SX, when I split it across
    > > > multiple "pages", it has a problem. It will not compile into
    > > tokens.
    > > > I get an error saying that any label not in the current "page"
    is
    > > > an "undefined label".
    > > > The line that gives me an error is: "gosub rcServo". Before I
    cut-
    > > and-
    > > > pasted my program into 4 windows, it worked perfectly, with the
    BS2-
    > > > SX.
Sign In or Register to comment.