public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* asm volatile encoding : Doubt.
@ 2004-03-19 12:15 sashti srinivasan
  0 siblings, 0 replies; only message in thread
From: sashti srinivasan @ 2004-03-19 12:15 UTC (permalink / raw)
  To: gcc-help

Hello All,

  The following is a line in rtems' timer driver
source.
    asm volatile(".byte 0x0F, 0x31" : "=A" (result));
  
  I could not understand this. RTEMS mailing list
clarified me saying that it is encoding of pentium
rdtsc instruction.  Please tell me how the above
statement differs from the one below.
        asm("rdtsc result");
(Assuming the instruction pnemonic is correct)

  Only thing I found from gnu documentation for gcc
that '=' specifies that result is a output of the
instruction.  According to the document, there must be
an instruction pnemonic string first inside the
paranthesis.  But there is the directive .byte there. 
Does this mean the opcode directly?

  The document also says that the arguments can be
referred like %0, %1 etc.  But there is nothing like
this here.  Is it because, since there is only one
operand, it is assumed that it follows the opcode?
   
  Please clear my doubts.

With Best Regards
Srinivasan

________________________________________________________________________
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more. 
Go to: http://in.insurance.yahoo.com/licspecial/index.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-19 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-19 12:15 asm volatile encoding : Doubt sashti srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).