At 08:31 AM 6/12/02 -0400, Olin Lathrop wrote: > A far better answer is to have the >assembler load the right value for you automatically. I've added a label to >the start of the table for that purpose: 2 things here: you *need* to save W before using it to set PCLATH - W contains the jump offset upon entry to this routine. 2nd - what Olin posted still does not deal with a wrap at the 256 byte boundaries. I've made the appropriate changes below: movwf SAVE_ADDR ; Save offset movlw high table1 ;set the high bits of the table entry adr movwf pclath movlw low (table1) addwf SAVE_ADDR,W ; find appropriate offset skpnc ;wrap past end of current page? incf pclath,F ;yep - point to next page movwf PCL ;now go to correct entry in table table1 ;start address of the table retlw B'01111110' ; '0' retlw B'00110000' ; '1' . . . nop ; Error - '15' retlw B'00000001' ; Return dash dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 18 years of Engineering Innovation (1984 - 2002) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics