Datasheet

C
19 0
MSB
0 0 0 0 0 0 0
715
0 0 0 0 0
LSB
C
19 0
MSB
0 0 0 0
15
LSB
www.ti.com
Instruction Set Description
4.6.2.40 RRA
RRA[.W] Rotate right arithmetically destination word
RRA.B Rotate right arithmetically destination byte
Syntax
RRA.B dst or RRA.W dst
Operation MSB MSB MSB–1 ... LSB+1 LSB C
Description The destination operand is shifted right arithmetically by one bit position as shown in
Figure 4-39. The MSB retains its value (sign). RRA operates equal to a signed division
by 2. The MSB is retained and shifted into the MSB–1. The LSB+1 is shifted into the
LSB. The previous LSB is shifted into the carry bit C.
Status Bits N: Set if result is negative (MSB = 1), reset otherwise (MSB = 0)
Z: Set if result is zero, reset otherwise
C: Loaded from the LSB
V: Reset
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example The signed 16-bit number in R5 is shifted arithmetically right one position.
RRA R5 ; R5/2 -> R5
Example The signed RAM byte EDE is shifted arithmetically right one position.
RRA.B EDE ; EDE/2 -> EDE
Figure 4-39. Rotate Right Arithmetically RRA.B and RRA.W
203
SLAU144JDecember 2004Revised July 2013 CPUX
Submit Documentation Feedback
Copyright © 2004–2013, Texas Instruments Incorporated