In short: The 8051's Special Function Registers are a block of 128 directly addressable byte locations in the 80H–FFH region of internal RAM that expose the CPU core (ACC, B, PSW, SP, DPTR) and every on-chip peripheral (ports, timers, serial port, interrupts) to your program.
If you have ever written MOV A, #0FFH or toggled a pin with SETB P1.0, you have been reading and writing Special Function Registers (SFRs) whether you realized it or not. On the classic Intel MCS-51 architecture, the SFRs are the control panel of the chip: a tightly packed region of memory-mapped registers that lets a handful of assembly instructions drive the ALU, the four I/O ports, the two timers, the UART, and the interrupt system. Understanding exactly where each register lives and what its bits do is the difference between guessing and engineering.
Where the SFRs live in the memory map
The 8051 has 256 bytes of on-chip RAM split into two overlapping halves. The lower 128 bytes (00H–7FH) are general-purpose RAM, including the four register banks and the bit-addressable area. The upper 128 bytes (80H–FFH) are the SFR space. Here is the subtlety that trips up newcomers: on an 8052 (and derivatives), addresses 80H–FFH are shared between the SFRs and an extra 128 bytes of indirect-only RAM. The addressing mode decides which one you hit — direct addressing (MOV A, 90H) reaches the SFR, while indirect addressing (MOV A, @R0 with R0 = 90H) reaches the hidden RAM. Same address, two physically different storage cells.
Key fact: Only 21 of the 128 SFR locations are actually implemented on a baseline 8051. Reading an undefined SFR address returns indeterminate data and writing it does nothing useful — never rely on "scratch" SFR bytes.
The CPU-core SFRs: ACC, B, PSW, SP, DPTR
These five registers are the heart of the machine. The Accumulator (ACC, address E0H) is the implicit operand of most arithmetic and logic instructions; the assembler mnemonic A refers to it. Because E0H is divisible by 8, ACC is bit-addressable — you can test ACC.7 directly in a conditional jump.
The B register (F0H) is the ALU's second hand. Its one indispensable role is multiply and divide: MUL AB places the low byte of the product in A and the high byte in B, while DIV AB leaves the quotient in A and the remainder in B. Outside those two instructions it is a convenient bit-addressable scratch byte.
The Program Status Word (PSW, D0H) carries the condition flags — Carry (CY), Auxiliary Carry (AC), Overflow (OV), the user flag F0, and parity (P) — plus the two register-bank select bits RS1:RS0. Switching banks by writing RS1:RS0 is a classic fast context-save trick for interrupt service routines, because it swaps R0–R7 to a fresh set of eight bytes in a single instruction. We cover every bit of this register in depth in our companion piece on the 8051 PSW register.
The Stack Pointer (SP, 81H) is an 8-bit register that pre-increments on PUSH and post-decrements on POP. On reset it holds 07H, so the stack starts growing upward from 08H — which is why leaving the default puts the stack on top of register banks 1–3. A professional startup routine almost always relocates it, e.g. MOV SP, #30H, to carve out clean stack space.
The Data Pointer (DPTR) is the only 16-bit SFR, physically two bytes: DPH (83H) and DPL (82H). It addresses external code and data memory via MOVC A, @A+DPTR and MOVX A, @DPTR, making it the workhorse for lookup tables in ROM and for talking to external peripherals.
| SFR | Address | Bit-addressable? | Primary role |
|---|---|---|---|
| ACC (A) | E0H | Yes | Main ALU operand |
| B | F0H | Yes | MUL/DIV, scratch |
| PSW | D0H | Yes | Flags + bank select |
| SP | 81H | No | Stack pointer |
| DPL / DPH | 82H / 83H | No | 16-bit data pointer |
| P0–P3 | 80/90/A0/B0H | Yes | I/O ports |
| TCON / TMOD | 88H / 89H | Yes / No | Timer control |
| SCON / SBUF | 98H / 99H | Yes / No | Serial port |
| IE / IP | A8H / B8H | Yes | Interrupt enable/priority |
Why multiples of eight are bit-addressable
Notice the pattern: ACC (E0H), B (F0H), PSW (D0H), P0 (80H), P1 (90H), IE (A8H), SCON (98H) — every bit-addressable SFR sits at an address whose low three bits are zero. The 8051 reserves 16 such SFRs so that bit instructions like SETB, CLR, and JB can encode a direct bit number. This is what lets you write SETB P1.0 to drive a single pin without a read-modify-write mask, a genuine advantage over architectures that force you to AND/OR whole bytes.
Peripheral SFRs: ports, timers, serial, interrupts
The four port latches P0–P3 (80H, 90H, A0H, B0H) double as data direction and data registers — writing a 1 configures a pin as a weak-pull-up input or drives it high. The timer SFRs TMOD (89H) and TCON (88H) choose the mode and start/stop the counters TH0/TL0 and TH1/TL1. The serial port uses SCON (98H) for framing control and SBUF (99H), a clever pair of physically separate transmit and receive registers sharing one address. The interrupt system is governed by IE (A8H) for enabling sources and IP (B8H) for two-level priority. A production 8051 firmware image, synthesized and verified with tooling from houses such as those behind Cadence and Siemens EDA flows, ultimately boils down to orchestrating exactly these registers.
Key fact: SBUF is two registers at one address — a write loads the transmit shift register, a read returns the received byte. This is why you can transmit and receive "simultaneously" in full duplex without a second address.
For a hands-on treatment of configuring the counters, see our tutorial on 8051 timer and counter programming, and browse the full catalog on our courses page.
A worked example
Suppose you want to blink an LED on P1.0 using Timer 0 in 16-bit mode. You would write MOV TMOD, #01H (mode 1, timer 0), seed TH0/TL0 with a reload value, set SETB TR0 in TCON to start it, and poll or interrupt on TF0. Every step is a single SFR access — no library, no abstraction layer, just the register map. That directness is why the 8051 remains a teaching staple and still ships in billions of units a year inside USB controllers, keyboards, and smart cards.
Teams building real silicon around 8051-class cores often pair this software view with RTL verification and physical design services — the kind of end-to-end flow offered by Avecas VLSI design services — so the register map you program against matches the netlist that gets taped out.
FAQ
How many SFRs does the 8051 have?
The address space reserves 128 locations (80H–FFH), but a baseline 8051 implements only 21 of them. The 8052 adds a few more (T2CON, RCAP2, TH2/TL2) for the third timer.
Why is the Accumulator called ACC instead of just A?
ACC is the SFR name tied to address E0H, used when you address it directly or by bit (ACC.7). A is the shorthand the assembler recognizes in register-implied instructions like ADD A, R0. They refer to the same physical register.
Can I use any SFR address as extra RAM?
No. Only implemented SFRs behave predictably. On an 8052 the indirectly-addressed upper RAM gives you 128 extra bytes, but you must reach it with @Ri, not direct addressing, or you will hit the SFR instead.
Is DPTR a real 16-bit register?
Functionally yes, but physically it is two 8-bit SFRs, DPH (83H) and DPL (82H), that the data-pointer instructions treat as one 16-bit value.
Go deeper: CourseTron's Embedded Systems with 8051 track walks you from the register map to interrupt-driven firmware on real hardware. Want industry-grade VLSI and training alongside? Explore ChipXpert's VLSI training programs.