www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/14/05:34:33

Date: Mon, 14 May 2001 12:35:39 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: MarKol <markol4 AT wp DOT pl>
cc: djgpp AT delorie DOT com
Subject: Re: What's wrong??
In-Reply-To: <9do6sp$pri$1@sunrise.pg.gda.pl>
Message-ID: <Pine.SUN.3.91.1010514123434.25445E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 14 May 2001, MarKol wrote:

> int
> main()
> {
>   unsigned int cr0;
>   // store a copy of CR0
>   __asm__ __volatile__ ("movl %%cr0, %%eax":"=a"(cr0)::"eax");
> }
> 
> 
> main.c: In function `main':
> main.c:6: Invalid `asm' statement:
> main.c:6: fixed or forbidden register 0 (ax) was spilled for class
> AREG.

See section 8.17 of the FAQ.

Note that CR0 cannot be accessed unless you are in Ring 0 (I think), so 
your code might GPF at run time.

- Raw text -


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