Runtime
Environment
- Register
Conventions
5.2.3
Register
Variables
The C compiler uses
up
to
eight register variables
within
a function. The
compiler
allocates the first
four
variables from registers
A9
through
A12
in
ascending order; the other variables
are
allocated from other available registers.
If
more than eight register variables
are
declared, the excess
are
treated
as
normal variables. A register variable can contain any integer type, a pointer
to
any type, or a float (doubles or structures
are
not
allowed); however, register
variables
of
type short and char
are
treated
as
long integers.
Using register variables can greatly increase code efficiency for some state-
ments (in some cases, the code may
be
twice
as
efficient). Since the compiler
does
not
track operations involving register variables, you can manipulate
them
as
desired (even
with
asm
statements).
5-7