MOTOROLA INSTRUCTION SET CPU32
4-8 REFERENCE MANUAL
4.3.4 Logic Instructions
The logical operation instructions (AND, OR, EOR, and NOT) perform logical opera-
tions with all sizes of integer data operands. A similar set of immediate instructions
(ANDI, ORI, and EORI) provide these logical operations with all sizes of immediate da-
ta. The TST instruction arithmetically compares the operand with zero, placing the re-
sult in the condition code register. Table 4-4 summarizes the logical operations.
CMP2 〈ea〉, Rn 8, 16, 32 Lower bound Rn Upper bound, CCR shows result
DIVS/DIVU 〈ea〉, Dn 32/16 → 16 : 16 Destination / Source → Destination
(signed or unsigned)
DIVSL/DIVUL 〈ea〉, Dr : Dq
〈ea〉, Dq
〈ea〉, Dr : Dq
64/32 → 32 : 32
32/32 → 32
32/32 → 32 : 32
Destination / Source → Destination
(signed or unsigned)
EXT Dn Dn 8 → 16
16 → 32 Sign extended Destination → Destination
EXTB Dn 8 → 32 Sign extended Destination → Destination
MULS/MULU 〈ea〉, Dn 〈ea〉, Dl
〈ea〉, Dh : Dl 16 ∗ 16 → 32
32 ∗ 32 → 32
32 ∗ 32 → 64
Source ∗ Destination → Destination
(signed or unsigned)
NEG 〈ea〉8, 16, 32 0 – Destination → Destination
NEGX 〈ea〉8, 16, 32 0 – Destination – X → Destination
SUB 〈ea〉, Dn Dn, 〈ea〉8, 16, 32 Destination – Source → Destination
SUBA 〈ea〉, An 16, 32 Destination – Source → Destination
SUBI #〈data〉, 〈ea〉8, 16, 32 Destination – Data → Destination
SUBQ #〈data〉, 〈ea〉8, 16, 32 Destination – Data → Destination
SUBX Dn, Dn
– (An), – (An) 8, 16, 32
8, 16, 32 Destination – Source – X → Destination
TBLS/TBLU 〈ea〉, Dn
Dym : Dyn, Dn 8, 16, 32 Dyn – Dym → Temp
(Temp ∗ Dn [7 : 0]) → Temp
(Dym ∗ 256) + Temp → Dn
TBLSN/TBLUN 〈ea〉, Dn
Dym : Dyn, Dn 8, 16, 32 Dyn – Dym → Temp
(Temp ∗ Dn [7 : 0]) / 256 → Temp
Dym + Temp → Dn
Table 4-4 Logic Operations
Instruction Syntax Operand Size Operation
AND 〈ea〉, Dn
Dn, 〈ea〉8, 16, 32
8, 16, 32 Source • Destination → Destination
ANDI #〈data〉, 〈ea〉8, 16, 32 Data • Destination → Destination
EOR Dn, 〈ea〉8, 16, 32 Source ⊕ Destination → Destination
EORI #〈data〉, 〈ea〉8, 16, 32 Data ⊕ Destination → Destination
NOT 〈ea〉8, 16, 32 Destination → Destination
OR 〈ea〉, Dn
Dn, 〈ea〉8, 16, 32
8, 16, 32 Source + Destination → Destination
ORI #〈data〉, 〈ea〉8, 16, 32 Data + Destination → Destination
TST 〈ea〉8, 16, 32 Source – 0, to set condition codes
Table 4-3 Integer Arithmetic Operations
Instruction Syntax Operand Size Operation