Andy wrote: >I wrote this "multiply by 255" code: > > > > MOVF B,W > > > MOVWF PRODUCT_HI > > > SUBLW 0 > > > MOVWF PRODUCT_LO > > > DECF PRODUCT_HI > >and David Duffy replied: > > > I've done it like this > > > > decf B,w > > movwf x_int_h > > clrf x_int_l > > > > Does that make sense? > > David: > > It makes sense, but it's not correct. > > What you've calculated is 256 * (B - 1), which is not the same > as 255 * B. Doh! What a dummy I'd be! Oh well, I put in your code to fix that (my) bug but am still having problems when A gets lower than 06h. Maybe I've got an error in the division routine. The required equation is (B*255)/A I still haven't found a suitable simple 16 by 8 in 16 routine. Regards... -- 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