Hi, James Williams wrote: Any ideas. I know that I am not crossing the 256 byte barrier. I know that is has something to do with the size of the goto instruction, but I can't seem to get the jump sizes right. Well for the 18xx series one needs to multiply with *4* for an goto table :) neat eh. Here's an 'ugly' an macro that actually worked :) Table_temp is an dedicated byte of access ram, modify until you think it has the functionality you need. Note: does not care about PCLATHU ! ( no pic's has that amount of program mem yet ) Usage: TABLE_JUMP_GTO Label_StartOfTable ;+++++ ; TABLE_JUMP_GTO Calculates an eventual table boundary crossing ; set's up the PCLATH register correctly ; Offset must be in w-reg, offset 0 jumps to the next instr. ; To be used OUTSIDE isr ONLY, modified for 18x series and a table with gotos ; i.e. the number in w is quadrupled. ; TABLE_JUMP_GTO MACRO TableStart MOVWF Table_Temp,A ; save wanted offset RLNCF Table_Temp,F,A ; multiply with 2 ( for 18x pic's ) ( bit 7 into bit 0 ) RLNCF Table_Temp,F,A ; multiply with 2 again ( for 18x pic's ) ( bit 6 into bit 0, bit 0 into bit 1 ) MOVLW HIGH(TableStart); get high adress for table ( first adress after macro ) BTFSC Table_Temp,0,A ; lowest bit set means add one ADDLW 0x01 BTFSC Table_Temp,1,A ; second bit set means add two ADDLW 0x02 MOVWF PCLATH,A ; set high adress MOVLW b'11111100' ; mask out lowest two bits ANDWF Table_Temp,F,A MOVLW LOW(TableStart) ; get low adress ( of first instr. after macro ) ADDWF Table_Temp,W,A ; add offset BTFSC STATUS,C ; page crossed ? ( 256 byte ) INCF PCLATH,F,A ; yes add one to high adress MOVWF PCL,A ; And jump ENDM Have fun, /Tony -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu