Keil Logo

Classic 8051 Memory Layout

The classic 8051 memory layout, shown in the following figure, is familiar to 8051 users the world over.

The classic 8051 architecture includes the following memory classes.

BIT, DATA, and IDATA

The BIT, DATA, and IDATA memory classes comprise the on-chip memory of the 8051 architecture and are shown in the following figure.

On-chip Data Memory

CODE and CONST

The CODE and CONST memory classes are typically stored in ROM that may be either off-chip or on-chip. The CODE memory class is used for the actual program code while the CONST memory class is used for constant variables declared in code space.

Code Memory

In addition, up to 32 code banks may be used for code banking applications. While these are technically located in code space, they are assigned their own address space. 

XDATA and PDATA

XData Memory

The XDATA memory class is typically stored in RAM that may be off-chip or on-chip (on newer devices). It contains external program data (named because it was off-chip on the original 8051 devices) including variables declared with the xdata and pdata memory types.

The PDATA memory class is a 256-byte page within the XDATA memory class.

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.