Date: Tue, 17 Dec 1996 13:51:39 +0200 (IST) From: Eli Zaretskii To: Matt J Reiferson cc: djgpp AT delorie DOT com Subject: Re: Register Variable Question? In-Reply-To: <19961215.150724.3694.0.MSnakes@juno.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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"