For example, x86 ISA has some specific instructions to handle stack-related operations such as push
and pop
, but stack can be totally implemented in the software by some memory access operations like mov
, even the latter has better performance: Why use Push/Pop instead of Mov to put a number in a register in shellcode?
In ARM, push/pop
are just aliases for memory operations, for reference: Push and Pop in arm
Why do we need to make the ISA aware of the existence of a stack? why don't we just make the hardware forget the "stack" and just leave it to software implementations? This would have two advantages, as far as I can see:
- hardware design can be simplified,
- give more flexibility to the software.
Can an ISA be implemented without the stack
concept, i.e, without the push
, pop
, %rsp
, %rbp
, and such things?