This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

The nature of BAD RELOCATABLE EXPRESSION

hi,

Let assume that one .asm file contains next definitions:

PUBLIC FLAG1,FLAG2
FLAG1	EQU	00000001b
FLAG2	EQU	00000010b

and the second file contains next line:
	MOV	A,#(FLAG1 OR FLAG2)

When compiling, it produces A14 error:

BAD RELOCATABLE EXPRESSION:
A relocatable expression may contain only one relocatable symbol which may be a egment symbol, external symbol, or a symbol belonging to a relocatable segment.
Mathematical operations cannot be carried out on more than one relocatable symbol.

I understand the mean of this error and have found some workarounds. But could I ask: what is the nature of this limitation? Is it just from pure compiler or the reason is more complex?

Thanks,
Oleg

Parents
  • I have nothing about this particular case, however I have, since ages, abolished extern constants. I honestly do not remember why, but it was something like what you refer to. so, today, and since whenever, all constants are in .inc or .h files. I did ask Keil support and got an answer I could accept/understand as to why but what it was is long lost.

    Erik

Reply
  • I have nothing about this particular case, however I have, since ages, abolished extern constants. I honestly do not remember why, but it was something like what you refer to. so, today, and since whenever, all constants are in .inc or .h files. I did ask Keil support and got an answer I could accept/understand as to why but what it was is long lost.

    Erik

Children
No data