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.
| Instruction | Operands | Description |
|---|---|---|
call | Label | Procedure call |
call | *Operand | Procedure call |
ret | Return from call |
LEAVE
leave parallels the ret instruction. It is equivalent to the following two instructions:
movq %rbp, %rsp
popq %rbpBibliography
- Bryant, Randal E., and David O’Hallaron. Computer Systems: A Programmer’s Perspective. Third edition, Global edition. Always Learning. Pearson, 2016.