
Similarly, when we exit a function, the following instructions are always executed:
mov rsp,rbp pop rbp
The above instructions are equivalent to:
leave
In other words, the leave instruction reverses the actions performed by the enter instruction. It copies the RBP to RSP and pops the RBP register so that the stack frame allocated to the function is released. Please note that the ret instruction is not part of the leave instruction and the ret instruction is executed after the leave instruction in x86 and x64 assembly.










































0 Comments