Microchip
16CXX Instruction Set Tables

Instruction general structure:

Type 1 (most) :
Bit : 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Coding : opcode (6 bits) d f (7 bits)

Where : d range : (0 -  1 dec) ( 1 bit  )  
        f range : (0 - 31 dec) ( 5 bits )

Type 2 (ANDLW, CALL, IORLW, MOVLW, RETLW, XORLW) :
Bit : 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Coding : opcode (6 bits) k(8 bits)

Where : k range : (0 - 255 dec) ( 8 bits )  

Type 3 (CLRW, CLRWDT, NOP, OPTION, SLEEP) :
Bit : 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Coding : opcode (14 bits)

Type 4 (BCF, BSF, BTFSC, BTFSS) :
Bit : 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Coding : opcode (4 bits) b (3 bits) f (7 bits)


Instruction Set Summary:

Instruction Syntax Operation Encoding Words Cycles Flags
ADDLW ADDLW k (W) + k → W 11 111x kkkk kkkk 1 1 C,DC,Z
ADDWF ADDWF f,d (W) + (f) → d 00 0111 dfff ffff 1 1 C,DC,Z
ANDLW ANDLW k (W) .AND. (k) → W 11 1001 kkkk kkkk 1 1 Z
ANDWF ANDWF f,d (W) .AND. (f) → d 00 0101 dfff ffff 1 1 Z
BCF BCF f,b 0 → f(b) 01 00bb bfff ffff 1 1 None
BSF BSF f,b 1 → f(b) 01 01bb bfff ffff 1 1 None
BTFSC BTFSC f,b skip if bit(b) in file(f) is clear 01 10bb bfff ffff 1 1(2) None
BTFSS BTFSS f,b skip if bit(b) in file(f) is set 01 11 bb bfff ffff 1 1(2) None
CALL CALL k PC + 1 → Stack, k → PC 10 0kkk kkkk kkkk 1 2 None
CLRF CLRF f 00h → f 00 0001 1fff ffff 1 1 Z
CLRW CLRW 00h → W 00 0001 0xxx xxxx 1 1 Z
CLRWDT CLRWDT 00h → WDT, 0 → WDT prescaler 00 0000 0110 0100 1 1 1 → TO, 1 → PD
COMF COMF f,d neg(f) → d 00 1001 dfff ffff 1 1 Z
DECF DECF f,d (f - 1) → d 00 0011 dfff ffff 1 1 Z
DECFSZ DECFSZ f,d (f - 1) → d, skip if result = 0 00 1011 dfff ffff 1 1(2) None
GOTO GOTO k k → PC ( 11 bits ) 10 1kkk kkkk kkkk 1 2 None
INCF INCF f,d (f + 1) → d 00 1010 dfff ffff 1 1 Z
INCFSZ INCFSZ f,d (f + 1) → d, skip if result = 0 00 1111 dfff ffff 1 1(2) None
IORLW IORLW k (W .OR. k) → W 11 1000 kkkk kkkk 1 1 Z
IORWF IORWF f,d (f .OR. W) → d 00 0100 dfff ffff 1 1 Z
MOVF MOVF f,d (f) → d 00 1000 dfff ffff 1 1 Z
MOVLW MOVLW k k → W 11 00xx kkkk kkkk 1 1 None
MOVWF MOVWF f W → f 00 0000 1fff ffff 1 1 None
NOP NOP No operation 00 0000 0xx0 0000 1 1 None
OPTION OPTION W → OPTION 00 0000 0110 0010 1 1 None
RETFIE RETFIE Stack → PC,   1 → GIE 00 0000 0000 1001 1 2 None
RETLW RETLW k k → W, Stack → PC 11 01xx kkkk kkkk 1 2 None
RETURN RETURN Stack → PC 00 0000 0000 1000 1 2 None
RLF RLF f,d f(n) → d(n+1), C → d(0), f(7) → C 00 1101 dfff ffff 1 1 C
RRF RRF f,d f(n) → d(n-1), C → d(7), f(0) → C 00 1100 dfff ffff 1 1 C
SLEEP SLEEP 0→PD, 1→TO, 00h→WDT, 0→WDT prescaler 00 0000 0110 0011 1 1 TO, PD
SUBLW SUBLW k k - (W) → W 11 110x kkkk kkkk 1 1 C,DC,Z
SUBWF SUBWF f,d (f - W) → d 00 0010 dfff ffff 1 1 C,DC,Z
SWAPF SWAPF f,d f<0:3> → d<4:7>, f<4:7> → d<0:3> 00 1110 dfff ffff 1 1 None
TRIS TRIS f W → TRIS register f 00 0000 0110 0fff 1 1 None
XORLW XORLW k (W .XOR. k) → W 11 1010 kkkk kkkk 1 1 Z
XORWF XORWF f,d (W .XOR. f) → d 00 0110 dfff ffff 1 1 Z

Status Word Flags (Memory Location 03h)
Bit Flag Description
0 C Carry
1 DC Digit Carry/Borrow
2 Z Zero
3 PD Power Down
4 TO Time Out

(d) field values:
d destination
0 W
1 f

Back