Searching \ for 'Stack Pointer' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=stack+pointer
Search entire site for: 'Stack Pointer'.

Truncated match.
PICList Thread
'Stack Pointer'
1998\04\16@192900 by TONY NIXON 54964

flavicon
picon face
Anyone know what happens to the stack pointer on a reset.

On a powerup reset, it is understandable that it would be set to
point to the 1st stack position, but what about a WDT reset or a wake
up from SLEEP.


TIA
Tony


PicNPoke Multimedia 16F84 Beginners PIC Tools.

**PLUS** - PicNPlay - PicNPlan - PicNPrep - PicNPost
PicNPort - DT Type Saver - *new* PicNQuiz.
Recent addition - DogBoneZ Component.

http://www.dontronics.com/picnpoke.html

1998\04\16@203625 by Mike Keitz

picon face
On Fri, 17 Apr 1998 09:23:45 +1000 TONY NIXON 54964
<spam_OUTTony.nixonTakeThisOuTspamENG.MONASH.EDU.AU> writes:
>Anyone know what happens to the stack pointer on a reset.
>
>On a powerup reset, it is understandable that it would be set to
>point to the 1st stack position, but what about a WDT reset or a wake
>up from SLEEP.

I don't think it is hooked to the reset logic at all.  On power up, the
value would be "random".  After a WDT or wakeup, it would be unchanged.
The stack will work properly without resetting it.

_____________________________________________________________________
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
Or call Juno at (800) 654-JUNO [654-5866]

1998\04\17@020144 by Ivan Cenov

flavicon
face
Is there any stack pointer in PIC ?
I imagine this hardware stack as 8-byte array
and pushing in and pulling out are some like this:

typedef word _14_bit_value;
word stack [8];

push (word return_addres)
{
   int i;
   for (i = 6; i >= 0; i--)
       stack[i+1] = stack[i];        // and last value is overwritten (lost)
   stack[0] = return_address;
}

word pull ()
{
   int i;
   ret_address = stack[0];
   for (i = 0; i < 6; i++)
       stack[i] = stack[i+1];
   return ret_address;
}

Thus, no stack pointer but the stack contents is moving.
On reset is important what the program is thinking about the stack.

Am I correct, what you think ?

Ivan Cenov
.....okto7KILLspamspam@spam@botev.ttm.bg

{Original Message removed}

1998\04\17@102909 by Mike Keitz

picon face
On Fri, 17 Apr 1998 08:59:44 +0300 Ivan Cenov <okto7spamKILLspamBOTEV.TTM.BG>
writes:
>Is there any stack pointer in PIC ?

In the 12-bit PICs, there is only a 2-level stack which works by copying
the data up and down:

Push:  S2 = S1, S1 = Data
Pop:  Data = S1, S1 = S2

Popping more than twice will return the value from S2 over and over.

>I imagine this hardware stack as 8-byte array
>and pushing in and pulling out are some like this:

In the 14-bit PICs, there is a pointer which works mod-8 and points to
one of 8 stack registers.  After 8 consecutive pops, the pointer will
underflow and the next 8 pops will return the same 8 values again.

Neither type of stack needs any initialization after a reset.  I would
doubt that the PIC chip does any.




_____________________________________________________________________
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
Or call Juno at (800) 654-JUNO [654-5866]

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