Specific implementation of assembler instructions CALL and RET

 

In the implementation details of the machine shown in FIG:

 

Note: the above figure after the return address of the next instruction to calculate the address, and is pushed onto the stack.

            Before the function returns, the stack pointer is already pointing to the return address of the memory space is located.

 

 

For allocation and deallocation of stack space, machine instructions is not responsible. So before the call stack space allocation, and stack space before the release of the return, we need to be responsible for assembly code execution.

Guess you like

Origin www.cnblogs.com/nice-to-meet-you/p/11317123.html