What does 0x4 do in “movl $0x2d, 0x4(%esp)”?

后端 未结 5 2222
一个人的身影
一个人的身影 2021-02-20 16:46

I am looking into assembly code generated by GCC. But I don\'t understand:

movl $0x2d, 0x4(%esp)

In the second operand, what does 0x4

5条回答
  •  孤街浪徒
    2021-02-20 16:58

    You're accessing something four bytes removed from where the stack pointer resides. In GCC this indicates a parameter (I think -- positive offset is parameters and negative is local variables if I remember correctly). You're writing, in other words, the value 0x2D into a parameter. If you gave more context I could probably tell you what was going on in the whole procedure.

提交回复
热议问题