IBM BASIC

Last updated
Five 8 KB ROM DIP chips and an empty 8 KB ROM expansion socket, on an IBM PC motherboard. Four chips hold Cassette BASIC, and one holds the BIOS. IBM PC ROM BIOS and IBM PC ROM BASIC (1981) b.jpg
Five 8 KB ROM DIP chips and an empty 8 KB ROM expansion socket, on an IBM PC motherboard. Four chips hold Cassette BASIC, and one holds the BIOS.

The IBM Personal Computer Basic, commonly shortened to IBM BASIC, is a programming language first released by IBM with the IBM Personal Computer, Model 5150 (IBM PC) in 1981. IBM released four different versions of the Microsoft BASIC interpreter, licensed from Microsoft 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 up to PC DOS 4. In addition to the features of an ANSI standard BASIC, 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. IBM also released a version of the Microsoft BASIC compiler for the PC concurrently with the release of PC DOS 1.10 in 1982.

Contents

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?" [1]

IBM Cassette BASIC

IBM Cassette BASIC
IBM Cassette BASIC.png
Developer Microsoft (for IBM)
First appeared1981
Influenced
IBM Disk BASIC, IBM BASICA, GW-BASIC

IBM Cassette BASIC came in 32 kilobytes (KB) of read-only memory (ROM), separate from the 8 KB BIOS ROM of the original IBM PC, and did not require an operating system 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 tapes 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 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 (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
IBM Disk BASIC.png
Developer Microsoft (for IBM)
First appeared1981
Influenced by
IBM Cassette BASIC
Influenced
IBM BASICA, GW-BASIC

IBM Disk BASIC (BASIC.COM) was included in the original IBM PC DOS. Because it used the 32 KB Cassette BASIC ROM, [2] BASIC.COM did not run on even highly compatible PC clones, such as the Compaq Portable. [3] The name Disk BASIC came from its use of floppy disks as well as cassette tapes to store programs and data. Disk-based code corrected errata 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)
IBM BASICA.png
Developer Microsoft (for IBM)
First appeared1981 (1981)
Platform IBM Personal Computer
OS IBM PC DOS
Influenced by
IBM Cassette BASIC, IBM Disk BASIC
Influenced
GW-BASIC

IBM Advanced BASIC (BASICA.COM) was also included in the original IBM PC DOS and required the ROM-resident code of Cassette BASIC. [2] 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 pixels, similar functions to draw lines and circles and to set colors, and event handling for communications and joystick presses. BASICA will 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 did not support subdirectories, and some graphics commands functioned slightly differently. As an example, if the LINE statement was used to draw lines that trailed off-screen, BASIC merely intersected them with the nearest adjacent line, while in BASIC 2.x and up, the lines ran off the screen and did not intersect. The PAINT command in BASIC 1.x began filling at the coordinate specified and expanded outward in alternating up and down directions, while in BASIC 2.x it filled everything below the starting coordinate and then, after finishing, everything above it. BASIC 1.x's PAINT command also made use of the system stack for storage and when filling in complex areas it could produce an OVERFLOW error. To remedy this, the CLEAR statement could be used to expand BASIC's stack (128 bytes is the default size). BASIC 2.x did not use the stack when PAINTing and thus was free of this problem.

Compaq BASIC 1.13 was the first standalone BASIC for the PC (that did not require Cassette BASIC to run) as well as the only version of BASIC besides IBM BASICA 1.00 and 1.10 to use FCBs[ clarification needed ] and include the original LINE statement with intersecting lines (the PAINT statement in Compaq BASIC 1.13 worked like in all later versions of BASICA/GW-BASIC: it used the new fill algorithm and no stack).

Early versions of PC DOS included several sample BASIC programs that demonstrated the capabilities of the PC, including the BASICA game DONKEY.BAS .

GW-BASIC is identical to BASICA, with the exception of including the Cassette BASIC code in the program, thus allowing it to run on non-IBM computers and later IBM models that lack Cassette BASIC in ROM.

IBM PCjr Cartridge BASIC

A ROM cartridge 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. [4] It is a superset of advanced BASIC. [5] 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 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 numbers 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 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 form in which reserved words are replaced with a single byte token to save space and execution time. Programs may be saved in compact tokenized form or optionally saved as DOS ASCII text files [6] 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 editing.

Legacy

GW-BASIC, launched in 1983, is a disk-based Microsoft product that was distributed with non-IBM MS-DOS 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, launched in 1991. It is a stripped-down version of the Microsoft QuickBASIC 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.

Related Research Articles

<span class="mw-page-title-main">BIOS</span> Firmware for hardware initialization and OS runtime services

In computing, BIOS is firmware used to provide runtime services for operating systems and programs and to perform hardware initialization during the booting process. The BIOS firmware comes pre-installed on an IBM PC or IBM PC compatible's system board and exists in some UEFI-based systems to maintain compatibility with operating systems that do not support UEFI native operation. The name originates from the Basic Input/Output System used in the CP/M operating system in 1975. The BIOS originally proprietary to the IBM PC has been reverse engineered by some companies looking to create compatible systems. The interface of that original system serves as a de facto standard.

<span class="mw-page-title-main">GW-BASIC</span> Dialect of the BASIC programming language

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 original. It was bundled with MS-DOS operating systems on IBM PC–compatibles by Microsoft.

<span class="mw-page-title-main">IBM Personal Computer</span> Personal computer model released in 1981

The IBM Personal Computer is the first microcomputer released in the IBM PC model line and the basis for the IBM PC compatible de facto standard. Released on August 12, 1981, it was created by a team of engineers and designers at International Business Machines (IBM), directed by William C. Lowe and Philip Don Estridge in Boca Raton, Florida.

<span class="mw-page-title-main">Tandy 1000</span> IBM PC compatible home computer system

The Tandy 1000 is the first in a line of IBM PC compatible home computer systems produced by the Tandy Corporation for sale in its Radio Shack and Radio Shack Computer Center chains of stores. Introduced in 1984, the product line was aimed at providing affordable but capable systems for home computing or education, with some of its Tandy specific features like graphics, sound and joystick port making it more appealing for home use.

<span class="mw-page-title-main">IBM PC DOS</span> Computer operating system

IBM PC DOS, also known as PC DOS or IBM DOS, is a discontinued disk operating system for the IBM Personal Computer, its successors, and IBM PC compatibles. It was manufactured and sold by IBM from the early 1980s into the 2000s. Developed by Microsoft, it was also sold by that company as MS-DOS. Both operating systems were identical or almost identical until 1993, when IBM began selling PC DOS 6.1 with new features. The collective shorthand for PC DOS and MS-DOS was DOS, which is also the generic term for disk operating system, and is shared with dozens of disk operating systems called DOS.

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.

<span class="mw-page-title-main">IBM PCjr</span> Home computer

The IBM PCjr was a home computer produced and marketed by IBM from March 1984 to May 1985, intended as a lower-cost variant of the IBM PC with hardware capabilities better suited for video games, in order to compete more directly with other home computers such as the Apple II and Commodore 64.

<span class="mw-page-title-main">Tandy 2000</span> Personal computer by Radio Shack

The Tandy 2000 is a personal computer introduced by Radio Shack in September 1983 based on the 8 MHz Intel 80186 microprocessor running MS-DOS. By comparison, the IBM PC XT used the older 4.77 MHz Intel 8088 processor, and the IBM PC/AT would later use the newer 6 MHz Intel 80286. Due to the 16-bit data bus and more efficient instruction decoding of the 80186, the Tandy 2000 ran significantly faster than other PC compatibles, and slightly faster than the PC AT. The Tandy 2000 was the company's first computer built around an Intel x86 series microprocessor; previous models used the Zilog Z80 and Motorola 6809 CPUs.

<span class="mw-page-title-main">Mindset (computer)</span> 1984 personal computer

The Mindset is an Intel 80186-based MS-DOS personal computer. It was developed by the Mindset Corporation and released in spring 1984. Unlike other IBM PC compatibles of the time, it has custom graphics hardware supporting a 320×200 resolution with 16 simultaneous colors and hardware-accelerated drawing capabilities, including a blitter, allowing it to update the screen 50 times as fast as an IBM standard color graphics adapter. The basic unit was priced at US$1,798. It is conceptually similar to the more successful Amiga released over a year later. Key engineers of both the Amiga and Mindset were ex-Atari, Inc. employees.

The Atari Microsoft BASIC and Atari Microsoft BASIC II variants of the 6502-version of Microsoft BASIC ported to the Atari 8-bit computers. The first version, released 1981, required 32 KB of RAM and was supplied on floppy disk. The second version, released the next year, had most of the code on a ROM cartridge with additional functions on an optional floppy.

<span class="mw-page-title-main">Compaq Portable series</span> Laptop manufacturer

Compaq's first computers' form factors were portable, also called "luggables", and then "lunchbox computers", and together constituted the Compaq Portable series. These computers measured approximately 16 inches (410 mm) deep, 8 inches (200 mm) tall, and approximately 20 inches (510 mm) wide. As the products evolved, laptops and notebooks were created offing a new level of portability that caused the market to explode.

BIOS implementations provide interrupts that can be invoked by operating systems and application programs to use the facilities of the firmware on IBM PC compatible computers. Traditionally, BIOS calls are mainly used by DOS programs and some other software such as boot loaders. BIOS runs in the real address mode of the x86 CPU, so programs that call BIOS either must also run in real mode or must switch from protected mode to real mode before calling BIOS and then switching back again. For this reason, modern operating systems that use the CPU in Protected mode or Long mode generally do not use the BIOS interrupt calls to support system functions, although they use the BIOS interrupt calls to probe and initialize hardware during booting. Real mode has the 1MB memory limitation, modern boot loaders use the unreal mode or protected mode to access up to 4GB memory.

<span class="mw-page-title-main">Compaq Portable</span> Early portable computer

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. It was not simply an 8088-CPU computer that ran a Microsoft DOS as a PC "work-alike", but contained a reverse-engineered BIOS, and a version of MS-DOS that was so similar to IBM's PC DOS that it ran nearly all its application software. The computer was also an early variation on the idea of an "all-in-one".

Donkey, often known by its filename DONKEY.BAS, is a video game written in 1981 and included with early versions of the IBM PC DOS operating system distributed with the original IBM PC. It is a top-down driving game in which the player must avoid hitting donkeys. The game was written by Microsoft co-founder Bill Gates and early employee Neil Konzen.

<span class="mw-page-title-main">Rainbow 100</span> DEC microcomputer

The Rainbow 100 is a microcomputer introduced by Digital Equipment Corporation (DEC) in 1982. This desktop unit had a monitor similar to the VT220 and a dual-CPU box with both 4 MHz Zilog Z80 and 4.81 MHz Intel 8088 CPUs. The Rainbow 100 was a triple-use machine: VT100 mode, 8-bit CP/M mode, and CP/M-86 or MS-DOS mode using the 8088. It ultimately failed to succeed in the marketplace which became dominated by the simpler IBM PC and its clones which established the industry standard as compatibility with CP/M became less important than IBM PC compatibility. Writer David Ahl called it a disastrous foray into the personal computer market. The Rainbow was launched along with the similarly packaged DEC Professional and DECmate II which were also not successful. The failure of DEC to gain a significant foothold in the high-volume PC market would be the beginning of the end of the computer hardware industry in New England, as nearly all computer companies located there were focused on minicomputers for large organizations, from DEC to Data General, Wang, Prime, Computervision, Honeywell, and Symbolics Inc.

<span class="mw-page-title-main">IBM 3270 PC</span>

The IBM 3270 PC, is a personal computer developed by IBM and released in October 1983. Although its hardware is mostly identical to the IBM PC XT, the 3270 contains additional components that, in combination with software, can emulate the behavior of an IBM 3270 terminal. Therefore, it can be used both as a standalone computer, and as a terminal to a mainframe.

<span class="mw-page-title-main">IBM JX</span> IBM PC model released in 1984

The IBM JX was a personal computer released in 1984 into the Japanese, Australian and New Zealand markets. Designed in Japan, it was based on the technology of the IBM PCjr and was designated the IBM 5511. It was targeted in the Australasian market towards the public education sector rather than at consumers, and was sold in three levels: JX (64 KiB), JX2 (128 KiB) and JX3 (256 KiB). Upgrades were available to both 384 KiB and 512 KiB. The JX was the first IBM PC to use 3.5" floppy drives.

<span class="mw-page-title-main">Home computer</span> Class of microcomputers

Home computers were a class of microcomputers that entered the market in 1977 and became common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a single, non-technical user. These computers were a distinct market segment that typically cost much less than business, scientific, or engineering-oriented computers of the time, such as those running CP/M or the IBM PC, and were generally less powerful in terms of memory and expandability. However, a home computer often had better graphics and sound than contemporary business computers. Their most common uses were word processing, playing video games, and programming.

The original IBM Personal Computer and IBM PCjr included support for storing data and programs on compact cassette tape.

References

  1. Curran, Lawrence J.; Shuford, Richard S. (November 1983). "IBM's Estridge". BYTE. pp. 88–97. Retrieved 19 March 2016.
  2. 1 2 Williams, Gregg (January 1982). "A Closer Look at the IBM Personal Computer". BYTE. p. 36. Retrieved 19 October 2013.
  3. Dahmke, Mark (January 1983). "The Compaq Portable". BYTE. pp. 30–36. Retrieved 27 July 2013.
  4. Readers' Feedback: IBM BASIC Versions, Compute! Magazine, No. 78, November 1986, p. 8, retrieved December 23, 2011
  5. IBM. PCjr Cartridges Announcement Letter. 1983-11-01 ().
  6. DOS text files terminate each line with a CR (carriage return, ASCII 13) and LF (linefeed, ASCII 10) character pair, in that order.