Shop OBEX P1 Docs P2 Docs Learn Events
how many 'word' variables can the STAMP store? — Parallax Forums

how many 'word' variables can the STAMP store?

MatthewMatthew Posts: 200
edited 2005-03-23 19:48 in General Discussion
How many 'word' variables can the STAMP store? How many variables can the STAMP store in all?

Thanks,
Matthew

Comments

  • Steve JoblinSteve Joblin Posts: 784
    edited 2005-03-19 20:52
    The BS2 has 12 word variables for your usage.· They are referred to as W0 through W12.· Each Word can be broken down into Bytes, Nibbles, and Bits.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-20 02:13
    Steve Joblin said...
    The BS2 has 12 word variables for your usage.· They are referred to as W0 through W12.· Each Word can be broken down into Bytes, Nibbles, and Bits.

    Steve,

    ·· Minor correction...There are 13 words available.· W0 - W12·· tongue.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • Steve JoblinSteve Joblin Posts: 784
    edited 2005-03-20 15:00
    Chris - My bad... I do know better.... Even as I was writing my post, I said to my self "it's twelve plus one for the W0 equals thirteen". Don't know why I wrote 12... Maybe because I was so happy that I actually knew something and could help out a fellow Stamper.

    Hope you are enjoying your new gig.... You have no idea how lucky you are! I would give anyting to work at Parallax!!!!
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-20 16:18
    Let's not encourage new programmers to use internal variable names (B0 .. B25, W0 .. W12) as this habit usually leads to difficult-to-find programming errors -- I know because I'm frequently sent such code to "fix."

    So, new folks, the BASIC Stamp 2 family has 26 bytes of user RAM which can be configured as Bits, Nibs (4 bits), Bytes, and Words -- you simply declare your variable and its type and the compiler will organize it into RAM for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • MatthewMatthew Posts: 200
    edited 2005-03-23 19:25
    Jon,

    How many bytes do bits, nibs, and words equal?

    Thanks,
    Matt
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-23 19:48
    1 byte = 8 bits
    1 byte = 2 nibs
    2 bytes = 1 word
Sign In or Register to comment.