What do the E and R prefixes stand for in the names of Intel 32-bit and 64-bit registers?

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 … Read more

Reading a register value into a C variable [duplicate]

Editor’s note: this way of using a local register-asm variable is now documented by GCC as “not supported”. It still usually happens to work on GCC, but breaks with clang. (This wording in the documentation was added after this answer was posted, I think.) The global fixed-register variable version has a large performance cost for … Read more

Program Counter and Instruction Register

You will need both always. The program counter (PC) holds the address of the next instruction to be executed, while the instruction register (IR) holds the encoded instruction. Upon fetching the instruction, the program counter is incremented by one “address value” (to the location of the next instruction). The instruction is then decoded and executed … Read more

Why are RBP and RSP called general-purpose registers?

General purpose means all of these registers might be used with any instructions doing computation with general purpose registers while, for example, you cannot do whatever you want with the instruction pointer (RIP) or the flags register (RFLAGS). Some of these registers were envisioned to be used for specific use, and commonly are. The most … Read more

Intel 64, rsi and rdi registers

These registers were originally implicitly used in repetitive instructions, for instance MOVSB, which copies a byte from DS:SI (DataSegment:SourceIndex) to ES:DI (ExtraSegment:DestinationIndex), at the time of the 16-bits computers with segmented memory in real mode. And also as index registers in 16-bit addressing modes like [bx + si]. Right now, these registers are for example … Read more