Antonio Sergio Sena wrote: > I investigated the AN526 application note in the Microchip handbook, > and used the DBL_MPYS.asm ( 16x16=32) with unsigned multiplication. > > The results i got, though, were far from what i was expecting. I am > multiplying a constant (d'328') by a variable (max: d'30000'), and when > my variable is > 199, i get strange results... > > I dont have any idea what problem the Microchip routines may have. > > Hints ? ideas ?? did someone ever use this routines ? Antonio: When I last looked at them, the Microsoft math routines were just horrible. Since 199 * 328 is less than 65536 and 200 * 328 is greater than 65536, I suspect that the routine you're using has problems propogating the carry from the second byte of the result to the third and fourth. Many of us have posted math routines to the list; there's a whole library of them at http://www.piclist.com . -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body