Search code examples
cassemblyintelicc

Modify and assemble .s file


Is it possible to modify and assemble the .s file which can be generated by Intel's C compiler? I know that it is possible with gcc via:

  1. gcc -S file.c
  2. modify file.s
  3. as file.s -o file.o

However, if I try exactly the same with Intel's icc it will result in several errors and warnings. What am I missing here? Thanks.


Solution

  • The problem with the assembly language is that there is no standard syntax, the most popular 2 syntax used to write assembly are the AT&T and Intel one.

    Guess which one is being used by gcc, by default, and which one by Intel .

    I suggest to use Intel syntax under gcc too so you can use just 1 syntax.

    An example on how to generate asm with Intel syntax starting from sourcecode in C

    gcc -S -masm=intel source.c