Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first version of BASIC published by Microsoft as well as the first high-level programming language available for the Altair 8800 microcomputer.

During the home computer craze during the late-1970s and early-1980s, BASIC was ported to and supplied with many home computer designs. Slight variations to add support for machine-specific functions, especially graphics, led to a profusion of related designs like Commodore BASIC and Atari Microsoft BASIC.

Microsoft BASIC

As the early home computers gave way to newer designs like the IBM Personal Computer and Macintosh, BASIC was no longer as widely used, although it retained a strong following. The release of Visual Basic reboosted its popularity and it remains in wide use on Microsoft Windows platforms in its most recent incarnation, Visual Basic .NET.

Microsoft BASIC

Altair BASIC and early microcomputers

The Altair BASIC interpreter was developed by Microsoft founders Paul Allen and Bill Gates using a self-written Intel 8080 emulator running on a PDP-10 minicomputer. The MS dialect is patterned on Digital Equipment Corporation's BASIC-PLUS on the PDP-11, which Gates had used in high school. The first versions supported integer math only, but Monte Davidoff convinced them that floating-point arithmetic was possible, and wrote a library which became the Microsoft Binary Format.

Microsoft BASIC

Altair BASIC was delivered on paper tape and in its original version took 4 KB of memory. The following functions and statements were available:

LIST, NEW, PRINT, INPUT, IF...THEN, FOR...NEXT, SQR, RND, SIN, LET, USR, DATA, READ, REM, CLEAR, STOP, TAB, RESTORE, ABS, END, INT, RETURN, STEP, GOTO, and GOSUB.

There were no string variables in 4K BASIC and single-precision 32-bit floating point was the only numeric type supported. Variable names consisted of one letter (A–Z) or one letter followed by one digit (0–9), thus allowing up to 286 numeric variables.

For machines with more memory, the 8 KB version added 31 additional statements and support for string variables and their related operations like MID$ and string concatenation. String variables were denoted with a $ suffix, which remained in later versions of the language. Later on, Microsoft released the 12K Extended BASIC, which included double precision 64-bit variables, IF...THEN...ELSE structures, user defined functions, more advanced program editing commands, and descriptive error messages as opposed to error numbers. Numeric variables now had three basic types, % denoted 16-bit integers, # denoted 64-bit doubles, and ! denoted 32-bit singles, but this was the default format so the ! is rarely seen in programs.

The extended 8 KB version was then generalized into BASIC-80 (8080/85, Z80), and ported into BASIC-68 (6800), BASIC-69 (6809), and 6502-BASIC. The 6502 had somewhat less dense assembler code and expanded in size to just under 8K for the single precision version, or 9K for a version using an intermediate 40-bit floating point format in place of the original 32-bit version. This new 40-bit format became the most common as it was used on most 6502-based machines of the era. It was also ported to the 16-bit BASIC-86 (8086/88).

The final major release of BASIC-80 was version 5.x, which appeared in 1981 and added support for 40-character variable names, WHILE...WEND loops, dynamic string allocation, and several other features. BASIC 5.x removed the ability to crunch program lines.

The core command set and syntax are the same in all implementations of Microsoft BASIC and, generally speaking, a program can be run on any version if it does not use hardware-specific features or double precision numbers (not supported in some implementations).

Licenses to home computer makers

After the initial success of Altair BASIC, Microsoft BASIC became the basis for a lucrative software licensing business, being ported to the majority of the numerous home and other personal computers of the 1970s and especially the 1980s, and extended along the way. Contrary to the original Altair BASIC, most home computer BASICs are resident in ROM, and thus are available on the machines at power-on in the form of the characteristic "READY". prompt. Hence, Microsoft's and other variants of BASIC constitute a significant and visible part of the user interface of many home computers' rudimentary operating systems.