Andy Shaw wrote: >Hi Folks, >Does anyone out there have any code for a reasonably >fast divide by 10 routine. I'm just looking for a rounded >up 8 bit signed value as the result I don't need the >remainder. It's not clear how large your dividend is, but if it is a single byte, take a look at this from Andy Warren. (Posting this for Andy W in case he is taking a nap.) Note that this is unsigned arithmetic. ; 8-Bit Divide. Written by Andy Warren. ; ; Copyright (C) 1994 Fast Forward Engineering. All rights reserved. ; Permission is hereby granted for any non-commercial use, ; so long as this copyright notice remains intact. ; ; Enter with Dividend in DIVIDEND, divisor in DIVISOR. ; ; Exits with quotient in QUOTIENT and remainder in REMAINDER, DIVIDEND ; scrambled, DIVISOR unchanged, carry-flag set. ; It takes about 80 cycles. DIVIDE MOVLW 1 MOVWF QUOTIENT CLRF REMAINDER LOOP RLF DIVIDEND RLF REMAINDER MOVF DIVISOR,W SUBWF REMAINDER,W SKPNC MOVWF REMAINDER RLF QUOTIENT BNC LOOP -- Bob Fehrenbach Wauwatosa, WI bfehrenb@execpc.com