Motorola DSP96002 User Manual
Page 663
B-144
DSP96002 USER’S MANUAL
MOTOROLA
checking on the source and either jump to an error handling procedure or return a valid result. The pro-
grams provided may vary depending on the application.
The following data types and abbreviations will be used:
I - Signed 32 bit integer
U - Unsigned 32 bit integer
SP - Single precision floating-point
All conversion examples assume that the value to be converted is in d0 if floating-point or in d0.l if fixed
point.
I
→
U
Program ICycles
Words
tst d0 ;check for in range 1 1
jmi _negerr ;if negative, error 1 2
--- ---
2 3
I
→
SP
Program ICycles
Words
float.s d0 ;convert to SP float 1 1
--- ---
1 1
U
→
I
Program ICycles
Words
tst d0 ;see if msb is set 1 1
jmi _toobig ;if set, too big 1 2
--- ---
2 3
U
→
SP
Program ICycles
Words
floatu.s d0.1 ;convert 1 1
--- ---
1 1