Keil Logo

Program Memory

Program (CODE) memory is read only; it cannot be written to. Program memory may reside within the MCS® 251 MCU, it may be external, or it may be both, depending upon the 251 derivative and the hardware design.

  • The 251 architecture supports up to 64K Bytes of program memory. However, program space can be expanded using code banking.
  • Some devices offer a larger code space.
  • Program code, including all functions and library routines, is stored in program memory.
  • Constant variables may also be stored in program memory.
  • The 251 executes programs stored in program memory only.
  • Program memory may be accessed from your C programs using the code memory type specifier.


  • The code memory type is implemented for compatibility to the C51 compiler. Instead of code, you should use const near or const far. This generates typically better code and should be used in new 251 applications instead of the memory type code.
  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.