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....... Ben ----- Original Message ----- From: Al Williams To: Sent: Monday, August 27, 2001 4:08 PM Subject: Re: [PIC]: reverse indirect addressing > If I understand your question, yes. When you load FSR, the INDF register > takes on the identity of the referenced register. So: > > movlw 0xA0 ; let's point at register 0xA0 for some reason > movwf FSR > movlw 0xA5 > movwf INDF ; 0xA5 -> register 0xA0 > movf INDF,W ; register 0xA0 -> W (should still equal 0xA5) > > I'm not sure what you read that led you to think INDF only takes writes? > > Regards, > > Al Williams > AWC > * Floating point A/D > http://www.al-williams.com/awce/pak9.htm > > > > -----Original Message----- > > From: pic microcontroller discussion list > > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Benjamin Bromilow > > Sent: Monday, August 27, 2001 9:38 AM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: [PIC]: reverse indirect addressing > > > > > > Hi all, > > > > As I understand it, with indirect addressing you can put a given > > value into > > a referenced register. Is there any way this can be done in reverse ie to > > read the value in a referenced register or must all register reads be done > > directly and explicitly??? I've had a good look around and can't find a > > work-around..... It seems strange that indirect addressing appears to only > > work for writes! > > > > Ben > > > > -- > > http://www.piclist.com hint: The PICList is archived three different > > ways. See http://www.piclist.com/#archives for details. > > > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.