Tech Nostalgia: Microcomputer + Software (Premium)

BASIC 8080 source code
Source: Bill Gates

Most are at least passingly familiar with the story of Bill Gates and Paul Allen, BASIC, the MITS Altair, and the dawn of the personal computer era. But with the publication last week of the first of a promised three Gates autobiographies, Source Code: My Beginnings, we are treated to yet another retelling. It occurred to me in reading it that we now have the definitive version of this genesis story between the Gates book and the version told by Paul Allen in his autobiography, Idea Man: A Memoir by the Cofounder of Microsoft by Paul Allen.

It’s an incredible story, and one I obsessed over as a young man, worried and convinced that I’d missed the PC revolution I was then trying to join. This was the same worry that Gates had had a decade earlier when he and Allen poured over the January 1975 issue of Popular Electronics, which famously featured the “world’s first minicomputer kit to rival commercial models” on its cover, the MITS Altair 8800. But that’s pretty much where Gates and I diverge. I went on to spend my adult life chronicling the PC era. But Gates–with Allen and MITS founder Ed Roberts–created it.

Gates and Allen didn’t know this at the time, but the Altair 8800 on the cover of Popular Electronics was a dummy unit, and not the one working hardware prototype that Roberts had created. According to Gates, Roberts shipped the prototype to the publication in New York, but “it never arrived (and was never found).” With the clock ticking–Roberts had pitched the story to the publication, which he co-wrote–he put together an “empty box, a mock-up cobbled together for the photo-shoot.” If Gates’ memory is correct, the front panel was made of cardboard.

The Altair 8800 was the culmination of a years-long dream–science fiction to most at the time–to bring computing down to human-scale. This required fundamental shifts in technology, size, and cost, not to mention geography. The minicomputer and earlier computing innovations were largely centered on the East coast of the United States, especially the Route 128 corridor outside of Boston that was home to Digital Equipment Corporation (DEC) and Data General. But personal computers would be built using microprocessors made in Silicon Valley in northern California on the West Coast. As is so often the case, disruption came from the outside. And where gigantic and expensive minicomputers served the government and the world’s biggest businesses, personal computers–called microcomputers originally–would be small, inexpensive, and sold to people.

The hardware had to come first. Semiconductor maker Intel created the world’s first microprocessor, the 4-bit 4004, in 1971, the key innovation was that Intel built all the 4004’s data processing logic and control capabilities–its central processing unit, or CPU–into a single chip with external RAM (up to 4 KB). Though it came out of a calculator design, the 4004 was a general purpose microprocessor that could be used for other things, where previous integrated circuits were purpose-built for specific products or use cases. By reprogramming the ROM in the 4004, Intel could use it in other calculators and, theoretically, in other types of products.

The Intel 4004, and subsequent microprocessors like the 4-bit 4040 and 8-bit 8008 from 1972 were by nature limited, and used mostly in calculators, cash registers, and minicomputer terminals, but they pointed to a future of more personal computing. Thanks to Moore’s Law, that future arrived in 1974 with the Intel 8080, an 8-bit chip that ran at 2 MHz–four times the speed of the 4004–and featured a 16-bit address bus that supported up to 64 KB of memory.

Productizing the 8080 as a general purpose computer for individuals required visionary thinking in hardware, software, and, perhaps most important, the interaction between hardware and software. And this is why Gates, Allen, and Robert, and the perfect nexus of these needs and their individual technical and business skills, came together at the right time and the right place to create the personal computer industry.

Roberts was a hardware geek who created and sold calculator kits until Texas Instruments came along with mass production and cheaper prices. With his business failing, he came up with the idea of a fully operational personal computer that could “do anything a mini-computer could do.” When Intel shipped the 8080, Roberts saw his opening and he somehow orchestrated a deal with Intel to purchase 1,000 Intel 8080 chips at just $75 each, a significant discount compared to the normal $350 price. He then cobbled together the Altair 8800, which he would sell in kit form for $400 alongside various peripherals and upgrades that would turn the kit into a functional personal computer.

Allen and Gates had grown up together in the Seattle area and had used the Intel 8008 to create traffic counters that they sold to state and local governments while Gates was still in high school. The central innovation there was that Gates and Allen needed a way to program the 8008 at a time when doing so was next to impossible. And so Allen used the 8008 instruction manual to create an 8008 emulator–he called it a simulator–in software on a DEC PDP-10 mainframe that Allen could access as a student at Washington State University. It was written in PDP-10 assembly language, included a debugger, and was arguably the world’s only software development suite for the 8008.

Gates had learned to write software code in an era in which that skill wasn’t just rare, it was unheard of. He benefitted from both time and place. Thanks to his rich upbringing–Gates is no rags-to-riches story, more like a riches to even more riches story–he had access early in life to a teletype connected to a General Electric minicomputer and, later, a PDP-10. He taught himself the BASIC programming language before the local company that owned the PDP-10 eventually banned him and Allen when they were caught hacking the machine to obtain free computer time. Gates, Allen, and a few other students got the ban overturned by agreeing to help the company find bugs in its software. And he was able to view the source code for PDP-10 Fortran, LISP, and machine language to see how they worked. But BASIC remained, in his words, his “language of choice.” Gates was the software coding whiz and Allen handled the hardware/software interaction,

With the arrival of the 8080-based Altair, Allen and Gates could move forward with their dream of creating a software company. The Altair was, in Allen’s words, “the first commercial personal computer,” but it was severely limited, with almost no memory and no meaningful interfaces for user interaction beyond 16 toggle switches for input and blinking lights for output. Roberts had created the hardware, but it couldn’t do anything. What the Altair needed is what all computers need, software.

Gates and Allen were the solution to that problem. Allen purchased an Intel 8080 instruction manual and, using his previous experience creating an 8008 emulator for the PDP-10 as a guide, started work on similar software for the PDP-10. By this time, Gates was enrolled at Harvard University and Allen was living nearby. So they worked at night, using the school’s loosely guarded computing resources when they were unutilized. Allen created a new simulator and debugger for the 8800, and Gates began working on a version of BASIC that would fit into the 4K RAM constraints of a basic Altair. He wrote it in assembly language.

“I was confident I could quickly get it up and running,” Gates writes in Source Code. “Maybe not the ultimate BASIC, but one that did enough to be viable and useful.”

To be viable and useful, the BASIC that Gates wrote not only needed to fit in just 4K of RAM, it needed to leave enough free memory so the user could also run a program they wrote using the language. It was theoretically possible to expand the Altair to 64 KB of memory, thanks to the machine’s innovative expansion capabilities. But RAM was expensive. Each 4K expansion card cost about $340. Gates would later create versions of his BASIC that offered additional features for those with 16 KB and 64 MB of RAM. But the first version would be far more constrained.

His first design choice was to create BASIC as an interpreter because doing so would require less memory. He had previously innovated what he called a “formula evaluator” while designing an 8008-based version of BASIC a few years earlier. And in Source Code, he describes how he had designed this architecture while out hiking, and left it at that. Now, needed a new BASIC for the 8080, Gates “downloaded [the formula evaluator] from [his] head” and wrote it out on a yellow legal pad.

“It was small and tight,” he says. “We can pull this off.”

He had one final hurdle: His BASIC would need to support floating point math, and not just the simpler integer math. “You can’t build a decent lunar landing game without floating-point math,” he reasoned. But this was what Microsoft today might call a “difficult computer science problem.” Debating the issue with Allen one day over a meal, a Harvard math major named Monte Davidoff injected himself into the conversation he had overheard. “I’ve done that,” he told the pair. He went on to write the floating-point math capabilities in their BASIC.

The three worked for several weeks on the project. Allen improved the emulator, making BASIC run faster. When it encountered bugs, they could use Allen’s debugger to locate the mistakes. Somehow they were able to get a fully functioning BASIC running in just 4K using a handmade 8080 emulator running on a PDP-10.

This, to me, is the central innovation that created the PC revolution. Gates and Allen had solved the chicken and the egg problem of a new kind of computer running on a new microprocessor with few resources and no user interface to speak of. They created software for hardware they had never seen or experienced.

And it worked.

“We were sure that no one else had tricked the PDP-10 in this way,” Gates explains. “And we were sure that gave us an advantage over anyone else who might be trying to write software for the Altair.”

There is so much more to this story, from the drama that erupted later at Harvard when the university discovered Gates had secretly allowed outsiders to use its expensive computers to the twisted path that Gates and Allen took in creating their company and divvying up their ownership stakes. In his book, Gates provides a few more details, but the story is as familiar as ever. It is the central technical accomplishment here that really stands out decades later.

Many individuals and companies had approached MITS about providing a BASIC for the Altair, but none of those efforts had amounted to anything. When Gates called MITS in early 1975 to ask about deep technical interfaces, he was told by the engineer who had designed the Altair for Roberts that “you’re actually the first to ask that.”

The Gates BASIC was ready in March 1975 after “six weeks of frenzied code-writing.” The pair arranged a meeting with Roberts, agreeing that Allen, who was a few years older than Gates but looked many years older, would traveling to MITS in Albuquerque with the interpreter saved out on a paper tape.

Gates and Allen were both obsessed that any bug in the code might prevent their BASIC from coming alive on the Altair. The night before Allen left for Albuquerque, Gates stayed up and poured over the code by hand, and made several improvements. He then saved it to tape and “hustled it over” to Allen. “I watched him tuck the roll into his carry bag,” Gates notes.

Allen, on a plane to MITS the next day, suddenly realized that they had forgotten a crucial component to BASIC, a “bootstrap loader” that wasn’t required by the 8080 emulator. He pulled out a yellow legal pad, wrote the necessary code by hand, and then inputted it into the Altair later that day, by hand. “This took a while,” Gates writes. “Each byte had to be input by setting eight data switches”

With that done, the Altair loaded BASIC from the tape Allen had carried to Albuquerque. It took about 7 minutes, and when it got to the end of the tape and started running the program … nothing happened.

Gulp.

Allen tried it again. And this time, the attached terminal displayed a simple message.

MEMORY SIZE?

Allen entered the number and began typing BASIC commands.

PRINT 2 + 2

The Altair responded with

4 OK

“Oh my God, it printed four!” Roberts yelled out.

It worked.

“With that, the first piece of software written for the first personal computer came to life,” Gates wrote.

“I don’t know who was more surprised,” Allen told Gates when he returned triumphantly to Boston, “me or them!”

“Paul was stunned that our little program worked flawlessly on its debut,” Gates recounts. “At the same time, Ed [Robert] and the lead MITS engineer, Bill Yeats, were floored that their machine actually did something.”

Yates had handed Allen a book of 101 BASIC computer games, and Allen typed in a version of the Lunar Lander game that Gates had insisted their BASIC support. “It ran the first time on the Altair that day,” he says. “Roberts was ecstatic.”

The rest of this story is well understood. But it’s important–crucial, really–to understand the scope of this accomplishment. Allen tried to put this in perspective in his 2011 memoir.

“Today we live in a world where sixteen gigabytes of memory–four million times our BASIC budget for the Altair–are packed into the base iPhone,” he wrote. Today, of course, the difference is even greater. We live in a world of nearly limitless computing resources. Indeed, all of us carry a supercomputer in our pockets.

But that future could only have happened with the perfect storm of hardware, software, and the right people in the right place at the right time, in the mid-1970s. The next step would be a new kind of company, the first in the world that would sell computer software.

“We wanted a name with gravitas, like our mode, Digital Equipment Corp,” Gates explains. “That name carried the weight of a behemoth. With a name like that, people might take us seriously, which still seemed like an ambitious goal for two young guys figuring it out as we went along. It was Paul who had the next thought: Since we were writing software for microcomputers, how about combining those two words? I agreed. We had our name.”

That name? Micro-Soft.

 

Source Code: My Beginnings by Bill Gates
Idea Man: A Memoir by the Cofounder of Microsoft
by Paul Allen

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Thurrott