In the case of the RETURN instruction the PCLATH is modified with the contents of the PCH. This is only true for the RETURN instruction, not the RETFIE or RETLW. Regards, Joe Triece ______________________________ Reply Separator _________________________________ >myke@passport.ca (myke predko) wrote: > >> Now, reading thru the 17C4x datasheets on the MChip Website (Doc 30412B), on >> page 41 (explaining the Program Counter Module) it says that Return: >> >> PCH -> PCLATH >> Stack -> PC<15:0> > >I believe this is wrong - apart from anything else it makes no sense - why would >PCLATH be updated with the PCH *before* the return? The 17C42 data sheet >I have says explicitly: > > The following PC related operations do not change PCLATH: > > a) LCALL, RETLW, RETURN, RETFIE instructions, > b) Interrupt vector is forced onto the PC > c) Read-modify-write instructions (e.g. BSF PCL) on PCL > >and the description of RETURN et. al. also state PCLATH is unchanged. > >Clyde Could somebody from Microchip please resolve this issue? As I noted in my original note, I have the 1994 Databook, the 1995/1996 Databook, and have downloaded the .PDF from the Web Site. All three of these sources disagree (and disagree with Clyde's quotation). Clyde, actually, I agree with what you have to say on this; it would make the most sense that "return" just loads the PC from the Top of Stack and doesn't change any other registers. This would make it very similar to "retfie" and "retlw". I just want to make sure I understand exactly how this instruction works. Thanx, Myke Myke "We're Starfleet officers, weird is part of the job." Capt. Catherine Janeway