Register
A register is a tiny storage location built into the processor itself, holding a single word of data, an address or a piece of control state, and fast enough that the arithmetic hardware can read it and write it within a single clock cycle. Registers are the only places where the processor actually operates: to add two numbers, the numbers must be in registers, and the result lands in one. Everything else in the memory system, from caches down to disks, exists to supply registers with values and to take values back from them, which makes registers the top and smallest rung of the memory hierarchy rather than a kind of memory a program browses.
Registers differ from every other storage in that they are named by the instruction, not found by an address. An instruction such as add rax, rbx names the registers in its own bits, so no address lookup, no cache search and no bus transfer is needed. The price is scarcity: the x86-64 architecture, introduced by AMD in 2003 with the Opteron, has 16 general-purpose registers of 64 bits, doubled from the 8 of 32-bit x86, while 64-bit ARM exposes 31 general registers plus a zero register and stack pointer, and RISC-V has 32 integer registers with the first hardwired to zero. A modern core has hundreds of physical registers behind these architectural names, and register renaming maps one onto the other so that independent instructions that reuse a name do not have to wait for each other.
Registers come in kinds, each with a special job beyond holding values. General-purpose registers hold operands and results. The program counter, called the instruction pointer on x86, holds the address of the next instruction, which is why a jump simply writes a new value into it. The stack pointer marks the top of the call stack, so function calls and returns move it up and down, and a status or flags register records outcomes such as zero, negative or carry that conditional branches inspect. Vector registers, widened to 256 bits with Intel's AVX in 2011 and to 512 bits with AVX-512, hold several numbers at once so one instruction can process them together, the basis of the numeric speed in libraries like NumPy. The processor core, the control unit and the arithmetic logic unit each have separate entries, and registers are the workbench they share.
Which values live in registers is decided by the compiler, an assignment problem that shapes the speed of every program. High-level languages let a programmer declare as many variables as desired; the compiler's register allocator must squeeze the ones in use at the same moment into the few available, and the classic technique of graph coloring was described by Gregory Chaitin and colleagues at IBM around 1981. When more values are live than registers exist, some are spilled to the stack in memory and reloaded later, which costs time. Calling conventions fix which registers a function may overwrite and which it must preserve, so that separately compiled code can interoperate. The C keyword register was once a hint to the compiler, but modern compilers largely ignore it because they allocate better than humans do.
Common confusions come from the word register itself, which has several unrelated senses. Registers are not part of main memory and not a cache, though both hold copies of values, because registers are explicitly named by instructions and managed by the compiler, whereas a cache is automatic and addressed implicitly. A variable in code is also not a register: it may live in one for part of its life and in memory for the rest, or in neither if the optimizer removes it. Outside processors, the Windows registry and hardware peripheral control registers share the name but are different things, though memory-mapped device registers are a real, related concept. For a programmer, registers matter mostly through performance: tight loops, shaders and GPU kernels run fastest when their working values fit, and GPU code that needs too many registers per thread limits how many threads can run at once.
Read a register as the processor's hands: the few slots where values are actually held and worked on, so everything else in the computer, however large, is ultimately a way of getting the right numbers into those hands at the right moment.