Internal Floating-Point Functions - Texas Instruments TI-89 Software Manual

Sierra c assembler
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Section 2: Compiler
2.12.2.

Internal Floating-Point Functions

The Sierra C compiler supports two different floating-point formats, each one
being automatically used in specific cases. The supported formats include the
TI BCD floating
compiler, not on the TI-89 / TI-92 Plus. Floating
are performed in the IEEE format by the compiler while all other floating
operations are handled by internally generated calls to the BCD floating
routines on the TI-89 / TI-92 Plus. Floating
BCD if they are used as operands in the TI BCD floating
important to remember that in rare cases, it is possible that a value computed in
the IEEE format and converted to BCD may differ from the result of the identical
operation if performed by the TI floating
accuracy between IEEE and BCD. Floating
used with caution for this reason, although since the IEEE format is comparable
to 20 BCD digits and the TI BCD values have 16 digits, differences will be
extremely rare.
When generating code for the TI BCD floating-point routines, floating-point
registers fp0 through fp7 correspond to stack frame locations (-10, a6) through
(-80, a6), respectively; each location occupies ten bytes. To minimize the amount
of code needed to make an internally generated call, the compiler goes through
an interface function on the TI-89 / TI-92 Plus, __bcd_math. Calls to the
floating-point interface function differ from calls generated for C language
function calls in two major respects:
Operand information, including the specification of both source and
destination registers (when applicable), is encoded into a single two-byte
argument.
The called (not the calling) function restores the stack upon function return.
When using the function call to __bcd_math, a two-byte code word is inserted
into the instruction sequence immediately following the function call. The code
word fully describes the floating-point operation, the size of the operands, and
the effective addresses of both the source and destination operands. If both the
source and destination operands are registers (data and/or emulation
floating-point registers), no information other than that supplied by the code word
is required.
TI-89 / TI-92 Plus Sierra C Assembler Reference Manual
point format and an IEEE format which exists only in the
-
double flt1=1024. * 16.;
double flt2;
flt2 = flt1 * 4.;
point operations on constants
-
point constants are converted to
-
point routines due to the difference in
-
point constant operations should be
-
/* IEEE operations */
/* TI BCD floating-point routines */
Not for Distribution
point
-
point
-
point routines. It is
-
Beta Version February 2, 2001
83

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-89 plusTi-92 plus

Table of Contents