5 ms·
Why do you claim that local variables and function calls are specific to C? They seem to be very popular among programming languages in general.
by swolchok 8y ago
Why do you claim that local variables and function calls are specific to C? They seem to be very popular among programming languages in general.
- Annatar 8y agoBecause I'm an assembler coder, and when one codes assembler by hand, one almost never uses the stack: it's easy for a human to write subroutines in such a way that only the processor registers are used, especially on elegant processor designs which have 16 or 32 registers.
- pjmlp 8y agoI surely did use the stack a lot, back in the old days when coding Z80 and 80x86 Assembly.
- Annatar 8y agoYou almost had to, because both Z80 and x86 processors have a laughably small number of general purpose registers. To write code which works along that limitation would have required lots of care and cleverness, far more than on UltraSPARC and MC68000. On MOS 6502 we used self-modifying code rather than the stack because it was more efficient and that CPU has no instruction and data caches, so they couldn't be corrupted or invalidated.