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

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

    GCC assembly operands follow a byte (b), word (w), long (l) and so on such as :

    movb
    movw
    movl
    

    Registers are prefixed with a percentage sign (%).

    Constants are prefixed with a dollar sign ($).

    In the above example in your question that means the 4th offset from the stack pointer (esp).

    Hope this helps, Best regards, Tom.

提交回复
热议问题