Searching \ for '[PIC]: MPLINK Interpage Calls' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'MPLINK Interpage Calls'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: MPLINK Interpage Calls'
2001\09\09@173816 by hooch gooch

picon face
Hi,
I'm noticing a dearth of documentation and
assembly code to elegantly handle far calls
between pages on the PIC (16f877 on my board).
I have done the necessary saving of the PCLATH
and interrupt handling runs smoothly.  The problem
I have is having to steer around any nesting of
far calls.  I finally broke down and wrote a macro
that pushes PCLATH values on my own PCLATH stack,
up to 8 deep.  It's some tens of lines long, which
makes me anxious about it being used too much as
a macro.  I have tried to organize the routines
logically, where on the most part keep the far
calls to one-deep.  However, I have found myself
duplicating code (like delay routines, for example,
which are used too often to be a macro) amongst
pages.  What's the best way to handle this situation?
Thanks!

hg

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\09\10@090621 by Olin Lathrop

face picon face
> I finally broke down and wrote a macro
> that pushes PCLATH values on my own PCLATH stack,
> up to 8 deep.  It's some tens of lines long, which
> makes me anxious about it being used too much as
> a macro.
> ...
> What's the best way to handle this situation?

What I do is not require subroutines to preserve PCLATH.  I have a bunch of
macros that deal with this and related issues.  See STD.INS.ASPIC at
http://www.embedinc.com/pic.  The GCALL (Global CALL) marcro sets PCLATH
before a call, then restores it to the current page after the return.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\09\10@095433 by hooch gooch

picon face
Thanks for the input, Olin.
Where might I find "setpage" and "mypage"?


{Quote hidden}

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\09\10@150610 by Olin Lathrop

face picon face
> >What I do is not require subroutines to preserve PCLATH.  I have a bunch
of
> >macros that deal with this and related issues.  See STD.INS.ASPIC at
> >http://www.embedinc.com/pic.  The GCALL (Global CALL) marcro sets PCLATH
> >before a call, then restores it to the current page after the return.
>
> Thanks for the input, Olin.
> Where might I find "setpage" and "mypage"?

In the same file.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...