Keil Logo

Class Information

The linker creates special symbols (using no program or data space) that contain address and length information for classes used in an application.

Symbol Name Description
_class-name_S_1 The starting address of the class.
_class-name_B_ The code bank in which the class is stored.
_class-name_L_ The length of the class in bytes.
_class-name_E_ The ending address of the class.
_class-name_T_ The target (execution) address of the class.

You may create declarations from external variables to access this information. For example, use the following to get information about the length of the CODE memory class in the measure module:

extern unsigned char _code_L_;

unsigned code_length = (unsigned int) & _code_L_;

The SROM.H header file contains macro definitions that simplify access to memory class information:

#include <srom.h>

SROM_MC(code) // Create external declarations for the CODE Class

unsigned code_size   = SROM_MC_LEN(code);
unsigned code_start  = SROM_MC_SRC(code)1;
unsigned code_end    = SROM_MC_END(code);
unsigned code_target = SROM_MC_TRG(code);


  1. The start address symbols are only valid when a Special ROM class is used (SROM class). Otherwise the target address symbol indicates the start address.
  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.