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

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

Re: [avr-gcc-list] lokal vars


From: Peter Bosscha
Subject: Re: [avr-gcc-list] lokal vars
Date: Sun, 24 Mar 2002 08:28:33 +0200

Hi,

Local variables are placed on the stack.
The operation that reserves space leaves register pair R28/R29 (Y reg)
pointing to the local space. If the array is the only local space that
is assigned, then R28/R29 is pointing at element 0 of your array.
Take care that you don't mess R28/R29 up otherwise you'll never get out
of doSomething().

The best thing to do is to look at your list file and make sure that
your call only reserves 10 bytes on the stack, then you're pretty sure
only your array is stored there..

Regards
Peter

>>> Torsten Hahn <address@hidden> 03/22/02 13:15 PM >>>
Hi,

is it possible to access local variable in assembler ?

I want do something like:

void doSomething()
{
        uint8_t array[10];

        __asm__ volatile ("

        ; do something with the datas in array

        ");
}

Regards,
Torsten.
-- 
Torsten Hahn 
TU Bergakademie Freiberg - Institut für Experimentelle Physik 
Silbermannstraße 1, 09596 Freiberg
mail: address@hidden
phone: +49 3731 392670 
avr-gcc-list at http://avr1.org


avr-gcc-list at http://avr1.org



reply via email to

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