PIC17C75X
SWAPF
Syntax:
Swap f
TABLRD
Syntax:
Table Read
[ label ] SWAPF f,d
[ label ] TABLRD t,i,f
Operands:
0 ≤ f ≤ 255
Operands:
0 ≤ f ≤ 255
d
[0,1]
i
t
[0,1]
[0,1]
Operation:
f<3:0> → dest<7:4>;
f<7:4> → dest<3:0>
Operation:
If t = 1,
TBLATH → f;
If t = 0,
TBLATL → f;
Prog Mem (TBLPTR) → TBLAT;
If i = 1,
TBLPTR + 1 → TBLPTR
Status Affected:
Encoding:
None
0001
110d
ffff
ffff
The upper and lower nibbles of register
'f' are exchanged. If 'd' is 0 the result is
placed in WREG. If 'd' is 1 the result is
placed in register 'f'.
Description:
Status Affected:
Encoding:
None
Words:
Cycles:
1
1
1010
10ti
ffff
ffff
1. A byte of the table latch (TBLAT)
is moved to register file 'f'.
Description:
Q Cycle Activity:
Q1
If t = 0: the high byte is moved;
If t = 1: the low byte is moved
Q2
Q3
Q4
Decode
Read
register 'f'
Process
Data
Write to
2. Then the contents of the program
memory location pointed to by
destination
the
16-bit
Table
Pointer
SWAPF
REG,
0
Example:
(TBLPTR) is loaded into the
16-bit Table Latch (TBLAT).
Before Instruction
3. If i = 1: TBLPTR is incremented;
If i = 0: TBLPTR is not
incremented
REG
=
0x53
0x35
After Instruction
REG
=
Words:
Cycles:
1
2 (3 cycle if f = PCL)
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register
Process
Data
Write
register 'f'
TBLATH or
TBLATL
No
No
No
No
operation
operation
(Table Pointer
on Address
bus)
operation
operation
(OE goes low)
1997 Microchip Technology Inc.
DS30264A-page 213