Section 2: Compiler
53
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
2.6. Reserved Keywords
Following is the list of reserved C language keywords that the Sierra C compiler
recognizes:
asm double int struct
auto else long switch
break enum register typedef
case extern return union
char float short unsigned
const for signed void
continue goto sizeof volatile
default if static while
do
2.6.1. ASM Keyword
The
asm
keyword is a standard extension to ANSI C that allows statements to be
inserted directly into compiler-generated assembly code. The
asm
keyword is
followed by a character string enclosed in parentheses, and it can appear in the
C source file wherever a statement or declaration is allowed. For example, the
following statement causes the instruction enclosed in double quotes to be
inserted into the assembly output at the location that corresponds to the
asm
statement’s location in the C source:
asm("move.w #0x2400, sr", 4)
The integer constant 4 that follows the string indicates the size of the instruction
in bytes. The
size
argument is optional; if omitted, the instruction is assumed to be
two bytes long. It is necessary to specify the size of the instruction only when the
asm
statement appears inside a loop,
if
statement,
switch
statement, or
between a
goto
statement and the label it references. An incorrect or missing
size specification may cause the compiler to generate an improperly sized
branch instruction, which will result in an assembly error.
2.6.2. ANSI C Keywords
The ANSI C standard added three keywords,
const
,
volatile
, and
signed
, to the
C language. The
const
and
volatile
keywords are extremely important to
embedded systems developers. These two keywords are fully described in
sections
2.9.8 Const Type Specifier
and
2.9.9 Volatile Type Specifier
. The
keyword
signed
aids in writing portable code. For example, some compilers
recognize objects of type
char
as signed and others recognize them as
unsigned. The keyword
signed
can be used in conjunction with the previously
existing keyword
unsigned
to control the interpretation of certain object