??? 03/10/08 11:33 Read: times Msg Score: -1 -1 Answer is Wrong |
#152074 - Cycle counting. Responding to: ???'s previous message |
If you write in 8051 assembler you can count cycles directly.
If you write in C you can view the generated assembly. Now when you have some fairly trivial code, I expect you can hand optimize this generated code. Or perhaps you look at it and think: If I was a compiler I could never do better. I would guess that this sort of loop falls into the latter category. If you can hand optimise it, by all means do. You have now got your assembly source file. If it was as good as it was ever going to get, leave it in C. I would prefer the hardware solution to this anyway, since you could keep in a HLL. David. |