Web page hosting, cheap domain name & website promotion services
  

 Index

Next: , Previous: Asm Labels, Up: C Extensions



5.37 Variables in Specified Registers

GNU C allows you to put a few global variables into specified hardware registers. You can also specify the register in which an ordinary register variable should be allocated.

  • Global register variables reserve registers throughout the program. This may be useful in programs such as programming language interpreters which have a couple of global variables that are accessed very often.
  • Local register variables in specific registers do not reserve the registers, except at the point where they are used as input or output operands in an asm statement and the asm statement itself is not deleted. The compiler's data flow analysis is capable of determining where the specified registers contain live values, and where they are available for other uses. Stores into local register variables may be deleted when they appear to be dead according to dataflow analysis. References to local register variables may be deleted or moved or simplified.

    These local variables are sometimes convenient for use with the extended asm feature (see Extended Asm), if you want to write one output of the assembler instruction directly into a particular register. (This will work provided the register you specify fits the constraints specified for that operand in the asm.)

 

 

  

 

Cheap domain by Cheap Domain Registrar | Cheap domain name registration 

Disclaimers: This document is provided as free service for the benefits of Active-Venture.com's virtual hosting customers only.

 

 

" It reminds me of the claim that Americans built the first computer... It depends on what properties are necessary for a device to be classed as a computer: That it's electronic? That it has Randomly Accessible Memory? That it operates on a stored program? I am tempted to suggest that one of the requirements implicit in some people's lists is that it was built in America.   "