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 stands for? offset address? And what the use of register EAX?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
movl $0x2d, 0x4(%esp)means to take the current value of the stack pointer (%esp), add 4 (0x4) then store the long (32-bit) value0x2dinto that location.The
eaxregister is one of the general purpose 32-bit registers. x86 architecture specifies the following 32-bit registers:and the names and purposes of some of then harken back to the days of the Intel 8080.
This page gives a good overview on the Intel-type registers. The first four of those in the above list can also be accessed as a 16-bit or two 8-bit values as well. For example:
The pointer and index registers do not allow use of 8-bit parts but you can have, for example, the 16-bit
bp.