On 5/12/05, lee davison <leeedavison at yahoo.co.uk> wrote:
> Even BASIC
has a call stack that will eventually overflow.
On a 6502 (PET, Apple II...) it's not that
deep because of
the 1-page stack. ISTR about 5 levels of GOSUBs were possible
before you ran the risk of stack overflow, but it might have
been as deep as 8.
Assuming the stack is cleared by RUN then you can nest 40 to
50 levels of GOSUBs in most 6502 BAISCs.
FOR ... NEXT is the stack hog, you can usually only nest that
15 deep or less.
With C= BASIC you have lass room as the top 10 bytes or so of
the stack are reserved for float to ASCII conversion.
Maybe that was it... MS BASIC on a C= PET, with subroutine calls and
FOR/NEXT nested deep enough that one _could_ see the bottom. I never
did a GOSUB-only test, but ISTR having to design some stuff with stack
depth in mind (I did a lot of stuff with Interactive Fiction/Adventure
Games in the late 1970s in BASIC, then I learned 6502 assembly ;-)
-ethan