Steve Smith wrote: > That's because the addition to PCL is 8 bit and the high bits aren't > managed properly(16xx doesn't have 16 bit add command) you need to > increment PCLATH for the next section of the table (I only found this > out last weekend) There is a good worked example in the techref at > piclist.com. The basic understanding I got from the list (thanks David > and Jan-erik Olin and others) is that the addwf pcl is limited to 8 bits > but a direct goto is 11 bits and PCLATH 3,4 are the page bits. This > leaves bits 0-3 of PCLATH which need to be set according to the page > location on computed (addwf PCL,F)jump. Hence a table that starts at > 0800h is called after setting PCLATH,3 to 1 and the continuation of the > table past 0900H requires a conditional incf PCLATH,f to continue the > table past the first 256b The easiest way to handle this is to make sure PCLATH is set right before you perform the computed jump, THEN make sure that all possible jumop-to locations are in the same page...The code is then trivial. --Bob -- -------------- Bob Axtell PIC Hardware & Firmware Dev http://beam.to/baxtell 1-520-219-2363 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu