clang doesn't use intel assembly syntax

Viewed 901

I'm trying to compile an inline assembly code in clang (Windows). So,I have the following code:

int main(int, char **) {
  asm("mov %eax,$4;");
}

I tried compiling it using clang++ -masm=intel main.cpp but it complains about mnemonic operand size main.cpp:4:7: error: unknown use of instruction mnemonic without a size suffix, because it was still using AT&T syntax.
I have tried using

asm(".intel_syntax;"
      "mov %eax,$4;");

But it complains about using .intel_syntax main.cpp:3:7: error: unknown token in expression asm(".intel_syntax;")

0 Answers
Related