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.

5 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!

  4. jeopardy game online said,

    October 7, 2014 at 8:02 pm

    When someone writes an article he/she maintains the plan of a user in his/her brain that how a user can understand
    it. So that’s why this post is great. Thanks!

  5. mobile website design london said,

    October 8, 2014 at 7:33 am

    I’ll right away take hold of your rss feed as
    I can’t find your email subscription link or e-newsletter service.
    Do you’ve any? Please permit me realize so that I
    may subscribe. Thanks.

Leave a Comment