Is there any symbol I could reliably use to point to the "top of the stack"? This would be helpful to simplify DeZog configuration files: DeZog requires a parameter with information of the top of the stack to show the call stack window. Currently, I'm just passing the address that corresponds to the CRT configuration, but it would be much nicer to pass a symbol.
I see "__register_sp" might be a good candidate (at least in zx spectrum targets), but I haven't seen any documentation about it.
Thanks!
Top of the stack
Re: Top of the stack
That symbol is probably the closest you‘ll get IF the stack has been set. The setting of sp is here: https://github.com/z88dk/z88dk/blob/mas ... nit_sp.inc
There are ways of walking the frame at runtime using ix eg see cmd_backtrace here: https://github.com/z88dk/z88dk/blob/mas ... er.c#L1275
There are ways of walking the frame at runtime using ix eg see cmd_backtrace here: https://github.com/z88dk/z88dk/blob/mas ... er.c#L1275
Re: Top of the stack
That should be the case for most targets / CRTs, right?That symbol is probably the closest you‘ll get IF the stack has been set. The setting of sp is here: https://github.com/z88dk/z88dk/blob/mas ... nit_sp.inc
Re: Top of the stack
Yes. From memory most of them set sp to an absolute address.