Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 9: Instruction Set
After instruction: REG = 0, W = 2, C = 1, Z = 1 result is 0
Before instruction execution: REG = 1, W = 2, C = x, Z = x
After instruction: REG = 0xFF, W = 2, C = 0, Z = 0 result is
negative
SWAPF - Swap Nibbles in f
Syntax: [label] SWAPF f, d
Description: The upper and lower nibbles of register f are swapped. If d = w or d = 0, the
result is stored in register W. If d = f or d = 1, the result is stored in register f.
Operation: f(0:3) -> d(4:7), f(4:7) -> d(0:3);
Operand: 0 f 127, d [0,1]
Status affected: -
Number of cycles: 1
EXAMPLE 1:
....
[label] SWAPF REG,w
Before instruction execution: REG=0xF3
After instruction: REG=0xF3
W = 0x3F
EXAMPLE 2:
....
[label] SWAPF REG,f
Before instruction execution: REG=0xF3
After instruction: REG=0x3F
http://www.mikroe.com/en/books/picmcubook/ch9/ (31 of 35)5/3/2009 11:35:12 AM