MOTOROLA
5-6
INSTRUCTION SET
CPU16
REFERENCE MANUAL
5.3.4 Multiplication and Division Instructions
There are instructions for signed and unsigned 8- and 16-bit multiplication, as well as
for signed 16-bit fractional multiplication. Eight-bit multiplication operations have a 16-
bit product. Sixteen-bit multiplication operations can have either 16- or 32-bit products.
All division operations have 16-bit divisors, but dividends can be either 16- or 32-bit
numbers. Quotients and remainders of all division operations are 16-bit numbers.
There are instructions for signed and unsigned division, as well as for fractional divi-
sion.
Fractional multiplication uses 16-bit operands. Bit 15 is the sign bit. There is an implied
radix point between bits 15 and 14. The range of values is –1 ($8000) to 0.999969482
($7FFF). The MSB of the result is its sign bit, and there is an implied radix point be-
tween the sign bit and the rest of the result.
There are special 36-bit signed fractional multiply and accumulate unit instructions to
support digital signal processing operations. Refer to the appropriate summary for
more information.
Table 5-11 Compare and Test Summary
Mnemonic
CBA
CMPA
CMPB
CPD
CPE
TST
TSTA
TSTB
TSTD
TSTE
TSTW
Function
Compare A to B
Compare A to Memory
Compare B to Memory
Compare D to Memory
Compare E to Memory
Test for Zero or Minus
Test A for Zero or Minus
Test B for Zero or Minus
Test D for Zero or Minus
Test E for Zero or Minus
Test for Zero or Minus Word
Operation
(A) – (B)
(A) – (M)
(B) – (M)
(D) – (M : M + 1)
(E) – (M : M + 1)
(M) – $00
(A) – $00
(B) – $00
(D) – $0000
(E) – $0000
(M : M + 1) – $0000
Table 5-12 Multiplication and Division Summary
Mnemonic
EDIV
Function
Operation
(E : D) / (IX)
Quotient
IX
Remainder
D
(E : D) / (IX)
Quotient
IX
Remainder
D
(E)
(D)
E : D
(E)
(D)
E : D
(D) / (IX)
IX
remainder
D
(E)
(D)
E : D
(D) / (IX)
IX
remainder
D
(A)
(B)
D
Extended Unsigned Divide
EDIVS
Extended Signed Divide
EMUL
EMULS
FDIV
Extended Unsigned Multiply
Extended Signed Multiply
Unsigned Fractional Divide
FMULS
IDIV
Signed Fractional Multiply
Integer Divide
MUL
Multiply
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.