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
0x4
in the second operand is an offset from the value of the register in the parens. EAX
is a general purpose register used for assembly coding (computations, storing temporary values, etc.) formally it's called "Accumulator register" but that's more historic than relevant.
You can read this page about the x86 architecture. Most relevant to your question are the sections on Addressing modes and General purpose registers