Microsoft QuickBASIC Decoder
The program below makes an attempt at converting a tokenized Microsoft QuickBASIC
program into readable ASCII text. It was helped along by
this old article and by experimenting with BASIC files I had on my Mac.
Some of them go back to the mid-'80s and I think some were saved by
GWBASIC on a PC.
You run the program like this:
decode_ms_basic.py <basic_program >basic_program.txt
MS BASIC programs start with a byte that seems to give version information.
The values I've seen are:
From this slim evidence I have guessed that the 0x08 bit being off says it's the newer BASIC format
(4- vs. 3-byte GOTO labels, symbol table instead of variable names inline...), and that
the 0x02 bit means decimal arithmetic.
- 0xF9: Older BASIC using IEEE floating point.
- 0xF1: Newer BASIC using IEEE
- 0xF3: Newer BASIC using Microsoft's decimal floating point.
If anyone's got
I would be really grateful if you'd send me copies to look at.
- Microsoft BASIC programs that start with a byte not in the set above,
- programs old enough to use MBF, the Microsoft Binary Format
for floating point, that have floating-point constants within the program, or
- newer QBASIC programs,
And of course any reports of experiences with this program are welcome.
(pyramus7hits.qb is the BASIC program that motivated me to do this;
pyramus7_hits_french.mid is a MIDI-fied version of the output I rescued
-rwxr-xr-x 1 sw staff 18043 May 9 13:36 decode_ms_basic.py
-rw-r--r-- 1 sw staff 29350 May 9 14:34 pyramus7_hits_french.mid
-rw-r--r-- 1 sw staff 2233 May 9 14:34 pyramus7hits.qb
This ls -l style index was made with a
Up to my home page.