Section 2: Compiler
51
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
2
Save and restore register
d2
in all functions that use the
register to guarantee that the value of the register remains
unmodified across function calls. The default is to use
register
d2
as a temporary scratch register with the value
not guaranteed across function calls.
2.4. Pragma Directives
A pragma is a preprocessing directive with the following form:
#pragma preprocessing_tokens
The functionality of a
#pragma
directive is similar to that of a command line flag.
The specified behavior, however, can be embedded into the source file and
turned on and off multiple times during a single compilation.
The Sierra Câ„¢ compiler currently supports five
#pragma
directives. Two of the
pragmas allow the default names of the text and data sections to be changed to
arbitrary names. One pragma permits integer functions written in C to be used as
interrupt handlers. Finally, two pragmas allow selected data objects to be
referenced using the absolute long addressing mode when
a4
-relative
addressing is selected on the command line. The five
#pragma
directives are
described as follows:
#pragma tsection
section_name
The
#pragma tsection
directive causes data, instructions, and
literal strings that will be placed in the text section to be placed in a
section with the name
section_name
. The
#pragma tsection
directive can be used multiple times to change to different names
or switch back and forth between a pair of names. For example,
the directive
#pragma tsection .text
will cause the name of the
text section to switch back to
.text
, the default name.
#pragma dsection
section_name
The
#pragma dsection
directive causes data, instructions, and
literal strings that will be placed in the data section to be placed in
a section with the name
section_name
. The
#pragma dsection
directive can be used multiple times to change to different names
or switch back and forth between a pair of names. For example,
#pragma dsection .data
will cause the name of the data section
to switch back to
.data
the default name.