Skip to content

SOFTWARE ARCHIVE / 1983

GW-BASIC

Programming

The BASIC interpreter that came with MS-DOS on almost every compatible: line numbers, the Ok prompt and the first programming lesson for millions of people.

A window into the history of our computers.

Cover of GW-BASIC
COMMUNITY RATING

— no rating yet

Platform
MS-DOS
Year
1983
Category
Programming
Developer
Microsoft
Language
English
HISTORY / CONTEXT / FEATURES

Inside GW-BASIC

Turn on the PC, type GWBASIC, and you land on a black screen with Microsoft’s copyright notice, the count of available bytes, and a single lonely word: Ok. Along the bottom, a row of function-key shortcuts: LIST, RUN, LOAD, SAVE. This is how millions of people started programming, with GW-BASIC, the interpreter that came on the MS-DOS floppy disks of almost every compatible. All it took was typing 10 PRINT «HELLO», 20 GOTO 10 and RUN for the computer to obey, and for a hobby to begin that, in many cases, ended up becoming a career.

History: the BASIC that didn’t need a ROM

The original IBM PC carried a BASIC burned into its ROM, and the BASICA that IBM distributed on disk relied on it. Makers of compatibles couldn’t copy that ROM, so Microsoft built a complete, self-contained interpreter on the basis of BASICA, functionally identical but with no need for the Cassette BASIC in IBM’s chip. The first version of GW-BASIC was the one included in Compaq DOS 1.13, released with the Compaq Portable in 1983, and it was the equivalent of IBM’s BASICA 1.10.

For years, each manufacturer shipped it with its own version of MS-DOS, sometimes under the name BASICA.EXE and sometimes with extras of its own: the AT&T and Tandy versions took advantage of the improved sound and graphics of their machines, and buyers of Hercules cards received HBASIC, with support for their 720×348 monochrome mode. For anyone who needed more speed, Microsoft sold BASCOM, a compatible compiler, separately.

And what does GW stand for? There are several theories, from «Graphics and Windows» to «Gates, William». Greg Whitten, one of Microsoft’s earliest employees, says the name was chosen by Bill Gates and that he himself called it Gee-Whiz BASIC. Gates, in an article marking BASIC’s 25th anniversary, wrote that GW-BASIC was short for «Gee Whiz».

What made it special

  • Direct mode: any command without a line number ran immediately, like a calculator; with a number, it became part of the program.
  • Screen editor: you could move the cursor over any visible line, fix it, and press Enter to store it in the program.
  • Function keys: the bottom row reminded you of the shortcuts for LIST, RUN, LOAD, SAVE and other common commands.
  • Music with PLAY: a small note language let you compose melodies for the PC speaker; SOUND gave finer control over frequency and duration.
  • Graphics and peripherals: commands for drawing in CGA and, from version 3.20, in EGA, plus joystick, light pen and serial port support.
  • Files: reading and writing disk files, and programs saved in a compact tokenized format or, if requested, as ASCII text.

Versions that defined an era

  • GW-BASIC with Compaq DOS 1.13 (1983): the first one, equivalent to BASICA 1.10, with no subdirectory support.
  • Later versions: bring the subdirectories of MS-DOS 2 and graphics improvements.
  • GW-BASIC 3.20 (1986): EGA graphics support and the last major new version. No version ever supported VGA.
  • GW-BASIC 3.22 and 3.23: the final revisions; 3.23 carries a copyright of 1983 to 1988.
  • QBasic (1991): its replacement in MS-DOS 5.0, derived from QuickBASIC 4.5.

Legacy

Since it came with almost every version of MS-DOS, GW-BASIC was for many people the cheapest way to learn the fundamentals of programming. The writer Mark Jones Lorenzo considers it perhaps the non plus ultra of Microsoft’s line-numbered BASIC family, which goes back to Altair BASIC. Its reign ended with MS-DOS 5.0, which replaced it with QBasic, a cut-down version of QuickBASIC.

On May 21, 2020, Microsoft released the 8088 assembly source code of GW-BASIC, as it stood in 1983, on GitHub under the MIT license. The repository is offered as a historical reference, with no tools to build it and no executables, and it does not accept changes. Reading it is a glimpse of how programming was done back then: all in assembly, without a single line of C.

Here we preserve GW-BASIC 3.2 on the third floppy disk of a 1988 MS-DOS 3.3, a bootable image with the interpreter ready to use.

A look at the program

See screenshots ↗
VISUAL ARCHIVE

Full screenshots of the program. Tap to enlarge and move from one to the next.

GW-BASIC / visual archive
GW-BASIC 3.23 startup screen with the Ok prompt and the function key row Enlarge
EXPLORAR0102030405
Image sources ↗
USER MANUAL

Back to the desktop.

01Using GW-BASIC 3.2 in DOSBox and writing your first program

Reference environment: DOSBox 0.74-3 (or DOSBox Staging) on Windows, macOS or Linux. The package is a 5.25-inch, 360 KB floppy disk image (.img format) with MS-DOS 3.3 and GWBASIC.EXE version 3.2.

Before you start

Save the image in a short folder, for example C:\RETRO\GW, and rename it to something simple, like gwbasic.img, so you can type it without mistakes. Also create an empty folder, for example C:\RETRO\PROG, where you will save your programs.

Step by step

  1. Open DOSBox and mount the working folder as a hard drive with mount c C:\RETRO\PROG.
  2. Mount the floppy disk with imgmount a C:\RETRO\GW\gwbasic.img -t floppy.
  3. Type C: to work in your folder, so programs are saved there.
  4. Start the interpreter with A:GWBASIC.
  5. Type your first program, line by line, pressing Enter at the end of each one: 10 PRINT "HELLO" and 20 GOTO 10.
  6. Run it with RUN and stop it with Ctrl+Break (in DOSBox, Ctrl+C also works).
  7. Save it with SAVE "HELLO" and return to DOS with SYSTEM.

Check that it works

On startup you will see the version, Microsoft’s copyright, the available bytes and the Ok prompt, with the row of function keys at the bottom. F1 is the same as LIST and F2 the same as RUN. Try music with PLAY "CDEFGAB" and a graphic with SCREEN 1 followed by CIRCLE (160,100),50.

If something goes wrong

If DOSBox can’t find the image, check the path and the file name. If an old program runs too fast, lower DOSBox’s speed with Ctrl+F11. You can also boot the machine from the floppy disk, like a PC of the era, with boot a: after mounting it: it will load MS-DOS 3.3 and all you need to do is type GWBASIC.

Downloads and resources

Sources and documentation9

¿Lo utilizabas?

Comparte tu experiencia con GW-BASIC o resuelve una duda con la comunidad.

Conversar en el foro ↗
SHARED MEMORY / SOFTWARE

Your desktop.
Your memories.

Vuelve a compartirlos.

Someone else remembers GW-BASIC. Send them this page and head back to that desktop together.

YOUR RETRO POSTCARD
CLÁSICOS
BÁSICOS.
ARCHIVO
OF SOFTWARE
Esto estaba
on my computer.
Cover of GW-BASIC
GW-BASIC1983 CLASICOSBASICOS.ORG

A memory to keep. A story to send.

THE ARCHIVE IS STILL OPEN

More software worth a look.