English
Language : 

DM163006 Datasheet, PDF (254/320 Pages) Microchip Technology – High-Performance ROM-less Microcontrollers
PIC18C601/801
SWAPF
Swap nibbles in f
Syntax:
[ label ] SWAPF f [,d [,a]]
Operands:
0 ≤ f ≤ 255
d ∈ [0,1]
a ∈ [0,1]
Operation:
(f<3:0>) → dest<7:4>,
(f<7:4>) → dest<3:0>
Status Affected: None
Encoding:
0011 10da ffff ffff
Description:
The upper and lower nibbles of reg-
ister ’f’ are exchanged. If ’d’ is 0, the
result is placed in WREG. If ’d’ is 1,
the result is placed in register ’f’
(default). If ’a’ is 0, the Access Bank
will be selected, overriding the BSR
value. If ’a’ is 1, the Bank will be
selected as per the BSR value.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1
Decode
Q2
Read
register ’f’
Q3
Process
Data
Q4
Write to
destination
Example:
SWAPF REG
Before Instruction
REG = 53h
After Instruction
REG = 35h
DS39541A-page 254
Advance Information
 2001 Microchip Technology Inc.