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> PCLATH<4:3> -> PC<12:11> Status Affected: None Description: GOTO is an unconditional branch. The eleven-bit immediate value is loaded into PC bits <10:0>. The upper bits of PC are loaded from PCLATH<4:3>. GOTO is a twocycle instruction. I'm having a problem with bit 8 of the PC or, PCLATH <0>. According to that entry, PCLATH <2:0> adjust themselves when a goto or call is used. Brendan ----- Original Message ----- From: "Dwayne Reid" To: Sent: Wednesday, June 19, 2002 10:31 AM Subject: Re: [PIC]: Wierd MPLAB SIM issue with PCLATH > > PCLATH does NOT change by itself! *YOU* have to set it to point to the > correct ROM segment. > > A very similar example was posted about a week ago. Here it is again: > > movwf SAVE_ADDR ; Save offset > movlw high (table1) ;set the high bits of the table entry adr > movwf pclath > > movlw low (table1) > addwf SAVE_ADDR,W ; find appropriate offset > skpnc ;wrap past end of current page? > incf pclath,F ;yep - point to next page > movwf PCL ;now go to correct entry in table > table1 ;start address of the table > retlw B'01111110' ; '0' > retlw B'00110000' ; '1' > . > . > . > nop ; Error - '15' > retlw B'00000001' ; Return dash > > dwayne > > -- > Dwayne Reid > Trinity Electronics Systems Ltd Edmonton, AB, CANADA > (780) 489-3199 voice (780) 487-6397 fax > > Celebrating 18 years of Engineering Innovation (1984 - 2002) > .-. .-. .-. .-. .-. .-. .-. .-. .-. .- > `-' `-' `-' `-' `-' `-' `-' `-' `-' > Do NOT send unsolicited commercial email to this email address. > This message neither grants consent to receive unsolicited > commercial email nor is intended to solicit commercial email. > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body