in line assembly

Kevin Ma
Wed Mar 15 23:49:00 GMT 2006

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,

  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

More information about the Gcc-help mailing list