Somehow, an interesting finding here for those using the MCS ICD.
When you hit 'ICD Compile and program' button (or CTRL+F10), it create a variable named DEBUG_STACK which hold the value/actual level of the stack.
NOW, to make things simple, just add those lines
Code:
@STACK_LEVEL = DEBUG_STACK
STACK_LEVEL VAR BYTE EXT
And look what happen to your STACK_LEVEL variable in the ICD window while jumping here and there with gosubs.
i used that one...
Code:
DEFINE LOADER_USED 1
DEFINE OSC 20
@STACK_LEVEL = DEBUG_STACK
STACK_LEVEL VAR BYTE EXT
START:
PAUSE 1000
GOSUB LEVEL1
GOTO START
LEVEL1:
PAUSE 1000
gosub LEVEL2
RETURN
LEVEL2:
PAUSE 1000
GOSUB LEVEL3
RETURN
LEVEL3:
PAUSE 1000
gosub level4
RETURN
LEVEL4:
PAUSE 1000
RETURN
WOOOOHOOOO! Don't break my bubble
to me it's a nice finding... maybe usefull one day or another. Down side... it won't work unless you use the ICD... Darrel's stuff have a BIG advantage as you just need to read the StackPTR byte variable.
Last edited by mister_e; - 18th February 2007 at 17:56.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks