At 09:53 PM 6/10/99 -0400, you wrote: It is a real pain with the 2 pages. You must set and clear the PCLATH when moving between pages. You are correct in saying that it must be cleared before doing the goto START. good luck, Peter >I realize this has come up before, and I thought I understood it - but it is >not working as I thought it should. >I am doing development with a 16C74A while waiting on TechTools to come out >with the 16C87X family module. To make sure I understood how to make a long >call (i.e. cross a 2k boundary) I wrote the following test code: >device pic16c74A,xt_osc,wdt_off,protect_off > org 00 > goto START > org 05h >START > bsf pclath,3 > call TEST > goto START > org 090fh >TEST > retlw 0 > >As I understood, the call would push the entire return address to the stack, >so the "retlw 0" would return to the "goto START", which it does, however, >since I set the pclath bit 3 to 1 before the call, it is staying 1 on the >"retlw 0" and the "goto START" is going to location 1005h rather than 0005h. >If I put a "bcf pclath,3" before the "retlw 0" then the program does goto >location 0005h. > >I thought the pclath was cleared by the retlw - is it not? >Thanks, > >David V. Fansler >Network Administrator >AutoCyte, Inc. >336-222-9707 Ext. 261 >dfansler@autocyte.com >Now Showing! www.mindspring.com\~dfansler\ Updated September 23, 1999 >