There's usually no reason to manipulate the stack manually.
What are you trying to do with 3 stack segments?
<br>
There's usually no reason to manipulate the stack manually.
What are you trying to do with 3 stack segments?
<br>
DT
well the task i have to complete requires me to use a stack..........we are getting to grips with how to use the pic and to use interrupts....so when a interrupt happens i wanna save the contexts of the WREG, STATUS and the BSR into each section of the stack. this is to be done with three different routines the ISR will run.......... i have done this by using MOVFF into registers but now i wanna use a stack
Thanks
Very strange assignment.
Definitely not the way to do things.
I can say, the only part of the stack that's available to read/write is the TOS (Top Of Stack).
You can NOT split it in thirds and have 3 TOS's.
To do what you are suggesting, you would need to create your own stacks in software, and POP the entries off the hardware stack, then put them in your own stacks. Then in reverse order, to pop them off your stack.
But I really see no benefit, other than learning. And it's NOT beginners stuff.
DT
Bookmarks