> > The 8x8 multiply routine given in application note AN526 by > > Microchip is optimized for speed. Still it takes a stagerring 44 > > instructions in the worst case. Is this the best routine for > > multiplication? > > That depends on your definition of "best", Amey. > > > Is there any other routine available, requiring less number of > > instructions? > > Of course. Try something like this: > > ; Enter with multiplier in W-Reg, multiplicand in "PRODLO". > ; Exits with product in PRODHI:PRODLO. No offense, but I counted 7 cycles per iteration in a loop that gets executed 8 times (actually, only 6 cycles for the last iteration). Consequently, as written, the code was slower than 44 cycles. On the other hand, if you unroll that loop the code will run a lot more quickly. One thing I personally like to do in my multiply routines, btw, is to write them so that the value sitting in the MSB isn't cleared before the operation, but is instead added to the LSB of the result. This makes computation of longer products convenient.