Using the GNU Compiler Collection (GCC): Explicit Register Variables

Next: Size of an asm, Previous: Asm Labels, Up: Using Assembly Language with C [Contents][Index]

#### 6.47.5 Variables in Specified Registers

GNU C allows you to associate specific hardware registers with C variables. In almost all cases, allowing the compiler to assign registers produces the best code. However under certain unusual circumstances, more precise control over the variable storage is required.

Both global and local variables can be associated with a register. The consequences of performing this association are very different between the two, as explained in the sections below.