![](http://datasheet.mmic.net.cn/30000/MC68EN360FE33_datasheet_2368935/MC68EN360FE33_175.png)
CPU32+
MC68360 USER’S MANUAL
Rounding yields:
The second result is preferred. The following code sequence illustrates how addition of a
series of table interpolations can be performed without loss of precision in the intermediate
results:
L0:
TBLSN.B
ea, Dx
TBLSN.B
ea, Dx
TBLSN.B
ea, Dl
ADD.L
Dx, Dm
Long addition avoids problems with carry
ADD.L
Dm, Dl
ASR.L
#8, Dl
Move radix point
BCC.B
L1
Fraction MSB in carry
ADDQ.B
#1, Dl
L1: . . .
5.3.4.5 TABLE EXAMPLE 5: SURFACE INTERPOLATIONS. The various forms of table
can be used to perform surface (3D) TBLs. However, since the calculation must be split into
a series of 2D TBLs, it is possible to lose precision in the intermediate results. The following
code sequence, incorporating both TBLS and TBLSN, eliminates this possibility.
L0:
MOVE.W
Dx, Dl
Copy entry number and fraction number
TBLSN.B
ea, Dx
TBLSN.B
ea, Dl
TBLS.W
Dx:Dl, Dm
Surface interpolation, with round
ASR.L
#8, Dm
Read just the result
BCC.B
L1
No round necessary
ADDQ.B
#1, Dl
Half round up
L1: . . .
Before execution of this code sequence, Dx must contain fraction and entry numbers for the
two TBL, and Dm must contain the fraction for surface interpolation. The
ea fields in the
TBLSN instructions point to consecutive columns in a 3D table. The TBLS size parameter
must be word if the TBLSN size parameter is byte, and must be long word if TBLSN is word.
Increased size is necessary because a larger number of significant digits is needed to
accommodate the scaled fractional results of the 2D TBL.
5.3.5 Nested Subroutine Calls
The LINK instruction pushes an address onto the stack, saves the stack address at which
the address is stored, and reserves an area of the stack for use. Using this instruction in a
series of subroutine calls will generate a linked list of stack frames.
0010 0000 . 0111 0000
0011 1111 . 0111 0000
0000 0001 . 0111 0000
0110 0001 . 0101 0000
0110 0001 .
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.