GW-Basic Program Decoder

GW-BASIC (aka GWBASIC or Gee-Whiz Basic) was a BASIC interpreter developed by Microsoft and bundled with MS-DOS until the advent of QBASIC with MS-DOS 5.0. GW-BASIC stored programs in memory at a time when memory was very scarce. Hence it used a compact, binary representation of code. It used this same binary format for code saved on disk, which makes it hard to read GW-BASIC programs nowadays.

Or at least it used to. Thanks to this site, I was able to write a decoder in Python. Upload your .BAS file below and you’ll get a human-readable version of the program back out. Enjoy!

Upload .BAS file:

If you’d like to see the source code, it’s available here.

Note This program is incomplete — it doesn’t correctly parse double-precision values yet.

3 Comments »

  1. danvk.org » Reading Old GW-Basic Programs said,

    February 3, 2008 at 3:50 am

    [...] GW-Basic Program Decoder [...]

  2. Basic Guru said,

    February 28, 2011 at 10:44 pm

    Thanks for the translator! Unfortunately it did have some bugs and did not parse the entire program… I found it easier to just run basic.exe, load the old programs, and then save “program.bas”,A which saves the code back out as ASCII.

  3. Rob Hagemans said,

    December 22, 2013 at 5:07 am

    Thank you for the great work on the decoder and for sharing the source!

    Your example, Mr De Forest’s page on the file format and some unexpected time on my hands have led to PC-BASIC, a free python-based GW-BASIC interpreter you can find at https://sourceforge.net/p/pcbasic/. It runs ascii, tokenised as well as protected BASIC programs. Have a look!

Leave a Comment