IDIV Undefined

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi All,
I am getting the following error in code warrior while linking a small
program. I am using HC08 edition.
"L1822 : Symbol _IDIVS is undefined". My code is as follows.
    int i,j;
    i = i/j;
I think the compiler generates the object code with the _IDIVS symbol.
But the Linker is not able to link this symbol. I know, I can
eliminate this by linking using ansi.lib file. But due to my memory
size limitation, I can't use any lib files. So how to over ride this
problem. Any idea?. Is there any compiler or linker settings is
available to solve this problem?

Thanks in advance
Shibu

Re: IDIV Undefined

Quoted text here. Click to load it


1. Don't use division.
2. If you have to use it, consider multiplicating by reciprocal instead.
3. If this doesn't fit, write your own _IDIVS function and link it in.

  Vadim

Re: IDIV Undefined

Quoted text here. Click to load it

Your choices are:

   1) Remove all division from your program.
   2) Link in ansi.lib.
   3) Write your own division routine and call that rather than using
      the / operator.

I would suggest option 2.  If the only thing you are using in ansi.lib
is _IDIVS (and CodeWarrior is a reasonable system for embedded
development), that should be the only routine taken from the library.
Any routine you write yourself is likely to be both larger and wrong.

Regards,

                               -=Dave
--
Change is inevitable, progress is not.

Re: IDIV Undefined
Quoted text here. Click to load it

You can write your own _IDIVS function.

JJS

Re: IDIV Undefined

Quoted text here. Click to load it

This looks rather strongly like an overly strong conclusion.  You want
that routine, and that library is where that routine is, so by all
means you should use it.

Unless your toolset is broken beyond all imagination, which I'm quite
sure it's not, just allowing it to use a library will not all by
itself cause any waste of code memory.  It's just a library, after
all.

--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Re: IDIV Undefined
shibu snipped-for-privacy@yahoo.com (shibu) wrote in message
Quoted text here. Click to load it

Unless you write a special-purpose assembly routine (maybe with the
HC08's native 'DIV' instruction ,) you have to write or use a library

Re: IDIV Undefined
Quoted text here. Click to load it

Did you check what the linker includes besides _idivs ?
If it only takes _idivs, I doubt you can do any better, except
avoiding div !
---
42Bastian
Do not email to snipped-for-privacy@yahoo.com, it's a spam-only account :-)
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline