For Retro Computing Enthusiasts

Gazette Feedback

By Editors & Readers — originally published in COMPUTE!’s Gazette Volume 1, Issue 1

Do you have a question or a problem? Or have you discovered something that could help other VIC-20 and Commodore 64 users? Do you have a comment about something you’ve read in COMPUTE!’s Gazette for Commodore? “Gazette Feedback” wants to hear from you. For our first issue, we’ve assembled some questions written to our companion magazine, COMPUTE!.

Automatic RUN

I own a VIC-20 personal computer. I have yet to find an explanation of just how to get a BASIC program to run automatically after it has been loaded from tape. Can you help? Thanks.

Tim S. Hallen

As you know, when you type LOAD and press RETURN on either a VIC-20 or Commodore 64, the next program on the cassette tape is entered into the computer’s memory. You must then type RUN and press RETURN to actually start the program. But there is a way to LOAD and RUN programs automatically.

Instead of typing LOAD, hold down the SHIFT key and press the RUN/STOP key. The next program on the tape will be LOADed and then RUN automatically. If the cassette has been rewound to its beginning, the program LOADed and RUN will be the first program on the tape.

Commodore 39?

I have been thinking about purchasing the Commodore 64 computer for home use and to play video games. But I’m a little skeptical of the 64K RAM advertised by Commodore. Does the Commodore 64 have 64K RAM that can be used in a program written by the owner? If the 64K RAM is available, how is it used? Since only 39K RAM is available for BASIC programs, is there a way to add a memory expansion cartridge to expand the BASIC RAM to 64K? Does such a cartridge exist or does Commodore or a second-party manufacturer plan to produce one?

Lt. Melvin S. Swain

We’ve received several letters on this question. It’s true that the Commodore 64 has 64K (64000 bytes) of Random Access Memory (RAM). But it’s also true that “only” about 39K (38911 bytes, to be exact) are available for BASIC language programming.

At the heart of all personal computers is a silicon chip called a microprocessor. This “computer-on-a-chip” is what makes computers such as the Commodore 64 and VIC-20 possible. The 64’s microprocessor is a chip called the 6510. It is a variation of the popular 6502 chip found in the VIC-20, Atari, Apple, and other small computers. One characteristic of this chip is that it can address (access) only 64K of memory at a time.

If the designers of the Commodore 64 simply filled the computer with 64K of empty memory, the machine would be helpless. Computers need certain built-in programs to function and to make them easier to use. Don’t confuse these built-in programs with the programs you write yourself or load into the computer from tapes or disks. The built-in programs are permanently stored in special memory chips called ROMs (Read Only Memories). Unlike other programs, they remain safe in their ROM memory chips even when power is turned off. The BASIC language itself is one of these programs. Another is the operating system, which performs “housekeeping” duties that you’re not usually aware of.

These internal programs need some of the 64K of space that the 6510 microprocessor chip can address. To make room for them, the Commodore 64 designers used some of the RAM area. That’s why, when programming in BASIC, you have only 39K of memory. The “missing” 15K RAM is taken up by the BASIC language, the operating system, and other things. This design is common in personal computers. What is less common is that the designers made it possible to temporarily “switch off” the Commodore 64’s ROM, thus freeing the full 64K of RAM underneath.

Unfortunately, when you switch off BASIC and the operating system, you are left with an “unconscious” computer. It has no tasks to perform at all, knows nothing; it’s pure memory with no thought patterns at all. You must replace the operating system with one of your own that takes care of the necessary housekeeping tasks. Since BASIC is gone, too, this replacement must be machine language. Therefore, the full 64K of RAM is directly available only to very advanced programmers. Average users will benefit from this feature indirectly. Eventually, there will be some commercial programs with their own custom operating systems to take advantage of the 64K.

The fact that less than 64K is available to the average user is not peculiar to the Commodore 64. All computers have varying amounts of “overhead,” memory which the computer consumes for its own purposes. For example, although the VIC-20 is advertised with 5K of RAM, only 3.5K (3583 bytes) are available for BASIC programming. This is true of other brands as well. The new 64K Atari 1200XL has about 38K for BASIC programming; so does a 48K Atari 400 or 800.

Since the Commodore 64 already contains all the memory it can address at once, there are no memory expansion cartridges from Commodore or other companies. But such a cartridge is feasible using a special technique called “bank selection.” Extra memory in the cartridge would be “swapped” with existing memory in the computer. For instance, such expanders make it possible to put 96K in a Commodore SuperPET, 128K in an Apple IIe, or 160K in an Atari 800.

Adding VIC Memory

I own a VIC-20 computer and would like to add some memory. The problem is, where does one start with memory on the VIC – with 3K, 8K, 16K, or a combination thereof? Would it make a difference which memory I added first, and what would be the most efficient first addition?

Russell C. Waters

Perhaps you could start off by asking, “How much memory do I need?” Many commercially available games, word processors, financial programs, and so on will state on their packages something like: “Requires 3K Expansion,” or “Requires At Least 8K Expansion.” The best answer to this question is to buy what your specific needs demand. You may never require more than 8K, 3K, or even the standard 5K.

If you plan to expand your VIC to large amounts of memory — 16K, 24K, or the full 32K — it is usually more economical to buy it all at once on a single plug-in expander. One 16K expander is usually less expensive than two 8K expanders. A single expander also is easier to use; two or more smaller expanders would require a special expansion board with enough extra slots to plug them in at once.

If you are interested in programming, or if you use BASIC programs written by others, there is something else to consider when adding memory to the VIC: the screen and color RAM locations can change. Screen and color RAM are the areas in memory where you can use the POKE statement to place characters and colors on the TV screen. (For an explanation of screen and color RAM, see “Commodore 64 Video Update” elsewhere in this issue.) The PRINT statement works the same on all VICs, but if you POKE to the screen, you must adjust your programs to work on the various memory configurations.

In the unexpanded VIC, the screen memory starts at location 7680 and ends at 8191, and the color memory is located from 38400 to 38911. When you add the 3K expander or the Super Expander, these locations do not change. However, if you add 8K or more of expansion memory, the locations do change. Screen memory will reside from 4096 to 4607, and color memory will move from 37888 to 38399.

This could cause some minor difficulties if, for instance, you have a program that was written for the unexpanded VIC, and you try to run it in a VIC with 8K or more expansion. It might try to POKE characters to the screen at the unexpanded locations (7680-8191), but the screen is now at 4096-4607. This would cause some errors, and could cause the program to abort.

Here is a formula you can use in your BASIC programs to automatically set your screen and color memory locations:

This formula will set the variables for the screen memory (SC) and color memory (CL) to the proper values. For example, if this were run on a VIC with 8K or more expansion, SC (screen) would be set to 4096, and CL (color) would be set to 37888. Then, whenever POKEing to screen or color memory, you would use these variables.

If you are having problems with a VIC program, this “moving memory” might be the culprit. If you have 8K or more expansion, try the program without the expander; likewise, if the program fails on a VIC with less than 8K, try plugging in an expander.

Computer Compatibility

If I buy pre-programmed cassettes from Timex or Atari, can I play them on my VIC-20? If I can, do I need an adapter?

Robert McClenahan

Unfortunately, programs on cassette or disk for one type of computer are not compatible with other computer brands. If a program is not specifically labeled for your computer, it will not load into memory.

Timex and Atari, for instance, record programs on tape (and disk) in formats which Commodore computers cannot recognize. Similarly, Commodore tapes cannot be loaded on Timex or Atari computers.

If you can find a program listing — a printout of a BASIC program — you could try typing it into your computer and modifying it to work. Although different computers use different versions of BASIC, they are remarkably similar. But unless you are knowledgeable about both computers, you might have to spend some time adjusting things, especially aspects of the program which involve the TV screen.

Computers made by the same company usually have more in common. Tapes and disks for Commodore PET computers will load on VIC-20s and Commodore 64s. With a few modifications, they can usually be made to work. Commodore plans to sell an adapter, called a PET Emulator, which will allow the 64 to run almost all PET programs.

Companion disk Companion Disk (.d64)

Enjoyed this? It’s what we do every month.

The revived COMPUTE!’s Gazette brings the spirit of the golden era to today’s retro scene — Commodore, Atari, Amiga, and more, in full-color print and digital every month.