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:
- 0xF9: Older BASIC using IEEE floating point.
- 0xF1: Newer BASIC using IEEE
- 0xF3: Newer BASIC using Microsoft's decimal floating point.
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.
If anyone's got
- 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,
I would be really grateful if you'd send me copies to look at.
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
from it.)
-rwxr-xr-x@ 1 switham staff 18256 Mar 31 2020 decode_ms_basic.py_txt
-rw-r--r-- 1 switham staff 29350 May 9 2008 pyramus7_hits_french.mid
-rw-r--r-- 1 switham staff 2233 May 9 2008 pyramus7hits.qb
This ls -l style index was made with a
php script.
--Steve Witham
Up to my home page.