Syntax check: Memory Full with MINUS 251 bytes over

John Geddes

New Member
I have hit a problem with a program for a 28x2 using Programming Editor (both under v5.5.0 and latest v5.5.1]: Syntax checking returns a complaint that my program is too long - by a NEGATIVE number of bytes.

Error: Memory full - -251 bytes over. Remove the 'table' command to release 256 more bytes or reduce program length by -251 bytes.

The logic is sound - if I cut out some of the content, the number of negative bytes increases appropriately.

A single one-character sertxd is enough to make it happen.
I can start with a program that passes the syntax check:

Syntax check successful!
Memory used = 3827 bytes out of 4096


If I then un-comment anything that makes it longer - eg sertxd("a") - then I get the negative error message.

Has anyone hit this before - and is there a workaround?

John Geddes
 

inglewoodpete

Senior Member
Error: Memory full - -251 bytes over. Remove the 'table' command to release 256 more bytes or reduce program length by -251 bytes.

Syntax check successful! Memory used = 3827 bytes out of 4096

If I then un-comment anything that makes it longer - eg sertxd("a") - then I get the negative error message.
I assume that you are using a table in the program space. 3827 + 256 = 4083 : almost breaking point. A SerTxd("a") takes about 5 bytes more.

My guess is that the compiler/packer is having a little hernia and not reporting the error very clearly.

The answer is to trim your code or start using the next slot. Using the second slot is not the easiest thing to do but I've used multiple slots in several projects.
 

tiscando

Senior Member
This confusing issue is still present 8 years later in the 28x2 compiler in PE 6.1.0.0 and had me searching the manuals and then the forums yesterday. See the attached demonstrator code (too big to post here).

It appears that the 'memory used' count on successful compilation increases pro-rata with the number of non-zero bytes in the table command, but the table actually takes the entire 256 bytes off the program memory according to the error messages. Is the latter correct? If so, the 'Memory used' message (on successful compilation) should state either N+256 out of 4096 bytes or N out of 3840 bytes when a table command is present in X2 code. Also, the 'memory full' error message need to be corrected so it doesn't show negative numbers of 'bytes over.'

Picaxe Manual #2 (last updated 10/2015) still does not make it clear that the table is shared with program memory on the X2s. But this post by jims shows an overview of how the different PICAXE memories are structured, which I found very helpful.

So indeed I simply had to switch from table to eeprom to free up 256 bytes of space.
 

Attachments

Top