Microsoft Releases The Source Code You Wanted Almost 30 Years Ago

In the late 1970s and early 1980s, if you had a personal computer there was a fair chance it either booted into some version of Microsoft Basic or you could load and run Basic. There were other versions, of course, especially for very small computers, but the gold standard for home computer Basic was Microsoft’s version, known then as GW-Basic. Now you can get the once-coveted Microsoft Basic source code for the 8086/8088 directly from Microsoft in the state you would have found it in 1983. They put up a read only GW-BASIC repository, presumably to stop a flood of feature requests for GPU acceleration.

You might wonder why they would do this? It is certainly educational, especially if you are interested in assembly language. For historical reasons, you might want to get a copy you could modify, too, for your latest retrocomputer project.

There are a few tidbits of interest. Some of the source is marked that it was translated. Apparently, Microsoft had a master implementation for some processor — real or imagined — and could translate from that code to 8088, Z-80, 6502, or any other processor they wanted to target.

From what we understand, GW-Basic was identical to IBM’s BASICA, but didn’t require certain IBM PC ROMs to operate. Of course, BASICA, itself, came from MBASIC, Microsoft’s CP/M language that originated with Altair Basic. A long lineage that influenced personal computers for many years. On a side note, there’s debate on what the GW stands for. Gee-Whiz is a popular vote, but it could stand for ‘Gates, William’, Greg Whitten (an early Microsoft employee), or Gates-Whitten. The source code doesn’t appear to answer that question.

We did enjoy the 1975 copyright message, though:

ORIGINALLY WRITTEN ON THE PDP-10 FROM
FEBRUARY 9 TO APRIL 9 1975

BILL GATES WROTE A LOT OF STUFF.
PAUL ALLEN WROTE A LOT OF OTHER STUFF AND FAST CODE.
MONTE DAVIDOFF WROTE THE MATH PACKAGE (F4I.MAC).

It wasn’t long ago that Microsoft released some old versions of MSDOS. If you have the urge to write some Basic, you might pass on GW-Basic and try QB64, instead.

GW-Basic Disk and Manual photo by [Palatinatian] CC-SA-4.0.

65 thoughts on “Microsoft Releases The Source Code You Wanted Almost 30 Years Ago

  1. Excellent move from MS, I was never too sure why this doesn’t happen more often.

    EA have promised to release some source code recently too. I think for some of the older C&C/Red Alert games.

    Why the hell not?

  2. I saw this in my Google watcher list today. Oddly enough one of those, “It must have been abandoned someplace so I’ll release it.”, places, decided to release the OEM kit for DOS3.3, yes DOS3.3 the one most of us ran on our machines before we ran off into a penguin colony.

  3. I had MS Basic copy #2 for my KIM-1 board, on a cassette tape. So it was for the 6502. I could never get it to run. When I called MS in Albuquerque, I could never get past a secretary. Gates learned early.

  4. Back in the early 80s I ported and repurposed Dr Dobbs Tiny Basic for the 6800 to the 6809 for a smart debug monitor (on a RS Rainbow computer) that had decimal floating point (emulation of course), variables that were float, bytes, and 16 bit “words”. I could use mixed base math to set variables or even breakpoints. That was super hard, but fun!

    1. By “rainbow computer” are you referring to the color computer? I had a coco2 and subscribed to rainbow and hot-coco, but never heard the computer itself called rainbow.

      1. That sounds right. I don’t have mine handy, but wasn’t there a tiny rainbow on the logo on the computer? But yes, I’ve never heard it called “Rainbow”,just tye magazine named tgat.

        Dr. Dobbs did have a Tiny BASIC for the 6809, though a bit later obviously.

        I thought by definition Tiny BASIC didn’t do fliating point,but it’s been a !ong time.

        1. Dr Dobbs published a whole series of Tiny Basics that they compiled into a book. That included the 6800 based version (no 6809 version was ever published) that I ported to the 6809 and then converted into my “tiny basic” 6809 debug monitor. I am so certain it had floating point, albeit the BCD variety, but I can’t find any of my old notes nor the compiler collection book (yet). Maybe before I die?

          1. “Santa Barbara Tiny BASIC for 6809’s” in Dr. Dobbs for May 1981, (reprinted in the collected volume 6), which obviously makes it later than the original wave. It’s said to be based on Palo Alto Tiny BASIC in the fifth issue of Dr. Dobbs.

            Carl D. Warren apparently had a tiny language, VTL-09, for the 6809, based on VTL-2 for the Altair 680B. I remembered it as a Tiny BASIC. It’s mentiined in his “6809 Cookbook” from Tab Books, 1980. He mentioned tge book in his column in Popular Electronics, actually warning people to not buy it. One reason was that chapter on VTL-09, because Tab had left out the source code, so there wasn’t much point of the chapter . He had other complaints about the finished book.

            The Radio Shack Color Computer was close to the circuit published by Motorola in an application note. Legit since the point was to get companies to buy the 6809. It not only used the 6847, but the 6883 dynamic memory controller.

          2. Thanks for the info. wasn’t aware of the later publication of “Santa Barbara Tiny BASIC for 6809’s” (I may have let my subscription lapse), but maybe it’s on one of my many Dr Dobbs CDs I got years later. Nor was I aware of any of the works by Carl D. Warren (barring senility). Good info. Probably would have come in handy on my contract job.

      2. My bad — you’re totally right. I think got the rainbow term from an even older Motorola 6800 dev board sporting a MC6847 video controller with an MC1341 video RF modulator that allowed using an old NTSC TV as a monitor. The latter two were also used on the CoCo. I even got to play with the Coco’s Unix in the form of MIcroware’s OS-9 which required dual floppies and was sooo slow. The final 6809 embedded project used a simpler board I designed and built.

        I developed the 6809 code on a old PC clone using a “cross-assembler”.

  5. My theory is that MS resists releasing a lot of very old code because their current products are still built on that indian burial ground so to speak. They’ve never re-written or truly invented anything; Windows 10 is like built around some kind of crusty DOS core from the eighties that’s throwing sparks and leaking fluid everywhere and has a million other things bolted haphazardly around it. And inside that core is some even older stolen CP/M code, probably.

      1. Hmmm. I’d believe it when I see it. Certainly doesn’t seem like they did; 10 has lots of strangely archaic holdovers that they’re slowly re-skinning with metro ui. But maybe.

        1. Don’t mistake compatibility for identical implementation. There had to be drastic, under-the-hood re-engineering done moving from 16 -> 32, and later 32 -> 64bit architectures, but much of the old APIs had to be preserved or emulated so software didn’t break. You might deride the fact that Windows still bares echos of CP/M compatibility 40-odd years later, and much of MS would likely agree. But they also have to deal with decades-long support contracts. Look at their attempts to sell Windows on ARM: All people care about is whether they can run their old software on it.

      2. I remember when MS was releasing new versions of Explorer claiming each of them was “completely rewritten” but they share a lot of the same bugs. Unless by “rewriting” MS meant just retyping again the same it was clear that they didn’t rewrite much.

      3. Given how it operates I always assumed Vista was the first in a new generational kernel design and the proceeding OSs built off that.

        Plus, super buggy when it was released (right up until it was shelved) which always smacks of new architecture to me. 7, 8, and 10 seemed much better iterations out of the gate.

      4. The breakpoint was Windows XP, which was based more on NT which was a clean new OS from the creators of the VAX architecture and OS. DOS stuff was still supported but at that point mostly in emulation or with wrappers. Win 8 was a further departure, abandoning some of the compatibility points that XP had been designed to maintain.

    1. You’re thinking of the Windows 9x famliy (Windows 3.x, Windows 95, Windows 98, and (the last in that line) Windows ME). The Windows 10 lineage goes back through Windows NT which was written from scratch at Microsoft in the 90’s.

      1. Sorry to disappoint you but much of NT, like MS-DOS before it, originated at D.E.C. Along with the primary architect, Dave Cutler, and the rest of the development team.

        1. “Sorry to disappoint you but much of NT, like MS-DOS before it, originated at D.E.C. Along with the primary architect, Dave Cutler, and the rest of the development team.”

          100% true! True in the sense that MS-DOS did not originate at DEC and Cutler was at Microsoft when he and his team developed Windows NT.

          1. I’m not sure what you’re trying to say there…

            Microsoft have never denied that Windows NT was based on Dave Cutler’s work on VMS while he was at D.E.C. That’s why they hired him and the others.

            The origins of MS-DOS are a bit more ‘cloudly’ and not helped by Paul Allen having repeatedly lied about it.

            The most damning is probably his claim that he had never had access to the CP/M source code which he later admitted was untrue. Apparently he’d ‘only used it as an API reference’.

        2. Interestingly enough though…. MS was working jointly with IBM on OS/2 right up until the point they had NT ready to be released.

          The conspiracy theorist in me likes to scream at me…. pointing out how OS/2 had big issues right up to the point where MS left the partnership on the OS. It was after MS left, and they completed the WARP version of OS/2 that OS/2 came out strong… but it was a little too late by that time as the OS developed a bad rep. MS released their OS shortly after dissolving their partnership…. and oddly…. some of the elements of NT had some minor resemblance to OS/2 names. (hpfs, ntfs, for example.) That conspiracy theorist in me also likes to point out how OS/2 wasn’t so good until MS left, and how fast NT was released after…. as in corporate espionage.

          of course this could be all coincidence and MS actually played fair.

      2. “written from scratch” probably isn’t 100% accurate. new kernel likely, as the were swapping out the msdos foundation for something more up to date, but i very much doubt it was a 100% new code. i mean if you have a module for windows 9x, and you can get it to compile and run under nt, why bother rewrites of those. i doubt they started a new codebase for notepad every time they put out a new version of windows.

        1. Free enterprise – if they’re so “miserable” – they can quit anytime. Instead, they stay put and complain about having a job uh ?

          Might be part of the problem: Homer Simpson work ethic – “if you don’t like your job, you don’t strike, you just go in everyday and do your job half ass – that’s the American way !”….. lmao

          1. It’s called venting. At some point in the evolutionary history of humans we realised that we can talk about our feelings and they might become more tolerable.

            There is never a guarantee that a sudden career change will make you happier but admittedly I’m proof that it can happen.

          2. “they can quit anytime”

            Yes, they probably could. But between the ‘no-compete’ clauses in their employment contracts and ‘no-poaching’ agreement between all the major employers in that section of the industry, they’re chances of getting another job are effectively nil.

  6. I started on Commodore basic and then switched to assembly. I’ve found that just about any language is better than basic. I’d love to see the source to MASM or their Pascal or C compiler.

  7. GW Basic was BASICA or close enough that a user couldn’t tell the difference. The same code would run either place. At the time people called it Gee Wiz Basic though I never heard what it was officially. As an old interpreted BASIC, it was relatively sophisticated. I recently got an Altair clone and wrote some little programs in the 4k Basic. I had forgotten how limited it was.

      1. You’re thinking of CP/M. MSDOS/PCDOS started out as 86-DOS, which was based itself on CP/M. DR-DOS was much later, by which point Microsoft had managed to beat Digital Research on price and software library. It was designed to be compatible with MSDOS 3, but with improvements and extensions they’d developed. By that point, though, it was already a vicious cycle trying to compete with MS.

  8. Not sure how close GW-BASIC is to it, but the original 8086 release (MBASIC-86) was a straight port of their 8080 version (MBASIC-80). It might even have been done mechanically: the BYTE review of the original IBM-PC noted its BASIC was slower than a 4MHz Z80’s, including multiplication & division, even though the 8088 had assembly multiply & divide instructions and the 8080/Z80 didn’t. A dumb one-to-one assembly translation would do that.

    The original Altair 8080 code has been examined at http://altairbasic.org/. That source said:

    00560 PAUL ALLEN WROTE THE NON-RUNTIME STUFF.
    00580 BILL GATES WROTE THE RUNTIME STUFF.
    00600 MONTE DAVIDOFF WROTE THE MATH PACKAGE.

    There were 4K, 8K, “Extended” and other versions. It would be great if the original 8080 version 5 source was released, though I think it has leaked in some CP/M collections.

    Most hobbists would have seen the 6502 version. That one was thoroughly dissected in the 1980’s, and the source has leaked recently. Michael Steil has a hexpla of different disassemblies at https://www.pagetable.com/c64ref/c64disasm/. His site has a lot of details, and one page on the WAIT 6502 easter egg MAY have a comment by Bill Gates himself.

    1. It was a joke. Just a funny way of saying that any “improvement” to GW-Basic would be pointless because of the historical purpose of the repositery. It is not meant to be used as a modern development tool. It is more like a museum piece, which should remain untouched.

  9. I had personal computers in the 1970s and early 1980s, but I never lowered myself to use anything from Microsoft. Nor to write significant code in BASIC. There are no excuses for some things.

    1. Sorry to burst your bubble but it you used an Altair or Apple computer or Xenix, or an IBM brand PC, you DID use a Microsoft product Blanche! How Microsoft got along without you “lowering yourself” is a mystery for the ages.

      You didn’t “write significant code” in Beginner’s Allpurpose Symbolic Instruction Code? Big whup.

  10. I feel the background to these kind of release is something else. Gates has almost become a living historical figure. Releases like this will serve as a legacy reminder for future generations. Sadly, they will over a period of time wipe out the memory of other’s achievements in the public mind. Like, when I read an article on quantum theory a majority of the time I see writers just pop in “Einstein” and totally ignore the others who had a more fundamental input and belief in it and its outcomes.

    1. Agree with you. This reminds me how surprised I am every time I’m reminded how old quantum mechanics really is and how lucky I was to have access to BASIC on an HP2000E in the mid 1970s.

Leave a Reply to OsgeldCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.