PDA

View Full Version : Stkptr



CocaColaKid
- 12th March 2007, 19:36
Just curious as to why you can't killing a gosub by killing the stack associated to it. Why could you not just use a goto in the subroutine and kill the stack pointer? This obviously would not work if you have nested gosubs though. However with just one stack could you not just use something like this?

STKPTR.0 = 0
STKPTR.1 = 0
STKPTR.2 = 0
STKPTR.3 = 0
STKPTR.4 = 0

Bruce
- 12th March 2007, 20:50
On 18F parts you can. POP, DECF STKPTR, etc allow you to manipulate the stack pointer.