At 13:16 26/05/98 +0200, you wrote: >PHXSYS wrote: >> >> Hi everyone >> >> In my program I am using the program counter to sequence several routines. I >> am using it like this: >> >> MOVF SSTATE,W >> MOVWF PCL >> >> SSTATE is the address of the specific routine. My problem is SSTATE is an 8 >> bit value and my routine length goes over 255 addresses. When it goes over Are you saying you have over 255 different states? I can't see this as there wouldn't be any room for your real code?! Just use a jump table (as someone else mentioned) but if you don't have more than 256 states you don't need more than a single byte SSTATE. (I'm not too familiar with the 54 but am using the 74). There's an example of how to use jump tables simply and more complicatedly (for over a 2k page jump in the Microchip manual), also there are lots of examples in the embedded application book (free from your local distie) and also there are examples (app notes) on the CD and on the Microchip web site. Have fun! Regards Adrian WWW WWW Adrian Gothard WWW WW WWW White Horse Design WWWWWWWWWW +44-385-970009 (Mobile/SMS), +44-118-962-8913/4 (voice/fax) WWWW WWWW whd@zetnet.co.uk, http://www.users.zetnet.co.uk/whd --- Developers of GPS satellite-based tracking systems