Safekipedia

Applesoft BASIC

Adapted from Wikipedia · Discoverer experience

Screenshot showing simple computer programming code from Applesoft BASIC.

Applesoft BASIC is a type of programming language called BASIC, made by Microsoft BASIC. It was created by Marc McDonald and Ric Weiland for use with Apple II computers. This version of BASIC replaced an earlier one called Integer BASIC and was built into the memory of all Apple II computers after the very first model.

Because it could handle numbers with decimals, Applesoft BASIC was also known as FP BASIC. The name comes from both Apple Computer and Microsoft. Apple workers, like Randy Wigginton, changed Microsoft’s version to work better on the Apple II and added new features.

The first version of Applesoft came out in 1977 and could only be loaded from a cassette tape. It didn’t work well with the computer’s high-resolution pictures. A better version, called Applesoft II, arrived in 1978. You could load it from cassette or disk, and it was built into the Apple II Plus and later models. This version could work with high-resolution graphics and is the one most people think of when they hear “Applesoft.”

History

When Steve Wozniak created Integer BASIC for the Apple II, he did not add support for floating-point arithmetic because he focused mainly on making games, which did not need it. Later, Microsoft made Microsoft BASIC for the MOS Technology 6502 processor, but there was no computer using it yet.

When the Apple II was shown to the public in April 1977, many people wanted it to have floating-point math, which the Commodore PET already had. Since Steve Wozniak was busy working on the Disk II drive and Apple DOS, Apple asked Microsoft for help. Apple paid Microsoft to create Applesoft BASIC, which added many new features to the older Integer BASIC.

Applesoft BASIC included new ways to handle text, better math functions, and commands for graphics. It also allowed programs to handle mistakes more smoothly. However, it did not keep one feature from Integer BASIC: the MOD operator for finding remainders.

Features

Applesoft is similar to another BASIC system but has some small differences. It cannot do certain operations that other BASIC systems can, but most programs will work on both.

The PR# statement can send output to special cards added to the computer. If there is no card in the slot, the computer will stop working. PR#0 brings output back to the normal screen.

Variables in Applesoft use five bytes of memory each. Programmers can make some variables use less memory, but this only helps when using many variables in arrays.

The RND function creates random numbers between 0 and 1. RND(0) gives the last random number made.

Applesoft does not support lowercase letters in programs, except inside text strings.

Applesoft lacks some common commands found in other BASIC systems, such as searching inside text, formatting printed numbers, or checking for key presses without pausing the program.

Only the first two letters of variable names matter. For example, "LOW" and "LOSS" are treated as the same variable.

The only sound Applesoft can make is a beep. It can draw simple graphics in low and high resolution modes. Starting with newer Apple computers, a special high-resolution mode exists, but Applesoft does not support it directly.

Applesoft can be extended by calling special routines stored in memory. These routines can perform tasks quickly or access parts of the computer directly.

Applesoft has some issues with handling errors and creating random numbers, which can sometimes lead to unexpected results.

Applesoft uses floating-point numbers for math, which makes it slower than simpler systems. Programs are stored in a way that can slow down certain actions. Keeping number values in variables before using them in repeated calculations can make programs run faster.

Sample code

In Applesoft BASIC, you can write a simple program that says "HELLO WORLD" like this:

Hello, World!, with inverse video and bell character, run then listed

10 TEXT:HOME
20 ?"HELLO WORLD"

You can put more than one command on a single line if you separate them with a colon (:). The symbol ? is a shortcut for the word "PRINT". When you list your program, it will show the word "PRINT" instead of ?. So, the program above will look like this when listed:

10 TEXT : HOME
20 PRINT "HELLO WORLD"

When Applesoft BASIC was first released in 1978, you could load it from a cassette tape. Later, when the Apple II+ computer was made, Applesoft BASIC was built into the computer’s memory and would start automatically if no disk was inserted. The older Integer BASIC was no longer built-in and could be found on disks instead.

Early evolution

The first version of Applesoft had a smaller program that used less memory than the later Applesoft II. Because of this, it did not include many features found in the later version. For example, it did not support special graphics commands, error-checking tools, or some useful commands for controlling the screen and saving data.

This early version of Applesoft was also slightly different from Microsoft’s original design. It showed a different prompt when turning on the computer and had some unique ways of handling commands. Some commands had different names, and certain features worked in special ways compared to later versions.

Related BASICs

There are several compilers for Applesoft BASIC, such as TASC from Microsoft in 1981.

Coleco said that the SmartBASIC on its Adam home computer worked the same way as Applesoft. Microsoft also let VTech use a BASIC similar to Applesoft for its Laser 128 clone computer.

Related articles

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

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