8-16 bit: using constants in segments?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

8-16 bit: using constants in segments?

ソリューションへジャンプ
1,401件の閲覧回数
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 解決策
452件の閲覧回数
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 返信
453件の閲覧回数
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 件の賞賛