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

Message-ID: <5BF60CD649EDD411A04600B0D049F53A544465@hydmail02.hyd.wilco-int.com>
From: Prashant Ramachandra <rprash AT wilco-int DOT com>
To: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>
Cc: "'Tom St Denis'" <tomstdenis AT yahoo DOT com>
Subject: RE: Accessing registers from C
Date: Mon, 2 Jul 2001 08:53:21 +0530
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp AT delorie 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.
--
Prashant TR <tr AT midpec DOT com>  Web: http://www.midpec.com/

"Those who do not understand Unix are condemned to reinvent it, poorly."
     -- Henry Spencer

- Raw text -


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