To guard against wrapping the PCL to the next page we use the following macro which stops the assembly dead in it's tracks if a table bleeds over into the next page: ;************************************** ;Check Calc Table Page Violation ;************************************** ChkTableViolation MACRO BegTabAd, EndTabAd NOLIST IF HIGH BegTabAd < HIGH EndTabAd ERROR "Calc Table Page Violation" ENDIF LIST ENDM It is used in the current case by inserting the following line after the last RETLW 0: ChkTableViolation TABLE,$ By the way, I am sure this was covered, but are there interrupt routines active? We once spent days wondering why a PCLATH changed seemingly spontaneously to discover the that ISR was not properly saving and restoring PCLATH. Tom > > >Try inserting > > movlw high(TABLE) > > movwf PCLATH > >before CALL TABLE > > This won't work if your table data crosses another 256-byte page boundary. > It will work for the data on the current page, but will jump to the wrong > program memory location after PCL overflows to 0x00 again. > > You need to set the PCLATH, then adjust the PCL, then check for > overflow and > if PCL overflowed, then you have to adjust the PCLATH again. Like I said, > read the PICLIST archives... there's a good section on tables in the > techref/microchip section. > > I would use the above suggestion with extreme caution, and only if you are > sure where you are in your code. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.