CPU32 Instructions
MOTOROLA M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL 7-11
TBLU TBLU
TBLUN Table Lookup and Interpolation (Unsigned) TBLUN
(CPU32)
Operation: Rounded:
ENTRY(n) + {(ENTRY(n + 1) – ENTRY(n)) x Dx 7 – 0} ÷ 256 → Dx
Unrounded:
ENTRY(n) x 256 + {(ENTRY(n + 1) – ENTRY(n)) x Dx 7 – 0} → Dx
Where ENTRY(n) and ENTRY(n + 1) are either:
1. Consecutive entries in the table pointed to by the < ea > and
indexed by Dx 15 – 8 π SIZE or;
2. The registers Dym, Dyn respectively
Assembler TBLU. < size > < ea > ,Dx Result rounded
Syntax: TBLUN. < size > < ea > ,Dx Result not rounded
TBLU. < size > Dym:Dyn, Dx Result rounded
TBLUN. < size > Dym:Dyn, Dx Result not rounded
Attributes: Size = (Byte, Word, Long)
Description: The TBLU and TBLUN instructions allow the efficient use of piecewise linear,
compressed data tables to model complex functions. The TBLU instruction has two
modes of operation: table lookup and interpolate mode and data register interpolate
mode.
For table lookup and interpolate mode, data register Dx 15 – 0 contains the
independent variable X. The effective address points to the start of a unsigned byte,
word, or long-word table containing a linearized representation of the dependent
variable, Y, as a function of X. In general, the independent variable, located in the low-
order word of Dx, 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, Dx 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, Dx 7 – 0. The adjusted
difference is then added to the selected table entry. The result is returned in the
destination data register, Dx.