News: 1743686949

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

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

(2025/04/03)


Microsoft co-founder Bill Gates has shared the 1975 source code for Altair BASIC.

The [1]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 the code and running it all at once was an option, but Gates explained: "We figured the line-by-line approach of an interpreter would be helpful to novice programmers since it would give instant feedback on their code, allowing them to fix any mistakes as they crop up."

[2]

Gates and fellow Microsoft co-founder Paul Allen famously spotted the Altair on the cover of the January 1975 issue of Popular Electronics. The duo reckoned – correctly as it turned out – that the PC revolution was imminent, "and we wanted to get in on the ground floor."

[3]

[4]

It took two months to create the software, which Gates and Allen had pitched to MITS founder Ed Roberts as already existing. This was complicated by the need to compress the code into four kilobytes to allow Altair owners to run programs without needing to purchase extra memory.

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

[5]How a good business deal made us underestimate BASIC

[6]50 years ago, CP/M started the microcomputer revolution

[7]Altair pays off $79m owed to SAS in software license spat, will sell rival product

[8]Microsoft adds cloud enablement to 1970s Altair 8800 tech

The pair also lacked the Intel 8080 chip, on which the Altair ran, so Allen put together a program to simulate the chip on a PDP-10 mainframe, allowing the software to be tested without the actual target computer. Another friend, Monte Davidoff, developed the math package.

By today's standards, this version, later known as 4K BASIC, was somewhat limited. There wasn't much in the way of string manipulation, for example, and a subsequent version, 8K BASIC, added functions familiar to users of later home computers.

[9]

It was, however, good enough for MITS to license the software. Gates said: "This was a pivotal moment for Paul and me. Altair BASIC became the first product of our new company, which we decided to call Micro-Soft."

The source code is provided as a 157-page PDF of scanned fan-fold paper rather than as source in a [10]convenient repository. . An annotated disassembly of Altair BASIC 3.2 can be found on [11]GitHub .

"I still get a kick out of seeing it, even all these years later," Gates said. "Computer programming has come a long way over the last fifty years, but I'm still super proud of how it turned out." ®

Get our [12]Tech Resources



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

[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Z-6wnaSgyqAaltn_yHk6zgAAAMw&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Z-6wnaSgyqAaltn_yHk6zgAAAMw&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Z-6wnaSgyqAaltn_yHk6zgAAAMw&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[5] https://www.theregister.com/2025/01/03/reevaluating_basics_legacy/

[6] https://www.theregister.com/2024/08/02/cpm_50th_anniversary/

[7] https://www.theregister.com/2022/06/28/altair_sas_wpl/

[8] https://www.theregister.com/2021/07/16/altair_redux/

[9] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Z-6wnaSgyqAaltn_yHk6zgAAAMw&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[10] https://www.theregister.com/2024/04/26/ms_dos_4_open_source/

[11] https://github.com/option8/Altair-BASIC/tree/master

[12] https://whitepapers.theregister.com/



neilo

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

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.

Lotsa lookups

Chris Gray 1

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!

It's a Trap!

m4r35n357

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

Am I joking?

The Moral of the Story

An_Old_Dog

... 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.

All things arise from Tao.
They are nourished by Virtue.
They are formed from matter.
They are shaped by environment.
Thus the ten thousand things all respect Tao and honor Virtue.
Respect of Tao and honor of Virtue are not demanded,
But they are in the nature of things.

Therefore all things arise from Tao.
By Virtue they are nourished,
Developed, cared for,
Sheltered, comforted,
Grown, and protected.
Creating without claiming,
Doing without taking credit,
Guiding without interfering,
This is Primal Virtue.