Eriks Ramblings

I have no problem things that are by me being named "Eriks Ramblings" or "Pithy notes from Erik Malund" AS LONG AS IT IS BY ME. However, when 47 people has changed it I object to being named as the author.


Rules for optimum '51 C

1) Take the darn PC hat off. '51 C is not "just c"
2) ALWAYS use the smallest size of a variable that will fit
3) Make counters in loops — instead of ++ wherever possible
4) Keil has - on request - provided for things like malloc, it is a disaster in a '51
5) The '51 has very powerful bit instructions - USE THEM. E.g. if a function can return TRUE or FALSE a bit is enough.
added by Steve
6) Frequently used variables shaould be byte wide variables that live in data memory.

7) Further optimise counting loops, by counting a byte wide variable DOWN to zero, to exploit the DJNZ instruction. WHOEVER added this did not read 4) which is the same.