Using CW for ColdFire v.6.4, target MCF5307, assembly error: "Illegal relocatable".

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

Using CW for ColdFire v.6.4, target MCF5307, assembly error: "Illegal relocatable".

1,385 次查看
Veter
Contributor I
I have this simple statement in my os_cpu_a.s file:
...
TER0 .equ ___MBAR+0x151
...
 
It seems quite legal but compiler throws exception bellow:
Error   : Illegal relocatable expression
os_cpu_a.s line 161   TER0 .equ ___MBAR+0x151
 
I'm quite sure the answer is very simple I just can't find any info in the help files.
Can anyone please give me a hint what I'm I missing here?
 
标签 (1)
0 项奖励
回复
1 回复

690 次查看
SimonMarsden_de
Contributor II
The CodeWarrior assembler only supports equates which can be fully resolved at assembly time. I think that a lot of assemblers work this way.

You can achieve the effect that you want by using a .textequ directive:

TER0:     .textequ "___MBAR+0x151"

When the assembler encounters the symbol TER0 in the source code, it will substitute the string __MBAR+0x151 (Like #define in the C preprocessor).


Hope this helps


Simon
0 项奖励
回复