Doing It With Fewer Bytes Than Bill Gates

The MITS Altair 8800 occupies a unique place in computing history as the first commercially succesful microcomputer for personal rather than business use. It is famous as the platform upon which the first Microsoft product ran, their first BASIC interpreter.

[Josh Bensadon] has an Altair 8800, and became intrigued by its bootloader. The simplest method of programming the machine is through binary using a set of switches on the front panel, and he remarks that there should be a warning in the manual: “fingers will get sore after repeated use of the small switches on the ALTAIR”.

In the Altair manual there are two listings, one 21 byte, and another in 20 bytes. Bill Gates is on record as saying that their first effort was 46 bytes long, but with more work he managed to create one in 17 bytes. Now [Josh] has beaten that, he’s created an Altair 8800 bootloader in only 14 bytes.

His write-up goes into great detail about how those bytes are shaved off, and provides us with a fascinating insight into the 8800’s architecture. Even if your 8-bit assembler is a little rusty, it’s a fascinating read.

We’ve featured Altair-inspired projects many times here at Hackaday, but rarely the real thing. This Altair PC case with the ability to emulate the original was rather a nice idea, as was this Altair front panel project. If you want the joy without the heartache though, there is an online emulator.

28 thoughts on “Doing It With Fewer Bytes Than Bill Gates

  1. Quote: “Even if your 8-bit assembler is a little rusty”

    All the old 8-bit CISC CPU’s were different unless one was based on the other!

    I tried to find a pic that I have seen before that showed the tree of evolution of 8-bit CPU’s by instruction set compatibility but no good :(

    He has don’t exceptionally well to improve on something that hasn’t been improved on in decades!

    Now we need an robot based on a 555 / Arduino / PI Zero-Stock to flip the switched and enter the boot-loader. It could be done with cheap servos or perhaps solenoids … servo’s sounds easier.

      1. A vertical 2 axis gantry with a switch flipper. How many megabytes of code can you make it take to enter simple programs onto an Altair, while having the switch flipper robot do the work as fast as possible?

        Sort of like drag racing model rockets where the contradictory goals are
        1. Get off the pad first
        2. Hit the lowest altitude
        3. Hit the ground last

      2. Two horizontal linear rails that shift one platform with two servos (one for each row of switches) and have like two mini ping pong bats on each servo so it can flip the switch up or down.

      3. The other direction wire some momentary micro switches switches in parallel with the front panel switches and have to boot loader stored on a cylinder or disc with pins representing the bits driven by a motor or clockwork similar to whats in a music box the push the micro switches and have the most steam punk boot loader ever.

    1. The gold here is that Mr. Bensadon has a beautiful piece of history directly related to the actual origins of Microsoft, the creation of billionaires, and your computer enjoyment today.

      The bootloader was a tiny piece of code hand entered via dip switches EVERY last time you powered it up, and typically used to load your larger monitor program from cassette tape or punch tape if you were lucky enough to have an interface for one of those, else you kept going for a few hundreds or thousand more bytes which you had to get 100% right. Your output was just those blinkin’ lights! This was the hacker toy that teased them to have more, design better…. get video and sound from…

      The APPLE boys could see what this could make. So they took an incredible mix of cheap chip tricks to do a video refresh which was also used for the dynamic ram refresh (few wanted to touch dynamic ram due to refresh needs, most all did static ram), and even snuck in a great forehead slap simple near zero cost trick to get 16 colors. They started straight out with a cassette tape interface circuit that added just a couple bucks… and of course you needed a keyboard but that was just a mass of switches so simple… and a power supply… and kewl looking cabinet for the day. That they included additional sockets for more plug in cards nailed the design down as a winner for good. Then they went one truly incredible stage farther and created a state machine for a disk interface card with puny chip count and pittance of cost… and they had it made.

      I don’t care if your business aspirations are to be a banker or baker… studying the way these guys innovated and cut costs is best shot you will personally ever have to become a millionaire. They did a year+ of hard concentrated HOBBY work in exchange for billionaireship.

      If you know electronics, you’ll further your career by studying the APPLE][ schematics. Advice that still applies today. Suggest you wear a hat so forehead slaps don’t marr your appearance.

      And this ALTAIR is what they were using and looking at when they decided they wanted more… and is what they experimented with. This is what tempted them… and developed their hunger, gave them ideas and brought forth plans.

      The bootloader is your BIOS in ROM nowdays.

      1. By comparison, my own efforts in those same days was weak.

        I went with the Cosmac Elf. Bought the board, suffered as the chip sockets cost more than the chips, but got it running. 128 bytes ram.

        Once I got it built the first program was hand entered by dip switches, and the “Hello World” was it made the I/O led blink. With great excitement I called the wife over. “It’s running! I got it working!” She looked… asked how I could tell, and when explained she nearly clocked me while yelling you spent $$$$ to make a light blink! I say nearly as my reflexes were pretty good those days.

        1. Hey, I wrote a tiny program to turn my ELF into a digital enlarger timer. “Real” ones sold for hundreds of dollars back in the day. We used it for years in a government photo lab. The code is still on-line somewhere, I think.

      2. AKK! Forgot to mention that they also put their Basic in Rom into the APPLE ][. That made it quickly usable with an easy to learn programming language, (albeit with a string garbage collector bug.). This made games easily programmable, and loaded by cassette software sales possible… it rose quickly.

      3. To be fair, soon after the Altair came out, there were S-100 bus computers that had no front panel.

        There was also the Processor Technology Sol-20 in 1976, which had a video interface and ASCII keyboard.

        In late 1975 SWTPC came out with a 6800-based computer, and no front panel. It had a monitor in ROM and you needed a terminal of some kind to use it. Oddly, around the same time MITS (who sold the Altair) came out with a 6800-based computer, but it had a front panel. The monitor in the SWTPC derived from a Motorola monitor, so the move away from front panels had started earlier.

        The front panel of the Altair was complicated (and thus added to the cost), and probably necessary right at that point. It allowed one to do something with the computer without spending more (on memory, on a serial board, on a terminal), but soon after was a liability. The Altair bootstrapped the home computer, it was necessary but soon better things came along.

        Michael

      1. In the fall of 1975, Godbout was offering for about fifty dollars an 8080, the matching clock IC, some RAM and an eprom. I was all excited, with a stretch I could afford that. I mention it to someone, and he points out without a monitor, or front panel, you couldn’t do a thing. And even if you could write your own monitor, you’d need the computer to get used to the 8080, and to get the monitor running.

        So much for that.

        Michael

        1. Hi Michael,

          In 1979, I almost hit the ceiling when I found an 8080 processor in one of those Radio Shack $5 grab bags. For those who don’t know what this is, it was sort of a pot luck thing. Radio Shack would fill a small bag with random parts or perhaps overstocked or non moving stock. Then they sealed the bag and sold it for $5. You just never knew what you’d get.

          The 8080 chip came in a pack with a data sheet stapled to the back. I read that data sheet. I mean, I read that data sheet in it’s entirety every day for 2 months! I planned on paper how I would build my 8080 computer but the cost of the other parts was beyond my means. That’s when, in 1979, I found an old copy (Aug 1976) of Popular Electronics with the COSMAC ELF and found that computer was cheaper to build instead. I remember thinking I already have the 8080 microprocessor, but for the ELF, I have to take a step back and buy an 1802 microprocessor. But, given all the other chips, it was still cheaper for me to build that ELF. If I had to do it all over again, I would have worked harder to earn the money to build both computers!

          Cheers,
          Josh Bensadon

        2. I think that for many people the 70s was not so much about what you *did*, it was more about what you *aspired to do*.

          I (like many of the time) wanted to build my own computer but it was decades before I did do so. In the mean time I learn everything I could and used pre-built computers. It set a career for me later in life when computers became more prominent.

      2. You could easily store this boot loader on a diode matrix the size of an S100 card though it would have to overwriting feature.
        I wonder if some early microcomputer enthusiasts used them?

  2. Wow, lot’s of great information and ideas here. First, I should say my bootstrap loader can be reduced by 1 more byte if I just load the H register with 03, but it would add another 300 bytes and 30+ seconds to the papertape.

    A robot to operate and run the switches? What a great idea! Of course, it would be easier, cheaper, etc, to just buy an EPROM. But this is about having FUN!!!

    I do greatly appreciate all the other comments about how it really was in 1975. I was just 9 at the time, it wasn’t until I was 13 before I knew enough to build a COSMAC ELF. Using computers back then was kind of like lighting a fire by rubbing 2 sticks. 2 very expensive sticks.

    I would love to hear more about people who actually bought these computers back then!

    Regards,
    Josh Bensadon

    1. It wasn’t all a primate affair as there were turn key computers that booted directly into basic on power up back then such as the HP 9830 and Wang 2200 but they were very expensive.

      1. Oh yes, I know the HP9830 (have one). It was in fact the first (school) computer I ever truly programmed/operated in 1977-1981. But this was far from reach of the hobbyists. I’m more eager to hear stories of Forrest Mims, Don Lancaster, Ed Roberts and any of the other great writers of Popular Electronics/Radio Electronics Magazines.

    1. actually if you read commends under original article you will learn Gates wrote 13 byte loader, but deemed it too hacky.

      >Computer Notes Volume 1, Issue 6, 1975
      Page Twenty-One
      Author Bill Gates

      “I’ve written a bootloader that only takes 13 bytes of keyed-in data, but anything smaller than 20 bytes isn’t easy to use.”

  3. Good work Josh. Your bootloader reminds us of the early computing days when the most concise and elegant code wins. Remember Gates’ quote “Measuring programming progress by lines of code is like measuring aircraft building progress by weight.”. It’s pretty much a lost art these days.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s