Integer Arithmetic Operations - Motorola CPU32 Reference Manual

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

Advertisement

4.3.3 Integer Arithmetic Operations
The arithmetic operations include the four basic operations of add (ADD),
subtract (SUB), multiply (MUL), and divide (DIV) as well as arithmetic compare
(CMP, CMPM, CMP2), clear (CLR), and negate (NEG). The instruction set
includes ADD, CMP, and SUB instructions for both address and data operations
with all operand sizes valid for data operations. Address operands consist of 16
or 32 bits. The clear and negate instructions apply to all sizes of data operands.
Signed and unsigned MUL and DIV instructions include:
• Word multiply to produce a long-word product
• Long-word multiply to produce a long-word or quad-word product
• Division of a long-word dividend by a word divisor (word quotient and word
remainder)
• Division of a long-word or quad-word dividend by a long-word divisor
(long-word quotient and long-word remainder)
A set of extended instructions provides multiprecision and mixed-size •
arithmetic. These instructions are add extended (ADDX), subtract extended
(SUBX), sign extend (EXT), and negate binary with extend (NEGX). Refer to
Table 4-3 for a summary of the integer arithmetic operations.
Table 4-3. Integer Arithmetic Operations
Instruction
Syntax
ADD
Dn, (ea)
(ea), Dn
ADDA
(ea), An
ADDI
#(data), (ea)
ADDQ
#(data), (ea)
ADDX
Dn, Dn
- (An), - (An)
CLR
(ea)
GMP
(ea), Dn
GMPA
(ea), An
GMPI
#(data), (ea)
CMPM
(An)
+,
(An) +
CMP2
(ea), Rn
CPU32 REFERENCE MANUAL
Operand
Operation
Size
8,16,32
Source + Destination:::} Destination
8,16,32
16,32
Source + Destination:::} Destination
8,16,32
Immediate data + Destination:::} Destination
8,16,32
Immediate data + Destination:::} Destination
8,16,32
Source + Destination + X :::} Destination
8,16,32
8,16,32
o :::}
Destination
8,16,32
(Destination - Source), CGR shows results
16,32
(Destination - Source), GGR shows results
8,16,32
(Destination - Data), GGR shows results
8,16,32
(Destination - Source), GGR shows results
8,16,32
Lower bound
$
Rn
$
Upper bound, GGR shows result
INSTRUCTION SET
MOTOROLA
4-9

Advertisement

Table of Contents
loading

Table of Contents