I know that when a routine is called, the processor stores the memory address of the code that called the routine so that it knows where to go to continue execution when the called routine “returns.” This address (named the return instruction pointer) is stored on the stack.
I have three questions in mind:
- Where in the stack is the Return Instruction Pointer stored?
- How is the RIP used when a function returns?
- and Where should this cause the program to continue execution?