At 01:44 AM 28/08/2001 +0100, you wrote: >Sorry, probably didn't make myself clear.... >Specifically what I was trying to do was specify a register to be read >rather than reading from the INDR > >For example, if I have a block of registers set aside for some data, I can >clear sequential registers by: > >movlw MYFIRSTREG >movwf FSR >LOOP >movlw 0 >movwf INDR >incf FSR,1 >goto LOOP > >So this clears an infinite number of registers. In practice a quick decfsz >would limit it. In practice however, we often want to READ from one and copy >it into the next. >Clearly this could be done using > >movf READFROM1,F >movwf MOVETO1 >movf READFROM2,F >movwf MOVETO2 >......... > >etc, etc >But surely it would be better if an indirect addressing system or some >work-around meant you could avoid explicitly stating such commands. I ask >because I need to copy 96 registers from one page to another and I don't >want to end up writing 96*2 lines of code....... You can still use the FSR. Just keep 2 variables as pointers. Do the 2 banks of registers line up? (but on different banks) If so, you can do it in a loop, reading, changing bank, writing and changing bank back again each time. I haven't tested it but the below code should give you the idea. :-) start: movlw .96 movwf count movlw start_address movwf fsr loop: movf indf,w bank1 movwf indf bank0 decfsz count,f goto loop all_done: Regards... -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.