On Fri, 1 Feb 2002 20:50:46 -0200, Edson Brusque wrote: >Hello, > > I need to multiply a byte by another byte and then divide this = result by >255, like x =3D y * z / 255. > > At this moment, I'm using CCS-PICC built-in maths, but it's very >inneficient. The execution time for this calculation is about 1200 >instructions(!). > > Someone have an idea of a very fast math function in assembly to = make >this? > If your application can tolerate about -0.4% error, you could just take the upper byte of a 16-bit multiplication result. (Hard to get much faster but this error may or may not meet your requirements.) regards, Bob -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads