piclist 2001\03\21\144919a >
Thread: PCLATH and page switching - ICD
www.piclist.com/techref/microchip/devprogs.htm?key=icd
flavicon
face BY : mikeKILLspam@TakeThisOuTwhitewing.co.uk



On Wed, 21 Mar 2001 07:33:39 MST, you wrote:

>Bob Ammerman <RAMMERMANKILLspamspam@spam@PRODIGY.NET> wrote:
>If you value your time at all: run to buy an ICD!
>
>
>OK...I agree, just need to see if the boss does too...I'm supposed to be smart
>enuf to not need it!
If you're smart enough not to need an ICD, you shouldn't be working
for someone who doesn't think a $99 investement is worthwhile!
>Reading over the specs, it targets the chips I am using (how lucky am I for
>that?), so the question begs to be asked...if my target assembly has the
>16F874, can I not build my own ICD?  I thought someone had done this, since it
>simply interfaces to MPLAB.
Yes
>Of course its probably not that simple is it? It never is...
>
>But I have to go back...why isnt this working?  I did a call to a display
>routine in page 2, set the bits...didnt do ANY calls or goto's in the called
>routine yet it won't work.  Come on...this should be simple right? Of course
>once I get the ICD it will be obvious no doubt.
Remember that the bits are page preselect, not select. They determine
where the upper address bits come from on call and gotos only. Return addresses are pushed with the full address, but the bits are
NOT restored to PCLATH on return. e.g. From page 0 <SET PAGE 1>
CALL PAGE1CODE
<SET PAGE 0> ; if this is omitted, the next call or goto will go to
page 1, probably into the weeds.

PAGE1CODE
 RETURN.  

What I usually do is this, which avoids having to remember which page
each routine is in. for routines called more than once it is fairly
code-efficient.  

Page 0 : call routine1
call routine2



errorlevel -306 ; suppress warnings so we only see 'real' ones
routine1
<set page 1>
goto p1routine1

routine2
<set page 1>
goto p1routine2
errorlevel +306 ; re-enable warnings to see unintentional cross-page

------------------------PAGE 1
p1routine1
<code>
goto page1exit

p1routine2
<code>
goto page1exit

page1exit <set page 0>
return


--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservTakeThisOuTspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


<31ihbtgckp9ebf7keagpvievmld6uj7a9n@4ax.com> quoted-printable

In reply to: <20010321143339.5927.qmail@nwcst317.netaddress.usa.net>
See also: www.piclist.com/techref/microchip/devprogs.htm?key=icd
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) PCLATH and page switching - ICD

month overview.

new search...