A
A
Andrey Andryushchenko2017-03-22 18:30:53
C++ / C#
Andrey Andryushchenko, 2017-03-22 18:30:53

How to use intel assembler syntax in CLion?

How to use intel assembler syntax in CLion? I try to turn it on with the line asm(".intel_syntax noprefix");, it gives an error

/tmp/cctafJFU.s: Assembler messages:
/tmp/cctafJFU.s:31: Error: no such instruction: `movl $0,%eax'
/tmp/cctafJFU.s:50: Error: no such instruction: `movl % edi,-4(%rbp)'
/tmp/cctafJFU.s:51: Error: no such instruction: `movl %esi,-8(%rbp)'
/tmp/cctafJFU.s:53: Error: no such instruction : `cmpl $1,-4(%rbp)'
/tmp/cctafJFU.s:56: Error: no such instruction: `cmpl $65535,-8(%rbp)'
/tmp/cctafJFU.s:60: Error: no such instruction: `movl $_ZStL8__ioinit,%edi'
/tmp/cctafJFU.s:62: Error: no such instruction: `movl $__dso_handle,%edx'
/tmp/cctafJFU.s:63: Error: no such instruction: ` movl $_ZStL8__ioinit,%esi'
/tmp/cctafJFU.s:64: Error: no such instruction: `movl $_ZNSt8ios_base4InitD1Ev,%edi'
/tmp/cctafJFU.s:86: Error: no such instruction: `movl $65535,%esi'
/tmp/cctafJFU.s:87: Error: no such instruction: `movl $1,%edi'

What needs to be fixed to make it work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Andryushchenko, 2017-03-22
@delphikettle

After the assembler insert, you need to turn on the at&t syntax back:asm(".att_syntax prefix");

D
devalone, 2017-03-22
@devalone

So it's not CLion that throws errors, but the compiler that it uses

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question