CPU12
INSTRUCTION SET OVERVIEW
MOTOROLA
REFERENCE MANUAL
5-11
5.15 Maximum and Minimum Instructions
These instructions are used to make comparisons between an accumulator and a
memory location. These instructions can be used for linear programming operations,
such as Simplex-method optimization or for fuzzification.
MAX and MIN instructions use accumulator A to perform 8-bit comparisons, while
EMAX and EMIN instructions use accumulator D to perform 16-bit comparisons. The
result (maximum or minimum value) can be stored in the accumulator (EMAXD,
EMIND, MAXA, MINA) or the memory address (EMAXM, EMINM, MAXM, MINM).
is a summary of minimum and maximum instructions.
5.16 Multiply and Accumulate Instruction
The EMACS instruction multiplies two 16-bit operands stored in memory and accumu-
lates the 32-bit result in a third memory location. EMACS can be used to implement
simple digital filters and defuzzification routines that use 16-bit operands. The WAV
instruction incorporates an 8- to 16-bit multiply and accumulate operation that obtains
a numerator for the weighted average calculation. The EMACS instruction can auto-
mate this portion of the averaging operation when 16-bit operands are used.
Table 5-14 Minimum and Maximum Instructions
Minimum Instructions
Mnemonic
Function
Operation
EMIND
MIN of Two Unsigned 16-Bit Values
Result to Accumulator
MIN ((D), (M
:
M
+
1))
⇒
D
EMINM
MIN of Two Unsigned 16-Bit Values
Result to Memory
MIN ((D), (M
:
M
+
1))
⇒
M
:
M
+
1
MINA
MIN of Two Unsigned 8-Bit Values
Result to Accumulator
MIN ((A), (M))
⇒
A
MINM
MIN of Two Unsigned 8-Bit Values
Result to Memory
MIN ((A), (M))
⇒
M
Maximum Instructions
Mnemonic
Function
Operation
EMAXD
MAX of Two Unsigned 16-Bit Values
Result to Accumulator
MAX ((D), (M
:
M
+
1))
⇒
D
EMAXM
MAX of Two Unsigned 16-Bit Values
Result to Memory
MAX ((D), (M
:
M
+
1))
⇒
M
:
M
+
1
MAXA
MAX of Two Unsigned 8-Bit Values
Result to Accumulator
MAX ((A), (M))
⇒
A
MAXM
MAX of Two Unsigned 8-Bit Values
Result to Memory
MAX((A), (M))
⇒
M
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: ......