Integer Arithmetic Operations - Motorola CPU32 Reference Manual

Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

Instruction
MOVEM
MOVEP
MOVEQ
PEA
UNLK

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 in-
structions 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 re-
mainder)
• 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.
Instruction
ADD
ADDA
ADDI
ADDQ
ADDX
CLR
CMP
CMPA
CMPI
CPU32
REFERENCE MANUAL
Table 4-2 Data Movement Operations
Syntax
Operand Size
list, 〈ea〉
16, 32
〈ea〉, list
16, 32 → 32
Dn, (d
, An)
16, 32
16
(d
, An), Dn
16
8 → 32
#〈data〉, Dn
〈ea〉
32
An
32
Table 4-3 Integer Arithmetic Operations
Syntax
Operand Size
Dn, 〈ea〉
8, 16, 32
〈ea〉, Dn
8, 16, 32
〈ea〉, An
16, 32
#〈data〉, 〈ea〉
8, 16, 32
#〈data〉, 〈ea〉
8, 16, 32
Dn, Dn
8, 16, 32
– (An), – (An)
8, 16, 32
〈ea〉
8, 16, 32
〈ea〉, Dn
8, 16, 32
〈ea〉, An
16, 32
#〈data〉, 〈ea〉
8, 16, 32
INSTRUCTION SET
Operation
Listed registers → Destination
Source → Listed registers
Dn [31: 24] → (An + d); Dn [23 : 16] → (An + d + 2);
Dn [15 : 8] → (An + d + 4)
(An + d) → Dn [31 : 24] : (An + d + 2) → Dn [23 : 16];
(An + d + 4) → Dn [15 : 8] : (An + d + 6) → Dn [7 : 0]
Immediate data → Destination
SP – 4 → SP
〈ea〉 → SP
+
An → SP
(SP) → An, SP + 4 → SP
+
Operation
Source + Destination → Destination
Source + Destination → Destination
Immediate data + Destination → Destination
Immediate data + Destination → Destination
Source + Destination + X → Destination
0 → Destination
(Destination – Source), CCR shows results
(Destination – Source), CCR shows results
(Destination – Data), CCR shows results
Dn [7 : 0] → (An + d + 6)
+
MOTOROLA
4-7

Advertisement

Table of Contents
loading

Table of Contents