image of READY prompt

This page discusses, at a high level, the history of Wang BASIC and some of its salient characteristics.

Prehistory (link)

BASIC was developed at Dartmouth University by John Kemeney and Thomas Kurtz in 1964. It was intended to be an educational language, simple to learn the basic concepts of programming for college students.

BASIC was somewhat modeled on FORTRAN, and like FORTRAN, the early versions of BASIC were focused on computations. Handling textual data was not well supported. For instance, in 1964 BASIC supported an assortment of matrix operation primitives via the MAT statement, yet the only textual representation was string literals for PRINT statements.

Wang's first attempt at BASIC came not with the 2200, but the Wang 3300. The 3300 was a general-purpose processor, taking aim at the PDP-8 class of customer. Timesharing interpreted BASIC and FORTRAN were developed for the 3300, but, for various reasons, the product was unsuccessful.

The 3300 BASIC interpreter went through a few revisions. The first version was very much like Dartmouth BASIC, in that it supported all the usual BASIC constructs and MAT statements, but had only string literals. An extended BASIC was eventually developed, which added support for string variables, although the strings were allocated 18 bytes and thus no string variable could be longer than that.

Significant Characteristics of Wang BASIC (link)

Although the 2200 CPU microarchitecture was very different from the 3300 CPU, the structure of the 2200 BASIC interpreter, called Wang BASIC, borrowed heavily from the 3300 experience, to the point that the two even shared some design flaws! Nevertheless, the 2200 Wang BASIC evolved to be more powerful, both numerically and in its ability to process text data. The Wang BASIC Versions page has details of the various flavors of Wang BASIC of the first generation 2200 machines.

Here are a few important features about Wang BASIC:

Significant Characteristics of Wang BASIC-2 (link)

The 2200VP CPU used a different, more powerful, microarchitecture than the first generation CPUs had, and so the BASIC interpreter had to be rewritten. At the same time, Wang enhanced it in a number of ways, producing what is called Wang BASIC-2.

The microstore in the first generation CPUs was implemented in a number of custom mask programmed ROMs. Changing the interpreter was possible either by using a patch ROM (limited to changing just a few instructions), or by wholesale replacement of ROM sets. Either was expensive, both in materials and in the need to have a field service call to swap the hardware. The 2200VP and later CPUs used SRAM to hold the microstore. Although there was a longer boot process in order to load the interpreter off disk, the benefit was that bug fixes and enhancements could be distributed simply by mailing out new boot disks.

Wang BASIC-2 was almost 100% upwards compatible with Wang BASIC. The biggest missing feature was explicit support for the cassette tape drive. Existing syntactic features were generalized, and some of the features not found in Dartmouth BASIC but found in other contemporary interpreters, such as the "ELSE" clause, were added, and limits on array size were raised.

The BASIC-2 page has specific syntactic enhancements, but this section contains an overview.

BASIC-2 for the Wang PC (link)

Thanks to former Wang engineer John Baxi, an unreleased Wang product has now seen the light of day. The first Wang PCs were not fully IBM compatible, as Wang thought doing them one better would lead to a successful product. They'd soon learn that compatibility was valued more than enhanced features.

Although the Wang PC was released with a Microsoft GW BASIC interpreter, Wang also produced a BASIC-2 interpreter. The interpreter was running on an 8086 but was significantly slower than BASIC-2 running on a 2200VP CPU. For whatever reason, they decided not to release it.

Unfortunately, the interpreter (zip file here) does not run on standard PC hardware. I'm hoping that someone who has a still-functioning "classic" Wang PC will be able to try out the interpreter. Please, let me know if it works, and whether it is stable.


Thanks to Peter Koelewijn, you can now use the Wang-2 BASIC interpreter on your modern PC. In fact, you can run any Wang PC software on your modern PC, so long as it is running a 32b OS. (You can run it in a 32b VM DOS shell if you only have a 64b version of windows; however, I've found that the interpreter doesn't run stably running windows xp under vmware player). The second hitch is that the keyboard mapping is incomplete, rendering some program features useless.

Download this zip file, unpack the contents into some folder on your PC, then set yourself up with a DOS shell one way or another and 'cd' your way over to where you unpacked the zip file. There is nothing to install; just run the program. To run the BASIC-2 interpreter, you must type wang basic2.exe. The first part invokes the WANG.EXE compatibility layer, and the second part, BASIC2.EXE, is the program to run.

Keep in mind that CTRL-R is like hitting the RESET button on a real machine.

How fast is it? On my 2.66 GHz recent vintage Core i5 CPU, 10 FOR I=1 TO 100000000:NEXT I runs in about six seconds. This is 4200 times faster than a real Wang 2200. My 2200 emulator running full out is only 21 times faster than a real Wang 2200 due to the overhead of interpreting the original microcode.

After you are done playing around with BASIC2.EXE, you might want to check out a couple other Wang products Peter has included in the zip file. One is in the subfolder WDB, a database product, and WWP, a word processing product. It helps if you can read Dutch.

Wang BASIC-3 (link)

Because the (M)VP CPU had a writable control store, patches to BASIC-2 were easy to deploy, but there was nothing stopping Wang from supporting a completely different language if they wanted to.

In fact, Wang did develop an enhanced dialect of BASIC called BASIC-3, as well as a COBOL interpreter. These were announced and demonstrated on April 2, 1981 at the Hannover Fair, Germany. In addition to the new languages, the file system was enhanced to allow more sophisticated file management than was possible under BASIC-2.

To hold all the microcode for the new languages, a system would need a $2000 modification to double the size of its control store. Enhanced systems could simultaneously run BASIC-3 and COBOL programs, though a given partition could run only one at a time. Humorously, the engineers referred to this product as BASBOL (pronounced "baseball").

Wang even produced a COBOL coding form for the 2200. It was a behemoth at 14"x12" (35.5cm x 30.5cm).

BASIC-3/COBOL got as far as beta site testing before the project was canceled. Apparently Wang management felt that such a system was starting to encroach on the low end of the VS family and they wanted a clear distinction between the 2200 and the VS families.

2200 COBOL was ANSI 1974 Level 1 compatible, and was fully compatible with VS COBOL. BASIC-3 would have been at largely modeled after the version of BASIC developed for the 2200VS family of computers. Having forward compatibility would make sense to make it easier for customers to upgrade their systems as they grew.

Further insight into Wang's thinking can be obtained by reading these internal memos.

The best insight into what the languages looked like is to inspect the Wang BASIC-3 datasheet and the Wang 2200 COBOL datasheet. Another possible source of hints it that BASIC-3 would have been largely modeled after Version 3 of 2200VS BASIC.

If anybody still has any documents, disks, or even just recollections of BASIC-3 or COBOL for the MVP, please contact me!

Learn More (link)

More detailed summary information on Wang BASIC can be gleaned from the Wang BASIC Versions page, BASIC-2 page, as well as the Wang BASIC vs. MS BASIC page. To really get the full scoop, read the Wang BASIC manual or the Wang BASIC-2 manual.