LEAVE

By Vesper Vei
1 minute read

Table of Contents

  1. LEAVE (leave)
    1. Basic purpose
    2. Instruction execution process
    3. Instruction format
    4. Behavioral characteristics
    5. Common uses

LEAVE (leave)

Basic purpose

LEAVE is used to restore the stack frame from before a function call, equivalent to cleaning up local variables and restoring the old RBP. Equivalent behavior:

mov rsp, rbp
pop rbp

Instruction execution process

  1. Write the value of RBP into RSP (discard the local variable area)
  2. Pop the old RBP from the stack

Instruction format

leave

Behavioral characteristics

Common uses


Relationship Graph

Loading graph...