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

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

Re: [avr-gcc-list] Calling functions (-udivhi3) from asm ?


From: Larry Barello
Subject: Re: [avr-gcc-list] Calling functions (-udivhi3) from asm ?
Date: Sat, 10 Mar 2001 08:20:13 -0800

.extern _udivhi3

regarding setting/clearing bits:

find and look at iomacros.inc

efficient code:

Use automatics.
switch() is really efficient
pass pointers to structs that contain your data.

In general: generate assembly listings (-S) and learn about
what the compiler is doing.  That will teach you a lot about
what works and what doesn't.  The compiler guys won't like
you doing this because then you write to the peculiarities
of the compiler, but with small parts like AVR I think that
is mandatory.

Cheers!

----- Original Message -----
From: "Robert Rozman" <address@hidden>
To: <address@hidden>
Sent: Saturday, March 10, 2001 5:20 AM
Subject: [avr-gcc-list] Calling functions (-udivhi3) from
asm ?


> Hello,
>
> after some work in gcc, I have some small parts of project
that I'd like to
> implement in asm (I use avr-gcc assembler). But I ran into
problems:
> - I'd need function like itoa but I want function to
return pointer to last
> character - so I transferred itos.S into my project, make
changes and the
> try to compile - but I get error:
>
> : undefined reference to '_udivhi3'
>
> itoa.S calls this function with line :
>
>  XCALL _U(_udivhi3) ; quotient in rP1:rP0, remainder in
r26:r27
>
> I obviously don't know how to specifiy extern function in
asm file.
>
> But then I tried another solution for test - I've changed
original itoa.S,
> recompiled library and then used itoa as part of stdlib.
But I get same type
> of error. Is itoa functional as it is in original form or
I'm doing
> something wrong ?
>
> Of cource right solution is if I change some global
functions to include
> them as custom parts of my project - but I'd like to know
how to solve this
> problem in asm file so main question remains :
>
> How to properly call function '_udivhi3' from asm
procedure ? What
> definitions should I make ?
>
> Thanks in advance,
>
> Robert Rozman
>
>
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
>




reply via email to

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