On Mon, 15 Sep 1997 01:34:40 -0800 Andrew Warren writes: > >Change those to "movlw low (try+1)" and "movlw high (try+1)" and >it'll work fine. Or move the 'try' label to the start of the table rather than the addwf PCL instruction. The "table anywhere" routine originally posted can be recoded to a shorter version that doesn't need a temporary RAM, usually it looks something like this: movlw high(table1) ;Point PCLATH at page having first element movwf PCLATH ; of the table. movfw offset ;Get index of desired table element. addlw low(table1) ;Index to low PC for desired element skpnc ;Skip if desired element in same 256 page. incf PCLATH,f ;Desired element is in next 256 page. call gettbl ;Lookup - returns ;to here with element value in W. ; ---- ; This can be placed anywhere in program memory, and shared by all ; routines that access RETLW tables. (after setting up PCLATH properly) gettbl movwf PCL ;Vector to PCLATH:W ; ---- ; Table of values table1 retlw 0 retlw 1 (etc) Usually it is simple enough to ORG everything so the tables don't cross 256 boundaries and compensating code isn't necessary.