how to use macro in assemble language embedded in C?

Kaoru Fukui k_fukui at highway.ne.jp
Wed Dec 27 22:04:44 EST 2000


> Hi,
>
> (NOTE: when reply this mail, please cc: kerler at newmail.net , thanks)
>
> I change the first line of temp.c:
>     asm("#include <asm\\ptrace.h>\n\t");
> to
>     asm("#include <asm/ptrace.h>\n\t");
> ==========temp.c==================
>  asm("#include <asm/ptrace.h>\n\t");
>  void dummy (void)
>  {
>      asm("stwu   %r1, -PT_R16(%r1)");             /* stack */
>  }

The problem is in YOUR syntax.
Inline asm is C launguage ,so C rabel can not put in string field like "-PT
_R16".
The compiler doesn't search the rabel which is put in string field

You can find some examples in asm-ppc.

cd /usr/include/asm
grep -n asm * | more

The documentation is gcc source.
Plaese get some new gcc's source,then open that.
*importance*
Read gcc/extend.texi.

There is much help.

More help is there(in gcc source).
cd gcc
grep -n asm | more

You will have much help there.

Kaoru


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list