At 01:14 PM 2/23/00 +1100, you wrote: Hi John, [Disclaimer. This info is valid for the 16C57, I am assuming to applies to the 16C05 which is a similar core to the 16C57 except that the '57 is 2K and has four pages not two like the 1K '505.] If you want to call from one page to another you need to set the page select bits in the status register. You can look this up in the data sheet to get a good idea of what is required. Each page is 512 words, not 256. You can only call the first 256 words of each 512 page so all subroutines need to be in the 00-FF address range. Hopefully someone will come along with a URL where you can download ready-rolled macros that are better than mine below: (Some of mind do not apply to the 1K '505.) flags EQU 03 (STATUS for the non Z80 convertees ;-) pa0 equ 5 pa1 equ 6 ;Call #from page, #to page call0p1 macro a bsf flags,pa0 call a bcf flags,pa0 endm call0p2 macro a bsf flags,pa1 call a bcf flags,pa1 endm call1p0 macro a bcf flags,pa0 call a bsf flags,pa0 endm call1p2 macro a bcf flags,pa0 bsf flags,pa1 call a bsf flags,pa0 bcf flags,pa1 endm call2p0 macro a bcf flags,pa1 call a bsf flags,pa1 endm call2p1 macro a bcf flags,pa1 bsf flags,pa0 call a bcf flags,pa0 bsf flags,pa1 endm call3p0 macro a bcf flags,pa0 bcf flags,pa1 call a bsf flags,pa1 bsf flags,pa0 endm gotop0 macro a bcf flags,pa0 bcf flags,pa1 goto a endm gotop1 macro a bsf flags,pa0 bcf flags,pa1 goto a endm gotop2 macro a bcf flags,pa0 bsf flags,pa1 goto a endm gotop3 macro a bsf flags,pa0 bsf flags,pa1 goto a endm -Jim >Dear PICsters, >I am trying to wrap my head around the paging system that the '505 uses. If >I understand correctly, the memory is banked into four arrays of around 255 >bytes each. A call from the first bank to the second or third bank seem to >wrap around the program counter or something which means the program somehow >finds its way back to bank 0 . Does anyone have some tips or can explain >this phenomena to me please? I would really appreciate it. Many thanks. > > Regards John > Regards, Jim Robertson NEWFOUND ELECTRONICS ________________________________________ Email: newfound@pipeline.com.au http://www.new-elect.com MPLAB compatible PIC programmers. ________________________________________