The basics of BASIC, the programming language of the 1980s.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I did the same thing as LGR, I spent months typing BASIC into the DOS prompt and getting nowhere. This was the early 90s and I had a 486 with DOS 5, but my local library was out of date so all their books were from the 80s.

And of course, in the 80s all the books told you to just turn your computer on and start typing BASIC, cause that's exactly what you did in the 80s. Even if you had an IBM PC, which was crazy expensive and mainly used in business at that time, you'd still get BASIC if you turned it on without a disk in the drive.

C:\>10 PRINT "HELLO WORLD"
Bad command or file name

Eventually I figured out I needed to run a program before I could use BASIC... only to find that the previous owner of my PC had deleted QBASIC.EXE to save all of 70k or whatever.

👍︎︎ 40 👤︎︎ u/fwork 📅︎︎ Mar 11 2017 đź—«︎ replies

*Python of the 1980s

👍︎︎ 18 👤︎︎ u/skulgnome 📅︎︎ Mar 11 2017 đź—«︎ replies

I wrote a text-based RPG/Choose Your Own Adventure in BASIC when I was young. Used QBASIC on a Tandy 8080. You could "save your game" by entering the seed for the RNG at the beginning; it would make each "dice roll" the same as it was the last time, as long as you made the same choices.

👍︎︎ 9 👤︎︎ u/roboninja 📅︎︎ Mar 11 2017 đź—«︎ replies

Modifying AppleSoft Basic programs on my //e was how I got my start!

Also I need to note that my iPhone autocapitalized AppleSoft. In 2017.

👍︎︎ 12 👤︎︎ u/mreichman 📅︎︎ Mar 11 2017 đź—«︎ replies

There's an open source Quick Basic clone out there called QB64. It's a bit heavy weight, but a good clone of the ide+language. Many have said nothing beats Quick Basic in terms of ease of use for beginners; good for simple games.

👍︎︎ 6 👤︎︎ u/[deleted] 📅︎︎ Mar 11 2017 đź—«︎ replies

Trivia:

VBA still allows line numbers and the use of REM for remarks (comments).

👍︎︎ 4 👤︎︎ u/nolotusnotes 📅︎︎ Mar 11 2017 đź—«︎ replies

Got a Sinclair ZX80 for a birthday as a kid so that's how I started programming. The BASIC commands were on the plastic membrane keys and it was a very basic BASIC implementation. One letter variable names, 1K of RAM, screen filled with white noise while the CPU was doing any work on the input. Sinclair was a big deal in British home computing, masses of homes had kids with the ZX80/81/Spectrum as it was such an affordable entry point. Unfortunately the QL was overdue and never taken seriously as a business machine and then Sinclair made the mistake of betting the farm on his C5 electric vehicle and never recovered.

👍︎︎ 10 👤︎︎ u/Rockky67 📅︎︎ Mar 11 2017 đź—«︎ replies
SCREEN 2

I had a MSX...

👍︎︎ 4 👤︎︎ u/Faucelme 📅︎︎ Mar 11 2017 đź—«︎ replies

Shout out to /r/retrobattlestations which is all about old computers.

There may also be a subreddit for your favourite old machine. /r/c64 is a thing, for example, as is /r/apple2

👍︎︎ 4 👤︎︎ u/palordrolap 📅︎︎ Mar 11 2017 đź—«︎ replies
Captions
Welcome to another episode of The 8-Bit Guy. Today we’re going to be talking about BASIC, the computer language of the 1980s. While BASIC was technically invented in 1964 by John Kemeny and Thomas Kurtz, at Dartmouth college, these computers were not at all what you would think of as personal computers. It really wasn’t until Bill Gates and Paul Allen, who worked at a little startup software company known as Microsoft, brought BASIC to some of the home computers of the 1970s, that it really started to take off and in the 1980s it saw an explosion. When you look at all of these computers here, they are all totally different from each other in hardware, software, and even the user interface. But they all had one thing in common, they ran BASIC. BASIC was the great equalizer of the home computer revolution. Early personal computers were not inter-compatible. You couldn’t take a binary program from an Apple II and go run it on a PC or a Commodore 64 or an Atari 8-Bit system or a TI99/4a, they were all different. Except when it came to BASIC. BASIC was taught in elementary how to use your home computer books. It was taught in schools. And because BASIC was the same language across all of the systems, you could take what you learned on one system and use that on another system. One of my favorite shows, Futurama, often has little hidden gags about it, such as Bender’s internal CPU is a 6502, the same CPU used in many home computers of the 1980s and you can see BASIC line numbering schemes on everything from his home-sweet-home poster, to the founding principle of the Church of Robotology where the instructions are clear that if you SIN, then you move to line 20, which says you will go to hell. Also Kif creates his holoshed programs in BASIC. So I’m not going to teach you how to code in BASIC in this episode, as that would be pretty boring. But I do want to point out, for example, how this code is recognizable as BASIC code. That’s because it uses line numbers separated by tens. In BASIC, you start every line of code with a line number. And we were always taught to start with 10, then go to 20, and so on. And the reason for this is that the computers didn’t really have any sort of text editor or word processors built in. And while generally you could go back and edit a line to add something, often you might need to insert something between two lines. So by leaving space, you could type a line 15, for example, and it would insert that into the code. OK, so I want to show you this book, 101 BASIC computer games. This came out in 1978, at the very beginning of the personal computer revolution. Now, the book is historically significant because it is the first computer book to sell over a million copies. Well, my first exposure to BASIC, at all, was as a kid. I was around 7 or 8 years old and the local library, they had a technology section for kids in the children's’ book section and I saw this book in particular. BASIC computer games, microcomputer edition. 101 great games to play on your home computer, from Creative Computing. This was released in October of 1978 and they had a bunch of copies of these still just lying around in the library in the early 90s, so I took it home. And it had all of these really cool looking games in here. And yeah, it’s just all type-in stuff. And all of these commands, I just put them in my Packard Bell, MS-DOS computer, and not a single one of them worked. But, of course, that is because, now I know that computer obviously was a DOS computer. It didn’t have Microsoft BASIC running in DOS. So, I just recently picked this book up and you know, I was looking through it and I discovered that the most of the games in here were targeted at the TRS-80, or the Commodore PET, or the Apple II or some of the early CP/M machines that could run BASIC like the Altair. So, I decided to try typing in one of these games to see how long it would take. I look through the book and decided on Hangman. It was actually one of the shorter games to type in. I used my Apple II since it is one of the target machines. I set a timer so I could see how long this would take me. And so, I went to town typing this thing in. I remember doing this as a kid and it took forever. I thought maybe I could do it faster as an adult. However, this stuff isn’t like typing spoken words. There are lots of symbols and numbers and stuff, so it actually takes longer than you would think. The time just kept dragging on. At last I was finally done… and the timer says… Holy cow! 47 minutes. Let’s list the program just so we can see how much I actually typed. Well, let’s try it out. Looks like they were expecting an 80 column display. Anyway, let’s see if it works. Let’s try E. Hey, I got a letter. Notice that it redraws the entire screen layout each time. That’s because BASIC doesn’t have any standardized commands for moving the cursor around on the screen. So these games had to be treated like they were working on an old teletype. Ahh yes, a syntax error. I would have actually been surprised if I managed to type all of that without any errors. So let’s examine line 520 and see what the problem is. Ahhh.. I see what I did. let me re-type that line. OK, so the game seemed to be working now. So, one of the things I noticed about this book is that none of the games in this book have any graphics. They’re all text-based games. Now, that seems rather boring in the 21st century. But in 1978 that really wasn’t much of a problem considering most computers back then didn’t have graphics anyway. And even when computers like the Apple II did show up on the market that had graphics capabilities, the commands were proprietary to that specific machine. So you still couldn’t publish a book that would have BASIC listings for a variety of different computers without being text-based games. So none of these games are likely to be considered fun in the 21st century, but, you know, I think what this book represents is more a historical picture of what the software situation was like back in the late 1970s. I mean, you couldn’t just walk into a Kmart or Target and buy a game from your computer right off the shelf. That didn’t really happen until the early 1980s. So when computer manufacturers came out with their computers during the late 70s, they really anticipated that most users would be writing their own programs in BASIC or they would be typing them in from a book or magazine, and BASIC was well suited for that task. So yeah, the big thing back in the day is that you would get a computer magazine and it would have two to three programs in it that you could type in! So there would be like 10 pages of listings of BASIC or sometimes machine language and you’d just sit there and go and type it all in and it was kind of fun. Because at the end, you would have a sweet game. You know, paper was cheaper than disks back then. Oh, how times have changed. So I remember waiting every month for the magazine to come. It would arrive, I would read it cover to cover, and then the next day I would take it to my school’s computer lab which had roughly ten Apple II systems in it and I would key in the BASIC programs. I could look at this and kind of see, wow this is how you could make a game. This is how programs work. Obviously in a very BASIC sense. But still. One of the great things about keying in BASIC programs from a magazine is that they sneakily teach you BASIC as you’re doing it. The BASIC language is relatively simple. You have variables, you can do operations on them. There are occasional commands that control input and output, like changing the screen, putting shapes on screen, etc. As you type in a program, you can’t help but learn the language. So, someone sent me these recently. This is a fascinating idea for me, and something that uses BASIC in a way that I hadn’t really seen until recent years. These are called micro-adventures. These are little novels, novellas, and you know they’re written just like a normal novel. But, when you get to certain points in here, you’re going to get. “Oh man. Something happened! To see what happens next, you type in a BASIC program and it’s going to. Well, some programs aren’t going to work. It’s got a little list here like IBM, Apple, Radio Shack, Commodore, TI, and Atari. But for the most part the programs work. You see this one has all of the check boxes. And yeah, if you have the right machine, you can see what happens next in the book with a little bit of interactivity and graphics and things like that. It’s just a fascinating idea. Clint sent me some pictures from the book, so I could print them out and try typing some of these in to see what they do. I decided to use my Radio Shack Color Computer, since it is on the supported list. Actually, it’s probably easier to type it in from this copy, since I don’t have to hold the book open while I type. So it appears to be some kind of a program for encrypting or decrypting secret messages. It won’t really do me a lot of good unless I actually read the book. That just goes to show you how popular BASIC was. This is number 6, number 7, I don’t know how many there were in the series, but obviously it was a thing. Another book I want to show you is this old Algebra textbook. Now, it took me forever to find one of these to show you, but I thought it was really important that you see this. Most of these books, I think were destroyed because unlike colleges, high school students don’t actually own these books and eventually they’re returned to the school who either destroys them or returns them back to the publisher. But for me, every math textbook I had in school from junior high all the way through graduation of high school, had BASIC in it. We usually had some Apple II computers in all of the classrooms, even if it were just one or two of them. And after you learned how to do the math in that chapter, you could go over to a computer and try using the concept you just learned by typing in this BASIC program. You can see this book was first issued to somebody named Brad Carter in the year 1990. So this was probably one of the last books that contained BASIC code like that. By the early 1980s nearly every personal computer manufacturer, including Apple, had switched to using Microsoft BASIC. And while today when we hear the term Microsoft, we tend to think of Windows and Office. But, even back then almost every personal computer displayed the Microsoft logo somewhere in BASIC. If you crack open an old Apple computer, like we have an old Apple IIgs here. You’ll see, inside the Apple, a chip labelled Microsoft. Dogs and cats sleeping together! Mass hysteria! Just because they had the most popular BASIC. There was a fun story on the Commodore 64. How did that work? He licensed, Jack Tramiel licensed the BASIC from Microsoft to work on the PET and he basically didn’t change it for all of the successive computers so the original one time license cost stretched over all of the millions of Commodores that he sold. People make a lot of fun of Microsoft. They did back in the day, they still do. But it is pretty hard to deny them their achievement of Microsoft BASIC. For what they packed into the ROM that was installed in all of these personal computers, it’s pretty amazing. Now, you would think that BASIC would be universal by this point, I mean, all computers were running Microsoft BASIC,right? Unfortunately all the commands for graphics, sound and disk drive operation were still proprietary But yeah, the difference in dialects is interesting. It’s like learning different accents for a language. You know, you can learn southern American English and then you’ve got like northwestern American English, and then English English, and then Scottish English. But it wasn’t just the language that was different from one of these machines to the next, each machine had its own unique personality. Basic was more than just a language. It was, in essence, the entire operating system and the user-interface. As an example, on the Commodore 64, if you had a game on floppy disk or cassette, you could put the game in the drive, but you still had to type a command in BASIC to load it up. Of course, most games had instructions on the disk telling you exactly what to type. For many Commodore users, the command LOAD asterisk, comma 8 was the only BASIC command they actually knew. And they didn’t even know what it meant, they just knew it started the games. but other machines used entirely different methods of starting a program on disk. The thing with BASIC is that is also, there’s no one BASIC. There’s different interpretations between all sorts of hardware, and that’s something that threw me off at first. Also the screen editor itself is very different. For example, in BASIC, the APPLE II gives you a little prompt when you type in a command. And for whatever reason, if you mess up, don’t go for the backspace key. Instead of correcting your mistake, it will infuriatingly make it worse. No, you have to use the cursor keys to back up. Commodore BASIC, on the other hand has a really nice screen editor. The backspace works like you would expect. And if you want, it’s easy to cursor back up into your program listing and make changes. Although the cursor keys are weird, there are just two of them. So this one goes up and down, and this one is left and right. You have to use the shift key in combination to change direction of the cursor. It’s weird, but you do get used to it after a while. On the Apple, if you want to move around the screen, you have to hit the ESCAPE key and press secret letters to move it around. One of the neat features that all Commodore systems had was its use of quotation marks. So, whenever you typed a quotation, such as in a print statement, it would actually use special symbols to record any commands you typed. So for example, I can press the home key type a word, cursor down three space, cursor right three spaces, change the color to something else, type another word, then close the quotes. Now when I run the program, it will remember that exact sequence of commands. That was always really helpful. So, Commodore BASIC had a great screen editor and a lot of other nifty features in BASIC, but it had one Achilles’ heal, especially with the VIC-20 and the C64, which were the best selling machines they had. Which is, they had no graphics, and no sound, and no disk drive commands built into BASIC. They did have load and save but that was it. While machines like the Apple II could just type catalog to get a listing, the Commodore had a bizarre method where you had to load in a program called dollar-sign from the disk drive. The disk drive itself actually did all of the work, constructing a small BASIC program and then sent it back to the computer. So now you could LIST the program and see the contents of the disk. The problem with this was if you were in the middle of working on a BASIC program, you just lost it because now it is overwritten by this directory listing. This was largely solved by additional cartridges such as the EPYX Fastload. Besides increasing the disk speed tremendously, It added many commands to BASIC such as just typing a dollar sign to get a directory without overwriting your program. Also you could get a menu with all sorts of useful stuff. This cartridge was so popular, every serious Commodore user had one. But that still didn’t help with the graphics command situation. According to the manual, if you wanted to do graphics, you would need to type in all kinds of complicated POKE and PEEK statements which directly changed the registers of the graphics chip. It was slow, and really difficult to understand what was going on. So if you wanted to draw a sine wave on the screen on the Apple II, no problem. A few lines of BASIC using the built in graphics commands would easily take care of that for you. But the VIC-20 or C64 was a nightmare. However, you could get cartridges like the Super Expander for the VIC-20, which added a variety of commands. And on the C64, Simon’s Basic was quite popular which did essentially the same thing. So, speaking of cartridges, the original Atari computers did not have BASIC built into ROM, which was actually very unusual during this time frame. If you just booted up the computer, it went straight to something called memo pad. It’s basically a useless text editor that wouldn’t even save your work. However, they did give you a cartridge with BASIC on it. You stick in a BASIC cartridge right here in the left slot. The right one is never used for anything. Else, if you turned it on you’d be in no BASIC mode. So if you were playing a game that was larger, like Ghostbusters or Rescue on Fractalus, it shadowed 8K of memory so the BASIC cartridge was in place you’d lose 8K of your games. So larger machine language games couldn’t fit in memory. So you’d actually have to take the BASIC cartridge out to play some games. Later machines like the 800Xl and all of the ones that came after,did of course have BASIC built into ROM. And that was cool, because it was right there! You could turn on the computer and it was ready to go! You could type in programs without having to do anything else. You didn’t have to boot into something separate like you do on an IBM PC, and that was really appealing to me. In fact, not only was it instantly available, you didn’t even have to really write a program. That’s right, you could actually type commands right at the prompt. So if you wanted to do a mathematical calculation, just type print and then your math problem, and it would print the result out. You could even do loops and stuff without ever entering a program. I mean, it was approachable, right? I mean the thing about BASIC was that it was so approachable. It was very much a logical thing were you can look at it, and once you’ve figured out what things like POKEs and stuff were, it made sense. You could just read it. Or at least I could. It made a lot of sense to me and I liked that about it. OK, so I’ve shown a bunch of horribly bland programs that were designed to be generic, to work on just about any computer that runs BASIC. But what could you do if you wanted to write a program for a very specific platform in BASIC, how could you make it better? Well, Steve Wozniak was one of the first to show what you could do. Not only did he write his own version of Basic, called Integer BASIC, which he specifcally designed for making games. But in 1976 he wrote his own game, little brick out. He said it took him 30 minutes to write it. And that’s really the power of BASIC, right there. You can write stuff very quickly. The thing about BASIC, the beginners all purpose symbolic instruction code is it wasn’t fast. It’s kind of like, the best modern day analogy would be python. Python is a language where every command is interpreted as it comes across, so instead of compiling it, it’s like oh, if that equals that, than this. It does it all real-time. Now, today’s modern computers, they’re so fast you really can’t notice that there’s a lack of speed. So BASIC is easy to learn, and its fast to write something. But it did have severe limitations on these 8-bit computers, especially when it came to speed. But, you know, I think that’s one of the challenges that makes it interesting and keeps me coming back and writing stuff in BASIC. Because, it’s interesting to see what I can do within those limitations. For example, a few years ago I decided to attempt to write Tetris in BASIC on the Commodore 64. It’s not a terribly long program. However, it did take me an entire day to write it. The first version I wrote only took about an hour, but it was so slow that it was not playable. So I spent the rest of the day figuring out ways to speed it up. In the end, it worked. So now you can play Tetris in BASIC. There were some other commercial games that were written in BASIC such as Sword of Fargoal, and another one called Telengard. I wanted to give you a way you could see the speed difference between BASIC and Machine Language. Something you could see that would really make sense. So, I’m going to write a little BASIC program to just fill the screen with all 256 characters, writing directly to screen memory. So you can see it takes it a few seconds to do that. Now I’m going to write the same program in machine language and lets watch. Dang, it’s so fast that you can’t even see it draw it out. However, it was possible to speed up BASIC to some extent, well beyond just moving to a faster computer. One option was using a compiler. For example, the Blitz compiler would take your BASIC program and convert it. It’s not exactly converting it to machine language, but it converts it to a sort of in-between stage. And you can see it’s a good bit faster than the original BASIC. In fact, after compiling my Tetris game, it’s so fast I can barely play it now. But don’t be fooled. These compiled BASIC programs, they’re about double the speed of a traditional BASIC program, but they’re still a fraction of the speed of a machine language program. But, on the bright side, you do get the convenience of programming in BASIC, an easy language, and it gives you a little extra speed. I like BASIC. It’s nothing overwhelmingly powerfully fast, or anything like that. In fact, there’s so many limitations with it, that’s honestly why I find it so fascinating even to go back to now. Anytime that I get a new old computer, I try something in BASIC first. What do I miss about BASIC? I mean, that’s like having a Ferrari and then somebody asking you what you miss about your Ford Escort, besides lower payments. Well here’s one thing, it was really easy to make something quick and fast. I miss just being able to turn on your computer and immediately start typing a program. I miss that direct connection that BASIC gave you to the machine and it’s hardware. I miss that direct connection that BASIC gave you to the computer it was designed to work with. I think that’s why nowadays I don’t really care that much about Linux. It’s because back in the 80s, everything had to be done with typing and you know, scrolling screens of text, and I guess I wasn’t really sad to see it go. Because I’m like, I did my time with that. But I think younger people, they kind of miss the romanticism about how these computers worked. All right, so I think we have reached the end of this unusually long episode but I have a few things I want to say in closing. First of all, a big thank you to Clint from LGR, as well as Jim Leonard and Ben Heck. This episode was originally going to be a lot longer and I ended up cutting a lot of stuff out or at least shortening some things down and one of the reasons was, I thought, well you know instead of making an hour long episode about BASIC, some of these things I really thought deserved their own episode. Just as an example, I’m going to do an entire episode on the VIC-20 super expander. I know it seems kind of mundane, but there’s a lot of interesting things that this cartridge does. So, I’m going to be doing an episode on that, as well as many of the other topics that were glanced over in this episode. So don’t feel like you’re going to be missing out. I’ll eventually cover those things. In the meantime, keep watching, I’ve got a lot more stuff coming, and I am doing YouTube full time as of February of this year so hopefully I’m getting more content out there. Welp, see you next time!
Info
Channel: The 8-Bit Guy
Views: 1,548,197
Rating: 4.9505663 out of 5
Keywords: BASIC, computer, language, programming, python, atari, commodore, apple, tandy, IBM, microsoft, CP/M, msdos, ms-dos, retro, vintage, coding, compiler, blitz, assembly, machine language, listing, steve wozniak, memory, variable
Id: seM9SqTsRG4
Channel Id: undefined
Length: 24min 7sec (1447 seconds)
Published: Wed Mar 08 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.