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

后端 未结 5 2066
一个人的身影
一个人的身影 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 17:14

    0x4(%esp) means *(%esp + 4) where * mean dereferencing.

    The statement means store the immediate value 0x2d into some local variable occupying the 4th offset on the stack.

    (The code you've shown is in AT&T syntax. In Intel syntax it would be mov [esp, 4], 2dh)

提交回复
热议问题