How does the stack on the Gameboy Advance work?
Jeff's crt0.S sets the user and irq stack pointers high in IWRAM (160 and
92 bytes respectively). This implies to me that these stacks grow upwards
in memory. Giving the irq stack 92 bytes and the user stack 160 - 92 = 68
bytes.
This looks to odd to me, and knowing that stacks ussually grow downward in
memory towards the top of the heap then maybe they really grow downwards,
giving the irq stack 68 and the user stack all of iwram (or until it
corrupts any variables stored there).
If so, then what is the 92 bytes left free at the top? I seem to recall
there being a third stack on the ARM7TDMI, is this for bios calls?
I knew all of this once upon a time, but looking at everything again is
serving to confuse me, not clarify ^_^
Looking at the linkscript and crt0.S for devkitadvance again is making me
have a lot of "What the hell!" moments which one gets when they look at
cod ethey wrote years ago.