[Top][All Lists]

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

[avr-gcc-list] avr-as: .byte SYMA - SYMB?

From: Joerg Wunsch
Subject: [avr-gcc-list] avr-as: .byte SYMA - SYMB?
Date: Tue, 27 May 2003 11:19:48 +0200
User-agent: Mutt/1.2.5i

(I figure avr-as is not fully on-topic, but since the developers of
avr-gcc and avr-as are identical, i'd rather post that here than on

I tried to define a byte in avr-as to the difference of two
(relocatable) symbols.  I pulled my hair out, but failed so far.

So something like:

SYMA:   mov     rthis, rthat
SYMB:   ldi     rthat, 42
        .byte   SYMA-SYMB

This should be possible, since the difference of two relocatable
symbols is an absolute value by itself.  It's even an absolute value
that can be computed by the assembler in that case (as opposed to one
that is only known at link time).

I always get an "illegal relocation size: 1" message.
Just-shoot-around-without-knowing-what-i'm-doing attempts to use lo8()
or pm() only add "garbage at end of line" messages to this.


        .word   SYMA-SYMB

however does work (and yields the expected result).

I see that message comes from avr_cons_fix_new() in
gas/config/tc-avr.c, but the constraints of what could be handled in
this function are unintelligible to me at the first glance.
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

reply via email to

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