18M2+ Table memory usage.

AndyGadget

Senior Member
The command reference (http://www.picaxe.com/BASIC-Commands/Variables/table/) states "M2 parts have 512 locations (0-511). These are separate to the 2048 bytes of program memory, so do not affect program length."

When I use a DATA statement the program length given by the syntax check doesn't increase (because data memory is separate on an 18M2+), but if I use a TABLE statement, it increases the memory shown as used, albeit not as byte-for-byte stored.

Is this a problem with the reported size or am I missing something?
 

nick12ab

Senior Member
There seems to be some inconsistencies in the documentation:
  • The command reference for the table command claims that it is separate for M2 parts only.
  • The command reference for the readtable command states "Some PICAXE chips enable lookup data (e.g. LCD messages) to be embedded in a table within the program (via the table command). This is a very efficient way of storing data. See the 'table' command for more details." with no mention of M2 parts having extra table memory.
  • The table command in PICAXE Manual 2 states "Preload a lookup table for embedding in the downloaded program. M2 parts have 512 locations (0-511). Other parts have 256 (0-255)".
  • PICAXE-M2 information doesn't state whether the table memory is separate or not.
  • The Quick Syntax Checker [F1] in PICAXE Programming Editor specifies that the table command doesn't apply to any M2 part and that the readtable command only applies to the 14M2 and 18M2. No mention of whether the table memory is separate on M2 parts is present.
So sorry, but I can't really be sure. You could try adding lots of table data to a program that uses up most of the program memory to see if it then says that you have used more bytes than there is memory.
 

AndyGadget

Senior Member
This does appear to be a bug with the syntax check memory used calculation. (I'm using PE 5.5.5)

Code:
#picaxe 18m2
#rem
table ($ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff)
table ($ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff)
table ($ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff)
table ($ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff)
table ($ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff)
table ($ff,$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+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2
b0 = b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2
b0 = b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2
b0 = b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2
b0 = b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2
b0 = b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2
b0 = b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1+b2+b1
The program above with the table commented out is 2047 bytes out of the 2048.
Remove the comments and the syntax checker says memory usage is 2048 but does not give an over-memory message, so it looks like the table size is included in the 'memory used' calculation but only the program is compared to the maximum value.

Would someone please move this to the 'bug report' section.

Request for PE6 - Syntax check shows program, table and data memory (where applicable) separately. :)
 

westaust55

Moderator
This does appear to be a bug with the syntax check memory used calculation. (I'm using PE 5.5.5)

Would someone please move this to the 'bug report' section.

Request for PE6 - Syntax check shows program, table and data memory (where applicable) separately. :)
No need to move this thread. Rev Ed personnel (ie hippy or Technical) will still see it here and respond accordingly.
 

westaust55

Moderator
The command reference for the table command claims that it is separate for M2 parts only.
Correct, In the PICAXE M2 chips 'program memory' contains the PICAXE firmware, the user's BASIC program, and a table (if used). All 3 are completely separate, but all are in the chip's 'program memory'. On M2 parts use of table does not make the user program space smaller.


The PE "bug" has been known about since May 2012 and not resolved in V55.4 or V5.5.5 which were released in Nov and Dec 2012 respectively and primarily to resolve some Flowchart related bugs.
 
Last edited:

Technical

Technical Support
Staff member
This is a compiler 'usage report' issue rather than a PE issue, and will be resolved in the next compiler release. The TABLE doe not use up any of the available 'PICAXE program' space, but the compiler currently still counts it, because table bytes are stored alongside the PICAXE program bytes within the 'PIC program memory'.
 

AllyCat

Senior Member
Hi,

Conversely, the "Syntax Check" for an 08M2 doesn't appear to take into account any bytes in the DATA/EEPROM memory space although they are said to be shared.

And whilst on this topic of "bugs/inconsistencies", the "Quick Syntax Check" (f1) shows TABLE as not available with 14/20M2, but TABLECOPY is!

Cheers, Alan.
 
Top