This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Assembler in GCC
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- To: Atanas Uzunov <mcubg at mail dot bg>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 5 Apr 2002 08:44:51 +0200
- Subject: Re: Assembler in GCC
- References: <003901c1dc2d$12d87820$c99d74d4@atanas>
- Reply-to: martin dot kahlert at infineon dot com
Hi,
On Fri, Apr 05, 2002 at 02:04:23AM +0300, Atanas Uzunov wrote:
> Hi,
> 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'
Try this links:
http://www-106.ibm.com/developerworks/linux/library/l-ia.html?dwzone=linux
http://www.cs.virginia.edu/~clc5q/links.html
Based on that, i would suggest something like that:
int main (int argc, char **argv)
{
asm volatile ("movb $2, %%ah" : : :"eax");
}
Read gcc's info page about extended inline assembly, too.
Hope that helps,
Martin.
--
The early bird catches the worm. If you want something else for
breakfast, get up later.