Searching \ for ' [PIC} page management' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'page management'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC} page management'
2001\04\09@094516 by Olin Lathrop

face picon face
> Code of my program had exceeded 2K page limit so I have to
> modify PCLATH (PAGESELect)before EACH goto, call
> instructions. My question - is there way to minimize
> quantity of 'pagesel's?
> I use MPLAB+MPLINK with multiply files containing
> subroutines called from main program flow. Is it possible
> excplicitly to allocate code in each file (node) for
> definite page (and no 2K boundary crossing inside node)?

I do exactly what you describe.  I set up a different linker section for
each program memory page.  Individual modules therefore can't cross page
boundaries.  I use the convention that PCLATH is always pointing to the
current page.  Local GOTOs and CALLs within a module therefore don't need to
bother with PCLATH.  You do need to set PCLATH before global GOTOs and
CALLs, and restore it after global CALLs.

I use a set of macros for defining and calling subroutines that make all
this relatively painless.  Check out the GCALL, MCALL and related macros in

Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014,,

-- hint: The PICList is archived three different
ways.  See for details.

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