From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22675 invoked by alias); 5 Apr 2002 06:45:10 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 22657 invoked from network); 5 Apr 2002 06:45:03 -0000 Received: from unknown (HELO david.siemens.de) (192.35.17.14) by sources.redhat.com with SMTP; 5 Apr 2002 06:45:03 -0000 Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.11.6/8.11.6) with ESMTP id g356ird25393; Fri, 5 Apr 2002 08:44:53 +0200 (MET DST) Received: from mail-l.muc.infineon.com (mail-l.muc.infineon.com [172.29.174.210]) by mail2.siemens.de (8.11.6/8.11.6) with ESMTP id g356irC29198; Fri, 5 Apr 2002 08:44:53 +0200 (MEST) Received: from keksy.muc.infineon.com (keksy [172.29.174.218]) by mail-l.muc.infineon.com with ESMTP id g356irGk000990; Fri, 5 Apr 2002 08:44:53 +0200 (MET DST) Received: (from kahlert@localhost) by keksy.muc.infineon.com (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) id g356ipQ00858; Fri, 5 Apr 2002 08:44:51 +0200 Date: Fri, 05 Apr 2002 00:07:00 -0000 From: Martin Kahlert To: Atanas Uzunov Cc: gcc@gcc.gnu.org Subject: Re: Assembler in GCC Message-ID: <20020405084450.A32710@keksy.muc.infineon.com> Reply-To: martin.kahlert@infineon.com References: <003901c1dc2d$12d87820$c99d74d4@atanas> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <003901c1dc2d$12d87820$c99d74d4@atanas>; from mcubg@mail.bg on Fri, Apr 05, 2002 at 02:04:23AM +0300 X-SW-Source: 2002-04/txt/msg00184.txt.bz2 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.