So to elaborate on my previous really short reply. I really like the macro, it handles the hardcoding the number of elements issue well.
For the definition inside the loop. I may be trusting the optimizer too much, the definition outside the loop is technically more correct. Out of curiosity I'll see if I can get an assembly output to look at, as with these tiny processors that type of code checking is still of value.
In programming teams, as optimizers get better, the holy wars have started to move from coding style vs resulting assembly code to each individual programmer's perception of what must be easiest to read for them must therefore apply to everyone else. So, may have been beat-up in one of those wars.?
Readability and coding is a manner that is consistent with the style of the team are good things, though.?
Tom, wb6b