NostalgiaPC Vintage Computing

Writing BASIC Like It's 1982

October 6, 2022 4:30
ibm basic programming vintage-pc education

Overview

In this video, my son and I explore programming on an IBM 5150 using PC BASIC version 1.10 stored directly in the computer’s ROM. We work through the classic challenges of 1980s programming: line numbers, string variables with dollar signs, and the “redo from start” error. This is a hands-on lesson in computing history, showing what programming was like before modern IDEs, when every computer came with BASIC built in and a blinking cursor waiting for your creativity.

Key Moments

  • Reading the IBM 5150 manual to understand how BASIC works
  • Learning about line numbers (10, 20, 30) and program structure
  • Discovering the dollar sign ($) suffix for string variables vs numeric variables
  • Troubleshooting the “redo from start” error when using wrong variable types
  • Successfully creating an interactive “Hello” program with user input
  • Understanding how people programmed in the 1980s with this 40-year-old keyboard

Full Transcript (Edited)

Okay, so I went and read the manual and now we’re gonna give it another shot. Question mark, question mark, and enter.

Okay, now the next line is 20, right? Yes. And here’s where we made a mistake before, so I’ll explain it right now. Type in space “INPUT”, okay. And space. Now we’re gonna give it a variable name where we’re gonna store the… we’re gonna store the name somewhere, right? So we can use it in the next line. So in this line we’re gonna read the name, but what we need to do is give it the correct type. So I’ll show you what I mean by that. So type in “MYX” again, like the name is MYX.

But if I leave it like that, it’s gonna expect a number. So that’s why we were typing letters and it was given an error. It gave you an error “redo from start” - that’s an error. So if you wanted to say “okay, I plan to store some text in there,” put a dollar sign at the end. Yeah, who did this?

All right, so now that means that whatever question I ask is going to be stored as text instead of as a number. Okay, so press enter.

And now, 30, space, PRINT, space, “HELLO” in quotes… in quotes, “HELLO”. Oh, delete that. And then press space. And then close it so you can have a space there. Notice how you left the space. That’s because… and now we can put another space and type in “MYX” with the exclamation point… with the sorry, with the dollar sign. With the dollar sign. Okay, enter.

And now run that and see if it works. Okay, no, but you run it without typing. Okay, you ran it and you were too fast. So when you press F2, try running again. Clear the screen so that it’s clear, we can see. This is our first lesson and you already know how to do all this stuff.

Okay, so you want to list the program? Yeah, this keyboard is a little bit different than the modern ones. It’s a 40-year-old keyboard.

Okay, so what we’re gonna do: we’re gonna print “what is your name,” then you’re gonna type in your name. It’s going to be stored into MYX, and then here we’re going to show, print “hello” and what should we see here? “Hello” and whatever you type, right? Yeah.

So run it again. Okay, what is your name? So type in something, your name I guess. And then when you press enter… “Hello Marco!” We figured it out!

So it’s like: 10, PRINT, “what is your name,” then 20 INPUT, MYX money sign, 30 PRINT, “hello,” space, quotient, MYX dollar sign. Then press run. It does it! Nice! Nice, good job!

You wrote your first interactive BASIC program. This is how people in the 1980s used to write programs.

Do you like other questions? Like, yeah, you can do like… you can… what is my favorite color and I type it in? Yeah, but another one you can do, if you get rid of this dollar sign…

More Vintage Computing

Explore more retro hardware teardowns, restorations, and vintage tech content.

Watch on YouTube