| ??? 02/14/07 15:54 Read: times Msg Score: +1 +1 Informative |
#132926 - Optimizing C Responding to: ???'s previous message |
Especially when I plan on doing this in C so cannot optimize the assembly code apart from Keil's creation. <p>
That's not quite true. Or at least you can try to avoid many pitfalls in C that would make your program slower than it has to be. Knowledge of '51 assembly is required (and you need to verify the compiler's output). For example,
while(somechar-- != 0)
{
DO_STUFF
}
and
do
{
DO_STUFF
} while(--somechar != 0)
might look very similar in C, the latter is quite a bit faster, especially when DO_STUFF doesn't to a lot. |



