You are misreading the description... See below: ----- Original Message ----- From: "Brendan Moran" To: Sent: Wednesday, June 19, 2002 1:57 PM Subject: Re: [PIC]: Wierd MPLAB SIM issue with PCLATH > Hang on, here, I'm not going over a page boundary, just over a 256 word > boundary > > The 16F87x datasheet has this entry for GOTO > > Syntax: [ label ] GOTO k > Operands: 0 =< k =< 2047 > Operation: k -> PC<10:0> 11 bits from instruction become 11 lsbits of new PC > PCLATH<4:3> -> PC<12:11> 2 bits from PCLATH become 2 msbits of new PC > Status Affected: None Note from the above: _nothing_ is changed in PCLATH. PCLATH is _not_ the most significant bits of PC!!!! Again (I just stated this a couple of weeks ago): The only times PCLATH is used is: 1: On a GOTO or CALL bits 4:3 become bits 12:11 of the new PC. 2: On an instruction with PCL as destination (like ADDWF PCL,F) bits 4:0 of PCLATH become bits 12:8 of the new PC. No other instruction examines PCLATH or modifies it, unless PCLATH is specifically mentioned in the instruction (like MOVWF PCLATH, or BSF PCLATH,3) In particular: RET, RETFIE and RETLW restore PC from the stack but do not touch PCLATH. Bob Ammerman RAm Systems -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body