Special Function Registers

The 8051 family of microprocessors provides a distinct memory area for accessing Special Function Registers (SFRs). SFRs are used in your program to control timers, counters, serial I/Os, port I/Os, and peripherals. SFRs reside from address 0x80 to 0xFF and can be accessed as bits, bytes, and words. For more information about special function registers, refer to the Intel 8-Bit Embedded Controllers  handbook or other 8051 data books.

Within the 8051 family, the number and type of SFRs vary. Note that no SFR names are predefined by the C51 compiler. However, declarations for SFRs are provided in include files.

C51 provides a number of include files for various 8051 derivatives. Each file contains declarations for the SFRs available on that derivative. See the section entitled, “8051 Special Function Register Include Files” in the “Library Reference” chapter for more information about include files.

C51 provides access to SFRs with the sfr, sfr16, and sbit data types. The following sections describe each of these data types.