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

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

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

958 Views
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?
 
Labels (1)
0 Kudos
1 Reply

263 Views
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 Kudos