Datasheet
© 2005 Microchip Technology Inc. DS70043F-page 39
dsPIC30F
TABLE 10-6: ROTATE/SHIFT INSTRUCTIONS
TABLE 10-7: BIT INSTRUCTIONS
Assembly Syntax Description Words Cycles
ASR f {,WREG} Destination = arithmetic right shift f 1 1
ASR Ws,Wd Wd = arithmetic right shift Ws 1 1
ASR Wb,#lit4,Wnd Wnd = arithmetic right shift Wb by lit4 1 1
ASR Wb,Wns,Wnd Wnd = arithmetic right shift Wb by Wns 1 1
LSR f {,WREG} Destination = logical right shift f 1 1
LSR Ws,Wd Wd = logical right shift Ws 1 1
LSR Wb,#lit4,Wnd Wnd = logical right shift Wb by lit4 1 1
LSR Wb,Wns,Wnd Wnd = logical right shift Wb by Wns 1 1
RLC f {,WREG} Destination = rotate left through Carry f 1 1
RLC Ws,Wd Wd = rotate left through Carry Ws 1 1
RLNC f {,WREG} Destination = rotate left (no Carry) f 1 1
RLNC Ws,Wd Wd = rotate left (no Carry) Ws 1 1
RRC f {,WREG} Destination = rotate right through Carry f 1 1
RRC Ws,Wd Wd = rotate right through Carry Ws 1 1
RRNC f {,WREG} Destination = rotate right (no Carry) f 1 1
RRNC Ws,Wd Wd = rotate right (no Carry) Ws 1 1
SL f {,WREG} Destination = left shift f 1 1
SL Ws,Wd Wd = left shift Ws 1 1
SL Wb,#lit4,Wnd Wnd = left shift Wb by lit4 1 1
SL Wb,Wns,Wnd Wnd = left shift Wb by Wns 1 1
Note: When the optional {,WREG} operand is specified, the destination of the instruction is WREG. When
{,WREG} is not specified, the destination of the instruction is the file register f.
Assembly Syntax Description Words Cycles
BCLR f,#bit4 Bit clear f 1 1
BCLR Ws,#bit4 Bit clear Ws 1 1
BSET f,#bit4 Bit set f 1 1
BSET Ws,#bit4 Bit set Ws 1 1
BSW.C Ws,Wb Write C bit to Ws<Wb> 1 1
BSW.Z Ws,Wb Write S
Z bit to Ws<Wb> 1 1
BTG f,#bit4 Bit toggle f 1 1
BTG Ws,#bit4 Bit toggle Ws 1 1
BTST f,#bit4 Bit test f 1 1
BTST.C Ws,#bit4 Bit test Ws to C 1 1
BTST.Z Ws,#bit4 Bit test Ws to SZ 1 1
BTST.C Ws,Wb Bit test Ws<Wb> to C 1 1
BTST.Z Ws,Wb Bit test Ws<Wb> to SZ 1 1
BTSTS f,#bit4 Bit test f then set f 1 1
BTSTS.C Ws,#bit4 Bit test Ws to C then set Ws 1 1
BTSTS.Z Ws,#bit4 Bit test Ws to SZ then set Ws 1 1
FBCL Ws,Wnd Find bit change from left (MSb) side 1 1
FF1L Ws,Wnd Find first one from left (MSb) side 1 1
FF1R Ws,Wnd Find first one from right (LSb) side 1 1
Note: Bit positions are specified by bit4 (0:15) for word operations.