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

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

[avr-gcc-list] avr-gcc ABI question


From: Trampas
Subject: [avr-gcc-list] avr-gcc ABI question
Date: Wed, 12 Jan 2005 12:44:38 -0500

First off I am using avr-gcc 3.4.1 I have the following function and was
wondering if the return value was correct. That is where I call the function
it looks to be reading r24 and r25 as the 16bit return value.

UWORD getMilliSeconds()
{
        UWORD temp;
        TIMSK=TIMSK & ~(1<<OCIE1A); //Turn Timer1 compare 1A interrupt off
 174:   89 b7           in      r24, 0x39       ; 57
 176:   8f 7e           andi    r24, 0xEF       ; 239
 178:   89 bf           out     0x39, r24       ; 57
        temp=MilliSeconds;
 17a:   20 91 20 01     lds     r18, 0x0120
 17e:   30 91 21 01     lds     r19, 0x0121
        TIMSK=TIMSK | (1<<OCIE1A); //Turn Timer1 compare 1A interrupt on
 182:   89 b7           in      r24, 0x39       ; 57
 184:   80 61           ori     r24, 0x10       ; 16
 186:   89 bf           out     0x39, r24       ; 57
        return temp;
}
 188:   c9 01           movw    r24, r18
 18a:   08 95           ret

Thanks 
Trampas




reply via email to

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