Dmitry Kiryashov wrote: >> Andy Shaw wrote: >> >Does anyone out there have any code for a reasonably >> >fast divide by 10 routine. Dmitry's creative solution with a suggestion: >;+1/2 > clrc > rrf X,W > movwf Y > >;+1/16 > swapf X,W > andlw 0xF > addwf Y,F ; *** New code inserted *** swapf X,W ; 1/16 + 1/16: improves round off andlw 0xF ; addwf Y,F ; > >;+1 > movfw X > addwf Y,F > >;/16 > swapf Y,W > andlw 0xF > > skpnc > addlw 0x10 > movwf Y -- Bob Fehrenbach Wauwatosa, WI bfehrenb@execpc.com