Bill Gates Shares The Code That Launched Microsoft
Written by Mike James   
Sunday, 06 April 2025

To celebrate Microsoft's 50th Anniversary, Bill Gates has shared the original Altair BASIC Source Code. However it's not been open-sourced in a GitHub repo - instead it's available as a 157-page pdf of scanned fan-fold paper! It makes for a fascinating read.

In his blog post announcing the new availability of this historic code written 50 years ago, Gates writes:

It feels like just yesterday that Paul (Allen) and I were hunched over the PDP-10 in Harvard's computer lab, writing the code that would become the first product of our new company. That code remains the coolest code I've ever written to this day...

He goes on to explain that is was seeing the Altair 8080 featured on the cover of the January 1975 issue of Popular Electronics that made the pair of them realize that: 

the PC revolution was imminent and we wanted to get in on the ground floor.

altair

 

Bill phoned Ed Roberts whose company Micro Instrumentation and Telemetry Systems (MITS) produced the Altair kits and claimed to already have a version of Basic for the 8080 microprocessor and that he was ready to do business. The only part of the claim that was true was the part about being ready to do business.

To create a BASIC interpreter, Paul Allen first had to write an 8080 simulator for the college PDP-10 - using a book bought from the corner bookshop, written by Adam Osborne, that gave the full 8080 instruction set!  Trying to implement a Basic interpreter using a simulator made the task a lot harder, but at least they had the power of the bigger machine's tools.  

Bill Gates coded the interpreter but of course there would have been a great deal of cross fertilization between the two projects. Gates had already written a Basic interpreter for the PDP-10 so he didn't have to look up the theory and was free to concentrate on the difficult task of squeezing the language into 4KBytes with enough space left over to run a program.

Commenting on this Gates writes in his blog post:

To meet that constraint, I used various techniques to optimize memory usage, like compact data structures and efficient algorithms. It was a fun challenge and although Paul and I were stressed about getting Altair BASIC to MITS as quickly as possible, I had a blast figuring out how to make everything fit.

The finished interpreter was delivered to MITS by Paul Allen as a paper tape. The program was untried on a real 8080 let alone on the actual Altair computer. Things were so tight that on the plane Allen realized that they had failed to write a bootstrap loader for the tape! 

The chances of the tape working when loaded into the machine would have been set at close to zero by any right thinking programmer - but, as told in this short video from over 30 years ago, after one shaky start, it worked second time around leaving both Ed Roberts and Paul Allen amazed!

 

For the purposes of a contract with MITS they also had to form a company. It was Paul Allen who came up with its name - combining Micro(processor) and Soft(ware) but it was Bill Gates who was the senior partner - being designated President while Allen was Vice President.

So that's the part of the story about the formation of Microsoft. Now let's consider the code - all 157 pages of printout of which this is but a few lines:

Bob

It is amazing  to think that this was done by a team of three - Gates, Allen and Monte Davidoff who wrote the math package - working day and night for two months.  Its ingenuity of the coding serves to mark the high point of a particular type of programming that virtually no longer exists - hand-crafted resource-limited programming. Even after corners were cut such as only using integer arithmetic and single letter variables the task wasn't easy. All commands had to be stored as single byte tokens and lots of space saving tricks had to be deployed.

There's also a lot to be gleaned from the comments. I was intrigued to find a reference to Bob Albrecht, one of the founders of the People's Computer Company (PPC) and the person who brought the first Altair 8800 to the Homebrew Computer Club. He was also a key figure in the effort to make Tiny BASIC a standard on many early machines. The comment is:

IS IT BOB ALBRECHT RINGING THE BELL
FOR SCHOOL KIDS?

and you can see this in the listing above. It is part of the Teletype input function and comments a test to see if the input character is an ASCII Bell code, i.e. 07. Yes, all they had to work with was an ASR33 teletype.

The comment was probably provoked by co-founder of the People's Computer Company Bob Albrecht's part in the free software movement and Tiny BASIC in particular.
Tiny BASIC was a free version of BASIC designed by Dennis Allison and the PCC in response to the open letter published by Bill Gates complaining about users pirating Altair BASIC, robbing Microsoft of the royalties due to them for work that had cost it over $40,000.  open Letter

What a change in 50 years - now Microsoft is one of the best resourced tech company and espouses open source software and Gates himself is a billionaire and a philanthopist who distributes his fortune to a wide raft of causes. 

In inviting us to download the code Gates concludes:

Computer programing has came a long way over the last fifty years, but I'm still super proud of how it turned out.

BG BasicPrintOut

 

 


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Perl Back In TIOBE Top 10
07/04/2025

The surprise new entry, or rather re-entry, to the TIOBE index this month is Perl, which has jumped up from #24 last month to #19, replacing Kotlin which has tumbled to #25.



Kotlin 2.1.20 Boosts Plugin Support
26/03/2025

Kotlin 2.1.20 has been released with updates to the kapt and Lombok plugins, a new DSL to replace Gradle's application plugin, and a number of improvements for WASM. 


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:059380158X>

<ASIN:0471568864>

<ASIN: 0670859133>

Last Updated ( Sunday, 06 April 2025 )