Keil Logo

C166: RENAMING MULTIPLE DATA CLASSES IN C


Information in this article applies to:

  • C166 Version 3.00 and Later

QUESTION

I need to create multiple data classes in a single file. For example, the following would be ideal:

#pragma RENAMECLASS (NDATA=SPECIALCLASS)
static unsigned byte Spare[512];

#pragma RENAMECLASS (NDATA=NORMCLASS)
static unsigned byte Finished;

Is there a way to do this in C166 Version 3?

ANSWER

This is not available in C166 Version 3 since you can only use the RENAMECLASS directive once for each class in a C file. However, the following work-around may help.

You may use the INIT and NOINIT pragmas to specify which data goes into the NDATA0 and NDATA classes. Then, you can rename these classes. For example:

#pragma INIT
#pragma RENAMECLASS (NDATA0=SPECIALCLASS)
static unsigned byte Spare[512];

#pragma NOINIT
#pragma RENAMECLASS (NDATA=NORMCLASS)
static unsigned byte Finished;

Typically, the stuff that goes into NDATA0 is cleared to 0 when your program starts. You may specify if the NDATA0 class should be cleared to 0 in START167.A66.

Last Reviewed: Wednesday, January 25, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.