www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/17/07:05:08

Date: Tue, 17 Dec 1996 13:51:39 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Matt J Reiferson <msnakes AT juno DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Register Variable Question?
In-Reply-To: <19961215.150724.3694.0.MSnakes@juno.com>
Message-ID: <Pine.SUN.3.91.961217134650.21044A-100000@is>
MIME-Version: 1.0

On Sun, 15 Dec 1996, Matt J Reiferson wrote:

> I want to have a couple of global register int variables in my program to
> get the most speed out of a couple of functions, when I compile I get an
> error message saying:
> 	register name not specified for 'int sliver_column'
> 
> The line it refers to is:
> 	register int sliver_column

The only way to specify that a global variable will go into a register is 
like so:

	register int sliver_column __asm__ ("eax");

Beware: there are a lot of gotchas in allocating a register for a global, 
so you should only use it if you really need that.  You can read all 
about this in the on-line gcc docs; type this from the DOS prompt:

	info gcc "C Extensions" "Explicit Reg Vars" "Global Reg Vars"

- Raw text -


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