This is a big pile of memory, but there is a stack pointer pointing to the top of the stack. Pressing it rises, the pop signal drops. But often you can cheat by simply changing the pointer, and in this way you can get a return value that has already been popped.
Not all architectures have a stack going in one direction. In the end, it does not matter. Some systems increase the push of the stack on push and decrease pop, other systems decrease when pressed and pop increase.
Example: the stack pointer is 0x100, and this increases the system. Then you click and the stack pointer is 0x104. You click on 0x108 again. You pop, go back to 0x104. Another system would start with 0x100, be brought to 0xfc, then reset to 0xf8 and pop up to 0xfc. If you reappear, you will return to 0x100. If you then subtract 8 from the stack pointer, then go back to 0xf8 so you can put them again. (Or, what the C compiler will do at the end of the function, just add / subtract 12 from the stack pointer, instead of inserting 3 local variables into 3 instructions.
source share