IBM ROM BASIC

Introduction
Availability on IBM Hardware
BASIC Versions
   ROM BASIC Versions
   BASIC.COM/BASICA.COM Versions
BIOS Interrupt Handlers
BASIC Documentation
Further Reading

Content by Tomáš Slavotínek and David Beem (original HERE). Last update: 04 Mar 2024


Introduction

IBM ROM BASIC, officially called IBM Personal Computer BASIC or IBM Cassette BASIC, is an interpreter that allows the user to write and run BASIC programs. In its original form, it takes 32 KB of ROM space and does not require an operating system to run. The main advantage of this implementation is its small RAM footprint (the code is executed directly from ROM). On the original IBM PC/XT/AT systems and early PS/2 machines, it acts as the default user interface invoked by the BIOS through Int 18h if no bootable device is found (and cannot be terminated once entered). Mid-era PS/2 machines still come with ROM BASIC, but it's no longer accessible on boot. Late PS/2s come either with an incomplete 5 KB ROM BASIC stub or lack it completely.

Additionally, the ROM BASIC code is used by IBM DOS executables BASIC.COM and BASICA.COM. These programs provide slightly enhanced versions of the IBM Cassette BASIC interpreter called IBM Disk BASIC and IBM Advanced BASIC respectively (or just IBM Personal Computer BASIC). The main improvement is the ability to load and save programs from/to a floppy disk. The user is also allowed to exit BASIC.COM/BASICA.COM and return to the OS (DOS).

It is unclear whether IBM included ROM BASIC with their later machines for compatibility reasons or to fulfill their legal obligations to Microsoft.

The following text is a quote from Frank Van Gilluwe's "The Undocumented PC" published by Addison Westley (Chapter 7, "Interrupt Vector Table", 2nd Edition, Page 294, INT 18h, "ROM BASIC/Boot Failure" description; available online HERE):

"[..] Almost no other manufacturer puts BASIC in the BIOS like IBM. I understand that the original agreement between Microsoft and IBM offered IBM a reduction in royalties if every machine included Microsoft's BASIC in ROM. Because of this, every IBM system still has the obsolete ROM BASIC as part of the system BIOS."

If you know more about this topic, please Contact Us.


Availability on IBM Hardware

Complete 32 KB ROM BASIC, Accessible on Boot

Most all IBM machines from the original IBM PC 5150 to the systems just below the 1991 PS/2s (pre-IML):

  • IBM PC
  • IBM XT
  • IBM XT 286
  • IBM Portable PC
  • IBM PC Convertible
  • IBM PCjr
  • IBM AT
  • PS/2 Model 25
  • PS/2 Model 30
  • PS/2 Model 25 286
  • PS/2 Model 30 286
  • PS/2 Model 50
  • PS/2 Model 55 SX
  • PS/2 Model 60
  • PS/2 Model 65 SX
  • PS/2 Model 70
  • PS/2 Model P70 (and P75?)
  • PS/2 Model 80

Two-stage ROM systems with IML option:

  • PS/2 Model 90 w/ Type 0 "Minus" Processor Complex (256 KB ROM)

One use for the BASIC interpreter on otherwise non-bootable MCA machines is to find out which adapters are installed (see HERE).

Complete 32 KB ROM BASIC, Inaccessible on Boot

Most IML systems:

  • PS/2 Model 76/77 (w/ "Bermuda" planar)
  • PS/2 Model 90/95 w/ Type 1 Processor Complex
  • PS/2 Model 90/95 w/ Type 2 Processor Complex
  • and more...

Incomplete 5 KB ROM BASIC Stub

Selected IML systems:

  • PS/2 Model 56/57 SX/SLC
  • PS/2 Model 56/57 SLC2/3
  • PS/2 Model 90/95 w/ Type 3 Processor Complex
  • IBM ThinkPad 700

No ROM BASIC Present

Flash-based systems (mostly w/ SurePath BIOS):

  • PS/2 Model 76/77 i/s (w/ "Lacuna" planar)
  • PS/2 Model 85 "X" (w/ Type 1 planar)
  • PS/2 Model 85 "K/N" (w/ Type 2 planar)
  • PS/2 Model 90/95 & PC Server 500 w/ Type 4 Processor Complex
  • PC Server 320/520
  • PC Server 720

BASIC Versions

You can tell what version of BASIC you are using by looking at the version identifier in the BASIC startup message.

The version identifier starts with a letter where:

  • C indicates Cassette BASIC (ROM BASIC)
  • D indicates Disk BASIC (BASIC.COM)
  • A indicates Advanced BASIC (BASICA.COM)
  • J indicates Cartridge BASIC (the J stands for "Junior")

The number after the identifier tells you which revision you are using. Some BASIC editions had only one revision other have gone through multiple.

For instance, Cassette BASIC on the PCjr is Version C1.20, while the PCjr's Cartridge BASIC identifies itself as Version J1.00, indicating that cassette BASIC was revised twice but cartridge BASIC has not yet been revised.

ROM BASIC Versions

There are three different versions of IBM ROM BASIC:

SystemVersion/Copyright StringSize
IBM PC (w/ early 16-64 KB planar)"The IBM Personal Computer Basic"
"Version C1.00 Copyright IBM Corp 1981"
32 KB
IBM PC (later), XT, XT 286, AT, PS/2 (except late)"The IBM Personal Computer Basic"
"Version C1.10 Copyright IBM Corp 1981"
32 KB
IBM PCjr"The IBM Personal Computer Basic"
"Version C1.20 Copyright IBM Corp 1981"
32 KB

Note: The 5 KB stub present in some PS/2 system ROMs consists of the first 5120 bytes of the C1.10 image.

BASIC.COM/BASICA.COM Versions

Multiple versions of Disk BASIC and Advanced BASIC were released over the years:

ExecutableVersion/Copyright StringDateExpected
ROM BASIC
location
PC DOS 0.90 pre-release
BASIC.COM"The IBM Personal Computer Basic"
"Version D1.00 Copyright IBM Corp. 1981"
4-Jun-81seg. F600h
BASICA.COM"The IBM Personal Computer Basic"
"Version A1.00 Copyright IBM Corp. 1981"
4-Jun-81seg. F600h
BAS18.COM"The IBM Personal Computer Basic"
"Version D1.00 Copyright IBM Corp. 1981"
4-Jun-81seg. 1800h 1)
BAS18A.COM"The IBM Personal Computer Basic"
"Version A1.00 Copyright IBM Corp. 1981"
4-Jun-81seg. 1800h 1)
PC DOS 1.00
BASIC.COM"The IBM Personal Computer Basic"
"Version D1.00 Copyright IBM Corp. 1981"
4-Aug-81seg. F600h
BASICA.COM"The IBM Personal Computer Basic"
"Version A1.00 Copyright IBM Corp. 1981"
4-Aug-81seg. F600h
PC DOS 1.10
BASIC.COM"The IBM Personal Computer Basic"
"Version D1.10 Copyright IBM Corp. 1981, 1982"
12-Apr-82seg. F600h
BASICA.COM"The IBM Personal Computer Basic"
"Version A1.10 Copyright IBM Corp. 1981, 1982"
12-Apr-82seg. F600h
PC DOS 2.00
BASIC.COM"The IBM Personal Computer Basic"
"Version D2.00 Copyright IBM Corp. 1981, 1982, 1983"
17-Jan-83seg. F600h
BASICA.COM"The IBM Personal Computer Basic"
"Version A2.00 Copyright IBM Corp. 1981, 1982, 1983"
17-Jan-83seg. F600h
PC DOS 2.10
BASIC.COM"The IBM Personal Computer Basic"
"Version D2.10 Copyright IBM Corp. 1981, 1982, 1983"
21-Jul-83seg. F600h
BASICA.COM"The IBM Personal Computer Basic"
"Version A2.10 Copyright IBM Corp. 1981, 1982, 1983"
21-Jul-83seg. F600h
PC DOS 3.00
BASIC.COM"The IBM Personal Computer Basic"
"Version D3.00 Copyright IBM Corp. 1981, 1982, 1983, 1984"
6-Jul-84seg. F600h
BASICA.COM"The IBM Personal Computer Basic"
"Version A3.00 Copyright IBM Corp. 1981, 1982, 1983, 1984"
4-Jul-84seg. F600h
PC DOS 3.30
BASIC.COMcalls BASICA.COM
BASICA.COM"The IBM Personal Computer Basic"
"Version A3.30 Copyright IBM Corp. 1981, 1982, 1983, 1984, 1985, 1986, 1987"
13-Nov-86seg. F600h
PC DOS 4.00/4.01
BASIC.COMcalls BASICA.COM
BASICA.COM"The IBM Basic"
"Version A4.00 Copyright IBM Corp. 1981, 1988"
?seg. F600h
PC DOS 5.00/5.02
BASIC.COMcalls BASICA.COM
BASICA.COM"The IBM Basic"
"Version A3.40 Copyright IBM Corp. 1981, 1987" 2)
?Int 15h AH=22h
seg. F600h 3)
MS-DOS 1.00 - 3.10 (OEM Compaq build checked)
BASIC.COMcalls BASICA.EXE
BASICA.COMcalls BASICA.EXE
BASICA.EXEstandalone, no ROM BASIC required
MS-DOS 3.20+ (selected retail builds checked)
GWBASICstandalone, no ROM BASIC required

Notes:

  1. The same executable as BASIC.COM/BASICA.COM aside from the seg. value. Seg. 1800h points to RAM (96 KB) instead of ROM on a regular PC/PC-compatible machine.
  2. Lower version number compared to BASICA.COM shipped with PC-DOS 4.0x.
  3. The fallback seg. F600h is used only if Int 15h AH=22h is not implemented (see below).

BIOS Interrupt Handlers

Int 15h AH=22h — ROM BASIC Support

Supported Machines:IML image of Type 3 complex, 8556/7, 9556/7, ThinkPad 720C (return address in ES:BX)
Type 4 complex, 85 K/N (not X!), Lacuna, Server 320/520, Server 720 (return CF=1)
On Return:
(ES:BX) - Pointer to ROM BASIC
CF = 0 - Operation successfully completed
   = 1 - Request failed (i.e. no ROM-resident BASIC)
(AH) - Return code
   = 00H - Operation successfully completed
   = 86H - Function not supported (ROM BASIC is at address F600:0000h)

The address returned in registers ES:BX may not point directly to BASIC but instead to a routine which copies the BASIC block from a non-standard location to the expected one before transferring control to it.

Late (flash-based) PS/2 systems completely lack ROM-resident BASIC and the interrupt handler returns AH=1 ("Request failed") to indicate this fact.

This call is used by BASICA.COM shipped with PC DOS 5.00/5.02 and later.

Int 18h — Resident BASIC

Supported Machines:All (functionality differs)
IVT Entry Address:0:0060h - 0:0063h

This interrupt call does not return.

Called by POST if no bootable device is found. On older machines this invokes the ROM-resident BASIC interpreter. On later machines it triggers an error message (typically I9990305 "No startable device") and halts the machine.

The Remote Initial Program Load (RIPL/RPL) procedure also hooks this interrupt. If installed, the RPL handler is called instead of the regular Int 18h handler, allowing for network boot if no startable device is found locally.

Int 80h to 85h

Reserved for BASIC.

Int 86h to F0h

Used by BASIC interpreter when running BASIC.


BASIC Documentation


Further Reading

Content created and/or collected by:
Louis F. Ohland, Peter H. Wendt, David L. Beem, William R. Walsh, Tatsuo Sunagawa, Tomáš Slavotínek, Jim Shorney, Tim N. Clarke, Kevin Bowling, and many others.

Ardent Tool of Capitalism is maintained by Tomáš Slavotínek.
Last update: 29 Sep 2024 - Changelog | About | Legal & Contact