Page 1 of 1

Memory Left

Posted: Sun Nov 04, 2012 7:57 pm
by Bill H
Can anyone tell me what combination of peeks will tell me how much memory I have left while writing a Basic program? I believe it would be STKBOT - E_LINE

Code: Select all

PRINT ((PEEK(16410)*256) + PEEK(16411)) - ((PEEK(16404)*256) + PEEK(16405))
but am not sure.

Bill H

Re: Memory Left

Posted: Mon Nov 05, 2012 6:16 pm
by PokeMon
It should be ERR_SP-STK_END-machine_stack.
Maybe calculate 100 Byte for machine stack to be on the safe site.