Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
stack   Message List  
Reply | Forward Message #13821 of 15019 |
Re: [gbadev] stack

No, the stacks grow downwards. In systems where there is only one
stack, that is ususally set to the high end of (a typically monolithic)
memory
area and the heap is placed in the low end. The two grow towards each
other. The same is done here, except that there are two stacks. The IRQ
stack is set up to be small (and if you have specific requirements for a
larger
one you can adjust that.) There is a block of memory set asside at the very
high end. My assumption is that this may be some required scratchpad RAM
for the BIOS. Then the IRQ stack grows down from its initial value and the
User stack grows down towards the IWRAM heap. Thus the User stack can
grow substantially more than the IRQ one and that is OK.

Does that make sense, or did I just stir the mud?

- John
----- Original Message -----
From: "Jason Wilkins" <fenix@...>
To: <gbadev@yahoogroups.com>
Sent: Friday, March 21, 2003 9:13 AM
Subject: [gbadev] stack


> 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.
>
>
>
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>






Fri Mar 21, 2003 7:49 pm

johnse98072
Offline Offline
Send Email Send Email

Forward
Message #13821 of 15019 |
Expand Messages Author Sort by Date

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...
Jason Wilkins
fenix@...
Send Email
Mar 21, 2003
5:36 pm

No, the stacks grow downwards. In systems where there is only one stack, that is ususally set to the high end of (a typically monolithic) memory area and the...
John Seghers
johnse98072
Offline Send Email
Mar 21, 2003
8:03 pm

The stack system the ARM7 uses only require 4 opcodes, LDR, STR, LDM and STM, which can also be used to load and store data from memory, which can get...
Benjamin White
bw3043@...
Send Email
Mar 21, 2003
9:10 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help