6
votes

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?

1
Yes, in NASM. No, in MASM. And this is MASM syntax, as evidenced by the OFFSET keyword, but you tagged it NASM, so which do want to know?harold
Hello @harold i'm programming in nasm thats why i tagged nasm. I wanted to know how to do this masm code in nasm and what offset flat:base mean.Weigel Gram

1 Answers

8
votes

Yes, mov dword [ebp - 16], base should be fine. I haven't seen offset flat: for a while - I think it's obsolete, but it's what AT&T's idea of .intel_syntax used to demand (I had to look at Gas's source code to find that out). Means the same as offset to Masm, or the unadorned variable name in Nasm.