Texas Instruments MSP430x1xx User Manual page 97

Texas instruments modules and peripherals user's guide
Table of Contents

Advertisement

RRC[.W]
Rotate right through carry
RRC.B
Rotate right through carry
Syntax
RRC
RRC
Operation
C −> MSB −> MSB−1 .... LSB+1 −> LSB −> C
Description
The destination operand is shifted right one position as shown in Figure 3−17.
The carry bit (C) is shifted into the MSB, the LSB is shifted into the carry bit (C).
Figure 3−17. Destination Operand—Carry Right Shift
Status Bits
N: Set if result is negative, reset if positive
Z: Set if result is zero, reset otherwise
C: Loaded from the LSB
V: Set if initial destination is positive and initial carry is set, otherwise reset
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
R5 is shifted right one position. The MSB is loaded with 1.
SETC
RRC
Example
R5 is shifted right one position. The MSB is loaded with 1.
SETC
RRC.B
dst
or
dst
Word
15
C
Byte
7
; Prepare carry for MSB
R5
; R5/2 + 8000h −> R5
; Prepare carry for MSB
R5
; R5/2 + 80h −> R5; low byte of R5 is used
RRC.W
dst
RISC 16−Bit CPU
Instruction Set
0
0
3-61

Advertisement

Table of Contents
loading

Table of Contents