Academic Program

Bit and Byte Oriented Commands

Bit and Byte Oriented Commands

This applies to the PIC16F1xxx and PIC16LF1xxx families of PIC MCUs.

Byte Oriented Operations

Mnemonic,
Operands
Description Cycles 14-bit Opcode
MSb……LSb
Status
Affected
Notes
Byte Oriented Operations
ADDWF f,d Add W and f 1 00 0111 dfff ffff C, DC,Z 2
ADDWFC f,d Add with Carry W and f 1 11 1101 dfff ffff C,DC,Z 2
ANDWF f,d AND W with f 1 00 0101 dfff ffff Z 2
ASRF f,d Arithmetic Right Shift 1 11 0111 dfff ffff C, Z 2
LSLF f,d Logical Left Shift 1 11 0101 dfff ffff C, Z 2
LSRF f,d Logical Right Shift 1 11 0110 dfff ffff C, Z 2
CLRF f Clear f 1 00 0001 1fff ffff Z 2
CLRW   Clear W 1 00 0001 0000 00xx Z  
COMF f,d Complement f 1 00 1001 dfff ffff Z 2
DECF f,d Decrement f 1 00 0011 dfff ffff Z 2
INCF f,d Increment f 1 00 1010 dfff ffff Z 2
IORWF f,d Inclusive OR W with f 1 00 0100 dfff ffff Z 2
MOVF f,d Move f 1 00 1000 dfff ffff Z 2
MOVWF f Move W to f 1 00 0000 1fff ffff None 2
RLF f,d Rotate left f through Carry 1 00 1101 dfff ffff C 2
RRF f,d Rotate right f through Carry 1 00 1100 dfff ffff C 2
SUBWF f,d Subtract with Borrow W from f 1 11 1011 dfff ffff C,DC,Z 2
SUBWFB f,d Subtract W from f 1 00 0010 dfff ffff C,DC,Z 2
SWAPF f,d Swap nibbles in f 1 00 1110 dfff ffff None  
XORWF f,d Exclusive OR W with f 1 00 0110 dfff ffff Z 2

 

Byte Oriented Skip Instructions

Mnemonic,
Operands
Description Cycles 14-bit Opcode
MSb……LSb
Status
Affected
Notes

Byte Oriented Skip Instructions
DECFSZ f,d Decrement f, Skip if 0 1(2) 00 1011 dfff ffff None 1,2
INCFSZ f,d Increment f, Skip if 0 1(2) 00 1111 dfff ffff None 1,2

 

These commands work on bit size operations.

Bit Oriented File Register Operations

Mnemonic,
Operands
Description Cycles 14-bit Opcode
MSb……LSb
Status
Affected
Notes
Bit Oriented File Register Operations
BCF f,b Bit Clear f 1 01 00bb bff ffff None 2
BSF f,b Bit Set f 1 01 01bb bfff ffff None 2

 

Bit Oriented Skip Operations

Mnemonic,
Operands
Description Cycles 14-bit Opcode
MSb……LSb
Status
Affected
Notes
Bit Oriented Skip Operations
BTFSC f,b Bit Test f, Skip if Clear 1(2) 01 10bb bfff ffff None 1,2
BTFSS f,b Bit Test f, Skip if Set 1(2) 01 11bb bfff ffff None 1,2

 

Notes:

  1. If the program counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second cycle is executed as a NOP
  2. If this instruction addresses an INDF register AND the MSb of the corresponding FSR is set, the instruction requires one additional instruction cycle.