Why do we have commands like push and pop?
From what I understand popand pushbasically the same as for ( movthen add) and ( subthen mov) respectively esp.
For example, there would be:
pushl %eax
is equivalent to:
subl $4, %esp
movl %eax, (%esp-4)
please correct me, if access to the stack is not (%esp-4), I'm still studying the assembly
The only true advantage that I see is that if both operations simultaneously give some advantage; however, I do not understand how this is possible.
source
share