Instruction Description Operation Flag CLK Data Transfer Instructions
Instruction Description Operation Flag CLK Data Transfer Instructions
W CLRF f Clear f SWAPF f,d Swap nibbles in f Arithmetic-logic Instructions ADDLW k Add W and constant ADDWF f,d Add W and f SUBLW k Subtract W from constant SUBWF f,d Subtract W from f ANDLW k Logical AND with W with constant ANDWF f,d Logical AND with W with f ANDWF f,d Logical AND with W with f IORLW k Logical OR with W with constant IORWF f,d Logical OR with W with f XORLW k Logical exclusive OR with W with constant XORWF f,d Logical exclusive OR with W with f INCF f,d Increment f by 1 DECF f,d Decrement f by 1 RLF f,d Rotate left f through CARRY bit RRF f,d Rotate right f through CARRY bit COMF f,d Complement f Bit-oriented Instructions BCF f,b Clear bit b in f BSF f,b Set bit b in f Program Control Instructions BTFSC f,b Test bit b of f. Skip the following instruction if clear. BTFSS f,b Test bit b of f. Skip the following instruction if set. DECFSZ f,d Decrement f. Skip the following instruction if clear. INCFSZ f,d Increment f. Skip the following instruction if set. GOTO k Go to address CALL k Call subroutine RETURN Return from subroutine RETLW k Return with constant in W RETFIE Return from interrupt Other instructions NOP No operation CLRWDT Clear watchdog timer SLEEP Go into sleep mode
Operation k -> w W -> f f -> d 0 -> W 0 -> f f(7:4),(3:0) -> f(3:0),(7:4) W+k -> W W+f -> d k-W -> W f-W -> d W AND k -> W W AND f -> d W AND f -> d W OR k -> W W OR f -> d W XOR k -> W W XOR f -> d f+1 -> f f-1 -> f
Flag 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
CLK
Z Z Z
1, 2 2 1, 2
f -> d 0 -> f(b) 1 -> f(b) Skip if f(b) = 0 Skip if f(b) = 1 f-1 -> d skip if Z = 1 f+1 -> d skip if Z = 0 k -> PC PC -> TOS, k -> PC TOS -> PC k -> W, TOS -> PC TOS -> PC, 1 -> GIE TOS -> PC, 1 -> GIE 0 -> WDT, 1 -> TO, 1 -> PD 0 -> WDT, 1 -> TO, 0 -> PD
1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1, 2 1,2 1,2 3 3 1, 2, 3 1, 2, 3
TO, PD TO, PD