Using another assembler (MASM, NASM, TASM, etc.) Using GCC

I have been looking through the questions here and on the Internet for a while, and I cannot figure out if it is possible to make an embedded assembly with GCC using something other than GAS. I am trying to find if I can avoid using not only the AT&T GAS syntax (although I know how to use Intel syntax with GAS), but the extended asm format. Although this is not for a project or anything other than my own curiosity, I would really appreciate any help I can get (this is actually my first question because I could not find an answer about this)! Also, if that matters, I am currently using DevC ++ (for C code, not C ++) on Windows.

Thanks Tom

+4
source share
2 answers

You can link the output to the assembler (file ".o" or ".obj") with your C or C ++ program. Put the assembler code in a text file. Your IDE or makefile will compile it just like any c source file. The only tricky bit is learning how to interact between two different systems.

+2
source

You cannot use other built-in assembly syntax with GCC. The built-in assembly is implemented literally by GCC, including the assembly you write in line with your own (text) assembly output, which is then sent to gas for assembly. Since GCC does not know how to change the native output format for submission to another assembler, you also cannot change the built-in assembly.

+1
source

Source: https://habr.com/ru/post/1338952/


All Articles