4 ms·
> Well, CALL and RETURN need a stack: RETURN would need an address to return to. So there you go. I agree with the sentiment but you're making an impermissible
by eqvinox 1y ago
> Well, CALL and RETURN need a stack: RETURN would need an address to return to. So there you go.
I agree with the sentiment but you're making an impermissible contraction here. Look at how ARM calls work—the instructions are "bl <addr>" (branch and link) and "bx lr" (branch to register, lr). "bl" just stores the return address in the link register. The stack is something the machine code does on top of that. Of course the CPUs are optimised for standard ways of doing that, but it's not inherent to the system.
- estimator7292 1y agoWe're talking about historic CPUs
- Veserv 1y agoARMv1 in 1985 had branch and link [1]. [1] https://en.wikichip.org/wiki/arm/armv1 https://en.wikichip.org/wiki/arm/armv1