The IBM Personal Computer BASIC, commonly shortened to IBM BASIC, is a
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
first released by
IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
with the
IBM Personal Computer, Model 5150 (IBM PC) in 1981. IBM released four different versions of the
Microsoft BASIC
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 v ...
interpreter
Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
, licensed from
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
for the PC and
PCjr. They are known as Cassette BASIC, Disk BASIC, Advanced BASIC (BASICA), and Cartridge BASIC. Versions of Disk BASIC and Advanced BASIC were included with
IBM PC DOS
IBM PC DOS (an acronym for IBM Personal Computer Disk Operating System),Formally known as "The IBM Personal Computer DOS" from versions 1.0 through 3.30, as reported in those versions' respective COMMAND.COM outputs also known as PC DOS or IBM ...
up to PC DOS 4. In addition to the features of an
ANSI
The American National Standards Institute (ANSI ) is a private nonprofit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organiz ...
standard
BASIC
Basic or BASIC may refer to:
Science and technology
* BASIC, a computer programming language
* Basic (chemistry), having the properties of a base
* Basic access authentication, in HTTP
Entertainment
* Basic (film), ''Basic'' (film), a 2003 film
...
, the IBM versions offered support for the graphics and sound hardware of the IBM PC line. Source code could be entered with a full-screen editor, and limited facilities were provided for rudimentary program
debugging
In engineering, debugging is the process of finding the Root cause analysis, root cause, workarounds, and possible fixes for bug (engineering), bugs.
For software, debugging tactics can involve interactive debugging, control flow analysis, Logf ...
. IBM also released a version of the Microsoft BASIC
compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
for the PC concurrently with the release of PC DOS 1.10 in 1982.
Background
IBM licensed Microsoft BASIC for the IBM Personal Computer despite already having its own version of BASIC for the company's mainframes.
Don Estridge said, "Microsoft BASIC had hundreds of thousands of users around the world. How are you going to argue with that?"
IBM Cassette BASIC
''IBM Cassette BASIC'' came in 32
kilobyte
The kilobyte is a multiple of the unit byte for Computer data storage, digital information.
The International System of Units (SI) defines the prefix ''kilo-, kilo'' as a multiplication factor of 1000 (103); therefore, one kilobyte is 1000&nbs ...
s (KB) of
read-only memory
Read-only memory (ROM) is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device. Read-only memory is useful for storing sof ...
(ROM), separate from the 8 KB
BIOS
In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is a type of firmware used to provide runtime services for operating systems and programs and to perform hardware initialization d ...
ROM of the original IBM PC, and did not require an
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
to run. Cassette BASIC provided the default user interface invoked by the BIOS through
INT 18h if there was no floppy disk drive installed or if the
boot code did not find a bootable floppy disk at power up. The name Cassette BASIC came from its use of
cassette tape
The Compact Cassette, also commonly called a cassette tape, audio cassette, or simply tape or cassette, is an analog audio, analog magnetic tape recording format for Sound recording and reproduction, audio recording and playback. Invented by L ...
s rather than floppy disks to store programs and data. Cassette BASIC was built into the ROMs of the original PC and
XT and of early models in the
PS/2 line. It supports loading and saving programs only to the
IBM cassette tape
The original IBM Personal Computer and IBM PCjr includes support for storing data and programs on compact cassette tape.
It was common for home computers of the time, such as the Apple II, Commodore 64 and BBC Micro, to use cassette tapes fo ...
interface, which is unavailable on models after the original Model 5150. The entry-level version of the 5150 came with just 16 KB of
random-access memory
Random-access memory (RAM; ) is a form of Computer memory, electronic computer memory that can be read and changed in any order, typically used to store working Data (computing), data and machine code. A random-access memory device allows ...
(RAM), which was sufficient to run Cassette BASIC. However, Cassette BASIC was rarely used because few PCs were sold without a disk drive, and most were sold with PC DOS and sufficient RAM to at least run Disk BASIC—many could run Advanced BASIC as well. There are three versions of Cassette BASIC: C1.00 (found on the early IBM PCs with 16–64K motherboards), C1.10 (found on all later IBM PCs, XTs, ATs, and PS/2s), and C1.20 (found on the PCjr).
IBM Disk BASIC
''IBM Disk BASIC (BASIC.COM)'' was included in the original
IBM PC DOS
IBM PC DOS (an acronym for IBM Personal Computer Disk Operating System),Formally known as "The IBM Personal Computer DOS" from versions 1.0 through 3.30, as reported in those versions' respective COMMAND.COM outputs also known as PC DOS or IBM ...
. Because it used the 32 KB Cassette BASIC ROM,
BASIC.COM did not run on even highly compatible
PC clones, such as the
Compaq Portable
The Compaq Portable is an early portable computer which was one of the first IBM PC compatible systems. It was Compaq Computer Corporation's first product, to be followed by others in the Compaq Portable series and later Compaq Deskpro series. ...
.
The name Disk BASIC came from its use of
floppy disk
A floppy disk or floppy diskette (casually referred to as a floppy, a diskette, or a disk) is a type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined with a ...
s as well as
cassette tape
The Compact Cassette, also commonly called a cassette tape, audio cassette, or simply tape or cassette, is an analog audio, analog magnetic tape recording format for Sound recording and reproduction, audio recording and playback. Invented by L ...
s to store programs and data. Disk-based code corrected
errata
An erratum or corrigendum (: errata, corrigenda) (comes from ) is a correction of a published text. Generally, publishers issue an erratum for a production error (i.e., an error introduced during the publishing process) and a corrigendum for an a ...
in the ROM-resident code and added floppy-disk and
serial-port support.
Disk BASIC can be identified by its use of the letter D preceding the version number. It adds disk support and some features lacking in Cassette BASIC but does not include the extended sound or graphics functions of BASICA. The primary purpose of Disk BASIC was as a "light" version for IBM PCs with only 48 KB of memory: BASIC.COM would then have about 23 KB free for user code, whereas BASICA would have only about 17 KB. By 1986, all new PCs shipped with at least 256k, and DOS versions after 3.00 reduced Disk BASIC to only a small stub that called BASICA.COM for compatibility with batch files. Even with all this excess RAM, BASIC would still allocate and manage only about 61 KB for user programs, whether it was Cassette BASIC, BASIC.COM, or BASICA.
IBM Advanced BASIC
''IBM Advanced BASIC (BASICA.COM)'' was also included in the original IBM PC DOS, and requires the ROM-resident code of Cassette BASIC. It added functions such as diskette file access, storing programs on disk, monophonic sound using the PC's built-in speaker, graphics functions to set and clear
pixel
In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a Raster graphics, raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, p ...
s, similar functions to draw lines and circles and to set colors, and
event handling
In computing, an event is a detectable occurrence or change in the system's state, such as user input, hardware interrupts, system notifications, or changes in data or conditions, that the system is designed to monitor. Events trigger responses or ...
for communications and joystick presses. BASICA does not run on non-IBM computers (even so-called "100% compatible" machines) or later IBM models, because they lack the needed ROM BASIC.
BASICA versions are the same as those of their respective DOS, beginning with v1.00 and ending with v3.30. The early versions of BASICA do not support subdirectories, and some graphics commands function slightly differently. As an example, if the
LINE
statement is used to draw lines that trailed off-screen, BASIC merely intersects them with the nearest adjacent line, while in BASIC 2.x and up, the lines run off the screen and do not intersect. The
PAINT
command in BASIC 1.x begins filling at the coordinate specified and expands outward in alternating up and down directions, while in BASIC 2.x it fills everything below the starting coordinate and then, after finishing, everything above it. BASIC 1.x's
PAINT
command also makes use of the system stack for storage and when filling in complex areas it can produce an
OVERFLOW
error. To remedy this, the
CLEAR
statement can be used to expand BASIC's stack (128 bytes is the default size). BASIC 2.x does not use the stack when PAINTing and thus is free of this problem.
Compaq BASIC 1.13 was the first standalone (does not require Cassette BASIC) BASIC for the PC as well as the only version of BASIC besides IBM BASICA 1.00 and 1.10 to use FCBs and include the original LINE statement with intersecting lines (the
PAINT
statement in Compaq BASIC 1.13 works like in all later versions of BASICA/GW-BASIC: it uses the new fill algorithm and no stack).
Early versions of PC DOS include several sample BASIC programs that demonstrated the capabilities of the PC, including the BASICA game ''
DONKEY.BAS''.
Microsoft
GW-BASIC
GW-BASIC is a dialect of the BASIC programming language developed by Microsoft from IBM BASICA. Functionally identical to BASICA, its BASIC interpreter is a fully self-contained executable and does not need the Cassette BASIC ROM found in the ori ...
is identical to BASICA,
with the exception of including the Cassette BASIC code in the program, so runs on non-IBM computers and later IBM models that lack Cassette BASIC in ROM.
IBM PCjr Cartridge BASIC
A
ROM cartridge
A ROM cartridge, usually referred to in context simply as a cartridge, cart, cassette, or card, is a replaceable part designed to be connected to a consumer electronics device such as a home computer, video game console or, to a lesser extent, ...
version of BASIC was available only on the
IBM PCjr, shipped in 1984, and supported the additional graphics modes and sound capabilities possible on that machine. It is a superset of advanced BASIC. Cartridge BASIC could operate only within the first 128 KB of memory on the PCjr and did not work with expansion RAM, ''i.e.'', the DEF SEG function cannot be used to point to memory segments above &H1FF0.
Cartridge BASIC was activated by typing BASICA at the DOS prompt. Conversely, IBM BASICA versions 2.1 and up refused to run if they detected a PCjr, but they could be patched to work around this limitation.
Operation
Cassette BASIC loaded when a PC or PCjr was booted without a bootable disk or cartridge. Disk BASIC and Advanced BASIC load when their
command
Command may refer to:
Computing
* Command (computing), a statement in a computer language
* command (Unix), a Unix command
* COMMAND.COM, the default operating system shell and command-line interpreter for DOS
* Command key, a modifier key on A ...
name (BASIC and BASICA respectively) is typed at a DOS command prompt (except on a PCjr, which activates Cartridge BASIC instead), with some optional parameters to control allocation of memory. When loaded, a sign-on identification message displays the program version number, and a full-screen text editor starts (see images, right). The function keys are assigned common commands, which display at the bottom of the screen. Commands may be typed in to load or save programs, and expressions can be typed in and executed in
direct (immediate) mode. If a line of input starts with a number, the language system stores the following line of text as part of program source, allowing a programmer to enter an entire program line by line, with
line number
In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and increm ...
s before each statement. When listed on screen, lines are displayed in order of increasing line number. Changes can be made to a displayed line of program
source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
by moving the cursor to the line with the cursor keys, and typing over the on-screen text. Program source is stored internally in a
tokenized
Lexical tokenization is conversion of a text into (semantically or syntactically) meaningful ''lexical tokens'' belonging to categories defined by a "lexer" program. In case of a natural language, those categories include nouns, verbs, adjectives ...
form in which
reserved word
In a programming language, a reserved word (sometimes known as a reserved identifier) is a word that cannot be used by a programmer as an identifier, such as the name of a variable, function, or label – it is "reserved from use". In brief, an '' ...
s are replaced with a single
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
token to save space and execution time. Programs may be saved in compact tokenized form or optionally saved as DOS
ASCII
ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
text files
[DOS text files terminate each line with a CR (]carriage return
A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text. It is closely associated with the line feed ...
, ASCII 13) and LF ( linefeed, ASCII 10) character pair, in that order. that can be viewed and edited with other programs. Like most other DOS applications, IBM BASIC is a
text-mode program and has no features for windows, icons, mouse support, or
cut-and-paste
Cut, copy, and paste are essential commands of modern human–computer interaction and user interface design. They offer an interprocess communication technique for transferring data through a computer's user interface. The ''cut'' command remo ...
editing.
Legacy
GW-BASIC
GW-BASIC is a dialect of the BASIC programming language developed by Microsoft from IBM BASICA. Functionally identical to BASICA, its BASIC interpreter is a fully self-contained executable and does not need the Cassette BASIC ROM found in the ori ...
, launched in 1983, is a disk-based Microsoft product that was distributed with non-IBM
MS-DOS
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
computers and supports all the graphics modes and features of BASICA on computers that do not have IBM Cassette BASIC.
The successor to BASICA for MS-DOS and PC DOS versions, now discontinued, is
QBasic
QBasic is an integrated development environment (IDE) and BASIC interpreter, interpreter for a variety of dialects of BASIC which are based on QuickBASIC. Code entered into the IDE is compiled into an intermediate representation (IR), and this ...
, launched in 1991. It is a stripped-down version of the Microsoft
QuickBASIC
Microsoft QuickBASIC (also QB) is an Integrated Development Environment (or IDE) and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the c ...
compiler: QBasic is an interpreter and cannot compile source files, while QuickBASIC can compile and save the programs in the
.EXE executable file format. QuickBASIC also includes some advanced language statements and functions (mostly involving OS interfacing and low-level
machine-language programming), supports multi-module programs, and includes advanced debugging features, all of which are absent from QBASIC.
References
External links
A brief history of the development of BASICwww.phys.uu.nl/~bergmann/history.html (archived)
PCE IBM PC Emulatornbsp;— emulates IBM Cassette BASIC and IBM Cassette Interface with connected third party cassette drive
which invokes & copies IBM Cassette BASIC
{{Authority control
BASIC interpreters
Discontinued Microsoft BASICs
Programming languages created in 1981
BASIC
Basic or BASIC may refer to:
Science and technology
* BASIC, a computer programming language
* Basic (chemistry), having the properties of a base
* Basic access authentication, in HTTP
Entertainment
* Basic (film), ''Basic'' (film), a 2003 film
...
BASIC
Basic or BASIC may refer to:
Science and technology
* BASIC, a computer programming language
* Basic (chemistry), having the properties of a base
* Basic access authentication, in HTTP
Entertainment
* Basic (film), ''Basic'' (film), a 2003 film
...
BASIC programming language family
Microsoft programming languages