Mail Archives: djgpp/1996/12/17/07:05:08
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 -