Sorry! Bob ----- Original Message ----- From: Peter Betts To: Sent: Tuesday, July 11, 2000 12:29 PM Subject: Re: [PIC]: 12C509 calls and gotos > Bob, > I did point the following out afterwards which is exactly what you are > saying. Therefore I had corrected myself. > > > > QUOTE: > > > > For a GOTO instruction, bits 8:0 of the PC are provided > > by the GOTO instruction word. The PC Latch (PCL) is > > mapped to PC<7:0>. Bit 5 of the STATUS register > > provides page information to bit 9 of the PC (Figure 4-8). > > > > For a CALL instruction, or any instruction where the > > PCL is the destination, bits 7:0 of the PC again are > > provided by the instruction word. However, PC<8> > > does not come from the instruction word, but is always > > cleared (Figure 4-8). > > > > The STATUS register page preselect bits are cleared > > upon a RESET, which means that page 0 is pre- > > selected. > > > > Therefore, upon a RESET, a GOTO instruction will > > automatically cause the program to jump to page 0 > > until the value of the page bits is altered. > > > > Because PC<8> is cleared in the CALL > > instruction, or any Modify PCL instruction, > > all subroutine calls or computed jumps are > > limited to the first 256 locations of any pro-gram > > memory page (512 words long). > > > > :------------------------------------ > > The last paragraph is interesting. > > > > Try making sure the sub-routine is in the PAGE1 but within > > the first 256 locations. > > > > Pete > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.