
1996 Microchip Technology Inc.
Advance Information
DS40139A-page 47
PIC12C5XX
SWAPF
Syntax:
Operands:
Swap Nibbles in f
[ label SWAPF f,d
0
≤
f
≤
31
d
∈
[0,1]
(f<3:0>)
→
(dest<7:4>);
(f<7:4>)
→
(dest<3:0>)
None
Operation:
Status Affected:
Encoding:
Description:
0011
10df
ffff
The upper and lower nibbles of register
'f' are exchanged. If 'd' is 0 the result is
placed in W register. If 'd' is 1 the result
is placed in register 'f'.
1
1
Words:
Cycles:
Example
SWAPF
REG1,
0
Before Instruction
REG1
After Instruction
REG1
W
=
0xA5
=
=
0xA5
0X5A
TRIS
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Load TRIS Register
[ label TRIS
f =
6
(W)
→
TRIS register f
None
f
0000
0000
0fff
TRIS register 'f' (f = 6) is loaded with the
contents of the W register
1
1
Words:
Cycles:
Example
TRIS
GPIO
Before Instruction
W
After Instruction
TRIS
Note:
f = 6 for PIC12C5XX only.
=
0XA5
=
0XA5
XORLW
Syntax:
Exclusive OR literal with W
[label
0
≤
k
≤
255
(W) .XOR. k
→ (
W)
Z
XORLW k
Operands:
Operation:
Status Affected:
Encoding:
Description:
1111
kkkk
kkkk
The contents of the W register are
XOR’ed with the eight bit literal 'k'. The
result is placed in the W register.
1
1
Words:
Cycles:
Example:
Before Instruction
W
After Instruction
W
XORLW
0xAF
=
0xB5
=
0x1A
XORWF
Syntax:
Operands:
Exclusive OR W with f
[ label XORWF f,d
0
≤
f
≤
31
d
∈
[0,1]
(W) .XOR. (f)
→ (
dest)
Z
Operation:
Status Affected:
Encoding:
Description:
0001
10df
ffff
Exclusive OR the contents of the W
register with register 'f'. If 'd' is 0 the
result is stored in the W register. If 'd' is
1 the result is stored back in register 'f'.
1
1
Words:
Cycles:
Example
XORWF
REG,1
Before Instruction
REG
W
After Instruction
REG
W
=
=
0xAF
0xB5
=
=
0x1A
0xB5