8-16 bit: using constants in segments?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

8-16 bit: using constants in segments?

跳至解决方案
1,883 次查看
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

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
934 次查看
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 项奖励
回复
1 回复
935 次查看
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 项奖励
回复