From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11944 invoked by alias); 24 Mar 2004 12:39:57 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 11936 invoked from network); 24 Mar 2004 12:39:56 -0000 Received: from unknown (HELO yosemite.airs.com) (209.128.65.135) by sources.redhat.com with SMTP; 24 Mar 2004 12:39:56 -0000 Received: (qmail 14401 invoked by uid 10); 24 Mar 2004 12:39:56 -0000 Received: (qmail 17227 invoked by uid 500); 24 Mar 2004 12:39:47 -0000 From: Ian Lance Taylor To: sashti srinivasan Cc: gcc-help@gcc.gnu.org Subject: Re: Machine Instruction encoding References: <20040324055342.29299.qmail@web8107.mail.in.yahoo.com> Date: Wed, 24 Mar 2004 13:44:00 -0000 In-Reply-To: <20040324055342.29299.qmail@web8107.mail.in.yahoo.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-03/txt/msg00233.txt.bz2 sashti srinivasan writes: > > > The following is a line in rtems' timer driver > > > source. > > > asm volatile(".byte 0x0F, 0x31" : "=A" > > (result)); ... > Lots of thanks for the clarifications. Sorry for > further simple doubts. The rdtsc instruction stores > the value(of time) in registers eax and edx, and you > have said that compiler puts data from these registers > into the variable 'result'. But we are not specifying > the registers(eax,edx) in this statement. How the > compiler knows that variable 'result' should be > updated based on these registers?(eax,edx do not > figure in this statement). > > If these are documented anywhere, please give me > pointers. The compiler knows that the results winds up in %eax/%edx due to use of the constraint 'A' on the value to be stored into result. This is documented, sort of, here: http://gcc.gnu.org/onlinedocs/gccint/Machine-Constraints.html#Machine%20Constraints Look for "Intel 386". Ian