Shop OBEX P1 Docs P2 Docs Learn Events
SPSTR starting location? — Parallax Forums

SPSTR starting location?

FalconFalcon Posts: 191
edited 2012-01-27 10:00 in BASIC Stamp
I'm starting to write some code that will pass multiple BYTES via the SERIN SPSTR statement into ScratchPad RAM. The BSS&RM describes SPSTR as follows:

Input a character string of L bytes (up to 126) into Scratch Pad RAM, starting at location 0. Use GET to retrieve the characters.

Is there a modifier that would save the BYTES at any ScratchPad location other than 0? Or is the only option to use an immediate PUT command to save them to a different ScratchPad location?

I want to receive ~ 16 BYTES but I would then need 16 PUT commands to relocate them using up more memory space.

I may end up with two separate serial busses coming into the STAMP. If so, they could potentially overwrite the data written to ScratchPad locations 0-15.

Thoughts? Comments?

falcon

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2012-01-27 07:37
    I don't think there's a provision for moving the pointer when using SPSTR. But, a simple loop after receiving will allow you to PUT the data anywhere in the scratchpad you want.

    Cheers,
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2012-01-27 08:16
    Confirming, no way. SPSTR always starts at zero, and you have to GET/PUT move data you want to save somewhere else before hitting another SPSTR.
  • FalconFalcon Posts: 191
    edited 2012-01-27 10:00
    I appreciate the replys. I hadn't seen anything about that but just wanted to have it confirmed.

    falcon
Sign In or Register to comment.