Programming in Tiny Basic

By Tom Pittman

Copyright 1978
Netronics Research and Development Ltd.
Rt.202 New Milford, CT 06776


PART ONE: Chapters

0 -- Getting Started
1 -- ELF Talks Back
2 -- Running Programs
3 -- Variables: Changing the Computer's Mind
4 -- If an Elf Could Decide...
5 -- Call for Savings
6 -- The Plot Thickens

PART TWO: Getting the Most Out of TINY BASIC

<Prev  Next>

0 -- Getting Started

You have your own personal computer! It will do anything you tell it to do, if it understands you. There is an old story about a farmer who said his mule obeyed him perfectly. A reporter asked him how he did it, and the farmer said, "with a pleasant voice and kind words." The reporter allomed as he had to see this, so the farmer took him over to the mule, picked up an old two-by-four, and gave the mule a sharp blow on the head.

"Wait a minute," said the reporter, "I thought you said you did it with a pleasant voice and kind words!"

The farmer replied, "I do, but I have to get the mule's attention first."

Your ELF II will obey you exactly, but you have to get its attention first. No, not with a two-by-four! We will use a special program which enables your ELF to understand what you say. This program is called a TINY BASIC Interpreter. It is an "interpreter" because it interprets what you are saying to the computer in computer language, and it interprets what the computer is saying in your language. Like the little man who stands beside the President when he visits other counteries, and translates into English and back. It is called "Basic" because it is the fundamental, basic thing you need to get started. Also, the letters stand for "Beginner's All-purpose Symbolic Instruction Code." It is "Tiny" because this interpreter is smaller (that is, it will run on a smaller computer) than most BASIC interpreters.

But enough history. Let's get started. You will need, besides the basic ELF II, the "Giant Board" with the Monitor and Cassette interface, one or more "4K RAM" boards, an ASCII keyboard (this looks like a typewriter keyboard), and an approved Video Modulator to connect the computer output to your TV set. The 4K RAM board should be configured for addresses 0000-0FFF (see the 4K RAM instruction manual for details), and you should leave the two RAM chips that came with the basic ELF II plugged in. Figure 1 will show you where the important parts of your computer are.

Turn your ELF II on (plug it in, or whatever turns it on). You can tell it is on when you can see two red numbers or letters lit above the number keys. There are three toggle or lock-down switches to the right. All three should be in the position towards yourself (switched off or locked up). We will call this condition Reset. When I say "Reset the Computer" I mean put the switches in this position.

Put the TINY BASIC Cassette into your cassette player, and start to play it. Adjust the volume so that when the whistle starts it is comfortably loud. This is probably at 1/2 to 3/4 full volume. Rewind it, and plug the "in" cable from the computer into the earplug (or "external speaker") socket on your cassette player. Push the "|" key one more time (the red digits will change to "00"), then start the player. After ten or fifteen seconds the red digits will start changing rapidly. The program is loading into the computer.

After a short while the digits will stop on "FF". It is possible that they might stop on some other pattern, with the little "Q" light to their right also on, or perhaps they never start. If this happens, there was an error in reading the tape, and you need to start over from the first Reset. If the Q light always comes on, or if the digits never start rapidly changing, perhaps you need to adjust the volume control or the tone control on your cassette player, or perhaps the head is dirty (see the instruction manual for the "Giant Board"). Try again from the first Reset.

When the digits stop without the "Q" light coming on, you are ready to run TINY BASIC. You do not need the cassette player any more for a while (you can turn it off). Reset the computer then push the Run switch away from you again. Push the "RETURN" key on the ASCII keyboard. If your TV set is connected and turned on, you should see something like four dots in the upper left corner of the TV screen, and a fifth dot blinking just slightly below and to the right of the lowest one. If you do not see this, perhaps there is a wire out of place connecting the keyboard or TV to the computer, or the TV is not tuned to the same channel as the modulator. Note: you cannot proceed without a correct load from cassette and the blinking dot on the TV screen.

The blinking dot we will call a cursor. Whenever you see it, TINY is waiting for you to type something in. Go on, type something. Type your name. But don't push the RETURN key again -- yet.

Try out the various keys on the keyboard, so you get used to what each letter looks like on the screen. Notice that sometimes if you are right at the right edge of the screen, and you type another letter, part of it will be there where the cursor was, and part of the letter will be on the next line at the left edge. You will get used to this, but if it bothers you for now, you can always type a space or two, so that the whole letter appears on the next line.

You will also notice that not all the letters are the same width. We did that to make them easier to read, but still not take up too much space on the screen. Some of the letters have descenders, that hang below the line a little. This makes them touch the tops of the letters on the next line. Again, this was to make the characters as readable as possible without sacrificing space. We hope you don't mind too much.

Your keyboard may have a special key labelled "SHIFT LOCK". If so, you want to be sure it is in the unlocked position (push it a few times to see if that releases it).

As you begin to fill the screen, you will notice that TINY rolls the top line off the screen to make room for a new line at the bottom. This is called scrolling, because it works something like an ancient scroll.

Now press the "ESC" key. Notice that the screen immediately scrolls up and you get a colon on the left margin of the new line. Try it again. See how it leaves the cursor dot on the end of the previous line. Type something (like your name), then the ESC key again. We use the ESCape key to escape from the line we are typing. TINY BASIC simply throws that line away and does not look at it again. The dot reminds you that this has happened. Notice that it looks different from a period (it is lower).

Now type an ESC so that the cursor is right next to the colon. Then type a DEL. It works something like the ESC, but if your line has several characters in it, you have to type as many DELs as there are characters before you get a new line. The DEL stands for DELete, and it deletes one character at a time from your line, always the last one you typed. We will get a better idea how this works in the next chapter.

Another special key you will be interested in is not even on your keyboard. You have to fake it by pressing two keys at once. Press the CTRL key down, then while holding that down, press the "L" key. We use this method to erase the screen. Notice, however, that the cursor is in the top corner of the screen. Anything you type is completely lost off the top. You can correct this by typing ESC. This is actually perfectly normal, and later you will see how to use this fact.

Now you know how to speak to your computer. In the next chapter you will see how to get your computer to speak to you. In the rest of this book we will always assume that TINY BASIC is loaded and ready to go. That means that any time you turn off your computer you will have to go through the steps in this chapter again. Since you will probably get more out of this book if you spread it out over several days, you can expect to reload TINY BASIC two or three times at least.

Back to Top
Continue with: 1 -- ELF Talks Back