The x86 CPU: From 4004 to 486
pikuma.comLearned to program on an 8088 machine with Hercules mono graphics card, first in GW-Basic which was godawful, then in A86 assembler and finally Turbo Pascal which was a pinnacle of human engineering, a portal into a wonderful future ahead.
There was great excitement and relief when the 80386 came out with its 32bit address linear memory model. Everything suddenly became possible - serious compute on the desktop.
Also remember fondly the workhorse that was the Core2Duo and the i4700k beast, and Mike Abrashes Black book on game programming.
LLM-style AI doesn't yet seem to be the growth technology we need to bring back the economic prosperity of the 80s-90s - but if RL can figure out a stable plasma fusion configuration and layout chips for much better data-flow, then we might see the level of prosperity and innovation we saw in those decades when Moores Law held sway.
> serious compute on the desktop.
The late great Guy Kewney wrote, I think in his original review of the IBM PC/AT in 1984 or 1985 (so roughly when I was doing my 'A' levels), something along the lines of...
"I got this sudden feeling that sitting there right in front of me was... Raw. Computer. Power."
The caps were his. The phrase has lived in my memory for 40 years.
He also had a wonderful description of WordPerfect 5, that went something like...
"I can only imagine the conversation at WP head office, when they sat down and tried to work out what they could do to top Wordperfect 4.2. And somehow, what came out of the meeting was: 'so, what we have here is the world's greatest bicycle. We know it, everyone says it. So what we're going to do is: we're going to put 11 more wheels on it."
These days WP 5.1 for DOS is held up as The Greatest DOS Word Processor Ever.
It was much more usable, because it had CUA menus. So if you didn't have all the f-key combinations memorised, you could just use the menus.
But that meant 3 complete UIs. At the time, it was seen as a bloated mess to existing WP users.
WP 4.2 was the sweet spot and ran from one 360kB floppy on an 8086. WP 5.1 needed a 286 with a hard disk.
But that's sort of my point...
At one point, if you were used to CP/M, an IBM PC with an 8086 and two 360kB floppies was a powerful computer.
Then came the PC/AT... 1.2MB on a floppy and anyway a hard disk as standard! It could take a meg of RAM, if you were insanely wealthy, and amazing multi-colour EGA graphics!
Raw Computer Power indeed!
Then the 386. I remember that era. Insane unimaginable power, in the MS-DOS era. 2 or 4MB of RAM! DOS 3.3 or 4.0 had no useful way to use all that. You could have a disk cache, and EMS as well, and it was still wasted.
These were computers so powerful one could stick 2 more serial ports in the back on an ISA card, and it was instantly a multiuser UNIX minicomputer serving 4 dumb terminals as well as the console. A £5000 PC that could replace a £250,000 minicomputer.
What could 1 person do with all that power? Nothing useful.
Then, in 3 years, came Windows 3.0, and suddenly this departmental-scale powerhouse wasn't fast enough any more... and you needed more RAM and a better graphics card and a bigger faster hard disk...
> 80386 came out with its 32bit address linear memory model. Everything suddenly became possible - serious compute on the desktop.
I wasn't really in the PC world at the time but I do remember this. I remember the first time using a 386 and feeling that, finally, PCs were genuinely powerful machines capable of genuinely impressive feats of computing.
I used A86! That was a great little assembler!
Cool article, thanks! Nitpick: the reason behind the little endianness _originally_ was data access speed-up on 2200, not arithmetic. The 2200 only had 8-bit arithmetic (as did 8008), but its address bus was processed low-to-high. The arithmetic angle became relevant in 8080, with its 16-bit arithmetic. Side benefit: casting between 8- and 16-bit data using the same address.
Another nitpick: the article says 8085 had multiplexed address/data bus. This is actually also true for 8008, 8080 before it, and 8086, 8088, and 80186/88 after it.
This is a neat history. However, going to be a bit nitpicky since they put this in bold re the 8008: "Intel did not design the instruction set of this chip" .. kinda true in a broad sense, but Intel engineers including Stan Mazor did change and enhance it, like adding increment and decrement operations and some other stuff mentioned in https://archive.computerhistory.org/resources/text/Oral_Hist...
The increment and decrement instructions were the only enhancements, according to what is said at your link.
They removed from the ISA a branch-on-bit instruction and reduced the address size from 16 bits to 14 bits, because at that time Intel could not use bigger integrated circuit packages, with enough pins for a complete address.
The link describes increment/decrement as “one of the enhancements we made” (emphasis mine). The other things rattled off there aren’t necessarily “enhancements”, so I don’t think it’s clear that Mazor is giving an exhaustive list of changes or enhancements.
One thing I'd emphasize is that the 4004 is not related to the 8008 at all, except that many of the same people worked on both chips.
Yes, the only relationship between 4004 and x86 is that the team which designed 4004 practically learned on it how to design PMOS logic circuits and by the end of the project they had a methodology of how to design such logic circuits in a more efficient way, which then they applied in their next project, which became Intel 8008.
In my opinion, not only 4004 is completely unrelated to 8008 and x86, but it also does not deserve to be called a "microprocessor", which is intended to mean "monolithic computer CPU", while it can be argued that the 4004 chip set was neither monolithic nor usable as a general-purpose computer CPU.
> In my opinion, [...] it also does not deserve to be called a "microprocessor", which is intended to mean "monolithic computer CPU", while it can be argued that the 4004 chip set was neither monolithic nor usable as a general-purpose computer CPU.
Somebody wrote a MIPS emulator in 4004 and used the emulated system to run linux. (it took a week to boot) I'd argue that if it runs linux it is a general purpose computer CPU.
I agree that it is not monolithic; you can't do anything without the associated ROM+IO chip. But I'd argue that's largely semantics. You can't use a modern x86 CPU without a motherboard full of associated chips either. Although it's not the Platonic ideal of a single monolithic IC, 2 chips to run programs is good enough.
> Somebody wrote a MIPS emulator in 4004
[[citation needed]]
> why does a modern PC still wake up pretending to be a chip from 1978?
I don't know why Intel and AMD are still doing this.
If they changed their CPUs to start in long mode (or even just 32-bit protected mode), nobody would notice except BIOS writers.
And BIOS writers expect to have to change their code to support new CPUs anyway. If Intel and/or AMD made it an ultimatum, the BIOS vendors would comply.
I know Intel had a plan to remove real mode and 16-bit support entirely, X86S, which they abandoned. But a lot of people opposed that because it would have harmed backward compatibility, including the ability to run older OS versions under virtualisation. Changing the physical CPU to no longer start in real mode would be invisible to everything except the BIOS, and even for the BIOS, only its early initialisation code would have to change.
Virtualization is a big thing. But it's also just effort. Keeping the cruft in costs nothing - the HDL doesn't change. It works any everyone knows how to deal with it.
This isn't like an operating system where backwards compatibility takes effort. Since this sits on the boot path, it takes more effort to remove a wart than to just leave it.
I know us developers like to ask "why not fix the wart", but that wart hurts no one.
Actually, I just learnt something...
Only the BIOS init code cares about which mode the BSP starts in
But the OS cares about what mode the APs start in. Most operating systems use INIT-SIPI-SIPI, which starts the APs in real mode.
If an OS uses ACPI 6.4 Multiprocessor Wakeup Mailbox instead, then UEFI does the INIT-SIPI-SIPI on the APs, puts them in 64-bit long mode, then hands that to the OS. However, few bare metal UEFI implementations actually implement it, it is mainly implemented by hypervisors to support confidential VMs.
So, Intel/AMD could make the BSP start in 32-bit protected mode, with minimal BIOS code changes; but the APs would still need to start in 16-bit real mode. They couldn't make the APs start in a different mode until they got everyone to move off INIT-SIPI-SIPI.
The amount of logic required for real mode is absolutely tiny compared to the rest of the CPU, and changing it in any way does have the very real risk of breaking something unintentionally:
https://www.os2museum.com/wp/will-the-real-real-mode-please-...
I would blindly guess... because of legacy reasons?
> And what does the "X" mean? According to Morse himself, nothing special. It was simply an arbitrary letter combining the "H" and "L" halves into one 16-bit register (as told to Vladimir Keleshev).
Ah I always thought it was for eXtended. But I guess X as a placeholder for either H or L makes sense too.
x86 is an octal machine https://news.ycombinator.com/item?id=30409100
I built my first machine using a 80486! It took a lot back then to build a machine. No YouTube, no Discord, no internet (for all intents and purposes). But a heck of a lot of fun!
Also one had to go to computer fairs when they were in town (or at least, that's what my father and I did), and oftentimes pick out some chip laid out in a wooden box with the clockspeed or details written on it in sharpie. Especially the previous generation, or possibly sketchy third-shifted or engineering units that could be had at a big discount. You'd often have to point to what you wanted, as the vendors were Taiwanese or Chinese, and cash was appreciated or possibly even required.
Then, that night, the ritual was to build the computer and, almost invariably, screw up some detail (like forgetting to switch from 220V to 110V on the back of the PSU) which would lead to hours of troubleshooting and despair, and sometimes a trip back to the fair the following day. Inevitably we'd be visited by success and have a brand new generation computer to play the latest games or get On-Line!
Amazing, and experiences for me that are now in this little floating island of time.
I grew up pretty rural, so we didn't have the fairs. We relied on the old catalogs. Remember Jameco, and the Computer Shopper magazine with all the supplier ads?
Jameco is still in business at jameco.com and has a terrific web site for sourcing discrete logic and similar parts. I have built many a breadboard project with materials sourced from there.
i resent the implications of 'third-shifted', to betray my own operational security: i work third shift, enjoy it... and believe i am by far the largest quality hawk at our business outside of upper management.
the thought of a recall or a disaster/accident which one is responsible for is terrifying.
edit: the reasoning behind casting a down-vote should be public.
In this case the colloquialism I'm referring to doesn't mean the night shift, but an illegal after-hours operation where the factory line is run in secret, and the products sold illicitly. https://waywordradio.org/third_shift/
Though that's of course an exaggeration for the chips I'm referring to, but that's how it felt, especially with the language barrier.
I had the Que publishing book, Building and Repairing PC's. What a resource.
Classic!
Me too. Had to learn to read the manuals to figure out why I was getting IRQ conflicts when I added the modem. Heh.
As far as I remember, some chips was called 586 and 686,but I think this was just a synonym for Pentium processors.
The chips were going to be given those names, but the names were changed to Pentium and Pentium Pro for trademark reasons. Specifically, Intel couldn't trademark the numbers, which allowed competitors to call their chips the same numbers.
It's false by the way - you can trademark numbers, colours, and stuff like that
Completely true, they were denied the application for lack of distinctiveness. I'm not going to google that for you.
This was never a widespread official Intel designation. Outside of Intel we use 586 and 686 to refer to the Pentium and Pentium Pro, it’s used by GCC, Linux, modern BSDs, etc, but it was never used widely by Intel marketing nor engineering. Intel proactively trademarked all names up to 986/i986 but this was before the AMD lawsuit.
Cyrix and AMD called those 5x86 and 6x86 (you can find pictures of those chips), because they couldn't call it "Pentium".
Whait...is that the reason we call the CPU architecture today x86? I was always confused, why we call it x86 (x64 is for 64bit, so why not call it x32, since they was all 32bit). Long years, I thought x86 stands for 286..486, but this can't be, since an x86 compiled app would not run on a 386 or below, I guess.
In algebra 'x' is used as "the unknown", as in, "solve for 'x'."
So 'x' is a textual wildcard, like "*" in DOS/Unix shell commands.
x86 matches 8086, and 80186, and 80286, and 80386, and 80486. Intel didn't make an 80586, as mentioned upthread.
By the period of the 80286, everyone just called it the '286 for short. You had a 286, or a 386, or a 486.
Some digit followed by 86. So, collectively, x86.
In contrast, MOSTEK offered the 6502 but Commodore used the 6510, so 65xx was a thing although not so common.
On the Mac, Atari ST, Amiga, etc. the shorthand was 68k: this covered 68000, 68010, 68020, 68030, 68040, etc.
But in the 32-bit era, the early 16-bit Intel chips can't run 32-bit code. So that's the lowest common denominator: x86 means 386 or higher.
Also see Intel's RISC chip family, on which Windows NT was originally written: i860.
86 * 10 = 860.
So it was codenamed N-Ten.
Dave Cutler and team got handed the planned portable version of OS/2, called OS/2 3.0, to the N-Ten. So it got called OS/2 NT -- the N10 version.
While it was underway, Windows 3 became a hit, so it was renamed "Windows NT" instead.
Pentium and Pentium-Pro (also reused i686 for later chips).
Gustavo is an amazing educator, really worth watching some of his courses.
Talking about little endian…
> This inverted storage, which was to haunt all processors evolved from the 8008, was a result of compatibility with the Datapoint bit-serial processor.
Am I the only one who thinks little endian is the right way to store things? Other than reading multi-byte numbers in order in hex dumps and things like that, I don’t see much advantage to big endian.
The way the IBM 1401 does it, because it's a variable word-length machine (fields being delineated by Word Marks, which is a bit in each core location specifically for marking the end of a field / instruction).
So the number '123' is stored in sequential memory locations: x, x+1, x+2 with a word mark under the '1'.
To add (assembly: A X,Y) e.g. '456' to said number at y, y+1, y+2 (in this case the 4 need NOT have a word mark (but usually does) because a word mark in either field ends the operation) the machine starts at the high-order address -- so it starts at address x+2 and y+2, develops any carry, applies that to x+1 and y+1, adds, and finally moves to the hundreds digit, adding any carry from the tens. (The destination address holds the sum in this case, '456' goes to '579')
Also, to move '123' somewhere, you specify the address of the '3' and the field is moved right-to-left to the destination (decrementing the internal pointer, and stopping when finding a word mark).
So, it more or less was Big Endian, but was still able to use a serial ALU by starting at the highest address!
big-endian is reminiscent of serialization and stack orientation.
It is our numeric system that is backward. 123 should be written 321. But, Arab is written right to left, and we took their convention when we took their numbers.
Most spoken languages are big endian, as were most historical numeral systems like Roman, Greek, Chinese or Maya numerals, so it can be argued that big endian is more natural for humans.
Yes, and it's also consistent with normal bit numbering: bit n has place value 2^n, while byte n has place value 256^n. The vast majority of BE processors actually have LE bit numbering.
The only exception is IBM, which used both BE bit and byte numbering. (Bit 0 is the most significant bit, and its value depends on the width of the data in question --- exposing the major disadvantage of BE, i.e. a length-dependent term.)
An old adage I've heard and found useful: "Little endian is Logical; Big endian is Backwards."
Yes. Especially for lower-bit-width chips which must serially do longer-bit-width-math, LE makes sense, since the pieces you work with are in memory in proper order.
Me too, little endian makes more sense.
"This hack lived much longer than anyone expected:"
Famous last words! Temporary lasts longer than you think.
Yes, the world is full of hacks, things done for historical reasons that are no longer valid, but need to be kept to maintain backwards compatibility.
50/60Hz mains power is one of them, and outside engineering this is how society is built and life evolves. Evolution is less of a master craftsman than a process that grabbed what was available at the time.
little endianness indeed only makes sense intuitively if the addition is bitwise. Why not fetch all the bytes then feed them into a carry look ahead adder?
The A20 gate is one of the most aggravating bits of x86 history. Not that they added it (backwards compatibility is very desirable for sales, so it makes sense that they added it), but that anyone was stupid enough to depend on that wrapping behavior in the first place. Such a short sighted, sloppy thing to do.
From what I read main culprit were useless CP/M emulation and Microsoft Pascal.
https://www.os2museum.com/wp/the-a20-gate-it-wasnt-wordstar/
Of course once A20 hack showed up Microsoft doubled down on exploiting wraparound :| producing more garbage software.
https://www.os2museum.com/wp/exepack-and-the-a20-gate/
IBM as always when designing the PC went with quick easy hack instead of thinking long term. A much better solution than A20 would be trapping on all accesses into High Memory Area to let the trap handler sort idiot programs from legitimate users.
Not excusing it, but back then and earlier people used any trick they could to speed up the code or save space. Many of these tricks were very ingenious and probably made programming a lot more fun than it is today. Unless you were trying to read someone else’s code.
> the 8085 had 12 new instructions, but Intel made a last-minute decision to document only 2 of them. The reason? To keep things simple for the next chip, which was already being designed. That chip was the 8086
I've head this claim a lot but have failed to find any real citation for this being the reason for the choice. Does anyone know of any actual evidence that this was the cause?
A retrocomputing Stack Exchange [1] thread looks like a really good source. That in turn cites [2] with Stephen P Morse, 8086 architect, as first author. I'd consider that pretty authoritative.
The exact quote from the latter source is:
"Several other instructions that had been contemplated were not made available because of the software ramifications and the compatibility constraints they would place on the forthcoming 8086."
[1]: https://retrocomputing.stackexchange.com/questions/8040/whic...
[2]: Intel Microprocessors: 8008-8086 published in IEEE Computer, Vol 13, No. 10, page 46, October 1980
Awesome. Thanks.
I know this article is more about the instruction set, but I'm kind of surprised it entirely skips mentioning the 386SX (and the AMD 386SX), which was wildly popular in the lower end of home computers and some basic laptops for quite a while in the windows 3.0/3.1 era.
The best anecdote I know about 386SX came for Computer History Museum Intel panel - cost of fully manufactured and packaged 386SX was $5 in 1988! And they started at $219. Magic money printer with tons of room to crush AMDs attempts at taking over low end. And Intel did crush, especially after losing 386DX lawsuit, all the way from flagship Am386DX-40 Q2 1991 $231 down to Q1 1993 $51 bottom feeder.
Industry press was super sure Intel intended to aggressively move lowend into 486SX. They didnt know the little secret of 386SX total manufacturing cost, those chips were practically free for Intel. 486SX introductory price took press by surprise and started turning some of those predictions.
One of the first 486SX coverage was this Byte https://www.worldradiohistory.com/Archive-Byte/90s/1991/Byte... with front page tag line "486SX vs Am386-40 Lab analysis reveals a surprise winner" while cover story is already titled "The 486SX Falls Short" giving away the surprise
Some were still slow to pick up whats up with articles like "Price War Coming?" in JANUARY 22, 1992 MICROPROCESSOR REPORT speculating "...Since Intel hopes to draw system makers and buyers away from the 386 and toward the 486SX, very aggressive pricing on that device is likely", but something was in the air with "The transition from the 386 to the 486 will not be nearly as rapid or as complete as the 286-to-386" and "Despite Intel’s 486 push, the 386SX and 386DX will remain the volume leaders in 1992, and Intel will have to share this market with its competitors"
386SX-16 and 25 hit $33 in 1993 and were perfectly fine for small cheap compact 386 to run Windows 3.1 in 386 Enhanced mode + maybe some Win32s, Windows 3.1 + 32-bit disk access, Windows for Workgroups 3.11 + 32-bit file access + 32-bit networking aka run of the mill office computers for doing boring office work.
high quality here
is this a consumer grade CPU or it's a enterprise grade?
Yes.