> I know that this is a simple question which has no doubt been > asked many times before, but I cannot understand or make any sense of the > PCLATH in relation to look-up tables. It's fairly simple to understand, if you bear these simple rules in mind: [note that when I refer to the top "byte" of the program counter or PCLATH, I'm talking about bits 8-12; the top 3 bits are unimplemented]. [1] On the 16Cxx chips, PCLATH is never modified except under program control. On reset, its value is undefined and you should make no assumptions about it. [2] On a reset, the PIC jumps to address 0 independent of PCLATH. PCLATH. [3] On an interrupt, the PIC jumps to address 4 independent of PCLATH. [4] Upon executing the last word of any 256-byte page, the PIC will increment the high "byte" of the program counter, independent of PCLATH. [5] Any instruction that writes to address 2 (PCL) will cause the value written to be copied into bits 0-7 of the program counter and PCLATH to be copied into the high byte of the program counter. [6] The "call" and "goto" instructions will copy bits 0-10 of the program counter with the corresponding bits from the opcode, and will copy the remainder of the program counter from the appropriate bits of PCLATH (i.e. bit 11 will be taken from PCLATH.3 and bit 12 will be taken from PCLATH.4). Note that on parts with 2K or less of ROM the high order bits of the program counter (loaded from PCLATH) are irrelevant. Hopefully that will clarify things somewhat. I should warn you, though: the 17Cxx has very different rules for handling PCLATH, so code migration to that part is not so simple as it would seem. If you stick with 16Cxx, though, you should do fine.