Professional Documents
Culture Documents
B.5
Mnemonic
Description
Function
Ekk
ANDLW
k .AND. W W
9kk
CALL
k Call subroutine
PC + 1 TOS, k PC
004
CLRWDT
Akk
GOTO
k PC(9 bits)
Dkk
IORLW
k .OR. W W
Ckk
MOVLW
k Move Literal to W
k W
002
OPTION
8kk
RETLW
003
SLEEP
00f
TRIS
f Tristate port f
Fkk
XORLW
k .XOR. W W
W OPTION Register
k W, TOS PC
0 WDT, stop oscillator
Mnemonic
Description
Function
1Cf
ADDWF
W + f d
14f
ANDWF
W .AND. f
06f
CLRF
040
CLRW
Clear W
24f
COMF
f,d Complement f
f Clear f
0f
0 W
.NOT. f d
0Cf
DECF
f,d Decrement f
f - 1 d
2Cf
DECFSZ
f - 1 d, skip if zero
28f
INCF
f,d Increment f
f + 1 d
3Cf
INCFSZ
f + 1 d,skip if zero
IORWF
W .OR. f d
MOVF
f,d Move f
f d
02f
MOVWF
000
NOP
34f
RLF
f Move W to f
W f
No operation
f,d Rotate left f
register f
C
7......0
DS33014G-page 181
APPENDICES
10f
20f
Mnemonic
RRF
Description
Function
register f
C
7......0
08f
SUBWF
f - W d
38f
SWAPF
f(0:3) f(4:7) d
18f
XORWF
W .XOR. f d
Mnemonic
Description
Function
4bf
BCF
0 f(b)
5bf
BSF
1 f(b)
6bf
BTFSC
skip if f(b) = 0
7bf
BTFSS
skip if f(b) = 1
DS33014G-page 182
Quick Reference
B.6
Mnemonic
Description
Function
3Ekk
ADDLW
k Add literal to W
k + W W
39kk
ANDLW
k .AND. W W
2kkk
CALL
k Call subroutine
PC + 1
0064
CLRWDT
2kkk
GOTO
k PC(9 bits)
38kk
IORLW
k .OR. W W
30kk
MOVLW
k Move Literal to W
k W
TOS, k PC
0062
OPTION
W OPTION Register
0009
RETFIE
TOS
34kk
RETLW
0008
RETURN
PC, 1 GIE
k W, TOS PC
TOS PC
0 WDT, stop oscillator
0063
SLEEP
3Ckk
SUBLW
k - W W
006f
TRIS
f Tristate port f
3Akk
XORLW
k .XOR. W W
Mnemonic
Description
ADDWF
05ff
ANDWF
018f
CLRF
0100
CLRW
Clear W
09ff
COMF
f,d Complement f
f Clear f
Function
W + f
W .AND. f
0 f
0 W
.NOT. f d
DECF
f,d Decrement f
f - 1 d
DECFSZ
f - 1 d, skip if 0
0Aff
INCF
f,d Increment f
f + 1 d
0Fff
INCFSZ
f + 1 d, skip if 0
04ff
IORWF
W .OR. f d
08ff
MOVF
f,d Move f
f d
DS33014G-page 183
APPENDICES
03ff
0Bff
Mnemonic
008f
MOVWF
0000
NOP
0Dff
RLF
Description
f Move W to f
Function
W f
No operation
f,d Rotate left f
register f
C
0Cff
7......0
RRF
register f
C
7......0
02ff
SUBWF
f - W d
0Eff
SWAPF
f(0:3) f(4:7) d
06ff
XORWF
W .XOR. f d
Mnemonic
Description
f,b Bit clear f
BCF
Function
0 f(b)
1bff
BSF
1 f(b)
1bff
BTFSC
skip if f(b) = 0
1bff
BTFSS
skip if f(b) = 1
Description
Equivalent
Operation(s)
Status
ADDCF
f,d
BTFSC
INCF
3,0
f,d
ADDDCF
f,d
BTFSC
INCF
3,1
f,d
Branch
GOTO
BC
Branch on Carry
BTFSC
GOTO
3,0
k
BDC
BTFSC
GOTO
3,1
k
BNC
Branch on No Carry
BTFSS
GOTO
3,0
k
BNDC
BTFSS
GOTO
3,1
k
BNZ
Branch on No Zero
BTFSS
GOTO
3,2
k
BZ
Branch on Zero
BTFSC
GOTO
3,2
k
DS33014G-page 184
Quick Reference
Table B.11: 12-Bit/14-Bit Core Special Instruction Mnemonics (Continued)
Mnemonic
Equivalent
Operation(s)
Description
Status
CLRC
Clear Carry
BCF
3,0
CLRDC
BCF
3,1
CLRZ
Clear Zero
BCF
3,2
Move File to W
MOVF
f,0
Negate File
COMF
INCF
f,1
f,d
SETC
Set Carry
BSF
3,0
SETDC
BSF
3,1
SETZ
Set Zero
BSF
3,2
SKPC
Skip on Carry
BTFSS
3,0
SKPDC
BTFSS
3,1
SKPNC
Skip on No Carry
BTFSC
3,0
SKPNDC
BTFSC
3,1
SKPNZ
BTFSC
3,2
LCALL
LGOTO
MOVFW
NEGF
f,d
Skip on Zero
BTFSS
3,2
SUBCF
f,d
BTFSC
DECF
3,0
f,d
SUBDCF
f,d
BTFSC
DECF
3,1
f,d
Test File
MOVF
f,1
SKPZ
TSTF
APPENDICES
DS33014G-page 185
Mnemonic
Description
Function
f p
f,p Move f to p
6pff
MOVFP
b8kk
MOVLB
k BSR (3:0)
bakx
MOVLP
k BSR (7:4)
p W
p,f Move p to f
4pff
MOVPF
01ff
MOVWF
a8ff
TBLATH f if t=1,
TBLATL f if t=0;
ProgMem(TBLPTR) TBLAT;
TBLPTR + 1 TBLPTR if i=1
acff
f TBLATH if t = 1,
f TBLATL if t = 0;
TBLAT ProgMem(TBLPTR);
TBLPTR + 1 TBLPTR if i=1
a0ff
TLRD
TBLATH f if t = 1
TBLATL f if t = 0
a4ff
TLWT
f TBLATH if t = 1
f TBLATL if t = 0
f Move W to F
W f
Mnemonic
Description
k Add literal to W
Function
(W + k) W
b1kk
ADDLW
0eff
ADDWF
f,d Add W to F
(W + f) d
10ff
ADDWFC
(W + f + C) d
(W .AND. k) W
b5kk
ANDLW
0aff
ANDWF
(W .AND. f) d
28ff
CLRF
0x00 f,0x00 d
12ff
COMF
f,d Complement f
.NOT. f
2eff
DAW
W adjusted f and d
06ff
DECF
f,d Decrement f
(f - 1) f and d
14ff
INCF
f,d Increment f
(f + 1) f and d
b3kk
IORLW
DS33014G-page 186
(W .OR. k) W
Quick Reference
Table B.13: 16-Bit Core Arithmetic and Logical Instruction (Continued)
Hex
Mnemonic
Description
Function
(W .OR. f) d
08ff
IORWF
b0kk
MOVLW
k Move literal to W
k W
bckk
MULLW
(k x W) PH:PL
34ff
MULWF
f Multiply W and f
(W x f) PH:PL
2cff
NEGW
1aff
RLCF
(W + 1)
f,(W + 1) d
register f
22ff
RLNCF
7......0
register f
7......0
18ff
RRCF
register f
C
20ff
RRNCF
7......0
register f
7......0
0xff f,0xff d
2aff
SETF
b2kk
SUBLW
04ff
SUBWF
(f - W) d
02ff
SUBWFB
(f - W - c) d
1cff
SWAPF
f,d Swap f
f(0:3) d(4:7),
f(4:7) d(0:3)
b4kk
XORLW
0cff
XORWF
(k - W)
(W .XOR. k) W
(W .XOR. f)
Mnemonic
Description
Function
BCF
f,b
Bit clear f
0 f(b)
8bff
BSF
f,b
Bit set f
1 f(b)
9bff
BTFSC
f,b
skip if f(b) = 0
9bff
BTFSS
f,b
skip if f(b) = 1
3bff
BTG
f,b
Bit toggle f
DS33014G-page 187
APPENDICES
8bff
Mnemonic
Description
Function
ekkk
CALL
31ff
CPFSEQ
f-W, skip if f = W
32ff
CPFSGT
30ff
CPFSLT
16ff
DECFSZ
(f-1) d, skip if 0
26ff
DCFSNZ
(f-1)
ckkk
GOTO
d, skip if not 0
k PC(12:0)
k(12:8) PCLATH(4:0),
PC(15:13) PCLATH(7:5)
1eff
INCFSZ
(f+1) d, skip if 0
24ff
INFSNZ
b7kk
LCALL
0005
RETFIE
b6kk
RETLW
0002
RETURN
33ff
TSTFSZ
(PC+1) TOS; k
(PCLATH) PCH
k W, TOS PC,
(PCLATH unchanged)
TOS PC
(PCLATH unchanged)
PCL,
skip if f = 0
Mnemonic
Description
Function
0004
CLRWT
0003
SLEEP
DS33014G-page 188
WDT,
Quick Reference
B.8
Field
Description
File Addresses
f
fs
fd
dest
Literals
kk
kb
kc
kd
Offsets, Addresses
nn
nd
ml
mm
xx
Bits
b
APPENDICES
DS33014G-page 189
Mnemonic
Description
Function
0Fkk
ADDLW
kk
W+kk W
0Bkk
ANDLW
kk
W .AND. kk W
0004
CLRWDT
0007
DAW
09kk
IORLW
kk
W .OR. kk W
EFkc
F0kd
LFSR
kd:kc FSRr
01kb
MOVLB
kb
kb BSR
0Ekk
MOVLW
kk
kk W
0Dkk
MULLW
kk
W * kk PRODH:PRODL
08kk
SUBLW
kk
kkW W
0Akk
XORLW
kk
W .XOR. kk W
Mnemonic
Description
Function
0008
TBLRD *
0009
TBLRD *+
000A
TBLRD *-
000B
TBLRD +*
TBLPTR +1 TBLPTR
Prog Mem (TBLPTR) TABLAT
000C
TBLWT *
000D
TBLWT *+
DS33014G-page 190
Quick Reference
Table B.18: Enhanced 16-Bit Core Memory Operations (Continued)
Hex
Mnemonic
Description
Function
000E
TBLWT *-
000F
TBLWT +*
TBLPTR +1 TBLPTR
TABLAT Prog Mem(TBLPTR)
Mnemonic
Description
Function
E2nn
BC
nn
E6nn
BN
nn
E3nn
BNC
nn
E7nn
BNN
nn
E5nn
BNOV
nn
E1nn
BNZ
nn
BOV
nn
E0nd
BRA
nd
Unconditional relative
branch
PC+2+2*nd PC
E0nn
BZ
nn
ECml
Fmm
CALL
EFml
Fmm
GOTO
mm:ml
Absolute Branch
(second word)
mm:ml PC<20:1>
0000
NOP
No Operation
No operation
0006
POP
TOS-1 TOS
0005
PUSH
PC +2 TOS
D8nd
RCALL
00FF
RESET
0010
RETFIE
0Ckk
RETLW
kk
kk W,
0012
RETURN s
0003
SLEEP
nd
DS33014G-page 191
APPENDICES
E4nn
Mnemonic
Description
Function
9bf
BCF
f,b,a
Bit Clear f
0 f<b>
8bf
BSF
f,b,a
Bit Set f
1 f<b>
Bbf
BTFSC
f,b,a
Abf
BTFSS
f,b,a
7bf
BTG
f,b,a
Bit Toggle f
f<b> f<b>
Mnemonic
Description
Function
W+f dest
24f
ADDWF
f,d,a
ADD WREG to f
20f
ADDWFC
f,d,a
14f
ANDWF
f,d,a
W .AND. f dest
6Af
CLRF
f,a
Clear f
0f
1Cf
COMF
f,d,a
Complement f
f dest
62f
CPFSEQ
f,a
64f
CPFSGT
f,a
60f
CPFSLT
f,a
04f
DECF
f,d,a
Decrement f
f1 dest
2Cf
DECFSZ
f,d,a
Decrement f, skip if 0
4Cf
DCFSNZ
f,d,a
28f
INCF
f,d,a
Increment f
f+1 dest
3Cf
INCFSZ
f,d,a
Increment f, skip if 0
48f
INFSNZ
f,d,a
10f
IORWF
f,d,a
W .OR. f dest
50f
MOVF
f,d,a
Move f
f dest
Cfs
Ffd
MOVFF
fs,fd
Move fs to fd
(second word)
fs fd
6Ef
MOVWF
f,a
Move WREG to f
Wf
02f
MULWF
f,a
W * f PRODH:PRODL
f +1 f
6Cf
NEGF
f,a
Negate f
34f
RLCF
f,d,a
register f
C
DS33014G-page 192
7......0
Quick Reference
Table B.21: Enhanced 16-Bit Core File Register Operations (Continued)
Hex
44f
Mnemonic
RLNCF
f,d,a
Description
Function
register f
7......0
30f
RRCF
f,d,a
register f
C
40f
RRNCF
f,d,a
7......0
register f
7......0
48f
SETF
f,a
Set f
0xFF f
54f
SUBFWB
f,d,a
WfC dest
5Cf
SUBWF
f,d,a
fW dest
58f
SUBWFB
f,d,a
fWC dest
38f
SWAPF
f,d,a
Swap nibbbles of f
66f
TSTFSZ
f,a
Test f, skip if 0
18f
XORWF
f,d,a
W .XOR. f dest
APPENDICES
DS33014G-page 193
Dec
Byte
Hex
Dec
Hex
Dec
Hex
Dec
4096
256
16
8192
512
32
12288
768
48
16384
1024
64
20480
1280
80
24576
1536
96
28672
1792
112
32768
2048
128
36864
2304
144
40960
2560
160
10
45056
2816
176
11
49152
3072
192
12
53248
3328
208
13
57344
3584
224
14
61440
3840
240
15
Using This Table: For each Hex digit, find the associated decimal value. Add
the numbers together. For example, Hex A38F converts to 41871 as follows:
Hex 1000s Digit Hex 100s Digit Hex 10s Digit Hex 1s Digit
40960
DS33014G-page 194
768
128
15
Result
41871
Decimal