Classic Computer Magazine Archive COMPUTE! ISSUE 52 / SEPTEMBER 1984 / PAGE 33

THE BEGINNER'S PAGE

Robert Alonso, Assistant Editor

ROM And RAM

Every group has its lingo. When you first start to get used to computers, there are a few words to learn, a bit of computerese. Two of the simplest, yet most misunderstood, of these terms are ROM (Read Only Memory) and RAM (Random Access Memory).

Absent-Minded Computer

Read only memory is called that way because it is a kind of memory in each computer which can only be read. No matter how many times you try, you may never write in ROM. Computers come equipped with ROM because they need to have instructions that tell them how to perform certain functions such as adding or subtracting or even how to send things to disk drives or printers. The ROM memory stores these vital instructions in chips that can't be erased by writing to them or by turning off the computer. Without ROM your computer would be useful only as a doorstop. Just imagine turning your computer off and having it forget how to work the next time you turned it on.

BASIC is usually a set of machine language routines stored in several ROM chips in each computer. Another set of important ROM routines are the input and output routines. These routines instruct your computer on how to communicate with external devices such as disk drives, cassette recorders, and printers. ROMs obviously contain important routines that are needed for doing any kind of work with your computer.

Extra ROM

Another useful and popular form of ROM is the game cartridge. Yes, those small black boxes that provide you with so many hours of fun are just preprogrammed read only memories. These ROMs in cartridge form are perhaps the fastest way to load a program into your computer. The reason they are so fast is that usually there is no loading taking place. You plug in the cartridge, and it immediately becomes a part of the computer. The computer has immediate access to the programs and data stored on the cartridge.

RAM memory, although not as intrinsically important to the computer as ROM, serves important functions in the computer. It is the area of memory where user programs are typed in and run. RAM is also used by all the commercial software that comes on disk or cassette. The routines that are located in ROM often have to rely on pointers in RAM to function correctly. Without RAM memory, the computer might not have a screen display, and it would have no such thing as a keyboard buffer to hold extra keypresses. Graphics would not be available either.

Empty Boxes

All memory in the computer can be described as a series of boxes that can hold something. Let's say that you have 1024 different boxes in which to put things. You could choose to place objects in these boxes sequentially from box 0 on up to box 1023, or you could just decide to place objects into boxes in any haphazard way that you yourself could understand. RAM memory is just like a series of empty boxes that allow you to place numbers into them. The only restriction that these boxes impose on you is that you must never place a number over 256 into any one box. If you have a section of memory that has 1024 spaces, you can claim to have IK of RAM memory. The difference between RAM and ROM when compared to boxes is that ROM memory is like a series of boxes that already have objects in them. Even more important, the boxes can't be emptied or altered by the user. The user can only look into the box to see what's in it. ROM could thus be compared to glass boxes. You can see in but can't remove anything without breaking something.

Any programs that run in RAM memory can be modified. For example, if you wrote a program in BASIC and then decided that you wanted to modify something in it, you could easily do so. One peculiarity of BASIC programs is that the RAM in which they are located must be continuous. If there were a gap of any sort, like a missing box, the program would not work properly.

Screen RAM

Perhaps one of the most interesting sections of RAM memory is the screen. It is one of the few RAM locations that are shared by both the central processing unit and the video chip in all computers. What this means is that there is a section of RAM—let's say a 1024 box section—that both the computer's main processing chip and the chip that produces the colorful TV image can look at. The reason it is shared is that you must be able to change the screen either by POKEing values into the screen RAM or by PRINTing values onto it. For you to be able to do this, the central processing unit must have access to it. The video chip needs to have access to the RAM because it needs to know what to display on the TV set. The video chip essentially scans screen RAM and evaluates what is stored there. Once it knows what is in the screen memory, it can reproduce an image of it on your TV.

One useful feature that many home computers come equipped with is that more RAM and ROM can usually be added by just plugging a cartridge into the side or back of the computer. In some computers you have to plug the RAM into the inside expansion areas, but this is usually an easy procedure. The reason expandability is such a desirable feature is that it enables the user to program or use larger programs with more functions and commands and that it facilitates the use of alternate computer languages or BASIC enhancements.

Memory Limitations

There is one limitation to the use of both RAM and ROM. Each microprocessor, the brain chip of each computer, can access only a predetermined amount of memory at any one time. For example, the popular 6502 processor found in the Apple, Atari, and Commodore computers can directly access only 64K of memory. The 8088 microprocessor found in the IBM PC and PCjr can access a little over one million bytes. There are other limitations that manufacturers either impose on their machines or are forced to adhere to. For example, Microsoft BASIC will only accept a program up to 64K long. An example of a self-imposed limitation is that IBM restricted the memory limits of the PCjr to 128K.