
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
621 of 808
NXP Semiconductors
UM10360
Chapter 34: Appendix: Cortex-M3 User Guide
Remark:
In the constants shown above,
X
and
Y
are hexadecimal digits.
In addition, in a small number of instructions,
constant
can take a wider range of values.
These are described in the individual instruction descriptions.
When an Operand2 constant is used with the instructions
MOVS
,
MVNS
,
ANDS
,
ORRS
,
ORNS
,
EORS
,
BICS
,
TEQ
or
TST
, the carry flag is updated to bit[31] of the constant, if the constant is greater
than 255 and can be produced by shifting an 8-bit value. These instructions do not affect
the carry flag if Operand2 is any other constant.
Instruction substitution:
Your assembler might be able to produce an equivalent
instruction in cases where you specify a constant that is not permitted. For example, an
assembler might assemble the instruction
CMP Rd, #0xFFFFFFFE
as the equivalent
instruction
CMN Rd, #0x2
.
2.3.3.2
Register with optional shift
You specify an Operand2 register in the form:
Rm
{,
shift
}
where:
Rm
is the register holding the data for the second operand.
shift
is an optional shift to be applied to
Rm
. It can be one of:
ASR#n: arithmetic shift right
n
bits, 1
≤
n
≤
32.
LSL
#n:
logical shift left
n
bits, 1
≤
n
≤
31.
LSR
#n
: logical shift right
n
bits, 1
≤
n
≤
32.
ROR
#n
: rotate right
n
bits, 1
≤
n
≤
31.
RRX: rotate right one bit, with extend.
—: if omitted, no shift occurs, equivalent to LSL
#0
.
If you omit the shift, or specify LSL #0, the instruction uses the value in
Rm
.
If you specify a shift, the shift is applied to the value in
Rm
, and the resulting 32-bit value
is used by the instruction. However, the contents in the register
Rm
remains unchanged.
Specifying a register with shift also updates the carry flag when used with certain
instructions. For information on the shift operations and how they affect the carry flag, see
Section 34–2.3.4 “Shift Operations”
2.3.4 Shift Operations
Register shift operations move the bits in a register left or right by a specified number of
bits, the
shift length
. Register shift can be performed:
•
directly by the instructions
ASR
,
LSR
,
LSL
,
ROR
, and
RRX
, and the result is written to a
destination register
•
during the calculation of
Operand2
by the instructions that specify the second
operand as a register with shift, see
. The result is used by the
instruction.