This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
in line assembly
- From: "Kevin Ma" <kevin dot ma at globalipsound dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 15 Mar 2006 15:53:59 -0800
- Subject: in line assembly
I'm new in using GCC. This is for an embedded system development. When I
tried to use in line assembly, I found I can't write a relatively large
block of assembly within C. For example, if I wrote,
asm(
lea -60(a7), a7 ;
movem.l d0-d6/a0-a5, (a7) ;
move.l MACSR, d6 ;
move.l %0x00, d0 ;
move.l d0, MACSR ;
(and a lot of lines ...)
)
The compiler would not recognize it. Seems I have to write strictly in the
syntax as
asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
which is the only way specified in the GCC manual.
How can I overcome this problem and write a large chunk of assembly code in
a C file? Thanks.
Kevin Ma