2 ms·
The call instruction on x86 automatically writes a return address to the stack, and I suspect that that's a standard instruction across architectures. That's su
by mtdewcmu 13y ago
The call instruction on x86 automatically writes a return address to the stack, and I suspect that that's a standard instruction across architectures. That's sufficient to make my point that the CPU expects a stack.
- panzi 13y agoSome architectures write the return address into a register and not onto the stack. The calling function has to preserve it's return address somehow, yes, but that isn't done for you (well, a compiler does it for you, but not an assembler). So if all parameters are passed via registers and the function does not need more memory than the registers provide for the calculation, then this kind of function does not need to access the stack at all.