Classic Computer Magazine Archive COMPUTE! ISSUE 46 / MARCH 1984 / PAGE 10

Easy Memory For The 64?

I recently purchased a 64, and discovered that only about 38K of BASIC RAM are available for my use. I have found a POKE that increases it by 5888 bytes. After turning your 64 off, then on, try the following:

PRINT FRE(O)
POKE 56, 137
PRINT FRE(O)

After entering these commands in the direct mode, the first result was -26627. After the POKE, the result was -32515, a difference of 5888 bytes.

My question is, why does it do this? Does it have any harmful side effects?

Jeff Lewis

The memory location you POKEd (byte 56) is one of two bytes (55 and 56) that tell the operating system the highest address used by BASIC.

As you discovered, these locations can be POKEd with new values. By POKEing location 56, you told the 64's operating system that the top of BASIC memory had been changed. The normal values for 55 and 56 are 0 and 160 respectively, signaling that the top of BASIC memory is 40960 (0 + 256*160). If you POKEd a value higher than 160 into location 56, you would be telling the computer it has more memory than it actually does.

When you POKEd 56 with a value of 137, you actually lowered the top of BASIC memory, which decreased the amount of RAM available for use. This is a legal POKE, and might be used, for example, if you wanted to protect a machine language program in high memory.

This won't damage your computer. To reset the pointers to normal, simply turn your 64 off, then back on. However, POKEing values into the memory pointers can cause strange RUNs if you're using a BASIC program.