Hi, I've been thinking about time delays and have read the code posted on the Fast Forward answers page, but for timing short delays 4 registers seems enormous overkill. I've devised the following and would appreciate comments and (more important) improvements. Apologies if I have reinvented the wheel. Keith. ; A flexible delay generator. ; =========================== ; ; This should allow delays in the range 18 to 1700 cycles with no missing ; values. It uses only one register, a six step subroutine and four bytes ; of code per call. ; ; Total time is : ; ; 3 cycles (setup) ; 2 cycles (call) ; 3 x contents of 'count' ; 4 x contents of W ; subtract 2 for nops following bit tests ; 2 cycles (return) ; ; count equ 0x10 ; Register used by delay. . . movlw 0x?? ; number of 3 cycle loops movwf count movlw 0x?? ; number of 4 cycle loops call Delay . . Delay addlw -1 btfss STATUS,Z goto $-2 decfsz count,F goto $-1 return ========================================================== Keith Dowsett "Variables won't; constants aren't." E-mail: kdowsett@rpms.ac.uk Phone: 0181-740-3162 Fax: 0181-743-3987 Snail mail: MRC Clinical Sciences Centre, Cyclotron Unit. Hammersmith Hospital. London W12 0NN.