ARM Technical Support Knowledge Articles

RENAMING MULTIPLE DATA CLASSES IN C

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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.

Article last edited on: 2006-01-25 20:21:49

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential