When you modify the PC via a write to its file register image the highest bits are loaded from the PCLATH (another file register). This does not happen with a goto, call or return. So when you do something like this set PCLATH first, or the program counter will en up in never-never land. A common pratice is to set up PCLATH once and put all PC-manipulation routines in the corresponding code page. In my home-brew 16x84 HLL a pragma jump_table must be put in each procedure or function which manipulates the PC, and these routines are put in the last code page. PCLATH is initialised to 0b11 in the startup code. This setup limits the total size of these routines to 256 instructions. regards, Wouter. ---------- > From: Bart Stofferis > To: PICLIST@MITVMA.MIT.EDU > Subject: question about ADDWF function: only 8-bit ??? > Date: Friday, December 04, 1998 09:59 > > Hi there ... > > I was wondering if the ADDWF instruction can add a 8-bit value > (W-accumulator) to the > 12-bit program counter ... without any errors ... > > example code: > > LUT ; begin lookup table > addwf PC ; consider PC is 0000 1111 1110 > retlw 0x000 ; 0000 1111 1111 > retlw 0x000 ; 0000 0000 0000 Err !!!!!! ???? or 0001 0000 > 0000 OK > retlw 0x000 ; 0000 0000 0001 Err !!!!!! ???? or 0001 0000 > 0001 OK > > > have a nice PIC-day ... > > Bart