If I'm only interested in the high byte of the result, I'm wondering if anyone knows any shortcuts to save a bit of time. It's just to scale one value using another.
This is a fairly standard method in asm for the PIC for the normal multiply, it seems that if I require less precision it might be possible to make it quicker, but I'm rubbish at this sort of thing.
This is a fairly standard method in asm for the PIC for the normal multiply, it seems that if I require less precision it might be possible to make it quicker, but I'm rubbish at this sort of thing.
Rich (BB code):
mul8x8m clrf prodH
clrf prodL
movfw mulcnd
clrc
btfsc mulplr,0
addwf prodH
rrf prodH
rrf prodL
btfsc mulplr,1
addwf prodH
rrf prodH
rrf prodL
btfsc mulplr,2
addwf prodH
rrf prodH
rrf prodL
btfsc mulplr,3
addwf prodH
rrf prodH
rrf prodL
btfsc mulplr,4
addwf prodH
rrf prodH
rrf prodL
btfsc mulplr,5
addwf prodH
rrf prodH
rrf prodL
btfsc mulplr,6
addwf prodH
rrf prodH
rrf prodL
btfsc mulplr,7
addwf prodH
rrf prodH
rrf prodL
return