This is part of a too-elaborate "super-assembler" I've developed, which I
hope to post on the Web soon. I use a 16C76 or '77 because of the "bankless
ROM" feature, a good location for TempW. This works on MPLAB 3.99.

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]

>Has anyone written a simple macro to call subroutines across page
>boundaries?

I've listed two below: one that preserves W to and from the called routine
and one that doesn't. Both use an assembler variable _CallCounter that must
be already declared, it's used to reset PCLATH with the best value so future
local calls & gotos don't go into orbit. The W-preserving macros use a
_TEMP_W RAM location that also must be declared. If _TEMP_W is not mirrored
in all RAM banks (the upper bytes of a 16C67 are mirrored), it's up to you
to babysit the initial & returning bank number.

;---- Long call macro ----------
;
; Set or clear page bit PA0 if needed before a call. Reset it after return.
; Only set/clear and reset if the call is to another page.
;
; Example: The following line...
;
; xcall PAGE1,page_1_fun
;
; ...is expanded to
;
; bsf f_PA0
; call page_1_fun
; bcf f_PA0
;
; if it is executed in page 0. But to...
;
; call page_1_fun
;
; ...if it is executed in page 1.
;
; page is needed as a macroparameter because the assembler can't resolve forwa
rd
; references correctly. (In pass 1 it doesn't know how many instructions the
; macro will be resolved too if it is to a forward label. This could lead to d
ifferent
; addresses for labels in pass 1 and 2.)
;