6 ms·
Ask HN: How did Paul Allen write an 8080 emulator in 1974?
Listening to the audiobook of “The Innovators” (highly recommend) today and the story tells of how Bill Gates wrote Basic for the Altair on an 8080 emulator written by Paul Allen in 1974.
How is this feat of computer programming not a major legend in computing history? Surely Paul Allen writing this emulator is even more impressive than Bill writing basic?
- curiousObject 3y agoIt was an 8800 emulator I believe, not 8080. (Edit - I’m mistaken - it was for the 8080 CPU) Then they wrote the BASIC interpreter on the emulator, copied it to punched paper tape and Allen wrote the loader for that while he was on the plane to demo it for Altair. On the real Altair 8800 hardware which they had never seen, it worked first time (they must have had some advance knowledge of the Altair’s I/O functions) It was a series of amazing feats https://en.m.wikipedia.org/wiki/Altair_BASIC https://en.m.wikipedia.org/wiki/Altair_BASIC Edit: maybe this feat was not so famous because the Altair was not sold in numbers like the Apple II, which Steve Wozniak is well known for (25000 Altairs sold vs Apple’s 6 million - plus clones)
- GianFabien 3y agoAs far as I can remember, the Altair used an Intel 8080A processor. The Intel 8008 wasn't widely used by hobbyists. I don't recall any CPU with 8800 designation from that era. Possibly RCA or TI, but neither were used by Altair. The Motorola 6800 and Mostek 6502 soon became more popular because they were easier to interface than the Intel 8080A. The Zilog Z80 came out a couple of years later.
- curiousObject 3y agoYou’re right. Thank you. I was misled by Altair 8800! Intel did originally call their iAPX CPU the 8800, but that’s almost got to be an unrelated coincidence because the Altair 8800 was launched in late 1974, but the iAPX’s development didn’t begin at Intel until 1975. The iAPX is also an utterly diverse architecture and instruction set that Intel abandoned later, and they continued with the x86 line. https://en.wikipedia.org/wiki/Intel_iAPX_432 https://en.wikipedia.org/wiki/Intel_iAPX_432
- Turing_Machine 3y agoThe 6502 was also a lot cheaper -- around $25 compared to around $100 for the 8080.
- nikanj 3y agoFor some reason people have mostly ignored the incredible technical achievements of the early Microsoft people. It was all sorts of unbelievable what e.g. Windows 95 was able to do on contemporary hardware
- bombcar 3y agoI always felt people thought windows 95 was amazing but it had significant support from the processor. The earlier versions that ran on things back to the 8086 were more impressive, to me.
- johndoe0815 3y agoThe 8080 was brought to market in April 1974 and it’s not unrealistic to assume that preliminary information on instruction encodings etc. was available earlier. The 8008 would have been available already, but it was not binary compatible. However, an assembly translator was available (similar to the latter one translating 8080 asm to 8086). So the question is if Allen wrote a binary emulator or perhaps something that interpreted asm source code? Maybe the emulator code is still hiding somewhere in the Microsoft archives… :)
- johndoe0815 3y agoSome background (and a bit of speculation) can be found in this retrocomputing StackExchange topic: https://retrocomputing.stackexchange.com/questions/4984/how-was-the-traf-o-data-8008-simulator-developed https://retrocomputing.stackexchange.com/questions/4984/how-... And a bit more about the PDP10 macro assembler that was used (also for 6502 BASIC) at Michael Steil's site: https://www.pagetable.com/?p=774 https://www.pagetable.com/?p=774
- GianFabien 3y agoIt wasn't that unusual. Microcomputers of the day were very limited, especially lacking memory. 4k RAM was considered to be a luxury. So many folks cross-developed using minicomputers. At my Uni, we often developed our tools on PDP-11 computers, especially using RSTS and BASIC, punched paper tape which could be read by hand fed paper tape readers. If you were lucky you had a ASR-33 terminal attached to your microcomputer or had a simple video card connected to a TV and a kludged up keyboard. Development systems from Intel were almost as expensive as a cheap minicomputer.
- cbm-vic-20 3y agoThere was a HN comment a while back from someone who worked on early 8-bit video game systems where they took a similar approach: https://news.ycombinator.com/item?id=15005101 https://news.ycombinator.com/item?id=15005101
- benj111 3y ago[flagged]
- timonoko 3y agoIf you look at the 1974 8080 Assembly Programming Manual, there is not much to do. "Appendix A Instruction Summary" describes each operation in handy pseudocode. All you need to do is to make an interpreter for these: CALL ADDR: ((SP)-1) <-- (PCH), ((SP)-2) <-- (PCL), (SP) <-- (SP)+2, (PC) <-- ADDR
- deleted 3y ago[deleted]
- JPLeRouzic 3y agoThis is the most informative comment in the thread. Thanks!
- Luc 3y ago> (SP) <-- (SP)+2 Typo I think, should be '-2', since that stack grows downward.
- timonoko 3y agoYes.
- faangiq 3y ago[flagged]
- dang 3y agoWe've banned this account for posting unsubstantive and flamebait comments, and ignoring our requests to stop. https://news.ycombinator.com/item?id=33566110 https://news.ycombinator.com/item?id=33566110 (Nov 2022) https://news.ycombinator.com/item?id=32359604 https://news.ycombinator.com/item?id=32359604 (Aug 2022) If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future. They're here: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- undefinedland 3y ago[dead]
- phire 3y agoIt didn't really match the modern definition of emulator. AKA, something that takes raw machine code and implements all the IO capabilities of the target device. Instead, Paul Allen's emulator worked at the code source level, and was implemented as a macros for the assembler. This wasn't even an 8080 assembler, it was a PDP-10 assembler and they created a bunch of macros to output the proper bytes for 8080 machine code. For PDP-10 mode, they switched to a different set of macros, that took the same source code but for each 8080 instruction, it generated one or more PDP-10 to replicated the behaviour of 8080. The source code also replaced the IO code with native PDP-10 IO routines. This gives you a PDP-10 binary that you can run as normal. I'm sure Paul Allen could have written an 8080 machine code interpreter if he wanted to; It's really not that hard to make an emulator of a single CPU with limited IO, especially when the instructions are all documented. But the goal wasn't to emulate other people's 8080 binaries, the goal was to quickly create a programming environment to target the 8080 platform.
- akira2501 3y agoSo.. like.. troff?
- tgv 3y agotroff was a text oriented macro processor, based on roff, and almost certainly didn't run on the PDP-10, because it was written for unix. Roff was based on runoff, which was for IBM hardware. A more likely candidate would have been https://en.wikipedia.org/wiki/MACRO-10 https://en.wikipedia.org/wiki/MACRO-10
- swagtricker 3y ago[flagged]
- DoesntMatter22 3y agoWhy would DOS have been claimed property of the US taxpayers when you are arguing they used that PDP-10 to create basic, not DOS? Also, why would Harvard do that anyway? They didn't murder someone, they formed one of the biggest companies in history with their computers. Also did Gates not buy DOS off of Seattle Computer Products? How did he screw him over exactly? Wikipedia says that it ended up making SCP millions of dollars. https://en.wikipedia.org/wiki/Seattle_Computer_Products https://en.wikipedia.org/wiki/Seattle_Computer_Products
- swagtricker 3y ago1 - Correction: writing late, typo - BASIC should have been property of the US tax payers. 2 - It was still pretty novel back then, but "borrowing" computer time w/o paying for it is (and was) theft of services. Like sneaking into a movie theater without paying. It wasn't their hardware to use, it was a critical part of a commercial endeavor. They didn't have permission in advance to use it. They didn't murder someone, but they were a couple of spoilt brats who figured they could get rich by ripping people off. They ripped off SCP (next point) and they screwed over IBM & Digital Equipment Corp. with the OS/2 gaslighting & NT intellectual property theft (case settled out of court). 3 - Gates wired up the deal with IBM then "bought" 86-DOS from Seattle Computer Products knowing very well it was going to be worth millions since people were waiting for IBM to release a PC at the time. SCP made less than a million dollars and had it drawn out in court (from that same article - "Microsoft paid SCP US$925,000 and reclaimed its license for DOS"). He saw an opportunity to play middle man and then shanked SCP.
- DoesntMatter22 3y ago3 - What is wrong with that exactly? You make it like he ran a scam. Him playing the middle man happens all the time. Nothing illegal about that.
- zabzonk 3y agoit's not so very impressive. the 8080 is quite an easy processor to emulate (but not at the transistor or i/o level) - you can do it with a switch - there are only 256 possible instructions (not all used). i wrote one on the Dec10 back in the early 1980s (with assembler, disassembler and debugger) in Fortran77 and ported it to VAX and IBM 4381. we used it to teach assembler programming at the polytechnic i worked for. you could easily (well, relatively easily) have written basic on my implementation.
- deleted 3y ago[deleted]
- andrewstuart 3y agoIt's funny the comments here saying it's not hard or unusual. Paul Allen did this in 1974 without the Internet or modern software tools. I think it is absolutely extraordinary and incredibly impressive.
- TheOtherHobbes 3y agoAssembler programming wasn't an unusually exotic skill in the early 70s, and the PDP-10 was an unusually friendly environment for it. Compared to modern programming, assembler on a 16- or 36-bit machine is simple, logical, and not at all abstract. DEC made a point of offering high quality detailed docs to students, and there was a kind of assembler culture that produced operating systems like TOPS-10, compilers for various languages, and editing tools, often with access to the sources. And as others have pointed out, the 8080 was not a complex processor. So mapping its instructions to macros wasn't hugely challenging. I had a friend who wrote a Z80 emulator - a harder challenge - on a PDP-10 as a spare time hobby project. It took about a month of after-hours programming. Full-time, it would have taken much less. More interesting is that it's possible Gates & Allen had access to the sources for the PDP-11 4K word Dartmouth BASIC. I have no idea if the original 8-bit MS-BASIC was a clean room reimplementation. But it's at least possible it wasn't.
- RetroTechie 3y ago> Assembler programming wasn't an unusually exotic skill in the early 70s ^^^ This. Back in the 80s I wrote a 8051 assembler running on a Z80 system. This involves a parser, and also a bunch of tables with opcodes, operand formats & so on. Took a number of weeks parttime (not sure if I ever completed it, but the bulk of the functionality was there iirc). This was using just text editor, Z80 assembler, maybe a debugger, and 8051 family datasheet(s). Apart from emulating I/O (as simple or complex as that in emulated machine), difficulty-wise this should be similar to writing an emulator. 8051 and 8080 are not very different in complexity.
- chpatrick 3y agoEmulating some simple instructions really isn't that hard, we did it in first year CS. He would have had the documentation available, you don't need the internet for that.
- ggambetta 3y agoWriting an emulator for a simple processor isn't particularly complicated. You only need a reference manual of the processor (which I assume he had). The emulator itself can be as simple as a while loop with a switch statement inside and some simple variable manipulation. Nowhere near "feat of computer programming" or "major legend". Source: I've written Z80 and x86 emulators for fun.
- deleted 3y ago[deleted]
- Taniwha 3y agoSo about the same time, in college in NZ we wrote a 6800 compiler for an algol like language (fit in 2k, written in assembler), to do bringup (on the university mainframe) we wrote a 6800 interpreter, it wasn't big ~1000 lines (cards), basically just a big case statement - it's not really a major feat, fom memory it took a few days. We called our company uSoft (with a mu), in retrospect it was a stupidly obvious name. Later on we discovered there was a US company using the same name, and they had an interpreter (how lame, we had a compiler). In retrospect they had a giant market and we were kids at the end of the world, they did a little better than us. Always wished we'd trademarked the name, it would have been worth something
- tambourine_man 3y agoThat’s an amazing story
- Taniwha 3y agothanks, I worked for one of Paul's companies at one point, sat down with him at a party and talked rockets (I flew them for fun, he was doing the X-prize), in retrospect I really wished I'd told him this story instead :-)
- JohnFen 3y ago> How is this feat of computer programming not a major legend in computing history? While what he did was certainly impressive, I don't understand why it would qualify for legendary status. Doing things like this wasn't all that rare back in the day.
- HeyLaughingBoy 3y agoI've spent most of my career in embedded systems, occasionally coming up for air to write a webapp or desktop application or even a mobile app. I find that the devs in those spaces tend to regard working directly with hardware as being akin to magic. It's not surprising: very few developers these days are working on bare metal, so the work they do seems weird and out there, even though for us it's just another day at the office.
- JohnFen 3y agoThat makes sense, yes. As a graybeard, I forget that what I expect pretty much any competent dev to know is no longer the baseline expectation.