ArticleslgStudy

computer science

IBM BASIC

IBM BASIC is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand IBM BASIC rather than just read about it. In short: 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.

IBM BASIC — main illustration
IBM BASIC — illustration

Key takeaways

  • IBM BASIC belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect IBM BASIC to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of IBM BASIC from memory before moving on to harder problems.

Reference excerpt

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.

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 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 (BASIC.COM) was included in the original IBM PC DOS. 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 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.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 pixels, similar functions to draw lines and circles and to set colors, and event handling 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 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.

… excerpt ends here. Continue reading the full article.

Illustrations

IBM BASIC illustration
IBM BASIC illustration
IBM BASIC illustration

Worked examples

Example 1 — a first encounter with IBM BASIC

Start with the simplest possible case. Write down what IBM BASIC claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to IBM BASIC before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about IBM BASIC ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of IBM BASIC

In research
IBM BASIC appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses IBM BASIC in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
IBM BASIC is common in secondary-school and first-year university syllabi. It links to neighbouring topics BASIC interpreters, BASIC programming language family, Discontinued Microsoft BASICs, so understanding it makes those chapters shorter.
In everyday life
Look for IBM BASIC outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “IBM BASIC” →

How to study IBM BASIC in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what IBM BASIC means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain IBM BASIC out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is IBM BASIC in simple terms?

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.

Why does IBM BASIC matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study IBM BASIC?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on IBM BASIC.

Tags

  • BASIC interpreters
  • BASIC programming language family
  • Discontinued Microsoft BASICs
  • IBM software
  • Microsoft programming languages
  • Programming languages created in 1981
  • X86 IBM personal computers

Keep exploring