This only worked out of luck. As you moved your code around, you managed to get the subroutine into the first half of a 512 location page. As I mentioned in a prior post: For 'goto', bits A0 through A8 come from the instruction, bit A9 is from PA0 in the status register. For 'call', bits A0 through A7 come from the instruction, bit A8 is always zero, bit A9 is from PA0 in the status register. Bob Ammerman RAm Systems (high performance, high function, low-level softare) ----- Original Message ----- From: Geoff Wootton To: Sent: Tuesday, July 11, 2000 9:02 AM Subject: Re: [PIC]: 12C509 calls and gotos > Pete, > > Thanks for the reply. You're right, if I move the subroutine > closer it does work, however I'd rather be able to use the > full address range as documented. The 12C508 has 512 program > memory locations, so setting bit 5 of the status register > will (should) give full addressabilty. The datasheet is > ambiguous on addressing the 12C509. There are 1024 locations > and it says to set bits 5 and 6 of the status register but > later on says that bit 6 is not implemented. If I move the > subroutines closer to the calls then they will be embedded > in my main code which makes it less readable. Also I'd then > have to put gotos in to jump over the subroutines. I've thought > of using nested subroutines but the stack on the 12C509 only > has 2 levels. > > Regards > > Geoff. > > -- > 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.