The Mystery Of The Two Missing Bytes
When the 64 is turned on, it says 38911 bytes free. But if I type PRINT FRE(0) + 2^16 in immediate mode,
it prims the number 38909. Now I don't care about the two bytes, but is that normal or should it be 38911?
Stephen J. Sommer
On power-up, the 64 tests the beginning and end of free memory and subtracts to find out how much memory is available.
There are 38911 bytes free for use by BASIC. A BASIC program line always ends with a zero, and the last line in a program
contains three zeros - one for the end of the line, plus two more zeros that indicate the end of the program.
When you turn on your 64, there's no BASIC program in memory and the memory test finds 38911 bytes free.
But the initialization of BASIC, which comes later in the power-on sequence, places two zeros at the start of the
BASIC program text area (at 2049 and 2050), just in case you try to LIST or RUN with no program entered.
So, even though there's no program, two bytes are used. When you use the FRE function to print the amount
of free memory, you see 38909 instead of 38911.