MOTOROLA
INSTRUCTION SET OVERVIEW
CPU12
5-12
REFERENCE MANUAL
5.17 Table Interpolation Instructions
The TBL and ETBL instructions interpolate values from tables stored in memory. Any
function that can be represented as a series of linear equations can be represented by
a table of appropriate size. Interpolation can be used for many purposes, including tab-
ular fuzzy logic membership functions. TBL uses 8-bit table entries and returns an 8-
bit result; ETBL uses 16-bit table entries and returns a 16-bit result. Use of indexed
addressing mode provides great flexibility in structuring tables.
Consider each of the successive values stored in a table to be y-values for the end-
point of a line segment. The value in the B accumulator before instruction execution
begins represents change in x from the beginning of the line segment to the lookup
point divided by total change in x from the beginning to the end of the line segment. B
is treated as an 8-bit binary fraction with radix point left of the MSB, so each line seg-
ment is effectively divided into 256 smaller segments. During instruction execution, the
change in y between the beginning and end of the segment (a signed byte for TBL or
a signed word for ETBL) is multiplied by the content of the B accumulator to obtain an
intermediate delta-y term. The result (stored in the A accumulator by TBL, and in the
D accumulator by ETBL) is the y-value of the beginning point plus the signed interme-
diate delta-y value.
shows the table interpolation instructions.
Table 5-15 Multiply and Accumulate Instructions
Mnemonic
Function
Operation
EMACS
Multiply and Accumulate (Signed)
16
×
16 Bit
⇒
32 Bit
((M
(X)
:
M
(X
+
1)
)
× (
M
(Y)
:
M
(Y
+
1)
))
+
(M ~ M
+
3)
⇒
M ~ M
+
3
Table 5-16 Table Interpolation Instructions
Mnemonic
Function
Operation
ETBL
16-Bit Table Lookup and Interpolate
(no indirect addressing modes allowed)
(M
:
M
+
1)
+
[(B)
×
((M
+
2
:
M
+
3) – (M
:
M
+
1))]
⇒
D
Initialize B, and index before ETBL.
<ea> points to the first table entry (M
:
M
+
1)
B is fractional part of lookup value
TBL
8-Bit Table Lookup and Interpolate
(no indirect addressing modes allowed.)
(M)
+
[(B)
×
((M
+
1) – (M))]
⇒
A
Initialize B, and index before TBL.
<ea> points to the first 8-bit table entry (M)
B is fractional part of lookup value.
Summary of Contents for CPU12
Page 8: ...MOTOROLA CPU12 viii REFERENCE MANUAL ...
Page 14: ...MOTOROLA INTRODUCTION CPU12 1 4 REFERENCE MANUAL ...
Page 20: ...MOTOROLA OVERVIEW CPU12 2 6 REFERENCE MANUAL ...
Page 38: ...MOTOROLA INSTRUCTION QUEUE CPU12 4 6 REFERENCE MANUAL ...
Page 300: ...MOTOROLA DEVELOPMENT AND DEBUG SUPPORT CPU12 8 16 REFERENCE MANUAL ...
Page 338: ...MOTOROLA MEMORY EXPANSION CPU12 10 8 REFERENCE MANUAL ...
Page 364: ...MOTOROLA INSTRUCTION REFERENCE CPU12 A 26 REFERENCE MANUAL ...
Page 386: ...MOTOROLA HIGH LEVEL LANGUAGE SUPPORT CPU12 C 6 REFERENCE MANUAL ...
Page 438: ...MOTOROLA SUMMARY OF CHANGES CPU12 S 2 REFERENCE MANUAL ...
Page 439: ......