Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Division function

2004-11-03 by Michael Anburaj

Hi Dean,


--- Dean greaves <dgreaves@...> wrote:

> Hi Michael,
> 
>             I wrote a small application this morning
> with just the divide
> routine in it.  When I stepped through the assembly,
> I noticed that most of
> the function is actually missing ???

This could happen is a typical case like this:

void APP_vMain (void)
{
      unsigned int a=0, b=1000, c=10;
 
       //a=test(b,c);
       a = b/c;
 
       CONSOL_Printf("a = %d, b = %d, c =
 %d\n\n",a,b,c);
}

In the above code, the (high optimization) compiler
would know that the values in \ufffdb\ufffd & \ufffdc\ufffd are fixed,
hence it would optimize it away & load the value 100
(result of 1000/10) directly to \ufffda\ufffd. Due to this you
wont see a call made to __udivsi3. Because of this I
purposefully added a subroutine to do the division.

>  It does n't
> look like what you have at
> all.  I'm afraid I'm a bit of a rookie at this, I
> would be grateful for any
> help 
> 
>  
> 
> Please find attached my ELF file
> 

No elf file attachment on this email.

Cheers,
-Mike.



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.