*********** REPLY SEPARATOR *********** On 16.10.1998, at 11:48, Stuart Allen wrote: >I have discovered my problem. Whenever a computed goto is executed PCLATH >must be set to match the current PC location, even if the source and target >of the jump have the same PCLATH value. This isn't neccessary if the table >is between 0 and 255 because PCLATH is zero. Yap. This will lead to many problems. I've been trying to figure out how to write *relocatable* code. Implementing jump tables seems practically impossible as the exact location is not know at the time of assembly. Crossing table boundry is simple if you know the exact address: just set the PCLATH. However making the code which MPLAB would take seems hard. Anyone figured out how to beat this one? Yes, putting a jump table to eg. one known segment is one solution. However, accessing those from another object file is not possible. (Address of external variable is too complex for mplink to solve.) Hints? Solutions? Anyone? -- Harri Suomalainen mailto:haba@cc.hut.fi We have phone numbers, why'd we need IP-numbers? - a person in a bus