![Atmel SAM4S Series Скачать руководство пользователя страница 88](http://html1.mh-extra.com/html/atmel/sam4s-series/sam4s-series_preliminary-data-sheet_3003408088.webp)
88
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Register with Optional Shift
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 the user omits the shift, or specifies LSL #0, the instruction uses the value in Rm.
If the user specifies 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. Speci-
fying 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
11.6.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.
The permitted shift lengths depend on the shift type and the instruction. If the shift length is 0, no
shift occurs. Register shift operations update the carry flag except when the specified shift length
is 0. The following sub-sections describe the various shift operations and how they affect the
carry flag. In these descriptions, Rm is the register containing the value to be shifted, and n is
the shift length.
ASR
Arithmetic shift right by n bits moves the left-hand 32-n bits of the register, Rm, to the right by n
places, into the right-hand 32-n bits of the result. And it copies the original bit[31] of the register
into the left-hand n bits of the result. See
The ASR #n operation can be used to divide the value in the register Rm by 2
n
, with the result
being rounded towards negative-infinity.
When the instruction is ASRS or when ASR #n is used in Operand2 with the instructions MOVS,
MVNS, ANDS, ORRS, ORNS, EORS, BICS, TEQ or TST, the carry flag is updated to the last bit
shifted out, bit[n-1], of the register Rm.
• If n is 32 or more, then all the bits in the result are set to the value of bit[31] of Rm.
• If n is 32 or more and the carry flag is updated, it is updated to the value of bit[31] of Rm.
Содержание SAM4S Series
Страница 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1142: ...1142 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 3 100 ball VFBGA Package Drawing ...
Страница 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Страница 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...