Classic Computer Magazine Archive COMPUTE! ISSUE 29 / OCTOBER 1982 / PAGE 36

Programming Games On Computers With Limited Memory

Charles Brannon, Editorial Assistant

It's sometimes a challenge, but very good games can be written for computers with small amounts of free memory. If you're programming on an unexpanded VIC, Atari, Sinclair, or pocket computer or any other system with few bytes of RAM, these suggestions are worth remembering.

One of the most valuable elements of a computer system is its volatile memory, RAM. This "workspace" holds the program you're working on, its variables, and even the screen display and "system software." Managing memory efficiently becomes vital when writing games of any complexity.

There are many programming tricks you can use to save memory. The following list contains some of my favorite techniques – and many more can be intuited:

If worst comes to worst, you can use a technique called "chaining," where one program loads and runs the next. This technique is prone to problems and is awkward to use. On tape, the programs must be contiguous, and the second program can not return to the first. Nevertheless, chaining is valuable for "initialization" code such as loading character sets or machine language, displaying the game's rules at the start, or reading or defining variables (if your BASIC permits chained programs to share variables). Chaining permits you to run programs of almost any size.