On 24 Jul 2008 at 8:27, Murray Greenman wrote:

>  and second that the time around the loop is
> changed by the instructions involved in loading.

Well, the timing can be kept constant by always adding in a value.

For the AVR, using a branch to test for overflow is not necessary: ROL 
followed by ANDI will get carry (instead of overflow as we are performing 
unsigned arithmetic) into the bottom bit of a register from where it can 
be used to index for the appropriate value (0 or 52,947) to be added. 

So the relevant calculation can be done with straight-through code, 
without any branches, giving a constant instruction count.

Regards from Cambridge

Chris
G3RSE


_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Reply via email to