cavanus <[EMAIL PROTECTED]> wrote:
> void function()
> {
> register uint16_t addr __asm__ ("r30");
> register uint8_t addrl __asm__ ("r30");
> register uint8_t addrh __asm__ ("r31");
That does not make sense at all (IMHO). Variables bound to registers
need to be used on global level. Also, r30/r31 are not available for
that purpose.
> How to generate in function() this assembly lines (loading address
> of global structure [t] in [rZ]) using avr-gcc inline asm?
> ldi r30, lo8(&t)
> ldi r31, hi8(&t)
> __asm__ __volatile__("ldi %0, %1" : "=r" (addrl) : "M" (???));
> __asm__ __volatile__("ldi %0, %1" : "=r" (addrh) : "M" (???));
Better explain your overall goal than trying to get the compiler into
generating exact the assembly code you want. If you want to program
in assembly language, don't use a compiler. If you want a compiler,
don't try forcing it to become an assembler.
--
J"org Wunsch Unix support engineer
[EMAIL PROTECTED] http://www.interface-systems.de/~j/
_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list