Steve Smith wrote: > Code attached sorry bout FSR its nothing to do with it. Its (AN556) > computed goto crossing 256 bit page boundary. All messages up to and > including 33 are ok but when pcl >255 it starts reading from the wrong > place. OK, so you are trying to read data from program memory by using RETLW instructions. The best way to read data from program memory on a 16F877 is not to use RETLW instructions, but read it directly. This can be done with the same interface used for reading the data EEPROM. See section 4 starting on page 41 of "PIC16F87x Data Sheet", DS30292C. For dealing with PCL wrap around issues you have to manage PCLATH. You really have to read them manual. Read pages 26 and 27 of the same book, which contain section 2.3 "PCL and PCLATH", section 2.4 "Program Memory Paging", and section 2.5 "Indirect Addressing, INDF and FSR Registers". The last section isn't relevant here, but you are obviously confused about the content. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads