Bob wrote: >I don't think this will work. If movff won't work directly to PCL, I doubt >it will work indirectly. Yes, I'm afraid of that, too > >You might try something like this: > > push > movwf PCLATH > movf TBLPTRL,W > movwf TOSL > movf TBLPTRH,W > movwf TOSH > movf PCLATH,W > return Yep, I've tried that, but the bad thing about it is that one must control interrupts around it. e.g. bcf 0FF2h,7 ; disable INTs push ; required, as we'll undo it with a return clrf TOSU ; TOS = jump-to address movff TBLPTRH,TOSH ; "" movff TBLPTRL,TOSL ; "" bsf 0FF2h,7 ; re-enable INTs return And that still won't work if it's called from within an ISR (unintended re-enabling of interrupts). It does work OK otherwise, at least in the SIM. Is it the case that the only instruction that can reliably change PCL on the 18 is addwf? -- ______________________________________ Andrew E. Kalman, Ph.D. aek@pumpkininc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu