4 ms·
Haven't read all of it, but the author assumes the availability of a return stack, which somehow makes this approach not really stack-free. Most modern calling
by ekr 12y ago
Haven't read all of it, but the author assumes the availability of a return stack, which somehow makes this approach not really stack-free. Most modern calling conventions (x86) use a register(eax/rax) for returning values.
But his approach does in fact conserve stack space.
- LukeShu 12y agoA little bit further down, he shows how to avoid using the return stack also, to use no stack at all. Also, by "return stack", he isn't referring to the mechanism for returning values, he is referring to the mechanism for knowing which address to jump (return) to when a function is finished. In x86, this is still done with a stack, but the stack modifications are done "behind the scenes" by the call/ret instructions.