Safekipedia

Commodore BASIC

Adapted from Wikipedia ยท Adventurer experience

Splash screen from the classic computer program Simons' BASIC, showing simple graphic design from the early days of personal computing.

Commodore BASIC, also known as PET BASIC or CBM-BASIC, was the version of the BASIC programming language used in Commodore International's 8-bit home computers. These computers ranged from the PET in 1977 to the Commodore 128 in 1985.

The core of Commodore BASIC was based on Microsoft BASIC. Commodore licensed it from Microsoft in 1977 for a one-time payment, choosing not to pay royalties per unit. This decision allowed Commodore to offer BASIC on many of its popular machines.

The original version for the PET computer was very similar to Microsoft's version. Later versions, like BASIC 2.0 on the C64, stayed close to this design. As new computers came out, BASIC changed to include features like graphics, sound, and special commands for the new machines' abilities. The final version, BASIC 10.0, was planned for the Commodore 65 but was never released.

History

Commodore used a special version of BASIC for their 8-bit home computers. This version began with the PET computer and was also used in later models like the Commodore 64 and the Commodore 128. Even though newer versions existed, the Commodore 64 used an older version to save money and because it was designed for home use.

Microsoft hid a secret message in the software. By typing a special command, a hidden message appeared, showing that Microsoft created the software. This secret was difficult to find and did not appear when looking at the computer's code.

Technical details

Commodore's BASIC had a helpful feature called a full-screen editor. Unlike other computers at the time, you could move around the screen easily to type or change lines of code. If you started a line with a number, it would save as part of your program. You could run lines without numbers by pressing RETURN.

The editor could save files to different devices, like cassettes, which were cheap and easy to use. Most computers only saved to disks. With Commodore, you could name your cassette files directly.

Commands could be shortened by typing just part of them. This made typing faster and let you fit more code on one line. However, this could sometimes cause small problems for programmers.

Commodore BASIC worked slower than machine code because it interpreted commands as they ran. Programmers found ways to make programs run faster. A special feature let you send commands to clear the screen or move the cursor.

Programs could have up to 80 characters on most machines. Later versions allowed even longer lines. The way programs ran followed the order of lines in memory, which could be changed with special commands.

Variables only needed the first two letters to be unique. Commodore BASIC used a special number format for calculations. It also included ways to work with time and random numbers. Early versions had slow clean-up for certain data, but later versions improved this.

Alternatives

Many extra tools were made for the Commodore 64 because its basic programming system was simple. One popular tool was the DOS Wedge. It helped users work with disks without losing their programs. Other tools, like Epyx FastLoad, added new commands to make programming easier.

The Simons' BASIC start-up screen

Some people thought the simple system was good because it made users learn more about how computers work. Users could use special commands to load files and manage memory.

A magazine called Loadstar let hobbyist programmers share their ideas and extra commands for programming.

Older versions of Commodore BASIC had some tricky parts that made programming harder. Later versions added new commands to make things easier.

Use as user interface

When you turned on a Commodore computer, it went straight to the BASIC programming system. You could type commands to load and run programs. If a program stopped, the values stayed in memory and could be shown for checking. The Commodore 128 kept these values safe until a new command was given. This made programming feel easy and interactive, like talking to a friend, unlike older systems that needed separate programs to work.

The Commodore 64 did not have simple commands to load from disks. Instead, users had to tell the computer which disk drive to use. Also, there was no easy way to see what files were on a disk without replacing the current program. Some tools helped fix this problem.

Example code

This section shows some basic examples of how to write simple programs using Commodore BASIC. These examples help you see how the language works and can be a good starting point for learning to code on these old computers.

The examples include simple commands that you can type and run, giving you a feel for what programming was like on these machines.

Versions and features

Commodore BASIC came in many versions, each adding new features for different Commodore computers.

Released versions

  • V1.0: Used in the PET 2001 with a special keyboard and built-in tape drive. It had limits on arrays and some commands were turned off.
  • V2.0: First update for PET 2001 with a better keyboard. It added support for special devices and fixed some problems.
  • V4.0: For PET/CBM 4000/8000 series. It added many disk commands and improved performance.
  • V2.0 (second release): For VIC-20 and C64.
  • V2.2: For C64GS in 1990.
  • V4+: For CBM-II series. It included memory management, better printing, error handling, and more.
  • V3.5: For C16/116 and Plus/4. It added sound, graphics, joystick input, and special commands for looping and editing programs.
  • V7.0: For C128. It added more sound and graphics, sprite handling, and commands for memory management and timing. It also let you switch to C64 mode.

Unreleased versions

  • V3.6: For Commodore LCD (unreleased). It was almost the same as V7.0 but had a few different commands.
  • V10: For Commodore 65 (unreleased). It included commands for graphics, mouse input, and memory management.

Notable extension packages

Special tools were made to work with Commodore BASIC on different computers. These tools helped users do more things with their programs.

Some of these tools included Super Expander 64 for the C64, Simons' BASIC also for the C64, Graphics BASIC for the C64 made by Hesware, BASIC 8 for the C128 by Walrusoft, and Vision BASIC for the C64 created by Dennis Osborn. There were also tools like Super Expander for the VIC-20 and JiffyDOS from Creative Micro Designs.

Related articles

This article is a child-friendly adaptation of the Wikipedia article on Commodore BASIC, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.