How to overcome limitation on nesting of GOSUBs to 4?
Archiver
Posts: 46,084
I am using BS2p with PBASIC2.5 and I am up against the limitation of
nesting of GOSUBs to 4.
Any pointers to how to overcome this hurdle?
I thought of using the GOTO statement and put the address of next
statement (i.e. next to the GOTO) in the SPRAM and then use another
GOTO at the end of the routine (which I want to be executed) and give
the return address from the SPRAM.
Is this logic alright? or are there other simpler methods?
If yes, how do I get the address of the next statement?
Thanks
Mohammed
nesting of GOSUBs to 4.
Any pointers to how to overcome this hurdle?
I thought of using the GOTO statement and put the address of next
statement (i.e. next to the GOTO) in the SPRAM and then use another
GOTO at the end of the routine (which I want to be executed) and give
the return address from the SPRAM.
Is this logic alright? or are there other simpler methods?
If yes, how do I get the address of the next statement?
Thanks
Mohammed