back to article Bill Gates unearths Microsoft's ancient code like a proud nerd dad

Microsoft co-founder Bill Gates has shared the 1975 source code for Altair BASIC. The code was the foundation on which Microsoft was built. Before Windows and before Office, there was a carefully crafted BASIC interpreter designed to fit within the limited resources available on the Altair 8800. Why an interpreter? Compiling …

  1. neilo

    By all accounts, Altair BASIC ran remarkably well. So it's been downhill all the way since!

    1. Doctor Syntax Silver badge

      Perhaps the FORTRAN compiler for CP/M outclassed it - but all the way downhill since then.

  2. Anonymous Coward
    Anonymous Coward

    30 years ago as an undergraduate, I remember a Comp Sci professor telling the class that he had a copy of Bill Gates' original BASIC and that it was a really fast, efficient and well-written piece of code. He said Bill is clearly very good at programming.

    Then he laughed and said "But I've found a bug in it!"

    He didn't elaborate any further. I guess it wasn't a very serious bug.

    1. frankvw Silver badge
      Devil

      "Bill is clearly very good at programming"

      From Programmers at Work, Microsoft Press, Redmond, WA [1986]:

      Interviewer: "Is studying computer science the best way to prepare to be a programmer?"

      Gates: "No, the best way to prepare is to write programs, and to study great programs that other people have written. In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."

      'Nuff said.

      1. Evil Auditor Silver badge
        Devil

        Re: "Bill is clearly very good at programming"

        At least, at that time Microsoft used deficient code of real programmers. Nowadays, it seems they mostly use self-referential garbage. And cloud.

      2. Benegesserict Cumbersomberbatch Silver badge

        Re: "Bill is clearly very good at programming"

        If memory serves, he and Allen also used the infrastructure of said Computer Science Centre to write the Altair BASIC code in the first place. Strict interpretation of the rules of use would have made the software the intellectual property of the University, and not Microsoft.

        Kids, huh?

        1. frankvw Silver badge

          Re: "Bill is clearly very good at programming"

          Not just kids - grown-ups, too. Tim Paterson of Seattle Computing Products pretty much "created" Q-DOS (Quick and Dirty Operating System) by taking CP/M, filing off the serial numbers and giving it a new paint job, then renaming it to 86-DOS and making it commercially available. Gates bought it, put a Microsoft sticker on the box and sold it as MS-DOS. The similarities between CP/M and MS-DOS 1.0 are painfully obvious.

          However, Digital Research (who had created, and owned, CP/M in the first place) never gave permission for their IP to be used in that manner by any third party, which essentially means MS-DOS was released as a stolen product. IBM knew this. They went ahead with it anyway. DR was too small to be considered a threat to Big Blue. When DR threatened with legal action IBM agreed to offer CP/M as an option for the IBM PC next to PC-DOS (the IBM-branded MS-DOS) but ensured that the pricing was such that CP/M was immediately pushed out of the market.

          Kids, my rear panel RS-232 port! Gates and Allen stole computer time at Lakeside to develop their own work that they then commercialized, then willingly and deliberately bought and sold stolen property. The rest of Microsoft's history simply continues that trend.

        2. A.Lizard

          Re: "Bill is clearly very good at programming"

          Recent study says 60% of modern Open Source code.copied from other programs... e.h. copy-paste via Stack Overflow.

          Worked with chatGPT as a coding assistant?

          If the kind of strict interpretation of IP.law were in fashion, the software industry would grind to a sudden halt.

  3. Chris Gray 1
    Go

    Lotsa lookups

    Looks like pretty good code to me. I have familiarity with 8080 code from decades ago, and that helps. Figuring out the meaning of stuff in the assembler, and twisting my brain to octal (been a hex guy for decades) takes some effort. Lots of comments in the code, which is good - way too many "programmers" nowadays either don't comment, or have terrible comments. I haven't spent more than a few minutes, but it looks like the whole thing uses lots of lookups in tables. Uses CPU status flags as character classification - nice!

    1. ThomH Silver badge

      Re: Lotsa lookups

      > Uses CPU status flags as character classification - nice!

      Bold too, if all you're running against is a simulator of the processor that you wrote yourself.

    2. Spamfast
      Facepalm

      Re: Lotsa lookups

      or have terrible comments

      i++; // Increment the counter.

      1. James Hughes 1

        Re: Lotsa lookups

        Why are you incrementing the counter?

        1. Anonymous Coward
          Anonymous Coward

          Re: Lotsa lookups

          Because it’s a counter, it’s what they do. They count.

      2. Pete 2 Silver badge

        Seen worse

        i++; // decrement the counter.

  4. m4r35n357 Silver badge

    It's a Trap!

    Stay away from the honey pot! https://en.wikipedia.org/wiki/An_Open_Letter_to_Hobbyists

    Am I joking?

  5. An_Old_Dog Silver badge
    Coat

    The Moral of the Story

    ... is that one way to succeed in business is to lie. "Yes, we've got a BASIC interpreter that'll run on a 4K Altair 8080. No, it's not with me. It's ... in my other coat. Which is at the cleaners."

    Mine's the one with the punched paper tape listing of the BASIC language "Star Trek" game in the pocket.

    1. DJV Silver badge

      Re: The Moral of the Story

      Hah, you beat me to it.

      "We coded day and night for the two months to create the software we had said already existed."

      And they've been doing the same ever since!

    2. Mage Silver badge

      Re: The Moral of the Story

      And ported from Dartmouth Basic. Not from scratch.

      1. captain veg Silver badge

        Re: The Moral of the Story

        Since Dartmouth was a compiler, describing it as a "port" is something of a stretch.

        -A.

        1. frankvw Silver badge

          Re: The Moral of the Story

          "I'm altering the source code. Pray I don't alter it any further."

          -- Darth Mouth

      2. Andrew Scott Bronze badge

        Re: The Moral of the Story

        only "ported" if they had a copy of the source code, and really only if the source was in 8080 asm.

        1. John Brown (no body) Silver badge

          Re: The Moral of the Story

          Yeah, more like reverse engineering since they started with the language definition, not the source code.

    3. Spamfast

      Re: The Moral of the Story

      Worked for Marion Morrison too by all accounts. "You can ride a horse, yes?" "Sure."

    4. frankvw Silver badge
      Trollface

      Re: The Moral of the Story

      "one way to succeed in business is to lie"

      It's a good way to get elected as US president, too...

    5. A.Lizard

      Re: The Moral of the Story

      Not mentioned - personal connections of Bill Gates, his mom was on the same board of directors of a charitable NGO as the wife of a C-level suit at IBM...

  6. IGotOut Silver badge

    Nothing changes

    "Extra memory for the Altair could easily cost more than the computer itself,"

    Becomes

    "Extra memory for the Apple could easily cost more than the computer itself,

    1. captain veg Silver badge

      Re: Nothing changes

      These days extra memory for Apple silicon requires buying a new, more expensive, computer in its entirety.

      -A.

      1. MonkeyJuice Silver badge

        Re: Nothing changes

        I have a friend who's a bit of a novice and wondered why his shiny development M1 laptop was thrashing hard. On closer inspection it turned out this fairly recent machine had 8gb ram in it. Explaining that I had double that on my GPU alone, on a rig that cost half the price, a lesson was learned about the cost of poor hardware choices.

  7. CowHorseFrog Silver badge

    Is there any public code from Musk ?

    I suspect he cant code for shit, have always known that Bill is actually v good.

    1. Bitbeisser

      Well, he sold the source code of a game called Bastar in BASIC for the SpectraVideo SV-318 micro computer to a US computer magazine for publication. Beyond that, probably not much from him around. It is even questionable if he even did any coding working himself at his first company, Zip2, which he founded with his brother Kimbal and a guy call Greg Kouri, who put up the first money and probably did most, if not all of the programming for their "online city guide"...

      1. ThomH Silver badge

        One of his BASIC titles for the Vic-20 also survives; I think it's an effort from when he was about 11 though, so not that informative as to the capabilities of the adult.

      2. CowHorseFrog Silver badge

        I remember when he first bought Twitter, there was a story he asked all the engineers to bring a printout of their best accomplishments...

        A printout... its like he never heard of online source control, which is pretty hard to do if you can actually code.

      3. Benegesserict Cumbersomberbatch Silver badge

        That must have been Bastar A.

        He incremented the version letter for each product, and his fourth one was the OS that runs Tesla vehicles.

  8. PhilipN Silver badge

    Boot code

    Creaking memory human variety but didn't Paul Allen say they forgot to write the boot code so he had to write it on the plane going to meet the customer?

  9. Dan 55 Silver badge

    That first link leads to a reeeally bloated web page

    Very post-80s Microsoft.

  10. Wemb

    Round objects

    Say what you like about BG and Microsoft - but that's an incredible ballsy move - not only to promise you have a working application when you don't, but to sell someone an app for which you've not yet written on a platform you don't own and can't afford to buy. Solution? Step 1 - write an emulator for the platform.. Step 2 - write the app on the emulator.. Step 3 - delivery product in under 8 weeks. Talk about agile - some times it takes my work 8 weeks to do the paperwork needed to approve the paperwork needed to start work on any code.

    1. John Brown (no body) Silver badge

      Re: Round objects

      Ballsy? Depends who's money you're spending. Theranos tried it using other peoples money and look how that ended up :-) If only she'd had a rich family to finance it all.

    2. collinsl Silver badge

      Re: Round objects

      Who is round and to what does he object?

  11. prandeamus

    BASIC Damage

    I definitely remember attending interviews (1980?) for Comp Sci course at Queen Mary College, London. Reading the interviewer's form upside down on his desk, he had a checkbox marked "BASIC Damage" such was the bad reputation that BASIC had in academia. Seemed a bit harsh at the time, though I understand the point.

  12. spold Silver badge
    Headmaster

    Since Friday is pedantic day....

    The PDP-10 (&11) were usually termed mini-computers not mainframes (limited address space). It still looked like a blue commercial freezer. I show my age by having actually programmed one. I know someone who hollowed out the gubbins of one and used it as a clothes cupboard (nerd award).

    1. Roland6 Silver badge

      Re: Since Friday is pedantic day....

      I wonder what was the first micro computer? ie. one actually called a micro computer.

      The Digico Micro 16 is going to one of the first few.

      1. atropine blackout

        Re: Since Friday is pedantic day....

        Its a long time ago (1972'ish?) but IIRC, the Intel 4004 was originally advertised as 'a microcomputer'.

        (The image used in an Intel advert of the time was that of a few 16pin DIL packages (4004, along with 1, 2 & 3) standing up on end in a sermi-circle and intended to look like a 'normal' minicomputer's bays).

        If thats all bollocks, just put it down to an old bloke's memory rot.

        1. This post has been deleted by its author

  13. Roland6 Silver badge

    "The source code is provided as a 157-page PDF of scanned fan-fold paper"

    Pre dot-matrix lineprinter fan-fold paper does bring back the memories. Modern development tools obfuscate the liniear nature of a programme and the (correct) order in which things need to be declared, although a screen full of code is probably as good as a page full of code in encouraging good segmentation of logic.

    1. John Brown (no body) Silver badge

      Re: "The source code is provided as a 157-page PDF of scanned fan-fold paper"

      Well, since we finally moved on from 80x25[*] text only screens, yes :-)

      * Or less, on the early micros.

  14. Roland6 Silver badge

    But with fan-fold it is very easy to flip between sections, only limiting factor is the number of fingers you have to hold pages...

    Interesting, not yet seen any form of on-screen scroll that is as good as a set of fingers and a couple of post-it notes...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like