From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23912 invoked by alias); 17 Mar 2010 06:16:31 -0000 Received: (qmail 23904 invoked by uid 22791); 17 Mar 2010 06:16:30 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from kuber.nabble.com (HELO kuber.nabble.com) (216.139.236.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Mar 2010 06:16:25 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NrmYJ-0000Yx-DB for gcc-help@gcc.gnu.org; Tue, 16 Mar 2010 23:16:23 -0700 Message-ID: <27927993.post@talk.nabble.com> Date: Wed, 17 Mar 2010 06:20:00 -0000 From: Manjunath S M <81matti@gmail.com> To: gcc-help@gcc.gnu.org Subject: Re: Inline Assembly Help In-Reply-To: <201003170126.01103.root@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: <201003170126.01103.root@localhost> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg00212.txt.bz2 Hi Brian, I would like to tell you that your question has been answered in the GCC=20 documentation for inline assembly. Your first question related to operand numbering, Operands corresponding to the C expressions are represented by %0, %1 ... etc. In the assembler template, each operand is referenced by numbers.=20 Numbering is done as follows. If there are a total of n operands (both input and output inclusive),=20 then the first output operand is numbered 0, continuing in increasing order= ,=20 and the last input operand is numbered n-1.=20 Now getting back to your question, a single variable may serve as both the input=20 and the output operand. Such cases may be specified in "asm" by using matching constraints.=20 asm ("incl %0" :"=3Da"(var):"0"(var));=20 For more information on the same kindly refer=20 http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html Regards Manjunath S M Brian O'Mahoney-4 wrote: >=20 > A very simple question, but no-where explicitly documented, when using=20 > extended assembly, how are operand numbers ie %n relate to input and > output=20 > constraint-lists ? >=20 > Do they independently count from zero, in each constraint list? What if a= n=20 > operand is in & out put? >=20 > Thanks, Brian >=20 > --=20 > Greetings (mit freundlichen Gr=C3=BC=C3=9Fen), Brian. >=20 > Dr. Brian O'Mahoney Email: omb@teraflex.ch >=20 >=20 --=20 View this message in context: http://old.nabble.com/Inline-Assembly-Help-tp= 27926516p27927993.html Sent from the gcc - Help mailing list archive at Nabble.com.