Shift Operations
2-45Central Processing Unit
Table 2−11. Shift Operations
Operation Type Illustration
Left shift of 16-bit value for ACC
operation. Syntaxes:
ADD ACC, loc16 <<0...16
ADD ACC, #16Bit <<0...15
ADD ACC, loc16 <<T
SUB ACC, loc16 << 0...16
SUB ACC, #16Bit <<0 ...15
SUB ACC, loc16<<T
MOV ACC, loc16 << 0...16
MOV ACC, #16Bit << 0...15
MOV ACC, loc16, <<T
Shift left
0
16-bit value to 16 LSBs
0/Sign
32 bits to ALU
SXM
Store 16 LSBs of left-shifted ACC.
Syntax:
MOV loc16, ACC << 1...8
Shift left
0
ACC
16 LSBs to ALU
Discard
Store 16 MSBs of left-shifted ACC.
Syntax:
MOVH loc16, ACC <<1...8
Note: This instruction performs a single
right shift by (16−shift1), where shift1 is a
value from 0 to 8.
Shift right
ACC
16 LSBs to ALU
Discard
Logical left shift of ACC. The last bit to
be shifted out fills the carry bit (C).
Syntaxes:
LSL ACC, 1...16
LSL ACC, T (shift = T(3:0))
LSL ACC, T (shift = T(4:0))
Note: If T(3:0) = 0 or T(4:0) = 0, indicating
a shift of 0, C is cleared.
Shift left
0
ACC
32 bits to ACC
C
Last
bit out
Discard
other bits