Peter wrote: > > > RESULT = (255 / A) * B >Do you really need 255*B ? >Say you have variables >A >B_Hi >B_Lo > >If you can get away with 256*B then you just need to store B into B_Hi and >make B_Lo = 0. > >Now just perform the 16bit (B_Hi:B_Lo) division by 8bit A. > >I think it would be quicker to multiply by 256 (a non event as it's the high >byte of a 16bit word) and then subtract B if you actually do want 255 rather >than do a long multiplication by 255. Thanks to all those who helped me see the answer to this. Sometimes the easy (obvious) answer just needs a nudge. I will multiply * 255 (make it high byte & decrement) and do the division with one of the routines on the piclist.com site. >What are you trying to calculate? A 16 bit timer value based on the # of steps to travel & how fast to get there. Sounds weird but hey - you asked! :-) Regards... -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu