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

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

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


From: Eric Weddington
Subject: Re: [avr-gcc-list] Basic inline asm question
Date: Wed, 23 Nov 2005 08:01:34 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

cavanus wrote:
Hello,

In this scenario:

        typedef {
                uint16_t x[10];
                uint8_t  y[4];
        } T;

        T t;

        // ...

        void function()
        {
                register uint16_t addr  __asm__ ("r30");
                register uint8_t  addrl __asm__ ("r30");
                register uint8_t  addrh __asm__ ("r31");

                // ...
        }

        // ...

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


I shoud try various typecasts in [???] but the compiler never match
the constraints...

Coud you explain more of what you are trying to do by using inline assembly?

--
Eric Weddington




reply via email to

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