Overview

The details of procedures are detailed in procedures. This file touches on the most relevant instruction classes.

CALL and RET

Like JMP instructions, call allows specifying a direct or indirect operand. call pushes the address of the instruction following it onto the stack and updates the PC to the operand. ret reverts these steps.

InstructionOperandsDescription
callLabelProcedure call
call*OperandProcedure call
retReturn from call

LEAVE

leave parallels the ret instruction. It is equivalent to the following two instructions:

movq %rbp, %rsp
popq %rbp

Bibliography

  • Bryant, Randal E., and David O’Hallaron. Computer Systems: A Programmer’s Perspective. Third edition, Global edition. Always Learning. Pearson, 2016.