According to the tech manual, you are allowed to
have the stack anywhere you like and upto 64K.
Does anyone know if you can have multiple stacks?
If so, how is this done?
According to the tech manual, you are allowed to
have the stack anywhere you like and upto 64K.
Does anyone know if you can have multiple stacks?
If so, how is this done?
Please support the defense of Ukraine.
Direct or via Unclutter App
No Ads.
No Trackers.
No Social Media.
All Content Locally Hosted.
Built on Free Software.
We have complied with zero government requests for information.
~ Est. 1999 ~
A pillar of corporate stability since the second millenium.
© 1999-2999 Tom Owad
According to which tech manual? Apple IIGS GS OS Internals describes it's interaction with the stack. There are memory locations to manage the stack and calls.
The 65816 has one 16-bit stack limited to bank 0. You could create smaller stacks within the overall 64K of stack space. You could even copy bank 0 to and from other banks if you needed to free up stack space or switch context, albeit slowly.
There are many ways to do this.
Apple IIGS/OS Reference Manual
Page 516-517
I forgot about this section
Each program running on the Apple IlGS reserves a portion of bank $00 as a combined
direct-page/stack space. Because more than one application can be loaded in memory at
one time on the Apple IIGS, more than one stack and one direct page could be in bank $00
at a given time. Furthermore, some applications may place some of their code in bank
$00. A given program should therefore probably not use more than about 4 KB for its
direct-page/stack space.
mmphosis
You say you can have have smaller stacks that add up to 64K. Are you saying
just to write your program in smaller sections?
Okay, now I am reading the same manual as you. from page 38...
It sounds like GSOS has some limitations, but nothing that probably could not be worked around if you need to. How large of stack does your program need? I was thinking in terms of programming the 65816 with GSOS out of the way, but I can think of some ways to get around this. It means managing your stack (or stacks) yourself -- like checking for overflow, swapping stack memory as needed and returning everything back to the way GSOS expects it on return.
I will say that I will go for the maximum (64K) and tailor it from there.