Texas Instruments MSP430x1xx User Manual page 95

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

Advertisement

* RLC[.W]
Rotate left through carry
* RLC.B
Rotate left through carry
Syntax
RLC
RLC.B
Operation
C <− MSB <− MSB−1 .... LSB+1 <− LSB <− C
Emulation
ADDC
Description
The destination operand is shifted left one position as shown in Figure 3−15.
The carry bit (C) is shifted into the LSB and the MSB is shifted into the carry
bit (C).
Figure 3−15. Destination Operand—Carry Left Shift
Status Bits
N: Set if result is negative, reset if positive
Z: Set if result is zero, reset otherwise
C: Loaded from the MSB
V: Set if an arithmetic overflow occurs
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
R5 is shifted left one position.
RLC
Example
The input P1IN.1 information is shifted into the LSB of R5.
BIT.B
RLC
Example
The MEM(LEO) content is shifted left one position.
RLC.B
Note: RLC and RLC.B Substitution
The assembler does not recognize the instruction:
It must be substituted by:
dst
or
dst
dst,dst
Word
15
C
Byte
7
the initial value is 04000h ≤ dst < 0C000h; reset otherwise
Set if an arithmetic overflow occurs:
the initial value is 040h ≤ dst < 0C0h; reset otherwise
R5
; (R5 x 2) + C −> R5
#2,&P1IN
; Information −> Carry
R5
; Carry=P0in.1 −> LSB of R5
LEO
; Mem(LEO) x 2 + C −> Mem(LEO)
RLC
@R5+.
ADDC
@R5+,−2(R5).
RLC.W
dst
RISC 16−Bit CPU
Instruction Set
0
0
3-59

Advertisement

Table of Contents
loading

Table of Contents