EasyManuals Logo

Texas Instruments TI-89 Software Guide

Texas Instruments TI-89
334 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #98 background imageLoading...
Page #98 background image
86
Section 2: Compiler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
2.12.3. Debugging Functions
The compiler can be directed to insert calls to debugging functions in the
generated assembly code using the
-XS
,
-Xs
, and
-Xc
command line flags. The
-XS
and
-Xs
flags cause the compiler to place calls to
__stk_ck
(i.e.,
_stk_ck
defined as a C function) at the beginning of each function. The
-Xc
flag causes
the compiler to place a call to
__line_ck
(i.e.,
_line_ck
defined as a C function)
following each line of C source code.
Both the
_stk_ck
and
_line_ck
functions are intended to be provided by the
user. These functions provide a mechanism to check various aspects of a
program. Although the
_stk_ck
function will typically compare the current stack
pointer offset and the amount of stack space needed by the calling function to the
total amount of available stack space, on the TI-89 / TI-92 Plus, this is done
through hardware. Even though the traditional use for
_stk_ck
is no longer
necessary, the function may be used for any other debugging purpose desired.
The
_line_ck
function could be used to locate the position in a program where a
particular memory location is corrupted.
The
-XS
flag causes the compiler to insert calls to
_stk_ck
at the beginning of
every function in the file. The amount of stack space used by the function is
available to
_stk_ck
in register
d0
. If the
_stk_ck
function uses any nonscratch
registers (i.e.,
d3–d7
,
a2–a7
, or
fp2–fp7
), it must save and restore them.
The
-Xs
size
flag is identical to the
-XS
flag with the exception that it causes the
compiler to insert the call to
_stk_ck
only when a function is expected to take
more than
size
number of bytes of stack space. If no value is specified, the
default value of 40 bytes is used.
The
-Xc
flag causes the compiler to insert a call to
_line_ck
following each line
of compiled C source code. No information is passed to
_line_ck
. The
_line_ck
function can be a very useful debugging aid, and its uses are left up to your
imagination. Unlike other functions,
_line_ck
must save and restore all registers
it uses including scratch registers
d0–d2
,
a0–a1
, and
fp0–fp1
. In addition,
_line_ck
must save and restore the condition codes in the status register,
because the function call may occur between the time a condition code is set and
when it is used.
Note:
The compiler adds a leading underscore ( _ ) to all function names and external
variables (unless the
-Xu
flag is specified). For example, the C language functions
abc
( ) and _
xyz
( ) will appear in an assembly language listing as _
abc
and _ _
xyz
,
respectively.

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals