"Andrew Warren" wrote: > Nope. The high byte of the PC isn't DIRECTLY readable; PCLATH, a > readable/writable register that shadows the high byte of the PC, > exists for precisely this reason. Ummm.. bad choice of words there, Andy. It could confuse some people - and then we'd get a slew of followups :-( So to forestall all that... PCLATH does not shadow the high byte of the PC, all it does is provide some of the bits to be loaded into the high byte of the PC when an instruction changes the low byte of the PC, such as a direct write, an add (more common) or a CALL or GOTO (in which case some low-order bits of PCLATH are ignored since the CALL etc. instruction provides them anyway). How many bits of PCLATH are used depends on how large the program memory is. The important thing to remember is that PCLATH is *never* updated when the PC changes for any reason - the term "shadow" can be taken to imply that it provides a way to find the value of the high byte of the PC, which it doesn't, only to set it. -- Clyde Smith-Stubbs | HI-TECH Software, | Voice: +61 7 3300 5011 clyde@hitech.com.au | P.O. Box 103, Alderley, | Fax: +61 7 3300 5246 http://www.hitech.com.au | QLD, 4051, AUSTRALIA. | BBS: +61 7 3300 5235 ---------------------------------------------------------------------------- For info on the World's best C cross compilers for embedded systems, point your WWW browser at http://www.hitech.com.au, or email info@hitech.com.au