Hi,
I'm working on a program that uses multiple lookup tables in EPROM (probably the normal Read/Write type, to be compatible with 08M2, etc.). The tables may use most of the available memory space, so it seems obvious to start from address zero and concatenate the tables, so basically all that's needed is something like:
But how do I write the program to "point" to the entries in the second and subsequent tables? In most languages, I think I'd put a label before each DATA statement, but although PICaxe Basic can use "numbers" in quite surprising places, labels don't seem to be associated with a numerical value.
So, do I have to manually count the number of bytes in each DATA statement and create an appropriate SYMBOL command to define the address for the first byte in each table?. Perhaps then including the symbol name after the appropriate DATA keyword, so that at least the compiler checks for overlap errors.
If I am using Read/Write memory, I suppose I could create a separate Program to Write the data values into EPROM memory. This would also solve the issue that DATA doesn't appear to support WORD values (which most of my tables contain). But to me, one of the strengths of PICaxe Basic is that one can write a single, free-standing program "on a single sheet of paper", without recourse to Multiple Programs, Include files or Libraries, etc..
Cheers, Alan.
I'm working on a program that uses multiple lookup tables in EPROM (probably the normal Read/Write type, to be compatible with 08M2, etc.). The tables may use most of the available memory space, so it seems obvious to start from address zero and concatenate the tables, so basically all that's needed is something like:
Code:
DATA (1,2,4,8,16)
DATA (1,3,9,27,81)
;... etc.
So, do I have to manually count the number of bytes in each DATA statement and create an appropriate SYMBOL command to define the address for the first byte in each table?. Perhaps then including the symbol name after the appropriate DATA keyword, so that at least the compiler checks for overlap errors.
If I am using Read/Write memory, I suppose I could create a separate Program to Write the data values into EPROM memory. This would also solve the issue that DATA doesn't appear to support WORD values (which most of my tables contain). But to me, one of the strengths of PICaxe Basic is that one can write a single, free-standing program "on a single sheet of paper", without recourse to Multiple Programs, Include files or Libraries, etc..
Cheers, Alan.