Motorola CPU32 Reference Manual page 248

M68300 series central processor unit
Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

4.6 Table Lookup and Interpolation Instructions
There are four table lookup and interpolate instructions. TBLS returns a signed,
rounded byte, word, or long-word result. TBLSN returns a signed, unrounded
byte, word, or long-word result. TBLU returns an unsigned, rounded byte, word,
or long-word result. TBLUN returns an unsigned, unrounded byte, word, or
long-word result. All four instructions support two types of interpolation data: an
n-element table stored in memory, and a two-element range stored in a pair of
data registers. The latter form provides a means of performing surface
(3~)
interpolation between two previously calculated linear interpolations.
The following examples show how to compress tables and use fewer
interpolation levels between table entries.
Example 1 (see Figure 4-3)
demonstrates table lookup and interpolation for a 257-entry table, allowing up
to 256 interpolation levels between entries.
Example 2 (see Figure 4-4)
reduces table length for the same data to four entries. Example 3 (see Figure 4-
5) demonstrates use of an 8-bit independent variable with an instruction.
Two additional examples show how TBLSN can reduce cumulative error when
III
multiple table lookup and interpolation operations are used in a calculation.
Example 4 demonstrates addition of the results of three table interpolations.
Example 5 illustrates use of TBLSN in surface interpolation.
CPU32 REFERENCE MANUAL
INSTRUCTION SET
MOTOROLA
4-195

Advertisement

Table of Contents
loading

Table of Contents