Motorola CPU32 Reference Manual page 212

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

Advertisement

TBLS
TBLSN
Table Lookup and Interpolate (Signed)
Operation:
Rounded:
ENTRY(n) + {(ENTRY(n + 1) - ENTRY(n))
*
Ox [7:0]} / 256
~
Ox
Unrounded:
ENTRY(n)
*
256 + {(ENTRY(n
+ 1) -
ENTRY(n))
*
Ox [7:0]}
~
Ox
Where ENTRY(n) and ENTRY(n
+ 1)
are either:
TBLS
TBLSN
1. Consecutive entries in the table pOinted to by the (ea) and indexed by
Ox [15:8]
*
size or,
Assembler
Syntax:
Attributes:
2. The registers Oym, Oyn, respectively
TBLS.(size)
TBLSN.(size)
TBLS.(size)
TBLSN.(size)
(ea),Ox
(ea),Ox
Oym:Oyn,Ox
Dym:Oyn, Ox
Size
=
(Byte, Word, Long)
(Result rounded)
(Result not rounded)
(Result rounded)
(Result not rounded)
Description:
The signed table lookup and interpolate instruction, TBLS, allows the efficient use of
compressed linear data tables to model complex functions. The TBLS instruction has two modes
of operation: table lookup and interpolate mode, and data register interpolate mode.
For table lookup and interpolate mode, data register Ox [15:0] contains the independent variable
x.
The effective address points to the start of a signed byte, word, or long-word table containing a
linear representation of the dependent variable, Y, as a function of
X.
In general, the independent
variable, located in the low-order word of Ox, consists of an 8-bit integer part and an 8-bit fractional
part. An assumed radix pOint is located between bits 7 and 8. The integer part, Ox [15:8], is
scaled by the operand size and is used as an offset into the table. The selected entry in the table
is subtracted from the next consecutive entry. A fractional portion of this difference is taken by
multiplying by the interpolation fraction, Ox [7:0]. The adjusted difference is then added to the
selected table entry. The result is returned in the destination data register, Ox.
For register interpolate mode, the interpolation occurs using the Oym and Dyn registers in place of
the two table entries.
For this mode, only the fractional portion, Ox [7:0], is used in the
interpolation, and the integer portion, Ox [15:8], is ignored. The register interpolation mode may
be used with several table lookup and interpolations to model multidimentional functions.
CPU32 REFERENCE MANUAL
INSTRUCTION SET
MOTOROLA
4-159
III

Advertisement

Table of Contents
loading

Table of Contents