Looking at an issue of Sinclair Programs last night, I came across some small tips for saving memory when programming on the ZX81 and thought maybe we should have a discussion thread which shares best practice...
1) Consider replacing GOTO 50 (for example)
In a program, statements such as GOTO 50, use seven bytes per digit.
You can actually change this to GOTO VAL "50" - here, you only use 1 byte per digit as the number is stored as a string.
2) Consider defining variables used by your program directly.
For example, if your program starts with:
10 LET A=50
20 LET B=100
30 LET C=1
You can add a SAVE line at the end of the program, followed by a RUN command to run the program after saving and loading.
Then entering,
LET A=50
LET B=100
LET C=1
before you SAVE the program ensures those variables are set up on loading the program.
You actually save 49 bytes in total !!
Tips for Saving Memory
Tips for Saving Memory
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm