linkedin facebook twitter rss

23 Dec register

Register as a verb can be used like “remember”.

A register (noun) can be a set of digital “locations” that, combined, are treated as a base unit of computing. A byte register is 8 bits in length,  a word 2 bytes, a doubleword 4 bytes and a quadword 8 bytes or 64 bits (commonly in use as a personal computing standard at the time of this writing).

The Tortall YASM Manual tells us about Intel CPU architecture:

The 64-bit x86 register set consists of 16 general purpose registers, only 8 of which are available in 16-bit and 32-bit mode. The core eight 16-bit registers are AX, BX, CX, DX, SI, DI, BP, and SP. The least significant 8 bits of the first four of these registers are accessible via the AL, BL, CL, and DL in all execution modes. In 64-bit mode, the least significant 8 bits of the other four of these registers are also accessible; these are named SIL, DIL, SPL, and BPL. The most significant 8 bits of the first four 16-bit registers are also available, although there are some restrictions on when they can be used in 64-bit mode; these are named AH, BH, CH, and DH.

The 80386 extended these registers to 32 bits while retaining all of the 16-bit and 8-bit names that were available in 16-bit mode. The new extended registers are denoted by adding a E prefix; thus the core eight 32-bit registers are named EAX, EBX, ECX, EDX, ESI, EDI, EBP, and ESP. The original 8-bit and 16-bit register names map into the least significant portion of the 32-bit registers.

64-bit long mode further extended these registers to 64 bits in size by adding a R prefix to the 16-bit name; thus the base eight 64-bit registers are named RAX, RBX, etc. Long mode also added eight extra registers named numerically r8 through r15. The least significant 32 bits of these registers are available via a d suffix (r8d through r15d), the least significant 16 bits via a w suffix (r8w through r15w), and the least significant 8 bits via a b suffix (r8b through r15b).

The figure below summarizes the full 64-bit x86 general purpose register set.

x86 General Purpose Registers

x86 General Purpose Registers

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.