[Top][All Lists]

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

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

From: Denis Chertykov
Subject: Re: [avr-gcc-list] It is more than: .byte SYMA - SYMB
Date: 12 Sep 2003 18:26:47 +0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Erik Christiansen <address@hidden> writes:

> 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

This happened because relocations for Y+N or Z+N not supported.
Please read GAS info about relocations.


> 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
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list

reply via email to

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