EasyManua.ls Logo

Texas Instruments TI-89 - Bcdcmp

Texas Instruments TI-89
1398 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
376
Appendix A: System Routines — Direct Floating Point Operations
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
bcdcmp
Declaration:
long
bcdcmp
(BCD16
a
, BCD16
b
)
Category(ies):
Direct Floating Point Operations
Description:
Compare two TI binary-code decimal floating-point numbers. This routine is
provided as a convenience for assembly language programs.
Inputs:
a
,
b
Two BCD16 numbers to compare.
Outputs:
Returns -1 if
a
<
b
,
0 if
a
==
b
1 if
a
>
b
.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: bcdadd, bcdbcd, bcddiv, bcdlong, bcdmul, bcdneg, bcdsub
Example:
a = -20
b = -30
.
.
.
move.l b(a6),-(sp) ;push b (a 10-byte BCD16 value)
move.l b+4(a6),-(sp)
move.w b+8(a6),-(sp)
move.l a(a6),-(sp) ;push a
move.l a+4(a6),-(sp)
move.w a+8(a6),-(sp)
move.l bcdcmp(a2),a0 ;assumes a2 -> jump table
jsr (a0) ;call bcdcmp(a, b)
lea 20(sp),sp ;pop parameters
tst.l d0 ;result returned in d0
blt less ;a < b --->
bgt greater ;a > b --->
. ;a == b
.
.

Table of Contents

Other manuals for Texas Instruments TI-89

Related product manuals