Hi, Richards Justin wrote: >I am using MPLAB 6.12 and a 16f628. > >I got bitten by the 256 byte boundary bug. So I relocated my RETLW table to the last 256 bytes ie=20 >1793 to 2048 > >When my Prog makes a call to 1793 PCL =3D 0 and PCLATH also equals 0. If I execute the next ADDWF PCL,f it jumps=20 >back to the start of the program. If I manual set PCLATH to 7 in the SIM all goes as expected. > >Why does PCLATH not change on the screen when it is another boundary. Is MPLAB going astray?=20 First this is not a bug but a feature :), the PCLATH is not the 'real' high portion of the program counter=20 it only serves as an buffer that enables writing the 'real' upper adress counter. Therefore if one is=20 to manipulate the program counter manually you always must make sure that the content of PCLATH are setup *before* you write the PCL. Beacuse as soon as you write to the PCL whatever content is in the PCLATH will be transfered to the PCH which is the 'real' upper program counter. Also beware that you might need to 'reset' the PCLATH after manipulation. /Tony -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads