>> repeat >> if overflow then >> begin >> hi := hi + 1; >> clear overflow >> end{if}; >> lo := timer >> until not overflow > >Or just > > lo = timer > if (overflow) { > lo = timer > ++hi > clear overflow > } > >I think this will save one instruction, and seems a trifle clearer. This is just unrolling the loop once. The number of instructions is the same (you save a test on "overflow" but add a "lo = timer"). I prefer the looped version because it handles the situation where the timer overflows immediately after you've cleared overflow. This seems a trifle more robust to me. It also more closely matches what I intuitively expect the code to do, which is to tell me the current 'time'. ___Bob