GCC calling GNU assembler

Andrew Haley aph@redhat.com
Wed Feb 3 12:36:00 GMT 2010

On 02/03/2010 09:26 AM, Nikola Ikonic wrote:

> Could anybody please answer me on following question:
> where is GCC callin assembler where it recognizes assembler code in C
> function? For example, let's say that there is this line in C code:
> asm("mov r1,r0");
> So, the parser parses this as an assembler string. But where, in GCC
> code, is assembler called to process this string?
> Or maybe the question is where this "mov r1, r0" string is passed to
> assembler. Anyway, I think you got my question.

The compiler driver, a program called "gcc", first calls another program
called "cc1" to translate C into assembly language.  It then calls "as"
to translate assembly language into object code.  It does this regardless
of whether there are any asm() statements in the program.


More information about the Gcc-help mailing list