We've lost track of what you actually think the problem is, can you be more specifc?
The original concern (and my confusion) was that writing a byte to the high (255) eeprom address consumed the entire 256 bytes of available program space and this seemed
somewhat contradictory to what the manual states in the document
picaxe-M2 Series Overview.pdf Page 3, reference table row #7, "Data EEPROM (bytes)" which states (or appears to state) a dedicated 256 bytes. Later on in the document, the statement is made about limited silicon resources and program/eeprom overlap.
I now understand the consumption of all of eeprom by writing to the last eeprom address.
From my understanding, moninos was inquisitive if this would change in a future release; which is to say that many compilers are "smart enough" to recognize net storage requirements and adjust pointers accordingly - in such a scenario, coding a single byte at eeprom address 255 would be optimized by the compiler to address 0 and the firmware would actually never know the difference because access to the eeprom would be through a pointer that contained an offset.
I understand the manual workaround by using eeprom low-address space first and working upwards. It would be nice if the aforementioned document was a bit clearer, however:
Memory Capacity
The M2 parts now have up to 2048 bytes of program memory, which is 8x larger than the older M parts.
They also contain 256 bytes of data memory (read/write/eeprom commands).
Due to more limited silicon resources on the 08M2/18M2 the upper 256 bytes are shared between program and data (2048 in total). Therefore with programs that are under 1792 bytes long all 256 bytes of data memory are available. Very long programs (over 1792 bytes) start to reduce the amount of data memory available. (something at this point about how EEPROM usage is calculated would be beneficial in my opinion)
In the case of the sample code, loading the entire sample into PE and clicking on syntax shows 2033/2048 program usage. Un-commenting the eeprom last line and clicking on syntax also shows 2033/2048 program usage. Edit the eeprom line to utilize
only 1 more data byte:
eeprom 0, (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
15)
and click the Syntax button. The error message displayed is:
Error: Memory location already used! (Byte 15)
There is not really a question here, just that the math (syntax checker) seems a bit strange.
- Ray