avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] It is more than: .byte SYMA - SYMB


From: Erik Christiansen
Subject: Re: [avr-gcc-list] It is more than: .byte SYMA - SYMB
Date: Fri, 12 Sep 2003 11:13:41 +1000
User-agent: Mutt/1.3.28i

The feeling, that I need to be more careful about treating an address as
absolute, is creeping over me. The assembler handles the following
address differences fine, except with an intervening alignment
directive:

c: .string  "Hello World"
   .align 2
d: ldi   XH,pm_hi8(d - c)     <- OK
   ldd   r16,Y+(d - c)        <- Error: constant value required
a: ldi   XH,pm_hi8(b - a)     <- OK
b: ldd   r16,Y+(b - a)        <- OK

Now that it has finally sunk in, that the assembler _is_ parsing the
expressions, it appears I'm not giving it sufficiently constant
"constant expressions". The assembler may need the linker to resolve the
alignment, so the answer seems to be "Don't do that.".

Now all that remains is to replicate the above in data space, I expect.

Denis and Marek, please accept my apologies for doubting the parser.

Regards,
Erik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]