delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/01/23:45:04

From: "Tom St Denis" <tomstdenis AT yahoo DOT com>
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: <cYR%6.74915$Mf5.20356152@news3.rdc1.on.home.com>
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" <rprash AT wilco-int DOT com> 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." <xos AT o2 DOT pl> 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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019