3 ms·
No, it's most high level languages, in general. Pascal or Standard ML for that matter, would suffer just as C does. Languages like C and Pascal really demand
by retrac 3y ago
No, it's most high level languages, in general. Pascal or Standard ML for that matter, would suffer just as C does.
Languages like C and Pascal really demand that you have a nice, cheap stack. Classically, a function call means pushing all the parameters to the stack, and then the return address, and then jumping to the function, then pulling all the parameters off the stack, and pushing the return value on the stack, then modifying the stack pointer to drop the parameters, and then reading the return address off the stack.
Neither the Z80 or 6502, have instructions that provide an efficient stack, which works with multi-byte data. You end up constantly manipulating the stack pointer (usually for a software-implemented stack) with slow 8-bits-at-a-time arithmetic. Painful.
The PDP-11's instruction set in comparison, provides not just one, but up to seven, flexible 16-bit stacks.