8-16 bit: using constants in segments?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

8-16 bit: using constants in segments?

Jump to solution
1,394 Views
irob
Contributor V
I'm trying to carve out a section of RAM in my *.PRM file. This works:

MY_DATA = READ_WRITE 0x008C SIZE 3;

This does not:

MY_DATA = READ_WRITE 0x008C SIZE PARAMETERS;

... where PARAMETERS is defined in my header file as:

#define PARAMETERS 3

Is there a way to do the above, putting in a defined constant in the PRM file? I'd prefer this, as sometimes the value of PARAMETERS changes depending on the version of firmware I'm working with.

Message Edited by CrasyCat on 2007-04-13 01:23 PM

Labels (1)
Tags (1)
0 Kudos
1 Solution
445 Views
CompilerGuru
NXP Employee
NXP Employee
Recent versions of CW for HC08/HC12 (out of my memory, I'm not sure since which version, sorry) have a checkbox in the linker preference which does cause that the compiler preprocessor is first run across the prm file.

If possible, I would stay with a simple prm file, and this means to keep the MY_DATA big enough for the content of all your firmwares so you dont have to do this conditional compilation (or macro replacement).

You can also place the variables with the @ operator (int blubs@x08c:smileywink:, then those memory ares should not occur in the prm file at all. And in C, preprocessing is possible, of course.

Daniel

View solution in original post

0 Kudos
1 Reply
446 Views
CompilerGuru
NXP Employee
NXP Employee
Recent versions of CW for HC08/HC12 (out of my memory, I'm not sure since which version, sorry) have a checkbox in the linker preference which does cause that the compiler preprocessor is first run across the prm file.

If possible, I would stay with a simple prm file, and this means to keep the MY_DATA big enough for the content of all your firmwares so you dont have to do this conditional compilation (or macro replacement).

You can also place the variables with the @ operator (int blubs@x08c:smileywink:, then those memory ares should not occur in the prm file at all. And in C, preprocessing is possible, of course.

Daniel
0 Kudos