call/ret
Notes
- This is Jorgensen chapter 12.6
-
call
-
call function
- Remember,
function is just a label.
- Possibly:
push rsi
jmp function
- rip, the instruction pointer or program counter
- It will be pointing to the next instruction at this phase of the FDE cycle
- Which is were we want to return
- This is just a little more subtle than you think
- It allows arbitrary returns
- But since we are putting the value of rip on the stack, we can also do recursion.
-
ret
- Note it is very important that we don't mess with the return address.