On Tue, 15 Dec 1998, Regulus Berdin wrote: > Hi Adriano, > > This can be done also by (2 code space less): > >pow10 movwf rD > addwf rD,w ;rD*2 > addwf PCL,f > p0 clrf rC > retlw 0x01 > p1 clrf rC > retlw 0x0A > p2 clrf rC > retlw 0x64 > p3 movwf rC ; W=3 > retlw 0xE8 > p4 movlw 0x27 > movwf rC > nop > retlw 0x10 I saw that too, BUT isochronicity (is that a word?) is lost. Also, there's a small error with case p3 (W is 6 not 3 when it is stored into rC).. But if you're willing to sacrifice isochronicity the you might as well get rid of the nop: pow10 movwf rC addwf rC,w ;rC*2 addwf PCL,f p0 clrf rC retlw 0x01 p1 clrf rC retlw 0x0A p2 clrf rC retlw 0x64 p3 nop ;rC is 3 retlw 0xE8 p4 movlw 0x27 movwf rC retlw 0x10 call pow10 movwf rD But it takes 11 cycles for the 4th power (as opposed to 10 for Adriano's solution)