Register
A register is a temporary storage area built into a CPU. Some registers are used internally and cannot be accessed outside the processor, while others are user-accessible. Most modern CPU architectures include both types of registers.
Internal registers include the instruction register (IR), memory buffer register (MBR), memory data register (MDR), and memory address register (MAR). The instruction register fetches instructions from the program counter (PC) and holds each instruction as it is executed by the processor. The memory registers are used to pass data from memory to the processor. The storage time of internal registers is extremely temporary, as they often hold data for less than a millisecond.
User-accessible registers are larger than internal registers and typically hold data for a longer time. For example, a data register may store individual values referenced being by a currently running program. An address register contains memory addresses, which reference different blocks of memory within the system RAM. Many CPUs now have general purpose registers (GPRs), which may contain both data and memory addresses.
Registers vary in both number and size, depending on the CPU architecture. Some processors have 8 registers while others have 16, 32, or more. For many years, registers were 32-bit, but now many are 64-bit in size. A 64-bit register is necessary for a 64-bit processor, since it enables the CPU to access 64-bit memory addresses. A 64-bit register can also store 64-bit instructions, which cannot be loaded into a 32-bit register. Therefore, most programs written for 32-bit processors can run on 64-bit computers, while 64-bit programs are not backwards compatible with 32-bit machines.