PDA

View Full Version : Data labels



Amoque
- 20th February 2014, 04:36
Can anyone verify?

I'm using PBP 2.60 and reading the manual: Copyright ©2009 microEngineering Labs, Inc. Oddly, the PDF version of the manual I'm using doesn't (at least readily) identify the software version.

Anyway, to the point: In the DATA statement section a label is described:

{Label} DATA {@Location,}Constant{,Constant...},

but in the READ statement section, no description of this feature is described or demonstrated.

READ Address,{WORD}{LONG} Var {,Var...}

... is this one of those "undocumented features" that I read about occasionally or am I missing something? I have tried using the label in the DATA statement and it compiles fine, but in the read it gives errors (as I'd expect it to work). Is there, perhaps some syntax I haven't tried? Older posts refer to (and demonstrate) it, perhaps it is no longer implemented?

Darrel Taylor
- 20th February 2014, 06:34
Well, I think it's documented.

In the DATA section of the manual it says ...
An optional Label (not followed by a colon) can be assigned to the starting EEPROM address for later reference by the program.

And the READ section shows ...
Read bytes, words and longs (if PBPL used) from the on-chip EEPROM at the specified Address ...

So if you write

Calibration VAR WORD

EE_Calibration DATA WORD $1045

READ EE_Calibration, WORD Calibration

It will read the 2-byte Calibration value from the EE_Calibration address in EEPROM.
There is no need to know what that address actually is. PBP will assign the address in the order the data statements were received.

If you are getting errors ... posting the code that caused them will help diagnose the problem.

Amoque
- 21st February 2014, 02:52
Thanks Darrel, I had in my mind more like a label... you know, MAIN:; goto MAIN type? Never dawned on me to define it so that it would hold an address value. Makes perfect sense now that I see it.

sign me,
...sufficiently talented fool