News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Adding inline asm allways generates an error

Started by typicalc, April 03, 2025, 12:56:16 PM

Previous topic - Next topic

typicalc

I have trouble making GCC compile som additional ASM
The source is C and it has this test line:
asm("movl $0, %eax\n\t");

I get an error:
C:\Users\joe\AppData\Local\Temp\cc34a8K4.s|34018|Error: no such instruction: `movl $0,%eax'|

When I compile and link from command line it compiles and link fine. If I compile & link using "-masm=intel" the compiles fails with the same error.
SO I suspect I have "-masm=intel" setting somewhere in Codeblocks. Where is it? I searched "Project build options" and "Settings- compiler setting" but there was nothing about this.

Do I need some other setting or #include ?

stahta01

Are you positive you are using the exact same compiler inside Code::Blocks and on the command line?

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

typicalc

#2
Ok I found a solution. I manually edited the cbp file and took out the offending "masm=intel"