What is the use of “push

前端 未结 6 1626
我寻月下人不归
我寻月下人不归 2020-12-23 09:38

What effect these two instructions cause in the assembly code generated by gcc for x86 machines:

push %ebp
movl %esp, %ebp
6条回答
  •  遥遥无期
    2020-12-23 10:06

    It's part of what is known as the function prolog.

    It saves the current base pointer that is going to be retrieved when the function ends and sets the new ebp to the beginning of the new frame.

提交回复
热议问题