>For example, I have a number between 0 and 255 and I want to know how many >times 10 can be divided into the number. >Is there a simple way to achieve this? Check out www.piclist.com and look for Nikolai's code generator for multiplication and division by a constant (in your case, 10). If you're not into REAL multiplication and division, you can always do this (I suppose this technique would qualify as "simple"): clrf Temp Div_By_10 movlw 0x0A subwf Your_Number, W btfss STATUS, C goto Done incf Temp, F movwf Your_Number goto Div_By_10 Done ..... at the end, "Temp" holds the whole number of times that your number is divided by 10. Note that I do not recommend this method, but it is worth mentioning that it IS a valid division method. It's just not nearly as fast in general as a real bit-shifting routine. --Andrew _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body