Andrew Warren wrote: > > > Here's this year's challenge: > > Write a routine to multiply two numbers, each in the range > 0-100... The numbers are in two registers, called SMALL and > LARGE, and your 16-bit result should be in two different > registers, called PROD_HI and PROD_LO. > > I just wrote one that takes 34 cycles... I'm SURE someone can do > better. Just so you don't get the whole beer, here's one that's 34 cycles too (and probably the same as yours). CLRF PROD_HI CLRF PROD_LO CLRC MOVF LARGE,W BTFSC SMALL,0 ADDWF PROD_HI,F RRF PROD_HI,F RRF PROD_LO,F BTFSC SMALL,1 ADDWF PROD_HI,F RRF PROD_HI,F RRF PROD_LO,F BTFSC SMALL,2 ADDWF PROD_HI,F RRF PROD_HI,F RRF PROD_LO,F BTFSC SMALL,3 ADDWF PROD_HI,F RRF PROD_HI,F RRF PROD_LO,F BTFSC SMALL,4 ADDWF PROD_HI,F RRF PROD_HI,F RRF PROD_LO,F BTFSC SMALL,5 ADDWF PROD_HI,F RRF PROD_HI,F RRF PROD_LO,F BTFSC SMALL,6 ADDWF PROD_HI,F RRF PROD_HI,F RRF PROD_LO,F RRF PROD_HI,F RRF PROD_LO,F but... I'm quite certain there is a faster way. Scott