2 years ago 2 years ago General Coding Share

My First Ever Computer Program – You Can Try It Too

This page gives an example of the first computer program that I saw in its entirety for myself. And typed in to a computer. And ran. And fooled around with.

I was (I think) 8 years old — my Grandfather had taken me to a TRS-80 computer show! The computer "class" (which was in fact a massive ad for people to be inspired to buy a TRS-80) was in one of the function rooms under Sydney "Eye" a.k.a. "Centrepoint" Tower.

The "ad" would have worked on me, in that I would definitely have purchased a TRS-80 at that time, if I had the money for it. Computers (even "home" ones) used to be a lot more expensive than they are now.

The function room had a Tandy TRS-80 computer set up on each desk, and each person got to sit down at their own computer for the duration of the session. There was a huge long line to wait in, of people waiting to go inside and have a try at using a real computer in real life (and not just on TV).

The presenter talked us through typing in, and then running, a short program in the language called BASIC. The language BASIC was the most popular non-professionally-used language in the early days of home computers.

On this page you can have a try at doing the exact same thing. Or pretty close. I can't remember exactly what the program(s) were, though they were simple, and easy to type in, and think they had some loops in them. Possibly an INPUT statement (which I may add to the page later on).

This page explains the steps, as I was shown, to write and run the very short program(s) on the TRS-80. You can also try them out in the emulator window below, on this web page.

Or you can try some vintage computer games. I'll add some more info about the games later. A friend from school had a TRS-80 Model III, and he had these games on it. At my friend's house, they were loaded from a cassette tape. Since floppy disk drives still cost almost as much as a decent second hand car. Other than in shops, I don't think I ever saw a floppy disk until later on, when I was in high school.

You can experience some really vintage computer programming by trying out the TRS-80 emulator below.

The TRS-80 Model III Emulator is by Peter Phillips, I got it from his website here.

TRS-80 Model III Emulator in JavaScript

To start the TRS-80 Model III Emulator, click the "Reboot" button, then press the Enter/Return key twice, then wait a few seconds...


   

       


Try typing in the program as below (including the line numbers):

10 PRINT "HELLO", X
20 X = X + 1
30 IF X < 10 GOTO 10

LIST

RUN

Press Enter/Return after each line. If you type a line wrong, just enter it again with the same line number and it will replace the previous line with that same number.

You can type LIST at any time to see what your program looks like. If you want a nice clear screen, type CLS to clear the screen.

Some more ideas:

  • You don't need to type all the spaces in the program — in fact you don't need to type any of them. Though it looks more readable with the spaces there, so I've added them to the source code listing here. I was expecting the TRS-80 to not need most of the spaces — though I was a little surprised that it still works even with no space between the IF and the X in line 30.
  • No matter whether you type in lower or upper case, the emulator seems to count it as upper case characters.
  • Any valid TRS-80 BASIC program from that era should work, or at least most of them.
  • I don't think there's any way you can save the programs you write in this emulator (not even by copying/pasting from the screen). If you really want to be able to do that, you could install a TRS-80 emulator on your device. Later on I may look into modding this JavaScript TRS-80 emulator to allow loading and saving, as a learning exercise in JavaScript for me — depending on how much time I have, and how hard it ends up being to do.
  • The only way I can currently think of to "save" any code that you write in the emulator is to take a screenshot, and save that as an image file (like a .jpg). You'd then have to re-type it in again if you wanted it in character/text form and not in image form.

Lower case characters didn't come standard (or at all) on many really vintage computers. On the TRS-80 they were available as an upgrade. Perhaps the Model III came standard with the "upgrade", unlike the earlier Model I (?) I'll have more of a look into that later. It displays lowercase on the startup screen so it must be able to display them. But so far, I've only found it possible to type in upper case characters on the emulator.

It was a big deal to have a computer screen with colour, too. Most TRS-80s only had a black and white screen, like this emulated one (and like the one I used at the computer show).

More to follow later...

Cover image by Raimond Spekking The Z80 CPU was used in the TRS-80.

Byte.Yoga Homepage - Australian Cyber Security Web Magazine

Share This Page

If you liked this page, please share it with others! You can use the links to share on Facebook, Twitter, LinkedIn, Pinterest, and Email. Ther is also an RSS feed to get updates for the website.