Scott Dattalo wrote: > You're right, it's not the best way. This way is better: > > X10: > > movf num,w ; w = num > addwf num,f ;num = 2*num > addwf num,w ; w = 3*num > addwf num,f ;num = 5*num > movf num,w ; w = 5*num > addwf num,f ;num = 10*num and this way is better still, since we're gonna get the wrong answer if our input is greater than 25, anyway: movf num,w ;w = num addwf num ;num = 2 * num (if num < 128) rlf num,w ;w = 4 * num (if num < 64) addwf num ;num = 6 * num (if num < 42) addwf num ;num = 10 * num (if num < 26) -Andy === Andrew Warren - aiw@cypress.com === === Principal Design Engineer === Cypress Semiconductor Corporation -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics