PIC17C75X
DCFSNZ
Syntax:
Decrement f, skip if not 0
GOTO
Unconditional Branch
[ label ] GOTO k
0 ≤ k ≤ 8191
[label] DCFSNZ f,d
Syntax:
Operands:
0 ≤ f ≤ 255
Operands:
Operation:
d
[0,1]
k → PC<12:0>;
Operation:
(f) – 1 → (dest);
skip if not 0
k<12:8> → PCLATH<4:0>,
PC<15:13> → PCLATH<7:5>
Status Affected:
Encoding:
None
Status Affected:
Encoding:
None
0010
011d
ffff
ffff
110k
kkkk
kkkk
kkkk
The contents of register 'f' are decre-
mented. If 'd' is 0 the result is placed in
WREG. If 'd' is 1 the result is placed
back in register 'f'.
GOTOallows an unconditional branch
anywhere within an 8K page bound-
ary. The thirteen bit immediate value is
loaded into PC bits <12:0>. Then the
upper eight bits of PC are loaded into
PCLATH. GOTOis always a two-cycle
instruction.
Description:
Description:
If the result is not 0, the next instruc-
tion, which is already fetched, is dis-
carded, and an NOP is executed
instead making it a two-cycle instruc-
tion.
Words:
Cycles:
1
2
Words:
Cycles:
1
Q Cycle Activity:
Q1
1(2)
Q2
Q3
Q4
Q Cycle Activity:
Q1
Decode
Read literal
'k'
Process
Data
Write to PC
Q2
Q3
Q4
Decode
Read
register 'f'
Process
Data
Write to
destination
No
operation
No
operation
No
operation
No
operation
If skip:
Q1
GOTO THERE
Q2
Q3
Q4
Example:
No
operation
No
operation
No
operation
No
operation
After Instruction
PC
=
Address (THERE)
HERE
ZERO
NZERO
DCFSNZ TEMP, 1
:
:
Example:
Before Instruction
TEMP_VALUE
=
?
After Instruction
TEMP_VALUE
If TEMP_VALUE
PC
=
=
=
≠
=
TEMP_VALUE - 1,
0;
Address (ZERO)
0;
Address (NZERO)
If TEMP_VALUE
PC
DS30264A-page 198
1997 Microchip Technology Inc.