5 ms·
> is there an example of machine code that doesn't make use of a linear contiguous call stack? Early CPUs didn’t have support for a stack, and some early langu
by Someone 4y ago
> is there an example of machine code that doesn't make use of a linear contiguous call stack?
Early CPUs didn’t have support for a stack, and some early languages such as COBOL and Fortran didn’t need one. They didn’t allow recursive function calls, so return addresses could be stored at fixed addresses, and a return could either be an indirect jump reading from that address or a direct jump whose target address got modified when writing to that fixed address (see https://people.cs.clemson.edu/~mark/subroutines.html https://people.cs.clemson.edu/~mark/subroutines.html for the history of subroutine calls)
Both go (https://blog.cloudflare.com/how-stacks-are-handled-in-go https://blog.cloudflare.com/how-stacks-are-handled-in-go) and rust (https://mail.mozilla.org/pipermail/rust-dev/2013-November/006314.html https://mail.mozilla.org/pipermail/rust-dev/2013-November/00...) initially had split stacks (https://releases.llvm.org/3.0/docs/SegmentedStacks.html https://releases.llvm.org/3.0/docs/SegmentedStacks.html, https://gcc.gnu.org/wiki/SplitStacks https://gcc.gnu.org/wiki/SplitStacks)