AMD elevated the Intel Architecture to 64 bits. They doubled the size of the general registers from 32 bits to 64 bits and doubled the number of general registers from 8 to 16. They gave the new registers names based on numbers, startling correctly at zero. But they let the original 8 Intel registers keep their original names, slapping on an
r (for register) prefix. The names are confusing, error prone, and weird.
What is the difference between
rbp? What is the difference between
rdi? Humans are pretty good at distinguishing single letters and simple sequences of numbers, but we are less good at handling single letter differences in random strings of letters.
To understand how the names got that way, we have to look at the Z80, a popular 8 bit processor from Zilog. It was an upgrade of Intel's 8080, being binary compatible but with new instructions and registers that made it a little easier to program and a little bit faster.
It had seven 8 bit registers (
l) that could be paired to make 16 bit registers (
hl). In addition, Zilog added two so-called index registers (
Recognizing the crappiness of its 8 bit architecture, Intel intended to take a great leap forward with its brilliant 432 project, which they called a micro mainframe with excellent support for high level languages like Ada. Unfortunately, they allowed their design to become far too complex, and it became a spectacular failure. Meanwhile, Zilog, Motorola, and National Semiconductor were launching their 16 and 32 bit architectures, and Intel had nothing to compete with.
So there was a crash effort to make a 16 bit device that would keep them afloat until they could make something better. They did not have time for performance or elegance, so they went for compatibility. They designed a chip that was assembly language compatible with the Z80. The goal was that would feed your Z80 asm files to an Intel assembler, and out came code that ran on the new 8086 chip.
The compatibility play did not work. The stuff that ran on the Z80 was happy to stay on the Z80, which was much cheaper than the 8086. So they released a new assembly language specifically for the 8086 and gave the registers new names.
The first four registers have two halves. For example, the
bx register has two halves (
bl). That was for Z80 compatibility. It is not something you would expect to see in a well designed architecture.
The original 8086 contained several specialized instructions that used certain registers in unique ways.
Most of those instructions have fallen out of favor,
dx still have a special relationship with multiplication and division.
AMD kept those names as they were.
I prefer to use the simple numbered names. Less baggage. But I will continue to use
It is weird that they put the stack pointer in the middle of the list.
Another alternative would be to give each register a single letter name, like the 8080 did, but it seems likely that Intel will double the number of registers again to remain competitive with ARM64 and RISC-V. Twenty six letters just ain't enough.
IBM went shopping for a CPU for their PC, bought Intel, and the rest, sadly, is history. The 8086 was the worst of its class, and it was the winner. It established what has become known as the Intel Architecture, which has been an on-going embarrassment for Intel. They tried to supplant it with the 960, 860, and Iridium. All failed. AMD did a clever hack to make what is now known as x64. Hopefully, that eventually falls to RISC-V or something better.