I am a PIC newbie struggling with lookup tables and PCLATH on a 16f877. My lookup table returns the expected result when the table crosses page bounderies. My question is, what approach can I use to restore the original value of PCLATH before the next CALL takes off into hyperspace? I have been reading the following. http://www.piclist.com/techref/microchip/pages.htm http://www.piclist.com/techref/microchip/tables.htm Here are my code fragments: ;************ ;My main loop ;************ SUBI16 int16FeedbackTemp, MAX_SETPT_A2DCOUNTS movf int16FeedbackTemp+1,W call ACountsToDegC ;************ ;My lookup table ;************ ACountsToDegC: addlw LOW aCountsTodegC movwf temp movlw HIGH aCountsTodegC skpnc addlw 1 movwf PCLATH movf temp,W movwf PCL ; ---------- ----------- ; TABLE OUTPUT TABLE INPUT ; Temp DegC A2D Count ; Lookup Index ; ---------- ----------- radix dec aCountsTodegC: retlw 255 ; 000 0x00 retlw 255 ; 001 0x01 retlw 251 ; 002 0x02 retlw 250 ; 003 0x03 Thanks in advance for any tips or suggestions, -Ed -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads