29.3.2. x86 PUSH and POP instructions
push %rax
is basically equivalent to:
sub $8, %rsp mov %rax, (%rsp)
and pop %rax
:
mov (%rsp), %rax add $8, %rsp
Why do those instructions exist at all vs MOV / ADD / SUB: https://stackoverflow.com/questions/4584089/what-is-the-function-of-push-pop-registers-in-x86-assembly/33583134#33583134