Lowers RAMTOP by N kilobytes and does NEW, to make room above BASIC for machine code. It uses RAND to put the new RAMTOP into the SEED system variable (16434-16435) and copies the two bytes into RAMTOP (16388-16389). For a set address X instead, use RAND X in line 10.
As printed, line 30 POKEs 16388 again where 16389 is needed, so RAMTOP is not lowered. Reprinted in Sinc-Link from Your Computer, March 1983, sent in by G. Chambers.
Published in Sinc-Link August-September 1986 (A 4-Line Program to Set RAMTOP).
Source Code
5 INPUT N
10 RAND 1024*(32-N) (or RAND X)
20 POKE 16388, PEEK 16434
30 POKE 16388, PEEK 16435
40 NEWNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
