Return Instruction Pointer in the stack

This question already has an answer here:

  • What and where are the stack and heap? 25 answers

  • Where in the stack is the Return Instruction Pointer stored?

    Anything stored in any stack is always stored at the top of the stack. That's according to the definition of "stack".

    How is the RIP used when a function returns?

    When the function executes a "return" instruction, the value at the top of the stack is popped, and stored in the instruction pointer.

    and Where should this cause the program to continue execution?

    Where it left off. That's not the call instruction. That's the instruction immediately following the call instruction.

    链接地址: http://www.djcxy.com/p/2272.html

    上一篇: C ++中的堆栈和堆栈意味着什么?

    下一篇: 返回指令堆栈中的指针