Memory Left

Frequently Asked Questions about the Sinclair ZX81
Forum rules
This is designed to be a simple set of questions and answers - please no general chit chat in here - keep it focused to help new users!
Post Reply
Bill H
Posts: 163
Joined: Sat Nov 27, 2010 6:05 pm

Memory Left

Post 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
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Memory Left

Post by PokeMon »

It should be ERR_SP-STK_END-machine_stack.
Maybe calculate 100 Byte for machine stack to be on the safe site.
Post Reply