Mortenc
Joined: 22 Feb 2007 Posts: 55
|
Math routines |
Posted: Fri Feb 15, 2008 7:43 am |
|
|
Hello CCS forum.
I new with C programming (old assembler programmer)
I'm wondering.
If I make a division like:
(oscillator is 8 MHz)
signed int16 a;
signed int16 b;
a = b/2
this will take very long (about 200 uS) , but if I change the variables to unsigned it will take < 10uS.
All assembler programmer will probably use a RRF (rotate right file)
to make this and thats what CCS compiler do when we use unsigned variables. Why don't they do that with signed variables and just just controlling the sign after this. It must be much faster.
Am I wrong? |
|