From: "Tom St Denis" Newsgroups: comp.os.msdos.djgpp References: <5BF60CD649EDD411A04600B0D049F53A544465 AT hydmail02 DOT hyd DOT wilco-int DOT com> Subject: Re: Accessing registers from C Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Message-ID: Date: Mon, 02 Jul 2001 03:33:28 GMT NNTP-Posting-Host: 24.112.8.23 X-Complaints-To: abuse AT home DOT net X-Trace: news3.rdc1.on.home.com 994044808 24.112.8.23 (Sun, 01 Jul 2001 20:33:28 PDT) NNTP-Posting-Date: Sun, 01 Jul 2001 20:33:28 PDT Organization: Excite AT Home - The Leader in Broadband http://home.com/faster To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Prashant Ramachandra" wrote in message news:5BF60CD649EDD411A04600B0D049F53A544465 AT hydmail02 DOT hyd DOT wilco-int DOT com... > On Monday, July 02, 2001 2:28 AM, Tom St Denis [SMTP:tomstdenis AT yahoo DOT com] > wrote: > | > | "Jacek K." wrote in message news:9hns3d$4rn$1 > | @news.tpi.pl... > | > Are there some instructions/macros to access CPU registers? > | > Anything other > | > than inline assembly, of course. > | > | No and you shouldn't. > > And why not? > > Try this: > > void foo () > { > register unsigned long eax __asm__ ("ax"); > > ... > } > > Everytime you use the variable "eax", you're actually accessing or modifying > the eax register itself. Perhaps, and by doing so you take away chances for GCC to optimize the code. You might as well not write in C then. Tom