25

For example, the accumulator is named EAX and, while the instruction pointer is called IP. I also know that there are bytes called CL and DH. I know there must be a convention to all of the names, but what is it?

Peter Cordes
  • 286,368
  • 41
  • 520
  • 731
eleven81
  • 6,151
  • 10
  • 36
  • 48
  • See also [Why are first four x86 GPRs named in such unintuitive order?](//retrocomputing.stackexchange.com/q/5121) on retrocomputing - more detail about how 8086 registers are designed to enable easy asm source compatibility with 8080. (Then 386 extended them to 32-bit, AMD64 extended them to 64-bit and added 8 new registers: [What are the names of the new X86\_64 processors registers?](//stackoverflow.com/q/1753602)) – Peter Cordes Nov 29 '19 at 23:23

5 Answers5

25

Something i found

* EAX - Accumulator Register
* EBX - Base Register
* ECX - Counter Register
* EDX - Data Register
* ESI - Source Index
* EDI - Destination Index
* EBP - Base Pointer
* ESP - Stack Pointer
Ólafur Waage
  • 66,813
  • 19
  • 139
  • 194
24

The C and the D are numbers/types and H for high and L for low parts of the higher register. http://en.wikipedia.org/wiki/X86

Wikipedia explains it very well.

More from the Wikipedia:

  1. AX/EAX/RAX: accumulator
  2. BX/EBX/RBX: base
  3. CX/ECX/RCX: counter
  4. DX/EDX/RDX: data/general
Daniel A. White
  • 181,601
  • 45
  • 354
  • 430
18

It's history. The x86 came from the 8086, which came from the 8080, which came from the 8008, which came from the 4004. There were 16-bit registers AX, BX, etc. and for the 80386 they got "extended" to 32 bits.

Added: BTW the Motorola 68K had 32-bit registers from the start, so it was much easier to program for the first couple decades. I worked on projects where Intel was chosen for business reasons, not technical.

Mike Dunlavey
  • 39,349
  • 13
  • 88
  • 132
  • The history isn't continuous - the 8080 has different register names, and those names came in with the 8086. Worth noting the CISC architecture here, with special purpose registers, in both the 8086 and 8080 variants, though - RISC came along later, with its 'all registers are much the same' approach (helped along by having 32 bits per instruction instead of trying to encode most instructions into 8 bits). – ijw Sep 16 '12 at 00:28
  • 1
    @ijw - but there are/were 8080 to 8086 translators, and there is a mapping. 8080's A register became AL, 8080's register pair B,C became CH, CL. 8080's register pair D,E became DH, DL. 8080's register pair H,L became BH, BL. 8086 includes LAHF and SAHF instructions which helps with 8080 to 8086 translation. 8086 added registers like SI (source index), DI (destination index), and BP (base pointer that defaults to SS segment register). – rcgldr Nov 25 '16 at 16:23
5

older processors have accumulators named A, B, etc (alphabeticaly orderd). When 16 and 32 bits accumulators were developed, engineers added an X (extended). So its all about history, as the language C is called this way becouse it was developed from B language (Bell labs).

The convention is only internal, to keep up with the names they are alredy familiar with.

Ped7g
  • 15,763
  • 2
  • 25
  • 54
RMAAlmeida
  • 294
  • 3
  • 13
5

Some good answers here: x86 assembly registers — Why do they work the way they do?

Community
  • 1
  • 1
D'Arcy Rittich
  • 160,735
  • 37
  • 279
  • 278