PIC17C75X
TLWT
Table Latch Write
TSTFSZ
Test f, skip if 0
[ label ] TSTFSZ f
0 ≤ f ≤ 255
Syntax:
Operands:
[ label ] TLWT t,f
Syntax:
0 ≤ f ≤ 255
Operands:
Operation:
Status Affected:
Encoding:
Description:
t
[0,1]
If t = 0,
f → TBLATL;
If t = 1,
f → TBLATH
None
skip if f = 0
Operation:
None
0011
0011
ffff
ffff
If 'f' = 0, the next instruction, fetched
during the current instruction execution,
is discarded and an NOP is executed
making this a two-cycle instruction.
Status Affected:
Encoding:
1010
01tx
ffff
ffff
Data from file register 'f' is written into
the 16-bit table latch (TBLAT).
Description:
Words:
Cycles:
1
1 (2)
If t = 1; high byte is written
If t = 0; low byte is written
Q Cycle Activity:
Q1
Q2
Q3
Q4
This instruction is used in conjunction
with TABLWTto transfer data from data
memory to program memory.
Decode
Read
Process
Data
No
operation
register 'f'
If skip:
Q1
Words:
Cycles:
1
1
Q2
Q3
Q4
No
operation
No
operation
No
operation
No
operation
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Process
Data
Write
register
TBLATH or
TBLATL
HERE
NZERO
ZERO
TSTFSZ CNT
:
:
Example:
Before Instruction
PC = Address(HERE)
TLWT
t, RAM
Example:
After Instruction
Before Instruction
If CNT
PC
If CNT
PC
=
=
≠
=
0x00,
Address (ZERO)
0x00,
t
=
=
=
0
RAM
TBLAT
0xB7
0x0000 (TBLATH = 0x00)
(TBLATL = 0x00)
Address (NZERO)
After Instruction
RAM
=
0xB7
TBLAT
=
0x00B7 (TBLATH = 0x00)
(TBLATL = 0xB7)
Before Instruction
t
=
=
=
1
RAM
TBLAT
0xB7
0x0000 (TBLATH = 0x00)
(TBLATL = 0x00)
After Instruction
RAM
=
0xB7
TBLAT
=
0xB700 (TBLATH = 0xB7)
(TBLATL = 0x00)
DS30264A-page 216
1997 Microchip Technology Inc.