Register Conventions
6-9
Run-Time Environment
6.2 Register Conventions
Strict conventions associate specific registers with specific operations in the
C environment. If you plan to interface an assembly language routine to a C
program. You must understand and follow these register conventions.
The register conventions dictate both how the compiler uses registers and how
values are preserved across function calls. There are two types of register
variable registers, save on call and save on entry. The distinction between
these two types of register variable registers is the method by which they are
preserved across calls. It is the called function’s responsibility to preserve
save-on-entry register variables, and the calling function’s responsibility to
preserve save-on-call register variables.
The compiler uses registers differently, depending on whether or not you use
the optimizer (
−
o option). The optimizer uses additional registers for register
variables (variables defined to reside in a register rather than in memory).
However, the conventions for preserving registers across function calls are
identical with or without the optimizer.
The following table summarizes how the compiler uses the TMS320C2x/C2xx/
C5x registers and shows which registers are defined to be preserved across
function calls.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...