----------
> From: Scott Dattalo <.....sdattaloKILLspam
@spam@UNIX.SRI.COM>
> To: PICLIST
KILLspamMITVMA.MIT.EDU
> Subject: Re: Optimal realization: Array data to another location
copyingin words of PIC
{Quote hidden}> Date: Thursday, January 28, 1999 12:18 PM
>
> On Wed, 27 Jan 1999, Dmitry Kiryashov wrote:
>
> > I have a little question about how to make couple of FSR
> > from existing one ;-)
> >
>
> movlw num_of_elements
> movwf i
> movlw b-1 ;initialize FSR
> movwf FSR
> loop:
> movlw (a-b)+1
> addwf FSR,f
>
> movfw INDF ;**1
> movwf temp ;**2
>
> movlw (b-a)
> addwf FSR,F ; (b+i)
> movfw temp ;**3
> movwf INDF ;**4
>
> decfsz i,F
> goto loop
If you are free to play with the addresses of your variables
you can shorten the main loop anytime the base address
is not different by three bits.
The address management and temp are 6 instructions worth
of overheads.
Walter Banks