Shop OBEX P1 Docs P2 Docs Learn Events
comparison with BS2 — Parallax Forums

comparison with BS2

basicstampedebasicstampede Posts: 214
edited 2008-08-28 16:15 in General Discussion
I noticed that both SX28 and BS2 have 2K·of memory for program.
So I guess that means that the number of BASIC statements I can program on SX28 is roughly same as BS2.·
Is this a correct assumption?
·

Comments

  • BeanBean Posts: 8,129
    edited 2008-08-28 11:46
    Not really.
    The BS2 commands are stored as tokens. So each command uses about the same number of bytes.
    On the SX28 commands are expanded into all the instructions needed to perform the action.
    By using subroutines this can be minimized. But it really is like comparing apples and oranges.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson

    "It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter

    www.iElectronicDesigns.com

    ·
  • basicstampedebasicstampede Posts: 214
    edited 2008-08-28 15:31
    Bean, I have a project in BS2 that is almost full in memory.

    If I do this in SX, then I guess the chances are high that it will exceed the memory of SX28?
  • JonnyMacJonnyMac Posts: 9,215
    edited 2008-08-28 16:15
    Your BS2 program may be very inefficient; the only way to know if you can fit it into the SX is to crack open the compiler and start writing code. To save space you will want to wrap high level functions (like PAUSE) into subroutines/functions so that they are only compiled once.
Sign In or Register to comment.