http://www.devili.iki.fi/Computers/Comm ... e_274.html
what does it mean
Stack Requirements: 13
Stack Requirements
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Stack Requirements
James_Parsons wrote:
http://www.devili.iki.fi/Computers/Commodore/C64/Programmers_Reference/Chapter_5/page_274.html
what does it mean
Stack Requirements: 13
what does it mean
Stack Requirements: 13
Although the 6502's stack is tiny by current standards it can handle quite a few nested subroutines. Assuming the worst case, in which each subroutine pushes all registers for later restoration, 42 subroutines can theoretically be nested. I say "theoretically" because interrupts will also claim stack space. Plus when BASIC is running, the stack gets used for FOR-NEXT loops, as well as handling GOSUB-RETURN pairs. You can get an OUT OF MEMORY error in BASIC if too many GOSUBs or FOR-NEXT loops are nested. The choice of error for this situation is unfortunate, because there's plenty of memory when it happens. What is really happening is that the stack pointer has been driven too close to $00, leaving insufficient stack space for another GOSUB or FOR-NEXT.
x86? We ain't got no x86. We don't NEED no stinking x86!
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Stack Requirements
From this page, it appears to be how many bytes' space it takes in the hardware stack (which is in page 1), not including the return address that gets put on it by your JSR that calls the routine. 13 bytes on that one is extraordinarily heavy stack usage. I looked at a lof of the following pages, and the other routines all took less, mostly zero to two.
It looks like you found a really good website there!
It looks like you found a really good website there!
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: Stack Requirements
GARTHWILSON wrote:
... It looks like you found a really good website there!
Mike
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Stack Requirements
barrym95838 wrote:
GARTHWILSON wrote:
... It looks like you found a really good website there!
Mike
x86? We ain't got no x86. We don't NEED no stinking x86!