We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
when I wrote a C code with division operation the compiler is generating some library calls.....when I tried to see the equivalent code for those function calls...I'm unable to reach there (may be because they arm library SW routines)...I cant use those SW routine calls...I can embed the equivalent code in my program( in assembly code). Form where I can get the Equivalent codes for division SW routines....I need codes for 32-bit/32-bit ,32-bit/16-bit & 16-bit/16-bit divisions....
Thanks in advance....
Hi Daith,
Thanks for your reply. I agree that it isn't always that simple. Many don't realise, for instance, that ASR doesn't exactly replace integer division because it doesn't round properly. But, as you say, this isn't something which you should undertake unless you really know what you're doing.
We might debate your comment about using the C compiler as an "assembler" another time. I have quite strong views on that! C is relatively "low-level" when compared with other high-level languages but I think it's wrong to thing of it as an assembly replacement. If you're trying to write assembly code, then my view is that you should use an assembler!
Chris
Chris Shore wrote: Thanks for your reply. I agree that it isn't always that simple. Many don't realise, for instance, that ASR doesn't exactly replace integer division because it doesn't round properly.
Chris Shore wrote:
Thanks for your reply. I agree that it isn't always that simple. Many don't realise, for instance, that ASR doesn't exactly replace integer division because it doesn't round properly.
Though to be honest I think floored division is superior to truncated division, especially with regard to the associated mod operator. But yes, the difference is something to be aware of.