GOSUB nesting limit
Greg_ve9gfi
Posts: 2
Hi Folks,
I recently wrote·a program that failed after I added just one additional GOSUB statement in a part of the program that was already in another GOSUB routine.
The program would reboot,·and I spent some time trying to debug the code before I realized that I was at the limit of the number of nested loops the BS2 can handle.
Is there any quick and dirty method to print out or otherwise determine the depth of the·nested loops as a program is running?
Thanks,
Greg
I recently wrote·a program that failed after I added just one additional GOSUB statement in a part of the program that was already in another GOSUB routine.
The program would reboot,·and I spent some time trying to debug the code before I realized that I was at the limit of the number of nested loops the BS2 can handle.
Is there any quick and dirty method to print out or otherwise determine the depth of the·nested loops as a program is running?
Thanks,
Greg
Comments
For the BS1 the total number of GOSUBs per program are 16.
For the BS2 the total number of GOSUBs per program are 256.
For both the BS1 and BS2, the total number of nested GOSUBs per program are 4.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Main:
n = 100
Recursion:
n = n-1
IF n == 0 THEN GOTO Main
ELSE GOTO Recursion
**