BASIC: Cross-Platform Software Hacking Then And Now

Surely BASIC is properly obsolete by now, right? Perhaps not. In addition to inspiring a large part of home computing today, BASIC is still very much alive today, even outside of retro computing.

There was a time, not even that long ago, when the lingua franca of the home computer world was BASIC. This wasn’t necessarily always the exact same BASIC; the commands and syntax differed between whatever BASIC dialect came with any given model of home computer (Commodore, Atari, Texas Instruments, Sinclair or any of the countless others). Fortunately most of these licensed or were derived from the most popular microcomputer implementation of BASIC: Microsoft BASIC.

BASIC has its roots in academics, where it was intended to be an easy to use programming language for every student, even those outside the traditional STEM fields. Taking its cues from popular 1960s languages like FORTRAN and ALGOL, it saw widespread use on time-sharing systems at schools, with even IBM joining the party in 1973 with VS-BASIC. When the 1970s saw the arrival of microcomputers, small and cheap enough to be bought by anyone and used at home, it seemed only natural that they too would run BASIC.

The advantage of having BASIC  integrated into these systems was obvious: not only were most people who bought such a home computer already familiar with BASIC, it allows programs to be run without first being compiled. This was good, because compiling a program takes a lot of RAM and storage, neither of which were plentiful in microcomputers. Instead of compiling BASIC source code, BASIC interpreters would interpret and run the code one line at a time, trading execution speed for flexibility and low resource use.

After turning on one’s microcomputer, the BASIC interpreter would usually be loaded straight from an onboard ROM in lieu of a full-blown operating system. In this interpreter shell, one could use the hardware, write and load BASIC programs and save them to tape or disk. Running existing BASIC code as well as compiled programs on one’s computer, or even typing them in from a listing in a magazine all belonged to the options. As BASIC implementations between different home computers were relatively consistent, this provided for a lot of portability.

That was then, and this is now. Are people actually still using the Basic language?

BASIC Joystick Fun

To start off with, let’s see a bit of what BASIC is about. For an extremely simple but fun example of how BASIC can be used, let’s take a look at an application for the Commodore 64 (courtesy of C64-Wiki) that moves an arrow around the screen while printing its screen coordinates using a joystick connected to the second joystick port. The C64 runs Commodore BASIC 2.0, which is based on Microsoft BASIC.

 10 S=2: X=150: Y=150: V=53248: GOTO 100
 15 J=PEEK(56320): IF J=127 THEN 15
 20 IF J=111 THEN POKE 56322,255:END
 25 IF J=123 THEN X=X-S
 30 IF J=119 THEN X=X+S
 35 IF J=125 THEN Y=Y+S
 40 IF J=126 THEN Y=Y-S
 45 IF J=122 THEN Y=Y-S
 50 IF J=118 THEN Y=Y-S
 55 IF J=117 THEN Y=Y-S
 60 IF J=121 THEN Y=Y-S
 65 IF X=>252 THEN X=10
 70 IF X=<10 THEN X=252 75 IF Y>254 THEN Y=44
 80 IF Y<44 THEN Y=254
 85 PRINT CHR$(147);CHR$(158);CHR$(17);"X-POS:";X;" Y-POS";Y
 90 POKE V,X:POKE V+1,Y: GOTO 15
100 FOR Z=832 TO 853 : POKE Z,0: NEXT Z
105 FOR Z=832 TO 853 STEP 3: READ J: POKE Z,J: NEXT Z
110 POKE V+21,1: POKE  V+39,7: POKE V+33,0: POKE V+29,1
115 POKE 56322,224: POKE 2040,13: GOTO 85
120 DATA 240, 224, 224, 144, 8, 4, 2, 1

Each of the lines above are entered as-is, including the line number. On the next line after the code we enter RUN and hit ‘Return’ (or ‘Enter’, depending on one’s keyboard). Assuming we didn’t mistype anything, the code will now execute to show the following screen:

In this exciting game, we move the arrow around the screen using the joystick.

So what does this code do? As with any BASIC program, it starts at the first line which here is 10. It defines a few variables here, before jumping to line 100 (using GOTO). In a FOR loop, we POKE (i.e. write a hardware register) and repeat this in a few more addresses, which updates the display to its initial configuration. Here the READ command is used to read constants which are defined by DATA.

Many of these memory addresses directly address the video adapter (VIC-II in the C64). When we use PEEK at line 15, it reads the contents of the memory address 56322, which corresponds to the current input values on the second joystick port. After that we can check the state of each input using the bit values and adjust our on-screen arrow accordingly (line 90), along with the coordinates (line 85).

The C64 Wiki page for this program includes a bitwise comparison version. That should run marginally faster, as it has fewer lines of code. For moving an arrow around the screen, the difference would be unlikely to be noticed, however.

Important to note here is that BASIC implementations on different microcomputers would have to POKE and PEEK different memory addresses to get the same effect due to the different system layout of each computer. Some implementations would also provide commands tailored specifically to that microcomputer system, which became more relevant as graphics and audio capabilities grew.

Interpreted Versus Compiled

A familiar sight for some people: the QuickBasic IDE.

The interpreted nature of BASIC on most microcomputers was both a benefit and a disadvantage. On one hand, it’s very flexible, and you can simply run your latest program and quickly modify it without having to deal with lengthy compile cycles (on a <10 MHz Z80 or 6502 MPU, no less). On the other hand, because any errors in the code will not become apparent until the program is run by the interpreter, this leads to the same joyful experience as with modern-day JavaScript and Python scripts, where the code will run fine until the interpreter suddenly keels over with an error message (if one is lucky).

With BASIC this usually comes in the form of a ‘Syntax error on line <line>’ error. Running the same code through a compiler would however have found those errors. This feature of interpreted code means that the easy distribution method of code as listings in computer magazines and reference books would only be as good as the quality of the printed code and one’s own typing skills. Fortunately, on the C64 and similar systems, fixing a mistyped line would be as easy as retyping it, hitting ‘Return’ and the interpreter shell would update the line in question.

BASIC Today

The PureBasic Visual Designer.

All good and well, you may say at this point, but nobody is dragging out that C64 to do some BASIC programming today. Aside from folks who like to play with old computers, of course. Here it should be noted that BASIC didn’t live and die with Commodore and Atari. Over at Microsoft, BASIC spawned Visual Basic, Visual Basic for Applications (VBA) and VB .NET. The latter allows writing VB code for the .NET runtime.

Microsoft also released Small Basic in 2008, which it says targets novice programmers, for example students who used a visual programming language like Scratch previously. This is not to be confused with SmallBASIC, which is an open source (GPL) BASIC dialect with accompanying interpreters for modern platforms.

BASIC dialects can also be found in many graphing and programmable calculators from Ti, HP, Casio and others, although many of these dialects are not directly compatible with the original BASIC standard (ISO/IEC 10279:1991). Since the 1980s, BASIC evolved to no longer require line numbers, instead using labels which it can jump to, along with adopting new programming paradigms. This was introduced with QuickBasic in 1985 and is a common sight today.

Also on the commercial side of the fence is PureBasic by Fantaisie Software, which provides an IDE and compiler for a number of target platforms. True BASIC is a modern BASIC toolchain and IDE which moves closer to FORTRAN in its syntax, and is developed by the original developers of BASIC (Darthmouth BASIC).

In terms of today’s open source BASIC interpreters and compilers, there is Chipmunk Basic, which dates back to the Apple MacIntosh, Microsoft recently open-sourced its GW-BASIC, and you’ll even find a healthy OSS ecosystem around BASIC. If none of that tickles your fancy, you can implement Tiny BASIC, straight from the BNF grammar as listed in the first issue of Dr. Dobb’s Journal from 1976. A few years ago our own Tom Nardi wrote about his experiences bringing a 1990s QuickBasic project into the modern world with QB64.

Making the case for BASIC

Clearly, BASIC is not dead then. It sees daily use in its commercial forms, the myriad of open source projects and in the vibrant retrocomputing community. Aside from still being a (arguably) good language to teach programming with, it’s also a nice option for embedded applications, especially where many use MicroPython or kin today, as the system requirements are much lower. We reported on an ARM MCU which came with a BASIC interpreter a number of years ago, for example.

There are also projects like UBASIC PLUS on GitHub, targeting STM32F0 MCUs and requiring as little as 8 kB of RAM and 64 kB of Flash. Another project for ARM and PIC32 (as well as DOS and Windows) is MMBasic, which lists its requirements as 94 kB of Flash and at least 16 kB of RAM.

With BASIC having evolved in an era when home computers had less memory and storage than a $5 microcontroller has today, it makes for an excellent, low-resource language for situations which call for the use of interpreted scripts rather than precompiled binaries, without having to shell out for MCUs with more Flash and RAM.

Are any of our readers regular users of BASIC in some form today? If so, be sure to leave a comment with your experiences and tips for those who might be interested in giving BASIC a shot, whether on desktop, retro systems or embedded :)

[Header Image: The HP 2000 system, mainly used for running time-shared BASIC, CC-BY 3.0]

116 thoughts on “BASIC: Cross-Platform Software Hacking Then And Now

  1. Actually BASIC is very important. I frequently use it on the Stamp microcontrollers from Parallax. And even QB on MSDOS based systems, now inside the occasional VM. And also on my TRS-80 Model 102.

        1. The equivalent program to move a pointer around the screen on a Colour Maximite 2 is:


          cls
          controller mouse open 0
          gui cursor on 0
          do
          gui cursor mouse(x,0),mouse(y,0)
          print @(0,0) mouse(x,0),mouse(y,0) ” ”
          pause 20
          loop

          Pretty scary.

  2. “Are people actually still using the Basic language?”

    No.

    I hate basic. Always did and always will. If I had to use basic, I would toss my computer in a dumpster and spend the extra time baking or gardening, or something — Anything!

    1. @ severe thingy

      Instead of saying how you feel, a largely emotive response, could you be a tiny bit more objective and perhaps say why you have such a reaction. This would certainly help me understand your position and influence my thoughts. I like to hope that I can be open minded and be receptive to other viewpoints. At the moment, what you said has little more information content than a burst of noise.

      Thanks

    2. VB.NET is so far removed from original Dartmouth BASIC as to be almost unrecognisable, It has evolved into an OOP block structured language without line numbers. It’s actually fairly pleasant to use. Original MS BASIC is another matter, but given the choice between that and 8 bit assembly language then it did what it said on the tin by providing a way in for beginners.

    3. It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
      –E. W. Dijkstra

      (If you don’t know who Dijkstra is, please stay away from computers. Far. Away.)

  3. The code block that adjusts the position of the pointer based on joystick input looks completely wrong. Only two of the 8 possible movements have an effect on the X position, where the opposite should be true (only joystick hard up or down has no X, diagonal movements all have an X along with hard left or right).

    1. Also, line break between 70 and 75 is missing. But it’s just a simple sample for those that have never seen how basic looks like. Besides, you can’t beat graphics editor in line 120.

    1. I wouldn’t say that. Visual Basic for DOS (VBDOS) is a hybrid of Quick Basic 4.5 and Visual Basic 1.0 (for Windows 3.x)..
      In fact, VBDOS can compile most QB programs just fine. And QB itself can optionally use line numbers. :)

  4. I would have thought that an example meant to show “what is BASIC about” would focus on things like GOSUB, FOR…NEXT and even the dreaded GOTO. You went right to PEEK and POKE! I always thought that programs which relied heavily on PEEK and POKE weren’t so much BASIC programs as they were assembly programs which used BASIC as a very ugly assembler only because back in the day purchasing a real assembler was expensive.

    1. “Learning BASIC for Tandy Computers” David A. Lien 3rd edition, 1988

      Part 8 out of 9 Miscellaneous
      Chapter 47 out of 53
      PEEK and POKE

      First sentence: “PEEK and POKE are BASIC words that allow us to do “non-BASIC” things.”

      PEEK and POKE are totally what BASIC is all about. Or at least more central to it than 6 out of 53 things.

        1. So who brought them to BASIC? Bill Gates? I’m just curious if they arrived with microcomouters.

          On a timesharing system, you don’t want people poking, or putting some machine code into ram and running it from BASIC. So it makes sense it only arrives when the user has full ownership of the computer.

          I think realistically pokes were mkstly used to put machine code into memory. Not exclusively, but I can think of a lot of magazine articles where the BASIC peogram was really a loader for a machine language program. Maybe that varied with computer, but Jim Butterfield got his supermon into the C64 via a BASIC loader.

    2. Well, PEEK and POKE simply respectively read a memory location and write a memory location. Nothing to do with assembly, although you can use poke to write assembly instructions into some memory locations, and then use USR to execute them. And you can use PEEK to read memory locations like scratchpad values of the BASIC interpreter (like what is the current cursor position, or which key was pressed last, things like that).

      Quite a lot easier to access memory than we can with Swift today. With Swift, to read a byte from a memory location, you have to write a statement as large as what would constitute a small game if written in BASIC. :P

      1. Yep. PEEK and POKE, especially on the PET, VIC-20, and C-64, are more often about I/O, Sound, and Graphics – the hardware – than “machine language”. Commodore didn’t extend BASIC to let you manipulate the underlying hardware directly, so PEEK and POKE are what you have.

        SYS and USR() are definitely where machine language comes in. I used to write a lot of ML helpers that lived in the second cassette buffer (because who has two tape drives?) and call them from BASIC programs.

        1. “Commodore didn’t extend BASIC to let you manipulate the underlying hardware directly, so PEEK and POKE are what you have.”

          To be honest, I think that Commodore simply didn’t have an extended BASIC for the C64 because they were cheapskates and didn’t want to pay the license fee. :)

          They should have licensed Simon’s BASIC extensions.

          1. That was pretty common. OSI stayed with the same BASIC. When Radio Shack came out with the Color Computer III, they used the same BASIC as the earlier models, moved it to RAM from ROM, and then applied patches from Microware to make it useful with the new hardware.

            The companies got a good deal, I think it was a bulk purchase rather than a price per unit sold. I remember something like that as the reason OSI didn’t fix some bugs.

            Remember, this was still very early in Microsoft’s life, early on they may have wanted to be earlier, then later hoped for higher prices when there was no competition.

            But Ithought some company bought the source code, so they could modify it or resell it. I may be mixing that up with something else.

      2. The whole point of Swift and such is to avoid accessing memory and any hardware directly. The more distance between programmer and the hardware, the better, so in modern programming there are layers and layers of abstraction. Peeking and poking memory and registers is good on resource-limited platforms. On modern systems your code can be as sloppy and inefficient, as you can make it, because most people will just upgrade the hardware to cope with bad code. That’s why old Java apps for old phones run sometimes better than modern Android apps on 2-5 years old smartphones, while doing the same thing…

    3. For those of us designing our own systems or adding our own hardware designs, PEEK and POKE were the only way to access any custom hardware.

      The easiest way to add hardware to a system was to memory map it. My first computer was an RCA 1802 and it only had 4 hardware I/O selector lines that were mutually exclusive, so it was basically the only way to access I/O in BASIC.

      I had a Super-Basic for the system, but I made my complete operating system in FORTH.

  5. BASIC didn’t “load from ROM”. The ROM was just there. In essence, the BASIC was the firmware, instantly on.

    It’s amazing how seemlessly those early 6502 and Z80 micros combined ther three different parts: a command shell, a text editor, and the BASIC interpreter.

    Sure, the command shell was just a “direct mode” that fed single lines to the interpreter, but that got the job done. Talking about your NEW, RUN, LIST, LOAD and SAVE commands here. Usually also a way to call machine code though that command had a different name on practically every box.

    The line numbers were mostly just a way to manage a simple text file. Sure, they could have made editing program text modal, and had that happened the experience would have been a lot more like using vi, with acute awareness of flipping modes. But the line number system undoubtedly makes things easier to code, not to mention making ready targets for GOTO and GOSUB.

    And of course the interpreter could be built like a free running version of the direct mode parser.

    Fwiw, PEEK and POKE dealt with memory addresses. On machines of the 6800, 6502 persuasion, hardware registers were mapped just like regular memory, so PEEK and POKE had you covered there. Otoh 8080, Z80 based hardware had a separate I/O space, and BASICs there often offered IN and OUT commands.

    One other random note, I recall thinking READ and DATA were an odd kind of thing, rather inflexible and inefficient. About twenty years later the idea occurred: if your program were instead fed to a *mainframe* on punched cards, you could keep several data sets, and just submit whichever data you wanted with your ‘batch job’. What was missing was the flexibility to merge saved-things, especially on tape based systems. Afaik loading a program from tape incurred an implicit NEW, which put the kibosh on being able to switch tapes and append DATA to your program. Would have been an easy option to provide, but then I suppose disk drives don’t exactly sell themselves.

    1. You have a good point about READ, DATA and the use of punched cards. For the Atari 8-bit computers at least, you could LIST to a file and use ENTER command to read it back in, just as if typed, either cassette or disk. So you could LIST program sections to files and use this to apply different data sets to the same program without any NEW.

    2. 1980’s micros didn’t have text editor style BASIC code editing because that would have required considerably more RAM. If you wanted to see what was around what you were editing, the usual procedure was to LIST the program then BREAK when the line that needed changing scrolled up. Then at the bottom of the screen you could retype the line. Being able to LIST then stop it *and just move the cursor up to the line* would have made things much easier. It wasn’t fun retyping a long line of code to fix one error, then the program still stops – and you find out that you typed another error that wasn’t in the line before. Writing all the code out by hand on paper then going through it to check *then* carefully typing it all in was quicker.

      1. Atari BASIC had a primitive full screen editor. The 400/800/XL/XE were over engineered in a lot of ways. The ROM OS was fantastic, far more advanced than what the C64 or Spectrum offered.

      2. The commodore PET, VIC, C64 would let you do that. If you could get it to show you the lines you wanted, you could use the “screen editor” to just cursor up, tweak the offending line, and hit return to re-enter the line. However this was not really a program-text-editor as such, more of a nifty way to juggle 25 different input line buffers. Beat the daylights out of the RadioShack EDIT command, that’s for sure. Fwiw I think the Apple 2 let you re-enter lines off the screen, too

    1. I used PIC Basic and Mikro-Basic. I switched to XC compilers, hacked to restore optimizations locked by marketing drones (free version adds copious amounts of GOTOs to the assembly intermediate to make it slower). Locking features is one thing, but padding a perfectly good code to make free version look as slow as Python is just evil…

  6. I have some friends after economic studies working in field of banking, insurances or consulting. They all always say that they can’t code but they are writing pretty complex macros in something like basic which for me is harder to read, write and debug than for example python

    1. You should check out COBOL, a programming language written for managers. I actually have a book about programming in COBOL for old Odra 1305 computer, where all commands were translated into polish…

    2. I worked for the guy that came up with the algorithm that is still used today to make those space probes’ 50W transmitters look like a 50,000W transmitter so we can talk to them from earth (at JPL for the Venus Probe IIRC, got his PHD doing it). He also was the guy that boosted the 110 baud modem do 600 baud.

      He could not understand or code anything but BASIC. I had to extract his algorithms from the basic code he gave me and convert it to C for our projects for our embedded micros.

  7. I’ve had great success with Basic over the years. As part of my hobby I became fluent in it and found it was well adapted to implement lots my projects in the 80s and 90s For example, 2 versions of fully automated home security systems (BSR lights controls, auto dialer , weather logger, speech syn, remote furnance control etc), automated a paper testing lab ( hardware fit with in budget constraints and got around tightly held control of the IT department ) , automated several mobile final product testing stands, implemented a data collection and analysis system for a pilot paper machine. All that was done with commodore computers with a bit of assembly thrown in. Non commodore stuff included model airplane 8052 data loggers using patched tiny basic to implement lcd displays and collect data. But the most powerful basic system I put together uses Excel and Visual Basic along with routines to collect data directly into excel. The breath of Excel is hard to beat and the tools offered by Visual Basic are also hard to beat putting some very powerful capabilities within reach of less literate computer programmers. It costs a bit to go that route but for one offs simple stuff it’s a pretty compelling way to go.

    Back in the 80s and 90s lots of people were using commodores and other home computers for doing lots of simple projects. Often a simple interface to their printer port or user port was enough and for lots of applications speed is not an issue. For example, during that era, I noticed a commodore computer was being used at the Atlanta airport to display train locations at each stop!

    I’m retired now so I’m getting up to speed on what’s available and I’m really impressed. Still, I miss the widespread availability of Basic and it’s easy to debug interpretive style.

  8. “To start off with, let’s see a bit of what BASIC is about.”

    Then proceeds with code that is 60% machine specific inputs, 30% machine specific pokes, and 10% standard basic.

    Just saying, it’s more what C64 is all about.

    1. I learned 6502 assembly specifically because on the PET, you can only go so far with BASIC. It doesn’t have the rich sound and graphics of a C-64, but it shares the same limits to the language and the same speed issues. There were some good games in 100% BASIC but for smooth, quick full-motion, you really had to jump to assembly.

      But you could do an entire text adventure in BASIC, as long as you didn’t mind waiting a couple of seconds between prompts.

      1. While the 64 had color bitmap graphics, sprites, atari 2600 compatible joystick ports, and the SID, its anemic BASIC provided direct support for exactly none of those things, which is why there was so much POKE this and POKE that.

        1. Heck, the BASIC on the PET 4032 was better than the 64’s. I think the 4032 ran 4.0 or some such. Sadly, the PET had no cool hardware. Just a 6845 CRTC that iirc you couldn’t elicit anything much different than 40×25 text from it, and there was the 488 bus but that had good support in ROM anyway.
          The 128’s BASIC was quite complete. In general it was a nice machine, just a little late to the party is all.

  9. I us visual basic for applications all the time while working in excel.
    i use visual basic net and have wrote a few small programs the run on a raspberry pi with mono
    I started out with basic on a ti 99/4a moved to gwbasic on a trs80 model 3 then move to quick basic on my msdos based 10mhz xt compatible at some point i got stared with visual basic version 5 and continue on to this day.

    1. I also learned BASIC on a TI 99/4A, even wrote some acceptable games (for a ten year old). Later MS-BASIC, TrueBasic (compiled!), and some others I forget now. I have a BASIC Stamp board from not too long ago in case I ever need it. I feel like I’m too old to be learning the language of the month when I can use a modern, structured version of BASIC.

      1. yea that’s me. I have tried to work with python and c for that matter but while sitting at the pc trying to write something my mind says i can knock this out in visual basic in no time

      2. TI-BASIC and Extended BASIC didn’t have PEEK, POKE or some other commands commonly found in other BASICs, but they could call assembly language subroutines. Still dunno why TI chose to change the LOAD command to OLD. Save was still SAVE. Much use was made of the various structured data file formats accessible to TI-BASIC, where one could specify FIXed or VARiable lengths for the entries, and the required or maximum number of characters per entry.

        The worst part of TI-BASIC built into the console was its double interpretation. Part of showing off the TMS9918 and TMS9918A Video Display Processor was Graphics Programming Language or GPL. TI was attempting to design an 8 bit CPU whose native language was GPL. Working hand in hand with the VDP it would’ve been a speedy, tightly integrated system.

        But with the GPL CPU a failure, and the time for the Home Computer to be launch, TI went with a big hack. They took their TMS9900 16 bit CPU and modified it to connect to an 8 bit bus. One of the compromises made was giving it just 256 bytes of RAM directly accessible by the CPU. The 16K was mainly video RAM, but also used for program storage.

        With the time invested into GPL for the VDP, TI wasn’t going to toss all that and start over. So they added a BASIC to GPL interpreter and a GPL to 9900 interpreter. So BASIC was converted to GPL then that was converted to 9900 machine code, then that told the VDP what to display. Can you say SLOW?

        TI Extended BASIC was a different thing. It was *almost* completely compatible with console BASIC, with just 2 or 3 things that could be done in console BASIC that were not supported by ExBASIC. But its main improvement was speed. Lots of speed. IIRC it bypassed GPL and went directly to 9900 code. It also tokenized most of the commands to save RAM and disk space, though when entered or displayed it used the full words. For how fast TI ExBASIC was, I took the character creation manual for a Marvel Superheroes roleplaying game and wrote out on paper a program to randomly create character stat sheets. It could spit them out to screen as fast as I could hit the ENTER key. I even had an option to print the data. Similar programs on other 1980’s micros could take quite a bit of time to churn through the calculations. Writing it in console BASIC would have been possible but more complicated since it couldn’t do multiple commands on a line so often what a single ExBASIC line could do would take 2 to 4. Unfortunately I don’t have any of my old TI-99 disks, or written or printed out program listings.

        There were a bunch of 3rd party extended and enhanced BASICs, many of which fixed the incompatibilities so they could run any program written in console BASIC. There was a guy who wrote some assembly language subroutines that others could use with their BASIC programs and IIRC at least one of the 3rc party BASICs directly incorporated them.

        All that diversity didn’t help. With so many different BASIC versions, program portability beyond TI’s two BASICs was poor to impossible. That made it very difficult to write a BASIC program for sale if you used some 3rd party BASIC because unless the programmer was willing to buy all the best selling BASICs and port the program to all of them it could possibly work on, the potential market was limited to just the other buyers of the same BASIC.

        The TI-99/4A Extended BASIC wizard was a guy by the name of Ray Kazmer. https://www.youtube.com/watch?v=_F6vozl6u0Y

    1. There was no evaluation before BASIC came to microcomputers. It had been promoted as a beginner’s language, so some had experience with it, and People’s Computing Company revolved around it.

      TinyBASIC either influenced Bill Gates, or he drew from the same source. Both came very early, making BASIC a necessity. I remember articles from early on telling readers that machine language was hard, but BASIC made programming easy.pr

      So there was an ongoing thread that made BASIC important.

      My first computer in 1979 didn’t have memory or aterminal, so no BASIC. So my first language was hand assemblying code.

      When I got my OSI Superboard in 1981, it had BASIC, I didn’t do much with it. I did get a Bob Albrecht book about BASIC, but I remember not being interested in following a long, “how do I do this” and leaping forward.

      Consumer computers needed a language built in, or there’d be little to do. But by then, 1977, BASIC had become the one language, actually Microsoft BASIC.

      I’ve never used FORTH, but when I first read about it, it seemed like a good choice to out in ROM. Sort of a cross between a monitor, and a high level language. But after a certain point, different paths weren’t open, it had to be BASIC.

      1. “Consumer computers needed a language built in, or there’d be little to do”

        I would put it a little different: “Consumer computers needed an operating system built in, or there’d be little to do”. And BASIC was quite a nice operating system to work in. Much better than all those monitors at the time, having to type commands like ‘l $8000’ and ‘x $8000’, all the while forgetting to first do ‘i $0000,$FF,$00’ to make sure that the first 256 bytes scratchpad area don’t contain garbage and make the application crash before it even starts.

        Doing ‘load “game”‘ and “run” was much easier and better to remember. And there was the pro that you could write your own programs. Just win/win all around :)

          1. Luckily it shipped with one, plus you could connect a HDD or external floppy.
            It’s a bit of a pointless argument given that, from about the mid to late 80s then all micros needed a disk of some type to start applications from.

      1. With all respect Elliot, Python is not always a bazillion times better than Basic. Consider one of the classic STEM tutorials for Python: writing a Snake game.

        On a ZX Spectrum, and some other 8-bit Basics (and a Jupiter Ace in Forth), it’s easy both to display characters anywhere on the screen (PRINT AT y,x;”Hi!”); create User Defined Graphics (PRINT ” [GraphicsMode]A[GraphicsModeOff]”;) and get interactive keyboard input (INKEY$). This makes writing a simple Snake game (and things like Space Invaders a relative doddle, given the relative performance of early 80s micros).

        From what I saw of the Python equivalent it involves creating a separate task to run a Curses terminal; forgetting any UDGs and interactive keyboard input is no where near as easy.

        So, for some learning tasks, 40 year old computers are better for the job.

  10. I started BASIC on an 8-bit Nascom I. It had a Tiny Basic rom built-in, and a NAS-SYS monitor. I would play around with the Tiny Basic, until I really started to feel it’s limitations (mainly the limited strings, and no floating point). Then found a tape with X-Tal Basic (which was NOT a MS-Basic derivative!).

    Took a while to load from tape, like 5 minutes. But it enabled me to port all of the interesting games from David Ahl’s Basic Computer Games to my Nascom. And learned to program BASIC at the same time. :)

  11. Look how cool is the translation of the legendary “Numerical Recipes” in Fortran is to Power Basic (the two routines shown below are SPLINT and SPLINE

    SUB SPLINT(XA(1),YA(1),Y2A(1),N,X,Y)

    local klo,khi,k
    local h,a,b

    KLO=1
    KHI=N
    um:
    IF (KHI-KLO) > 1 THEN
    K=(KHI+KLO)/2
    IF XA(K) > X THEN
    KHI=K
    ELSE
    KLO=K
    END IF
    GOTO um
    END IF
    H=XA(KHI)-XA(KLO)
    IF H = 0 then Print “Bad XA input em SPLINT.”:stop
    A=(XA(KHI)-X)/H
    B=(X-XA(KLO))/H
    Y=A*YA(KLO)+B*YA(KHI)+((A^3-A)*Y2A(KLO)+(B^3-B)*Y2A(KHI))*(H^2)/6.
    END sub

    SUB SPLINE(X(1),Y(1),N,YP1,YPN,Y2(1))

    ‘ Suspeito que os arrays x() e y() precisam estar sorteados em
    ‘ ordem crescente de X.
    ‘ 13/05/94

    local i,k,nmax
    local sig,p,qn,un

    NMAX=1000
    DIM dynamic U(NMAX)
    IF YP1>1E30 THEN
    Y2(1)=0.
    U(1)=0.
    ELSE
    Y2(1)=-0.5
    U(1)=(3./(X(2)-X(1)))*((Y(2)-Y(1))/(X(2)-X(1))-YP1)
    END IF
    for I=2 to N-1
    SIG=(X(I)-X(I-1))/(X(I+1)-X(I-1))
    P=SIG*Y2(I-1)+2.
    Y2(I)=(SIG-1.)/P
    U(I)=(6.*((Y(I+1)-Y(I))/(X(I+1)-X(I))-(Y(I)-Y(I-1))/(X(I)-X(I-1)))/(X(I+1)-X(I-1))-SIG*U(I-1))/P
    next
    IF YPN > 1E30 THEN
    QN=0.
    UN=0.
    ELSE
    QN=0.5
    UN=(3./(X(N)-X(N-1)))*(YPN-(Y(N)-Y(N-1))/(X(N)-X(N-1)))
    END IF
    Y2(N)=(UN-QN*U(N-1))/(QN*Y2(N-1)+1.)
    for K = N-1 to 1 step -1
    Y2(K)=Y2(K)*Y2(K+1)+U(K)
    next
    erase u
    END sub

  12. In highschool (80,81,82) Basic was the language used to teach us about coding. We used teletype terminals with the box of paper underneath. At the time it was ‘exciting’ and set my career path. In college the language was Pascal for all the main classes like data structures. Never seriously programmed in Basic again. Touched on Fortran, Cobol, Lisp, APL, Assembly, etc … Pascal was/is a wonderful structured language. Learned a little ‘C’ on my own which got me a job as a real-time programmer for control systems (substations/hydro/communications).

    At my current job, the thing I did was switch ‘all’ of the VB apps (written within Excel and Access… Uggggh.) to Python in the department I was in. Much easier to maintain and use. No longer need excel/excel/word installed on our production systems and batch files to run them. Just Python. Has been much more reliable and much easier to maintain for 24×7 operations. Call-outs are very rare now on those systems.

    So from my perspective Basic is ‘left’ in the dusty past. With the systems of today Python very much takes over as the language of choice. Even in controllers, we have microPthyon and Circuit Python for ‘beginner/ease of use’ languages. If to slow for the application at hand, one can always drop down to ‘C’ (like on the RPI Pico or Arduino).

    For me ‘C’ and now Python have been the most useful languages in my career. Pascal is a very close runner up because for desktop apps Turbo Pascal, and Delphi were are are awesome for RAD GUI development on Windows/Dos. Still like to dabble there at times. Have Lazarus/Free Pascal loaded on my Linux machines for that purpose.

    For kicks, I recently convert an old Vintage Basic game application to ARM64 assembly. I learn more by ‘doing’ and this helped me get a handle on Linux ARM64 assemble. Yes, I like twiddling the bits now and then. It is who I am.

    Bottom line. I don’t use Basic. Much better choices out there now.

  13. At work, we used a Laird BT900 Bluetooth module in two projects.

    It comes with a minimal shell using AT-style commands. You can run your own programs written in “smartBASIC” on the module. The program is compiled on a PC to a binary blob, which is then copied to the module using an AT command. The BASIC is quite powerful, nothing like the home computer BASICs of the 1980s. It does not need line numbers, supports events, exception handling, and of course everything Bluetooth related.

    In both projects, we just installed a slightly modified example program that essentially provides a transparent serial connection from bluetooth to an ARM-based microcontroller.

      1. “Affordable” is a bit of a nebulous and subjective quality. If you peg it at price of a 5 year old used car, I think the Altair did that first and the Apple II later. If you peg it at the price of a new bicycle, then you had to wait until the ZX80 or 81 in kit form. However, there was also a range in the prices of home computers. Sure you could spend $5000 easily on fully boxed up models with premium keyboards, dual floppy drives, nice monitors. However, you could also get $100-$200 boards like the Kim 1, Ohio Superboard, COSMAC elf, etc.

        It’s the same today, you’ll get people saying “computers aren’t affordable!” looking at $1500+ Macbooks, while someone who’s got a whole $100 tied up in their Pi + thrift store keyboard and LCD etc is snickering at them.

      2. That depends on your definition of “affordable”, probably “home comouter” too.

        My first computer, in 1979, was a KIM-1, I got free. But it came out in 1977.

        My second computer, in 1981, was an OSI Superboard, about $500 Canadian. It came out in 1977 or 78.

        I couldn’t afford to buy a computer in the seventies, but others could, and some weren’t sky high.

        Of course, in the seventies, some of it was just to have a computer, you didn’t have to have a use. Hence the KIM-1 was fine, and so cheap that someone taking a course on microprocessors for work didn’t even want it afterwards.

    1. Sharp MZ-80K, MZ-80A? My dad had one of them.
      On the other hand, they were clean computers with only a “monitor program” in ROM (an early type of firmware).
      Also, Sharp called them “Personal Computer”.

  14. One more try. (First was refused). See how the command line parsing routine is neat in Power Basic

    sub arg(z$,n%,a$(1))

    ‘ Devolve o no. de argumentos (em n%) e os argumentos [em b$()] da
    ‘ linha de comando via command$

    ‘ F. Jablonski – 22/03/91

    local c%,kv%,kn%,a$,k
    dim dynamic b$(640)
    a$=z$
    c%=len(a$)
    if c%=0 then n%=0 : erase b$ : exit sub

    ‘ livra-se dos espacos `a direita e `a esquerda

    while right$(a$,1)=” ”
    a$=left$(a$,c%-1)
    c%=c%-1
    wend
    c%=len(a$)
    while left$(a$,1)=” ”
    a$=right$(a$,c%-1)
    c%=c%-1
    wend

    ‘ livra-se dos multiplos espacos entre os argumentos

    while instr(a$,” “)0
    k=instr(a$,” “)
    a$=left$(a$,k)+right$(a$,c%-k-1)
    c%=c%-1
    wend

    ‘ conta e isola os argumentos

    kv%=1 : n%=1
    while instr(kv%,a$,” “)0
    kn%=instr(kv%,a$,” “)
    a$(n%)=mid$(a$,kv%,kn%-kv%)
    kv%=kn%+1
    n%=n%+1
    wend
    a$(n%)=mid$(a$,kv%,c%-kv%+1)
    erase b$
    end sub

  15. BASIC is still used in both test&measurement and ATE. Teradyne Flex ATE systems, which are responsible for about half of my Fortune 500 company’s fab output test hardware, uses a dialect of BASIC for its programming. There is a very high likelihood that every person reading this is doing so on hardware that has our chips in it, and every chip we sell goes through automated test.

    1. Ah, good old teradyne flex, programmed with a crappy combination of VBA, Excel spreadsheets, and hatred.

      give me the old HP83k and HP93k, programmed in C/C++, and a unix interface, not the fisher-price my-first-ATE “programming” languages.

      seen waaay to much bad vba code on the Teradyne series…

    2. For some reason, whenever I want to do some one off bit twiddling, or read a few bytes of data, I end up doing it in qbasic and hating myself. For some reason I also end up there when some setting is locked out or unimplemented in CMOS setup, so I stuff the bits in and save it from there. I could probably do it in debug but the mnemonics ain’t very mnemoniccy and I have to look everything up each time. It’d probably stick if I found enough interesting i.e. personally valuable, things to do with it for two weeks, but usually just want to get some niggling thing out the way so bang it up in qbasic and continue onto the thing I really wanted to be doing.

  16. And from PoC||GTFO:

    “A mind which has *not* been exposed to BASIC will only with great difficulty become a reverse engineer. What does a neighbor who grew up on BASIC spaghetti code think when he first reads unannotated disassembly? As surely as the gostak distims the doshes, he knows that he’s seen worse spaghetti code and this won’t be much of a challenge!”

    PDF: https://www.alchemistowl.org/pocorgtfo/pocorgtfo01.pdf

  17. Early BASIC was terrible. It was a tool to learn the very general concepts of programming but little more.

    All variables were in the global scope and were limited to two letters making it near impossible to choose descriptive variable manes.

    It was line numbers only and no labels.

    There were no function definitions only GOSUB (line number) and this was an absolute pain with all variables in the global scope.

    Also I see here references to other BASICs. Note that Q-Basic and Quick-Basic were entirely different. One was an interpreter only and the other could compile to .EXE

    1. And it didn’t even have floating point, or strings, or arrays, and you had to say LET, and you had to enter it by beating the keyboard with broken bottles.

      Wasn’t it glorious? =P

  18. I am sure there are many edge cases like this with Basic. Just like Fortran is still heavily used in some science circles. At my last job, one of the hats I wore was to help the scientists (working on plasma boundary simulations and stuff for space craft) keep working some old Fortran applications and maintain their high end server (Linux OS of course). I keep hearing Cobol hasn’t gone away either :) .

    I am just glad that I have found better tools for the work “i” do.

  19. I began with BASIC on a an ASR33 Teletype 1973. Truly wondered what the fuss was about. Later used Microsoft BASIC on a Sym-1 (a 6502 SBC way ahead of its time in 1980) and struggled valiantly to learn as much as I could. I was pretty adept at hand coded assembly programming and knew the was great swathes of computing MS BASIC just did not touch. Along comes BBC BASIC , capable of recursion, calling procedures and functions by name, local variables, inbuilt 6502 assembler, reading and writing bytes, 4byte integers and strings directly to RAM, typed data structures on tape storage, repeat/until, 8bit user port etc etc just to name some of my personal favourites. And it was fast and clean. Written by the very same people who came up with the ARM CPUs. The first simulation of the ARM concept was written in about 800 or maybe less lines of BBC BASIC code on an 8Bit 6502 machine.

    BBC BASIC has been ported to many machines and should be given a high position in the pantheon on BASICs. GW-BASIC was good as I could POKE/PEEK data to and from the ’86 PC printer port. Once the Windows kernels forbade such internal byte tickling, I basically hibernated my hacking for 15 years until finally being liberated by the Arduino Renaissance, and then the Raspberry Pi with its GPIO. Microsoft totally missed the boat on that idea, MS BASIC with its clumsy peek and pokes just did not help at all.

  20. I have written a Tiny BASIC+ for NUCLEO-8S208RB board but never used it. For me it was only a programming exercise. It is written entirely in assembly. It has a simple File System on the extra FLASH memory not used by BASIC where it save program files. It can be configured to autorun any file stored at power on or reset.

    There is a reference manual, a user manual and a few examples programs.

    But this all in french. :-)

    https://github.com/Picatout/stm8_tbi

    1. Forgot to talk about the line editor. Every is done an the MCU. The only requirement on the PC side is vt100 terminal emulator. Then it can be used on any operating system. This is a tokenized BASIC to improve speed, nevertheless there is a decompiler to reconstruct the original text and edit again. There is editing facility like overwrite|insert, and recall of a specific line for editing.

      Also the LIST command list list all or a range of lines.

  21. If I recall correctly, I think Wang Computer’s OS was written in Basic….or at least it’s word processor and major applications were.

    One of the coolest assembly language programs I think I ever wrote for my TRS-80 was a renumberer for Basic that went through a program changing all line numbers to step my 10’s so you could insert new lines in between.

    1. I’ll second that second. Everyone thinks of Xerox Parc as this big transformation, but here you have how scant more than 10 years prior, something even bigger happened. Sure it’s obvious now that we should have this level of responsiveness from our machines, but before DTSS people apparently just had no concept. Wow. Worth the watch.

    2. Excellent documentary.

      I learnt a lot. As a person who has viewed the ASM of many early BASICs (so that I can do extended things) I can now see why much of the code is as it was.

      The black box code that works with RAM/ROM was always a different coding style to the code that handled IO.

  22. I still use BASIC to develop video games. I love BASIC! I hope it becomes more mainstream. And by the way, for those who might be interested, I made a YouTube video entitled “Why I like BASIC”. My channels name on YouTube is HE360.

  23. I use BASIC Engine for writing little games, programs, and for creating gcode for my plotter.
    https://basicengine.org/

    It’s just fun to use. It boots instantly, and because it’s interpreted I can play with the code and test different things until it works. I can’t google and find a library, I have to learn and implement my own solutions. That’s the fun part. The other day I hooked up a DS3231 RTC and now have it updating the system clock on boot without a library, compiling and recompiling, toolchains, IDE’s, etc.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.