A CPU register is the fastest memory a microcontroller has: it lives inside the processor core, is addressed directly by instructions, and is read or written in a single cycle. Everything the core computes passes through registers first, which is why understanding them is the first step in reading any firmware. This page sits alongside the classification of microcontroller memories, because registers are the volatile top of the memory hierarchy shown below.

Most cores expose a small bank of general-purpose registers. An 8-bit PIC uses a working register W together with a file-select register to reach data memory; an ARM Cortex-M offers R0 through R12 as general registers, with R13 as the stack pointer, R14 as the link register, and R15 as the program counter. These are the variables the assembly language actually moves and adds. When you trace a routine, the register contents at each step tell you more than the source code ever could.
Beyond the general bank, a microcontroller maps its peripherals into special function registers, or SFRs. Writing to an SFR configures a timer, starts an ADC conversion, or toggles an output pin; reading one reports status. Because SFRs share the same address space as data RAM on many parts, a single instruction can touch either. The boundary between “CPU register” and “peripheral register” blurs, which is exactly what makes microcontroller pin definition and register work inseparable during bring-up.

The program counter, or PC, holds the address of the next instruction. Every branch, call, and interrupt shifts it, and any attack that diverts the PC – by glitching a compare or overwriting the stack – changes what the chip executes next. The stack pointer manages return addresses for subroutines and interrupts; a corrupted stack is the classic path from a small bug to a full takeover. These registers are why a MCU attacking technique often targets the first few clock cycles after reset.
The status register records the outcome of the last operation: zero, carry, negative, and overflow bits let conditional branches decide. Skipping or forcing a flag is the simplest fault-injection win, because security checks are usually “if password matched, branch”. A single wrong flag sends execution past the gate. This is the heart of the attacking chip unpredictability method, where a glitch makes the core mis-judge its own state.
When a locked device is read, the static memory is only half the story; the volatile registers held keys, pointers, and intermediate results that vanish on power loss. Capturing them requires observing the live part, not just dumping flash. The how the MCU memory works guide covers the non-volatile side, while any hands-on recovery treats registers as the moving part of the puzzle.
Some cores hide extra complexity behind banking. An 8051 switches between four register banks by flipping two bits, so the “same” R0 can address four different physical locations depending on which bank is active. Mid-range PIC parts use a comparable trick with bank-select bits inside a status register. Keeping track of the active bank is a constant chore during disassembly and a frequent source of misread logic, because an instruction that looks like it touches one variable may actually touch another.
Because registers are volatile, capturing them means observing the chip while it runs rather than after power is removed. A debugger or a bus logic analyser can snapshot the working registers at a chosen moment – for example, just before a routine that clears a key – and that snapshot often explains a firmware behaviour the static flash dump alone cannot show. Hands-on recovery therefore treats registers as evidence instead of noise, and pairs the live capture with the non-volatile read described in the how the MCU memory works reference.
Vendor manuals use different names for the same idea – WREG, ACC, or R0 – so mapping a new core means first translating its register vocabulary. The effort pays off immediately, because once the working registers and the status flags are known, the rest of the firmware’s logic becomes readable. The what is assembly language page closes the loop by showing how those registers appear inside the instructions themselves, so the two references are best read together.
In short, registers are where the CPU meets the code. Learn their names and roles on your target core, and the rest of the firmware starts to read like prose.