13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AMD64 Technology 24594 Rev. 3.10 February 2005LEAVEDelete Procedure Stack FrameReleases a stack frame created by a previous ENTER instruction. To release theframe, it copies the frame pointer (in the rBP register) to the stack pointer register(rSP), <strong>and</strong> then pops the old frame pointer from the stack into the rBP register, thusrestoring the stack frame of the calling procedure.The 32-bit LEAVE instruction is equivalent to the following 32-bit operation:MOV ESP,EBPPOP EBPTo return program control to the calling procedure, execute a RET instruction afterthe LEAVE instruction.In 64-bit mode, the LEAVE oper<strong>and</strong> size defaults to 64 bits, <strong>and</strong> there is no prefixavailable for encoding a 32-bit oper<strong>and</strong> size.Mnemonic Opcode DescriptionLEAVELEAVELEAVERelated <strong>Instructions</strong>ENTERrFLAGS AffectedNoneC9C9C9Set the stack pointer register SP to the value in the BP register<strong>and</strong> pop BP.Set the stack pointer register ESP to the value in the EBP register<strong>and</strong> pop EBP.(No prefix for encoding this in 64-bit mode.)Set the stack pointer register RSP to the value in the RBP register<strong>and</strong> pop RBP.184 LEAVE

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!