PIC17C4X
TLRD
Table Latch Read
Table Write
TABLWT
TABLWT 0, 1, REG
Syntax:
Operands:
[ label ] TLRD t,f
Example1:
0 ≤ f ≤ 255
Before Instruction
REG
TBLATH
TBLATL
TBLPTR
=
=
=
=
=
0x53
0xAA
0x55
0xA356
0xFFFF
t
[0,1]
If t = 0,
TBLATL → f;
If t = 1,
TBLATH → f
None
Operation:
MEMORY(TBLPTR)
After Instruction (table write completion)
Status Affected:
Encoding:
REG
TBLATH
TBLATL
TBLPTR
=
=
=
=
=
0x53
0x53
0x55
0xA357
0x5355
1010
00tx
ffff
ffff
Read data from 16-bit table latch
(TBLAT) into file register 'f'. Table Latch
is unaffected.
Description:
MEMORY(TBLPTR - 1)
TABLWT 1, 0, REG
Example 2:
If t = 1; high byte is read
If t = 0; low byte is read
Before Instruction
REG
TBLATH
TBLATL
TBLPTR
=
=
=
=
=
0x53
0xAA
0x55
0xA356
0xFFFF
This instruction is used in conjunction
with TABLRDto transfer data from pro-
gram memory to data memory.
Words:
Cycles:
1
1
MEMORY(TBLPTR)
After Instruction (table write completion)
REG
TBLATH
TBLATL
TBLPTR
=
=
=
=
=
0x53
0xAA
0x53
0xA356
0xAA53
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register
Execute
Write
register 'f'
MEMORY(TBLPTR)
TBLATH or
TBLATL
Program
Memory
Data
Memory
TLRD
t, RAM
Example:
15
15
0
0
Before Instruction
TBLPTR
t
=
=
=
0
?
RAM
TBLAT
8
7
0x00AF (TBLATH = 0x00)
(TBLATL = 0xAF)
16 bits
8 bits
After Instruction
TBLAT
RAM
=
0xAF
TBLAT
=
0x00AF (TBLATH = 0x00)
(TBLATL = 0xAF)
Before Instruction
t
=
=
=
1
?
RAM
TBLAT
0x00AF (TBLATH = 0x00)
(TBLATL = 0xAF)
After Instruction
RAM
=
0x00
TBLAT
=
0x00AF (TBLATH = 0x00)
(TBLATL = 0xAF)
Program
Memory
Data
Memory
15
15
0
0
TBLPTR
8
7
16 bits
8 bits
TBLAT
1996 Microchip Technology Inc.
DS30412C-page 139