42

The 32-bit register names start with an E and the 64-bit ones start with an R. What do the E and R stand for? Is there a reason for choosing these alphabets?

Also, in 64-bit registers, too, we can see in any low-level debugger such as Windbg that the right-most bits are still referred to by the same name as that of the 64-bit register except the name starts with an E. For e.g. the right-most 32 bits of the RAX register in a 64-bit system is referred to as EAX.

So, do the E and R stand for something? And also, why the suffix X for register?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
  • Partially at least http://stackoverflow.com/questions/5125729/where-can-i-find-x86-register-names – Sami Kuhmonen May 12 '17 at 08:59
  • @SamiKuhmonen Thank you. – Water Cooler v2 May 12 '17 at 09:21
  • @LưuVĩnhPhúc Thank you. – Water Cooler v2 May 12 '17 at 09:28
  • `E` means extended http://stackoverflow.com/a/1753618/995714 [What does the 'R' in x64 register names stand for?](https://softwareengineering.stackexchange.com/q/127668/98103). [What does X mean in EAX,EBX,ECX…?](http://stackoverflow.com/a/2545226/995714). [What does E in ESP mean?](http://stackoverflow.com/q/2537367/995714) – phuclv May 12 '17 at 09:31
  • 1
    @LưuVĩnhPhúc: I'm closing some of the older questions as duplicates of this, when appropriate. This looks like it has the most canonical answer, especially since it sources the "R" naming to that mailing list post by an AMD architect. – Peter Cordes Jul 08 '17 at 04:13

1 Answers1

51
  • R just stands for "register". The AMD64 ISA extension added 8 additional general-purpose registers, named R8 through R15. The 64-bit extended versions of the original 8 registers had an R prefix added to them for symmetry.

  • E stands for "extended" or "enhanced". (Wikipedia says "extended".) They are the "extended" versions of the 16-bit registers, in that they offer 16 additional bits for 32 bits total.

  • X is also for "extended"—or perhaps it implies 16 as in hexadecimal.* The X-suffixed registers are the 16-bit extended versions of the 8-bit registers. For 8-bit registers, the L suffix means "low", and the H suffix means "high".

Therefore, taking one particular register as an example, you have the 8-bit AL and AH registers, which are the low and high bytes of the 16-bit AX register, which is the low word of the 32-bit EAX register, which is the low double-word of the 64-bit RAX register.

| 63 - 32 | 31 - 16 | 15 - 8 | 7 - 0 |
======================================
.         .         | AH     | AL    |
.         .         | AX             |
.         | EAX                      | 
| RAX                                |
======================================
| 63 - 32 | 31 - 16 | 15 - 8 | 7 - 0 |

__
* X was used in the mnemonics (such as LXI and DCX) on the 8080 for instructions that treated a pair of otherwise-separate 8-bit registers as a 16-bit integer, similar to how AX represents the AH:AL pair. Thus, another possible interpretation is that X means pair, and this usage was continued when naming the high:low pairs on subsequent processors, including the 8086, which was a full 16-bit extension of the 8080.

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • 2
    https://stackoverflow.com/a/2565092/224132 suggests that the X may stand for "pair". 8080, an ancestor of 8086, could use pairs of 8-bit registers as a 16-bit integer or pointer the same way that CX is the CH:CL register-pair. – Peter Cordes Jul 08 '17 at 03:47
  • Thanks, good find. While I agree that's an interesting historical tidbit worth incorporating into a canonical answer, I'm not sure it convinces me that "X" actually stands for "pair". It probably still stood for "extended", since these instructions were "extended" to operate on 16-bit pairs. @Peter – Cody Gray - on strike Jul 08 '17 at 07:44
  • Yeah, while editing your answer after leaving my first comment, I decided it probably means / comes from pair but doesn't literally stand for it. IDK if I.J. Kennedy really meant to say it *stood for* pair, or just meant to illustrate the 8080 history. – Peter Cordes Jul 08 '17 at 07:45
  • 1
    Also related: [Why are first four x86 GPRs named in such unintuitive order?](https://retrocomputing.stackexchange.com/q/5121) has some good stuff about how designing 8086 for easy source-porting from 8080 asm influenced the design of the register set. – Peter Cordes Jul 20 '18 at 03:16
  • Related: writing AL, AH, or AX just merge a new value into that low part of RAX. Writing EAX zero-extends into the full RAX. [How do AX, AH, AL map onto EAX?](https://stackoverflow.com/q/15191178) – Peter Cordes Nov 04 '22 at 07:46