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

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

Re: [avr-gcc-list] Re: Wierd Calls.


From: Dave Hylands
Subject: Re: [avr-gcc-list] Re: Wierd Calls.
Date: Thu, 12 Mar 2009 07:24:30 -0700

I meant to sent my last reply to the list.

Hi David,

On Wed, Mar 11, 2009 at 2:17 PM, David VanHorn <address@hidden> wrote:
>>
>>
>> The assembly above comes from the __udivmodhi4 helper function (found
>> in libgcc.a), which is a helper function for performing a 32-bit
>> divide.
>
>
> Let me guess.. It was stuck on below the LCD routines in memory, and AVR
> Studio didn't know that somehow?

Yeah - libgcc.a probably isn't compiled with debug information.

> I'm still puzzled as to why the compiler didn't change:
>
> // This takes 53uS at 4 MHz
> Bin = ( A / Data_Divisor )  // Data_Divisor is a constant, 32.

If I declare

const uint32_t Data_Divisor = 32;

then it calls the helper function, but if I declare

const int Data_Divisor = 32;

then it appears to use the shift.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/




reply via email to

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