Now that i know u can use gcc for Intel syntax instead of default at&t with
gcc -S -masm=intel test.c
There is this line
mov DWORD PTR [ebp-16], OFFSET FLAT:base
Is it the same as mov dword[ebp-16], base?
Otherwise what must i do?
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.
Yes,
mov dword [ebp - 16], baseis correct NASM syntax to store the label address to 4 bytes of memory at EBP-16.I haven’t seen
offset flat:for a while – I think it’s obsolete, but it’s what GAS’s idea of.intel_syntax noprefixused to demand (I had to look at Gas’s source code to find that out).gcc -masm=inteluses it when using symbol addresses as immediates, butoffset baseworks, too, in GAS.It means the same as
offsetto MASM, or the unadorned variable name in NASM.