Shop OBEX P1 Docs P2 Docs Learn Events
Addressing Scratchpad Ram or EEPROM memory directly from IF-statements — Parallax Forums

Addressing Scratchpad Ram or EEPROM memory directly from IF-statements

andre.nieuwoudtandre.nieuwoudt Posts: 65
edited 2010-10-06 03:19 in BASIC Stamp
Let me start off by saying that I think Stamps are great, except for one thing: the surprisingly limited RAM available for Variable definition.

To get around this problem, I would like to use Scratchpad RAM or EEPROM space in the remaining 7 slots of the BS2px. However, to GET and READ, you need variables, and there is not enough RAM for all the variables I need.

What I would like to do, is to be able to refer directly to, for instance, a value stored at an address in the Scratchpad RAM or EEPROM from. e.g. within an IF-statement, without having to GET the value into a variable first.

For example:

IF (GET BYTE, 10) > (GET BYTE, 17) THEN..... ' Direct reference to BYTE values in Scratchpad RAM at Addresses 10 and 17

or:

IF (GET WORD, 10) > (GET WORD, 17) THEN...... ' Direct reference to WORD values in Scratchpad RAM at Addresses 10 and 17

or:

IF (READ BYTE, 10) > (READ BYTE, 17) THEN....... ' Direct reference to BYTE values in EEPROM at Addresses 10 and 17 in Slot 0

or:

SEROUT 1, 396, [GET WORD, 10] ' Serial Out the BYTE value stored at Address 10 in Scratchpad RAM

I can not find any syntax to do something like this, which is a pity, because we have access to a lot of bytes above and beyond the Variable RAM to store data, but not for declaring variables.

Has anybody perhaps discovered a way to do this, apart from resorting to Multi-slot programs or Master-Slave setups?

If not, I would really like to submit this as a development request to Parallax.

PS. Using "Common" or "General" variables is OK to PUT or WRITE the values in the first place, but not an option for subsequent GET or READ processing.
Sign In or Register to comment.