Poor Man's Memory Expansion: Introduction Jan 11, 2002 When is a cassette not a cassette? When it's used as RAM! We all know that the Astrocade (1977) computer and any computer from today (2002) are similar in name only. Computers still work using the same idea (ones and zeroes) and do the same thing (freeze-up, breakdown, lose our data, make us curse), but a store-bought computer today really means (at least) a complete set-up of items to make us curse: computer, monitor, printer, memory, hard drive, CD-ROM drive, floppy drive, keyboard, and mouse. The Astrocade, with BASIC, is about as rudimentary a home computer as you can have; the memory storage device (cassette) is serial- the user uses a common (for the time) household audio-cassette recorder. What those users would not have given for a fast Random Access floppy drive- like our modern, much beloved, floppy drive. I'm not knocking this early computer arrangement; it works. Even then users were always looking for something more, something better, something to make the system have bragging rights. Who wanted to go around saying, "I have a 4K Astrocade," when one could brag with something like, "I have an expanded Astrocade, I made a 1K RAM expander myself. Imagine what I can do now, the possibilities are endless!" Nowadays memory and storage have somewhat lost bragging rights (everyone's got lots of it). The following article, Poor Man's Memory Expansion (Anderson, C.J. "Poor Man's Memory Expansion," CURSOR 2, no. 3 (October 1980): 67-68), has always been a favorite of mine. I've retyped it so that it can be shared- and make us all feel bad; it will make you think twice again about complaining about your current computer set-up. Adam Poor Man's Memory Expansion By C.J. Anderson Flash Foonman, our resident maniac and sometime inventor, came running into the office yesterday looking more wild than usual. "What would you say," he smirked, "if I told you I had just downloaded that 16K BASIC CHESS program into Bally BASIC and it's up and running on the Arcade right now?" "I'd say you've started drinking early today," I replied, but he had already grabbed my arm and hauled me out of my chair. Out on the bench sat the Bally. On the screen was a chessboard. White had just opened with P - K4. Nothing was happening, but I noticed that the cassette recorder was running and the red light on the interface was on. Suddenly the screen went blank and a program listing began to appear. "It's working on its opening move," said Flash. "We should have its response in a couple of hours." "A couple of hours?!" I moaned. "Hey, that's good for a chess program, "said Flash. "Atari's VIDEO CHESS, level 7, takes an average of eight to ten hours per move. Anyway, since we've got plenty of time, let me explain what's happening here." I assured him I was all ears. "I really do have a 16,000 byte program running here," he began, but I stopped him. "Where's your expanded RAM?" I asked. "Where is your memory add-on?" "Right here," he said, patting the cassette recorder. "And it's not RAM, it's mass memory just like a floppy disk or a stringy floppy. Only it's very slow. I call it a STRINGY CREEPY." "You mean you've got a 16,000 byte program on that cassette and the Bally is processing it 1800 bytes at a time?" I gasped. "That's really neat, Flash, but how many times do you have to sit here and rewind the tape looking for the subroutines you need as the program calls for them? You've just made yourself a part of the machine, and I don't call that true computing." "Not so, mon ami," he replied. "I never touch the machine. It calls for its own subroutines and loads them automatically whenever it needs them thanks to the newly discovered SELECTIVE LOAD function that Fred Cornett wrote about in Vol. II, issue 2 of Cursor. Each subroutine on the tape is prefaced by an identifier number, you know: 257, 258, etc. Each subroutine uses the same line numbers so when a new subroutine is called for it automatically erases the previous one from our constant 1800 byte RAM. When the new subroutine is fully loaded, a :RETURN; GOTO 1000 command on the tape starts the computer running again and it branches down into the new material. Then it decides which subroutine it wants to see next, sets the A variable to that number, and branches to a :INPUT A;STOP command in RAM. That sends it back to the tape to find the subroutine that corresponds to the value of A. Simple, huh?" "Hold it!" I said. "That's really brilliant, all right, but what happens when the cassette comes to the end? How do you rewind it to start over?" "I don't have to," said Flash, grinning, "because this is a very special cassette. It has no end and no beginning. It's the Automatic Repeating Cassette, catalog number 60,920 from Edmund Scientific Co., 101 E. Gloucester Pike, Barrington, New Jersey 08007. It sells for a measly $12.95 plus $1.75 shipping and handling, and it boasts 20 minutes of recording time. That's enough to store 20,000 bytes of data or program [when using 300 baud Bally BASIC]. I tested the process with a Radio Shack 43-401 which has only 20 SECONDS of recording time and costs $5.95, but this A.R.C. from Edmund is the cat's pajamas!" "Now let me get this straight," I said. "This endless cassette just sits here going around and around forever, and the computer keeps jumping to it, waiting for its desired data to come around then loading that data and therefore modifying its own program constantly?" "Yup," said the madman. "No limit to the size of the program you can run as long as time is not an important factor. On a long program like this 16K job you may have to wait up to 20 minutes between each subroutine, which is okay, for a sophisticated chess game or for mailing list or word-processing applications. For shorter programs, but still larger than 1800 bytes, I just the load the subroutines in sequence several times on the cassette loop. That speeds up the search. If I can get them on twice, we can search in ten minutes. If I can get them on there three times, it's a little less than 7 minutes." Just then the chessboard reappeared on the screen and the computer made its move: P - K4. "I expected that," mumbled Flash, and reached for his copy of BOBBY FISCHER TEACHES CHESS. I left him mumbling something about the Sililian Defense, but not before I had picked up his notes off the bench. Here's a simple little program that Flash designed to demonstrate his "stringy creepy" concept to any skeptical users. STRINGY CREEPY CASSETTE OPERATING SYSTEM (COS) By Flash Foonman Use an ordinary blank cassette, or one of the two described. The program will demonstrate how the computer can continually modify its internal program by acting on its own decisions. If you use an endless cassette, it will do so with no human assistance. Otherwise you must rewind the tape after each response. Type the following line: 100 PRINT "FOUND 257";RETURN Now, transfer it to the tape with the following commands input without a line number (before hitting "GO" make sure your tape recorder is recording): NT=1;:PRINT ;TV=1;TV=1;LIST;PRINT ":RETURN;GOTO 10 Stop the recorder. Do not rewind. Now type: 100 PRINT "FOUND 258";RETURN Transfer it to tape with the previous command, changing the identifier to "...TV=1;TV=2..." etc. Repeat this process twice more, using "...FOUND 259..." "...TV=1;TV=3..." and "...FOUND 260..." "...TV=1;TV=4...". Rewind the cassette, RESET the Bally and enter this simple program: 5 CLEAR 10 GOSUB 100:A=RND (4)+256;PRINT "A=",#0,A 20 :INPUT A;STOP 100 PRINT "START CASSETTE";RETURN Okay, RUN the program. Start the cassette. The screen displays the value it has selected for A, the input port opens, the program stops, and the computer loads subroutine A when it finds it. It then restarts itself and announces that it has found subroutine A. HALT the program at this point, and LIST it on the screen. Notice what happened to line 100; out with the old, in with the new. If you're using a repeating cassette you can sit back and watch the computer reprogram itself all day long. The actual resident program is only 44 bytes long, but its effective length is 112 bytes. It's slow, but it's real honest-to-gosh expanded memory. As for Flash, I just heard him shout: "Hey! If a guy has TWO cassettes running simultaneously, one playing and one recording, the computer could be pulling data off the first one, modifying it, and rewriting it on the second one!" I'm going out for a drink! [Note: Use of the selective load characteristic of the original Bally BASIC is not supported in Astro BASIC, so, as written, this article would not work for Astro BASIC.] -- From the Astrocade newsletter Cursor, Vol. II, Page 67 (October 1980)