??? 11/15/04 11:55 Read: times |
#81165 - RE: Division by 32bit constant Responding to: ???'s previous message |
Sorry!
I have missed '/' symbols Must be: After profiling i've found the source of problem. When I convert 32 bit value to string, i use integer division : a= a/base. (base = 8,10,16). So, as I now, it's naturaly, because universal division function is very slow. For optimization developers usually use (in such cases) "division by constatnt" alghorithms. For example, if i need alghorithm a=a/8, I just write a>>=3; And that's all! But when I use 10 base system I need a = a/10 alghorithm. On PC there is standart agorithm (a = a*(2^32/base), in high 4 bytes we recive a*2/base). But this trick is possible only on 32bit architecture. QUESTION: Does anybody know algorithm for 32 bit value division by constatnt in the context of 8 bit architecture? I tryed to study Keil's sprintf version but it's a 'strong meat' for me... |
Topic | Author | Date |
Division by 32bit constant | 01/01/70 00:00 | |
RE: Division by 32bit constant | 01/01/70 00:00 | |
If it aint broke... | 01/01/70 00:00 | |
RE: If it aint broke... | 01/01/70 00:00 | |
RE: Division by 32bit constant | 01/01/70 00:00 | |
RE: Division by 32bit constant | 01/01/70 00:00 | |
RE: Division by 32bit constant![]() | 01/01/70 00:00 | |
RE: Division 32bit by 10 | 01/01/70 00:00 |