petilon 1 day ago

Credit should be given to Digital Equipment Corporation. Back then software isn't what companies made money on, it is hardware. Source code wasn't guarded as a secret as it is today, and you could find print outs in the dumpster [1]. Bill Gates and Paul Allen found the source code of DEC Basic [2] and ported it. (Wikipedia says Microsoft Basic was "inspired by" DEC's PDP-10 BASIC-PLUS.)

[1] https://www.businessinsider.com/10-things-you-didnt-know-abo...

[2] https://www.theregister.com/software/2000/06/29/bill-gates-r...

  • abecedarius 1 day ago

    From [2]:

    > Gates said: "I'd skip out on athletics and go down to this computer center. We were moving ahead very rapidly: Basic, FORTRAN, LISP, PDP-10 machine language, digging out the operating system listings from the trash and studying those."

    Is there more context clarifying this means they studied the source code of DEC Basic?

    • petilon 1 day ago

      In this [1] interview Gates says that he and his group got DEC BASIC source code and enhanced it.

      [1] https://americanhistory.si.edu/comphist/gates.htm

      • abecedarius 1 day ago

        "The BASIC they did which we got ahold of the BASIC source code and enhanced t quite a bit was great."

        Thanks! I think this is still talking about his high school volunteer hacking rather than the MS Basic era. (i.e. doesn't obviously support your "ported it".)

        • petilon 1 day ago

          They got the source code of DEC Basic, studied it, "enhanced quite a bit" then wrote their own Basic which is similar to DEC Basic, and you don't think it is a derivative? Ok. It is a derivative in my book.

          • avadodin 20 hours ago

            It is derivative as in it uses the same ideas not as in it uses the same code. The latter would run afoul of copyright law but the former is perfectly fine.

            You can make your own reincarnation anime even if you formerly worked making cels for TenSura.

            GNU is not UNIX.

  • ndiddy 1 day ago

    The Microsoft BASIC syntax is certainly inspired by DEC BASIC, but the actual implementation is completely different. DEC BASIC compiles the program source code into bytecode, while Microsoft BASIC tokenizes each line as it's entered and then interprets the tokens at runtime. You have to remember that minicomputers had vastly different capabilities from 8-bit microcomputers. Even if Gates did look at the code for DEC BASIC, there's not much there he could have used.

  • ThrowawayR2 12 hours ago

    This is the second time I've seen this weird false claim on Hacker News that MS BASIC is a port of DEC BASIC: https://news.ycombinator.com/item?id=43576119.

    From Paul Allen's site at https://paulallen.com/Futurist/Microsoft.aspx , it's said that the OS source code printouts is what they got out of the trash: "While his parents were concerned with his slipping grades, there was no slowing him down. He and Bill would go “dumpster diving” in C-Cubed’s garbage to find discarded printouts with source code for the machine’s operating system — an area Paul saw as the “Holy Grail” of software, which he knew he could use to unlock the machine’s potential. He was awestruck by the tightly written elegance on those printed pages."

    • petilon 11 hours ago

      That's completely false. Bill Gates has said [1] he got DEC's Basic source code and "enhanced it". So it is not limited to OS.

      [1] https://americanhistory.si.edu/comphist/gates.htm

      • ThrowawayR2 11 hours ago

        If you read the source the parent poster provides, it plainly says "...digging out the operating system listings from the trash..." not DEC BASIC. Same deceptive pattern as the previous account making false claims so there's something weird going on here.

        • petilon 10 hours ago

          What about this sentence don't you understand:

          "The BASIC they did which we got ahold of the BASIC source code and enhanced t quite a bit was great."

          That's a direct Bill Gates quote, see here: [1] https://americanhistory.si.edu/comphist/gates.htm

          • ThrowawayR2 10 hours ago

            You're debunking your own claim. It says "enhanced it" presumably for running on the PDP-10. What it clearly does not say is ported or sold as MS BASIC.

            • petilon 9 hours ago

              You can use another word instead of "port". What is undeniable is that the Gates team looked at the DEC Basic source code, had extensive experience with it (having enhanced it), and the Basic they later made had functional similarities to DEC Basic. It is undeniable that DEC deserves some credit, as MS Basic is not a clean room implementation.

EvanAnderson 13 hours ago

It's really neat that many of the comments in the 6502 version[0] match this 8080 version. I've only done a quick review but there's a lot of duplication. It's interesting to see how the 6502 version reflects its direct lineage from this version.

The table of constants for the SIN function doesn't have the two bogus constants that make up the "WAIT 6502" easter egg[1]. Since WAIT wasn't in this version that easter egg couldn't exist anyway. That's not to say there isn't an easter egg of some kind in here, but it's not that one.

(It's hard to believe it's been a year since the 6502 version was released. It seems like just a few days ago I was hunting around in the code for the easter egg...)

[0] https://opensource.microsoft.com/blog/2025/09/03/microsoft-o...

[1] https://www.pagetable.com/?p=43

tailrecursion 1 day ago

One of the things I'm often curious about is how various BASIC interpreters organize memory for string storage. You'd think there's some way to reclaim memory after an expression involving intermediate strings is finished. But you don't see descriptions for how BASIC works in this regard.

piker 1 day ago

These two guys* were crazy productive in the 2 months they worked. Just the level of commenting shows how much thought they were able to give it during that span.

* plus the math package guy

  • jll29 1 day ago

    Does the code work?

    I.e., has anyone OCR'd the listing and fed it into an emulator yet?

  • jhallenworld 1 day ago

    I always thought that the floating point routines were the big feature that made Microsoft BASIC a thing (compared with both Radio Shack and Apple integer BASIC). It's interesting reading about Monte Davidoff and also that Gates knew they needed a specialist for this.

    https://en.wikipedia.org/wiki/Monte_Davidoff

    • senfiaj 1 day ago

      Me too. The 4K basic was quite limited in other functionalities (in order to fit into the memory). But that floating point module made it very competitive, although also made the execution slower. IMO Monte Davidoff is underappreciated.

    • MiroslavPokorny 1 day ago

      The reason i believe Microsoft Basic became popular across multiple platforms is because nobody else sold their BASIC to other hardware vendors.

      In those days the money was in hardware which cost a lot, and software was thrown in. It wouldnt make sense for IBM to sell their BASIC to another hardware vendor.

      Microsoft was different, they would sell their languages to anyone and they did. Can anyone actually name a competitor in those early days ?

      Even Apple didnt sell their own Woz written basic to other 6502 vendors, C= had to buy Microsoft Basic.

      • roryirvine 15 hours ago

        MicroFORTH would have been the nearest thing to it - but FORTH was sufficiently easy to implement that most vendors decided to make their own rather than pay FORTH Inc.

        SofTech Pascal could have been there, too, if they hadn't priced it way out of the reach of hobbyists.

        In many ways, that was Microsoft's real genius - charging just a few dollars per user to the manufacturers. Even the Professional Development System was only low hundreds of dollars rather than thousands. They were the first tech company to use the "make it up on volume" strategy.

        • LeFantome 14 hours ago

          It is right there in the name.

          Software had always been one big project with a dedicated team to build something one off, like building a hospital. Every customer commissioned their own software.

          Microsoft recognized that the future was writing smaller software that was meant to be sold to many, many people for less money each.

  • MiroslavPokorny 1 day ago

    2 months to write a working BASIC from scratch in the shared computer environment seems highly unlikely. I think more time would be required and having some source to inspire and guide the design would be a big advantage.

  • markus_zhang 1 day ago

    I checked the documentation and looks like even the 4K version supports single precision floating point numbers (32-bit). Not sure how they managed to do it in 8-bit machines but I guess they just had to use more registers/memory for each of them.

thrownawaysz 1 day ago

"FILE WILL BE DELETED AFTER PRINTING"

hah I've never seen that before but reminds me to roguelike games.

"permadeath coding" would be actually fun. IF compiler error THEN erase code repository or something like this

  • bitwize 1 day ago

    The source code (and original assets) to many video games from as late as the 90s has been lost. The publishing company often deleted it after the game shipped, thinking it just took up space. This is one reason why, for example, there hasn't been a substantive remaster of Final Fantasy VII.

    Also, it sounds like you described Vigil: https://github.com/munificent/vigil

    • reaperducer 1 day ago

      The publishing company often deleted it after the game shipped, thinking it just took up space.

      Floppy disks were not cheap, expensive, easy to get, or reliable. It sucked.

      Even on the U.S. east coast, I remember having to travel over an hour to get to the nearest store that sold floppy disks. Each BASF FlexyDisk cost $18 in 2026 money. So $50 if you wanted redundant long-term storage of one program.

      That's why we printed everything out all the time; especially for archive storage.

      …which also turned out to be a bad idea. Just in a different way.

      • cduzz 1 day ago

        I'd guess that any of these media is sketchy for long-term archival storage.

        I've got probably 30 5.25 floppies in my house, and I have a 5.25 drive and an old motherboard that can probably recognize that drive, and I've got the cables to connect the drive to the motherboad (and power supply). I'd guess that there's maybe a 20% chance that, if I spent a week trying to mash it all together I'd be able to get some data off of some of these floppies.

        On other magnetic media the chances are between "haha, no" (oh, you've got an old 8 inch 10mb Bernoulli disk?) to 5% (oh, a QIC150 tape).

        On the other hand, if I found a stack of moldy greenbar printout of some data, I'd say that most of the data can likely be recovered, and likely for not a tremendous amount of money.

        • badc0ffee 1 day ago

          Get a Greaseweazle and that floppy drive will work on any modern computer (macOS, Windows, Linux). I've been backing up floppies from a disorganized retro PC collection I bought, and almost all of them still work.

      • bitwize 1 day ago

        A company of any size wasn't archiving stuff on freaking floppies. In the 70s and 80s most video games were developed on big iron—PDPs or VAXen, usually, and data from those was archived on paper or mag tape. If you were renting (or stealing) time on one of these, as "Micro-Soft" was in its very early days, then printing stuff out may have been more economical. But major game studios of the day had resources and means of bulk archival that didn't involving buying a bunch of floppies at Lechmere.

        • reaperducer 1 day ago

          You vastly overestimate the budget and abilities of most software houses of the day.

          For every Atari or Epyx, there were many dozens of very significant publishers who did their work on consumer-grade hardware.

          Except for Atari and less than a handful of others with previous income, none started with PDPs on hand. They had to work up to that.

          It's not like today with everything consolidated and full of VC money. Bootstrapping your way to success was de regur, and the playing field was wide open to anyone with a home computer and a little talent.

ChrisArchitect 1 day ago

Associated blog post from 2025:

Celebrate 50 years of Microsoft with the company's original Source code

https://www.gatesnotes.com/microsoft-original-source-code

(Discussion: https://news.ycombinator.com/item?id=43575884)

  • joebig 1 day ago

    Gates plays the long game. The man dodged multiple requests over decades to publish this og code that launched MS as a company (pretended he had misplaced the same or forgot to reply or something): only to perfectly time it for a jubilee release.

    • senfiaj 1 day ago

      I wonder were most of the comments added later? I guess they used pen and paper to write the ASM code and then enter it as machine code.

      • II2II 1 day ago

        Why would anyone put themselves through that if they didn't have to? There is the tale of Allen hand coding the bootloader in machine code, but that was because he was on the plane to give a demo. Otherwise, all of the tales I've heard of the development of BASIC involved a mainframe. Hand coded assembly was certainly conceivable, given that terminals weren't exactly everywhere back in the day, but even a basic assembler does more than the straight translation of instructions into opcodes.

    • markus_zhang 1 day ago

      I imagine that was one of the happiest moments in his life (completing Altair BASIC).

joebig 1 day ago

And all of it within ~4 Kbytes too!

  • senfiaj 1 day ago

    And the PDF is about 100MB.

    • andsoitis 1 day ago

      that's only because it is 157 images (one per page). if it were text it would have been a more reasonably size, albeit still much larger than the actual source.

      however, the PDF also adds nostalgia and more information than the source alone. whether that's a good tradeoff I'll leave up to the reader, but clearly Bill Gates thinks it is more interesting to post this than point to GitHub repo. I would agree.

      • RetroTechie 7 hours ago

        I'll cut mr. Gates some slack if scanned from original printouts, and done so to avoid OCR'ing errors. That said: it's an under 4K binary right? How much effort to check that text version matches original printouts? (or even paper tape!) The guy is a billionaire ffs! If he cares, hire some people to double-check OCR output. Errors in comments aren't end of the world anyway.

        Then maybe throw some small(er) sized images in that pdf + link to full-sized ones on the web.