This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Asm in GCC
- From: Laurent Pinchart <laurent dot pinchart at capflow dot com>
- To: gcc-help-return-8513-laurent dot pinchart=capflow dot com at gcc dot gnu dot org
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 05 Apr 2002 09:42:45 +0200
- Subject: Re: Asm in GCC
- References: <004101c1dc2d$63b61180$c99d74d4@atanas>
- Reply-to: laurent dot pinchart at capflow dot com
>
>
>I need to know how to implement simple assembler instructions in C for
>example:
>
>mov ah, 2
>
>when i wrte this (asm ("mov ah, 2"::)) i get the message: Error: suffix or
>operands invalid for `mov'
>
>In help files there are examples only with somthing like that : mov %0,%1
>...
>nothing said about ah, al ...
>
1) Read the documentation.
2) asm in GCC uses the AT&T syntax, where the destination operand is the
second operand. Thus what you want to do is written
mov $2, %ah
Laurent Pinchart