Keil™, An ARM® Company

Technical Support

LX51: LOCATING PROGRAM OR VARIABLES TO SPECIAL AREAS


Information in this article applies to:

  • C51 Version 7

QUESTION

I am writing an IAP loader and would like to locate it in the first 1024 Bytes of my CODE memory. How can I ensure this? I have tried to use wildcards, but this did not work out, since it collidates with interrupt vectors.

ANSWER

The best approch is to locate the program code with a USER CLASS. User classes are an extension of the LX51 Linker/Locater (which is available in the PK51 Professional Developer's Kit).

For example, you can write the following pragma within the C source files that contain the IAP loader program code:

#pragma userclass (code = IAP)    // generates CODE_IAP class

This userclass directive places the program code of the module to the memory class CODE_IAP. Now you can separately locate this memory class when you enter it in µVision under Project - Options for Target - LX51 Locate - User Class. To locate the IAP code to the first 1KB of your program section enter here.

CODE_IAP (C:0 - C:0x3FF)

Note that you have to select the Use Extended Linker LX51 under Project - Options for Target - LX51 Locate - User Class.

MORE INFORMATION

  • Refer to USERCLASS in the Cx51 User's Guide.
  • Refer to CLASSES in the LX51 User's Guide.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Thursday, August 17, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure