
MOTOROLA
Chapter 3. Instruction Set Model
3-13
Instruction Set Summary
Although there is no Subtract Immediate instruction, its effect can be achieved by using an
addi
instruction with the immediate operand negated. Simplified mnemonics are provided
that include this negation. The
subf
instructions subtract the second operand (
r
A) from the
third operand (
r
B). Simplified mnemonics are provided in which the third operand is
subtracted from the second operand. See Appendix F, “Simplified Mnemonics,” in the
Programming Environments Manual
, for examples.
3.2.4.1.2
Integer Compare Instructions
The integer compare instructions algebraically or logically compare the contents of
r
A with
either the UIMM operand, the SIMM operand, or the contents of
r
B. The comparison is
signed for the
cmpi
and
cmp
instructions, and unsigned for the
cmpli
and
cmpl
instructions. Table 3-4 lists the integer compare instructions.
The
crf
D operand can be omitted if the result of the comparison is to be placed in CR0.
Otherwise, the target CR field must be specified in the instruction
crf
D field.
For more information refer to Appendix F, “Simplified Mnemonics,” in the
Programming
Environments Manual
.
3.2.4.1.3
Integer Logical Instructions
The logical instructions shown in Table 3-5 perform bit-parallel operations. Logical
instructions with the CR update enabled and instructions
andi.
and
andis.
set CR field CR0
to characterize the result of the logical operation. These fields are set as if the sign-extended
low-order 32 bits of the result were algebraically compared to zero. Logical instructions
without CR update and the remaining logical instructions do not modify the CR. Logical
instructions do not affect the XER[SO], XER[OV], and XER[CA] bits.
For simplified mnemonics examples for the integer logical operations see Appendix F,
“Simplified Mnemonics,” in the
Programming Environments Manual
.
Table 3-4. Integer Compare Instructions
Name
Mnemonic
Operand Syntax
Compare
cmp
crf
D
,
L
,r
A
,r
B
Compare Immediate
cmpi
crf
D,L,
r
A,SIMM
Compare Logical
cmpl
crf
D
,
L
,r
A
,r
B
Compare Logical Immediate
cmpli
crf
D
,
L
,r
A
,
UIMM
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.