Program Memory

Program memory can be read only. It cannot be written to. Program memory may reside within the 8051 CPU, or it may be external, or it may be both, depending upon the 8051 derivative and the hardware design. There may be up to 64 KBytes of program memory. Program code including all functions and library routines are stored in program memory. Constant variables may be stored in program memory, as well. The 8051 executes programs stored in program memory only.

Program memory can be accessed by using the code memory type specifier in C51.