News for hackers. Stuff that matters.
Re:What is “the stack”? by kmm on Thursday March 03, 2016 @12:30AM (#11215202)
`push` decrements the stack pointer on x86 architecture, unlike on ARM. The stack is strange in that it grows downwards. That is also why in the disassembly of the `blah` function the argument is temporarily stored in `ebp - 4` as ebp points to the top of the stack (which is at the lowest address).

I also wouldn't really say assembly follows the C stack pointer. The C language makes no assumptions about stacks, stack pointer or return addresses. It just describes "functions" to which the execution can be transferred and from which can be returned. How this is implemented, is up to the compiler designer and is platform dependent. I wouldn't be surprised to find out there were platforms without a stack/stack pointer but with a C compiler

Re:What is “the stack”? by danellis on Thursday March 03, 2016 @03:34AM (#11215671)
> `push` decrements the stack pointer on x86 architecture, unlike on ARM.

Why do you say "unlike on ARM"? In 25 years I've never seen anything but a full, descending stack used as the program stack. You can have ascending stacks, but that's more an artifact of the fact that `pop` and `push` (which didn't exist in the assembly language until Thumb) are just specific uses of the general multiple load/store instructions `LDM` and `STM`, which can "write back" an incremented or decremented base register.

Re:What is “the stack”? by jldugger on Thursday March 03, 2016 @12:35AM (#11215221)
I always just drew the stack downwards in school. Makes it easier to for that assignment to diagram the stack at level of deepest recursion, at least.
Re:What is “the stack”? by ddingus on Thursday March 03, 2016 @01:40AM (#11215398)
There are. Parallax Propeller has no stack, no interrupts.