leave
Destroy stack frame
Destroys the stack frame made by enter by setting rsp to rbp and popping the saved rbp.
186 and later
Used in
- call, ret and the System V conventionx86-64 assembly
- Stack arguments and a stack framex86-64 assembly
CFPFAFZFSFDFOF –––––––
- Changes no flag
Forms
leave
It has the effect of mov rsp, rbp followed by pop rbp and leaves flags unchanged. It can match an enter frame or the usual explicit frame setup. leaveq explicitly selects the 64-bit form.
global _start
section .text
_start:
enter 16, 0
mov qword [rbp - 8], 12
leave ; undoes the frame enter made
mov rax, 60 ; syscall 60: exit
xor rdi, rdi
syscall