As seen in this question the ARM stack grow direction is selectible, but who selects this direction exactly? The operating system? The app? The manufacturer?
If it is the operating system, what's the stack direction for iOS, Android and Windows RT?
Ultimately it's the designers of the operating system who choose which direction the stack grows in.
If you want to create your own stack, and not rely on the one given to you by the OS, you can use whatever type of stack you choose. However, if you want to use the OS stack, you have no choice but to accept what the OS gives you.
The first OS that ran on ARM was Arthur, written by Acorn Computers. Arthur uses a growing-downwards stack, quite possibly because the developers who wrote Arthur were used to the stack on the 6502, which also grows downwards. (Arthur didn't last long, and was quickly replaced by RISC OS.)
There is a version of ARM Linux that runs on Acorn hardware - I still have a version of it on my 1995 Acorn Risc PC. I know that that version of the ARM Linux kernel makes calls into RISC OS for various purposes, so it has to use growing-downwards stacks as well. Other operating system developers quite probably followed the lead set by Acorn and/or the ARMLinux developers.
As for iOS, it appears to use a growing-downwards stack (the STMFD
instructions here suggest that). I suspect the same is true for Android and Windows RT, but I haven't been able to verify this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With