Register Variables
5-6
5.3 Register Variables
The C compiler uses up to two register variables within a function. You must
declare the register variables in the argument list or in the first block of the
function. Register declarations in nested blocks are treated as normal vari-
ables.
The compiler uses AR6 and AR7 for register variables:
-
AR6 is assigned to the first register variable.
-
AR7 is assigned to the second variable.
The
address
of the variable is placed into the allocated register to simplify
access. Thus, 16-bit types (char, short, int, and pointers) may be used as reg-
ister variables.
Setting up a register variable at run time requires approximately four instruc-
tions per register variable. To use this feature efficiently, use register variables
only if the variable will be accessed more than twice.
The optimizer also creates register variables, but it uses them in a different
way.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...