Data labels


Closed Thread
Results 1 to 3 of 3

Thread: Data labels

  1. #1
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198

    Default Data labels

    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?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Data labels

    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
    Code:
    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.
    DT

  3. #3
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Data labels

    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

Similar Threads

  1. linear data memory & large data arrays
    By ronsimpson in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th June 2011, 23:21
  2. Serial Number labels
    By villafan in forum Off Topic
    Replies: 1
    Last Post: - 28th May 2010, 17:51
  3. from interrupt to other labels
    By jmbanales21485 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th May 2008, 13:32
  4. Code Issue? - Pin Labels
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th July 2006, 16:28
  5. Replies: 0
    Last Post: - 28th May 2004, 17:25

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts