[Top][All Lists]

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

AW: [avr-gcc-list] Basic inline asm question

From: Haase Bjoern (PT-BEU/EMT) *
Subject: AW: [avr-gcc-list] Basic inline asm question
Date: Wed, 23 Nov 2005 16:40:08 +0100


>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" (???));

For me your example looks like very strange code. My difficulty is that
I do not understand what you plan to do and why you whish to use inline
assembly in the first line. If you whish to force some operand into Z,
it might be better to simply use the "z" register constraint for the
variable you whish to be kept in r30 - r31 and leave it to the compiler
to find the optimum register usage.?
If you could give a bit more details on what you whish to do, we might
be able to help better.


reply via email to

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