“If you disassemble a single binary, you can never tell why something was done in a certain way. If you have eight different versions, you can tell a lot. This episode of Computer Archeology is about reverse engineering eight different versions of Microsoft BASIC 6502 (Commodore, AppleSoft etc.), reconstructing the family tree, and understanding when bugs were fixed and when new bugs, features and easter eggs were introduced. This article also presents a set of assembly source files that can be made to compile into a byte exact copy of seven different versions of Microsoft BASIC, and lets you even create your own version.”
An astounding blog, I’m in heaven. I need to get back working on my TextMate bundle for C64 programming…
that “WAIT 6502” printing microsoft is actually really cool. it was to prove they made it. i should try that next time i boot my c64.
MS BASIC was certainly pervasive, but I still can’t understand what made it popular. Of all the versions of BASIC I’ve used, MS BASIC was hands-down the worst. I would rewrite MS BASIC programs into a different dialect to avoid using it, that’s how bad it was. That was half the reason I avoided DOS – if they couldn’t even make a decent BASIC, I wasn’t about to use a disk operating system from them.
It was written in the late 70’s for computers around 1MHz with not very much RAM. Do give them a break. The C64 basic was good for the time, other than lacking built in drawing commands (that arrived later with BASIC 7 on the 128)
Agreed. It was the absolute worst BASIC on ATARI as well. BASIC XL, Action Basic, C and FORTH were all better and more interesting.
But, it clearly showed Bill’s business model. Low Quality & High Price. The only justification anyone could give was “it was compatible.”
Is it just me or is this just a strange thing to do decades after the release of Microsoft BASIC? The fact that Microsoft BASIC was pretty awful (just like pretty well everything Microsoft has ever written) doesn’t help!
If you’re looking for a 6502 BASIC that’s worthy of such reverse-engineering treatment, the *only* one worth looking at was BBC BASIC that came with the Acorn BBC Micro in the early 80’s.
I actually have the banned “BBC Micro Compendium” book that had an entire annotated disassembly of the BBC BASIC ROM and it makes for great reading. Incredibly tight and fast code coupled with more features over other BASICs made for arguably one of the greatest pieces of commercial 6502 code ever written. Oh, but it’s not American, so it doesn’t count 🙁
I thought this was an interesting exercise, and regardless of its quality, the range of machines running Microsoft BASIC made it a worthwhile choice.
I agree about BBC BASIC – even today, I think it is a handy dialect. As well as having good features (some inspired by COMAL), it was very fast compared considering the hardware. Back then, it used to annoy me to read criticisms of BASIC that didn’t actually apply to Acorn’s.
“Oh, but it’s not American, so it doesn’t count :-(”
Just like the Linux kernel? Or SAP? or SUSE Linux (used to be a german distro)? OS news isn’t even run by Americans. A lot of the readers here aren’t American. That sort of crap isn’t needed.
“”Oh, but it’s not American, so it doesn’t count :-(”
Just like the Linux kernel? Or SAP? or SUSE Linux (used to be a german distro)? OS news isn’t even run by Americans. A lot of the readers here aren’t American. That sort of crap isn’t needed.”
Agreed. Let’s leave the back-handed America-bashing to places like Digg.com. I think most of us here on OSNews are more interested in the technology – no matter where it came from 😉
Edited 2008-10-27 15:17 UTC
Well I had more exposure to MSX Basic myself (also from MS), which IMHO wasn’t that bad, compared to what I knew from other systems around at the time. If anything, Basic simply is a crappy language by nature, some dialects just worse than others.
As for BBC Basic, one feature it shares with the Acorn Electron (where I encountered it first) is the inline assembler. You’d put some specially marked section with assembler code right into your Basic program, even use some Basic variables in there as constants / arguments, and upon running the Basic program the computer would assemble that section, replace the Basic variables with their current values, and thus execute the assembler code as a seamless part of your Basic program.
We all know these low-powered machines were begging to be programmed in machine code, and there exist many ways to mix machine code with Basic (or other languages), but I thought this was a really nifty way to do it. And lower the barrier for using assembly code. Which is great, since for higher level language users it isn’t easy to get started with extremely low-level assembly. That was true back then, and still is. Perhaps even more today. Tools may be better these days, but the distance between machine code and modern-day, popular languages is bigger than ever.
This is how I got into assembly language programming on my Archimedes when I was a kid – I wrote things in BASIC and then gradually began to add more and more assembly language. It was also handy to have all of the features of BASIC at hand. For example, for the quick creation of a lookup table.