Specifying Registers For Local Variables - Intel i960 User Manual

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

7
Language Implementation
It is up to you to make sure that the assembler names you choose do not
conflict with any other assembler symbols. Also, you must not use a
register name; that would produce completely invalid assembler code.

Specifying Registers for Local Variables

You can define a local register variable with a specified register like this:
register int *foo asm ("r5");
is the name of the register that should be used.
r5
Defining such a register variable does not reserve the register; it remains
available for other uses in places where flow control determines the
variable's value is not live. However, excessive use of this feature may
leave the compiler too few available registers to compile certain functions.
Alternate Keywords
The option
disables certain keywords;
disables certain
traditional
ansi
others. This causes trouble when you want to use GNU C extensions, or
ANSI C features, in a general-purpose header file that should be usable by
all programs, including ANSI C programs and traditional ones. The
keywords
,
and
cannot be used since they won't work
asm
typeof
inline
in a program compiled with
, while the keywords
,
,
ansi
const
volatile
,
and
won't work in a program compiled with
signed
typeof
inline
.
traditional
The way to solve these problems is to put
at the beginning and end of
__
each problematical keyword. For example, use
instead of
,
__asm__
asm
instead of
, and
instead of
.
__const__
const
__inline__
inline
Other C compilers won't accept these alternative keywords; if you want to
compile with another compiler, you can define the alternate keywords as
macros to replace them with the customary keywords. It looks like this:
#ifndef __GNUC__
#define __asm__ asm
#endif
7-51

Advertisement

Table of Contents
loading

Table of Contents