Hello, > Consider this code: > = > default_minutes: > addwf PCL, f ; jump table > retlw .5 > retlw .10 > retlw .15 > retlw .20 > = > When it was in the beginning of my code, PCL was below 0xff, = > it worked. When tidying my code I moved the above to the = > bottom of the source, and the code went totally havoc. After = > 20 minutes of debugging, I found that two lines before it, = > PCL overflowed and turned into 0x00, making the jump-table = > return a value which made the goto go to the beginning of the code! > = > It's easily solvable by moving "default_minutes" to a place = > near the top of the source, but is there any way you can = > solve it in other ways? I mean, since the chip (16F886) got = > 8kb program stack, PCL must be able to keep track of all 8kb data. With the normal way, described in all the mails here, it is working fine, a= s long you are not crossing the 2 Kbyte border! I have the same issue here. I did some sim-debugging and had to find out, t= hat RETLW is not restoring PCLATH correctly after returning from the comput= ed goto. A normal RETURN does :-( So, what I do is, before I am grabbing the PCLATH of the table, I save the = original PCLATH to a register. After return, I restore PCLATH from there. movlw d'0' ; Startoffset f=FCr String setzen movwf toffset ; Laden von toffset movlw stringdef ; default stringl=E4nge =3D 32 Zeichen in stringcounter= laden movwf stringcnt string11loop movf PCLATH,w ; store of PCLATH movwf pclath_temp movlw HIGH text11 ; load PCLATH with hi adress of texttab movwf PCLATH movf toffset,w ; textoffset in w laden call text11 ; text abholen von toffset movwf tx_temp ; restore PCLATH movf pclath_temp,w movwf PCLATH movf tx_temp,w call rs232send ; text an rs232 senden incf toffset ; toffset um 1 erh=F6hen decfsz stringcnt ; stringcounter um 1 veringern, solange bis counter =3D= 0 goto string11loop return This code does note care about the 256 byte board, since my tables are not = so big, but I want to move them in the second or third 2KByte page. If the tables are bigger, this code should be extended with the 256 Byte wo= rkaround, so that the table can be 512 Byte long. Best Jens -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist