Searching \ for 'Page Bit' 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/index.htm?key=page+bit
Search entire site for: 'Page Bit'.

Truncated match.
PICList Thread
'Page Bit'
1999\06\10@175413 by PDRUNEN

picon face
In a return, is the page bit restored?

That is, if the next call after my return is made to page 1,
But in the routine before I set the page bit to page 0 and do the return,
Then I am really going to go somewhere into page 0?

Thank!

1999\06\10@185753 by Mike Keitz

picon face
On Thu, 10 Jun 1999 17:50:50 EDT spam_OUTPDRUNENTakeThisOuTspamAOL.COM writes:
>In a return, is the page bit restored?

Hey, a real PIC question, even if it is frequently asked.

The answer is no.  The page bits are never changed automatically by
hardware except in case of a reset.

>That is, if the next call after my return is made to page 1,
>But in the routine before I set the page bit to page 0 and do the
>return,
>Then I am really going to go somewhere into page 0?

The RETURN instruction ignores the page bit.  It will always return to
the instruction after the last call because the full return address was
stored in the stack.  The state of the page bit when a call or goto is
executed determines which page the program will go to.  It's up to
software to be sure it is correct.

So from a program running in page 0, you could set the page bit to 1 and
call several routines in page 1 successively without needing to set the
page bit before each call.  Each return would return to the page 0
program, even though the page bit is still 1.  The bit would need to be
set back to 0 before calling or going to any place in page 0.


___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\06\11@044954 by Dr. Imre Bartfai

flavicon
face
Hi,
AFAIK the PIC stack saves the COMPLETE return address. Such way is ensured
the return gets immediately after the appropriate call. At least, this is
true for 14-bit core, but I guess also for 12-bit ones.
I hope this helps.
Imre


On Thu, 10 Jun 1999 .....PDRUNENKILLspamspam@spam@AOL.COM wrote:

> In a return, is the page bit restored?
>
> That is, if the next call after my return is made to page 1,
> But in the routine before I set the page bit to page 0 and do the return,
> Then I am really going to go somewhere into page 0?
>
> Thank!
>
>

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