
1996 Microchip Technology Inc.
DS30412C-page 123
PIC17C4X
INCF
Increment f
Syntax:
[
label ]
INCF f,d
Operands:
0
≤ f ≤ 255
d
∈ [0,1]
Operation:
(f) + 1
→ (dest)
Status Affected:
OV, C, DC, Z
Encoding:
0001
010d
ffff
Description:
The contents of register 'f' are incre-
mented. If 'd' is 0 the result is placed in
WREG. If 'd' is 1 the result is placed
back in register 'f'.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Execute
Write to
destination
Example:
INCF
CNT,
1
Before Instruction
CNT
=
0xFF
Z=
0
C=
?
After Instruction
CNT
=
0x00
Z=
1
C=
1
INCFSZ
Increment f, skip if 0
Syntax:
[
label ]
INCFSZ f,d
Operands:
0
≤ f ≤ 255
d
∈ [0,1]
Operation:
(f) + 1
→ (dest)
skip if result = 0
Status Affected:
None
Encoding:
0001
111d
ffff
Description:
The contents of register 'f' are incre-
mented. If 'd' is 0 the result is placed in
WREG. If 'd' is 1 the result is placed
back in register 'f'.
If the result is 0, the next instruction,
which is already fetched, is discarded,
and an NOP is executed instead making
it a two-cycle instruction.
Words:
1
Cycles:
1(2)
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
register 'f'
Execute
Write to
destination
If skip:
Q1
Q2
Q3
Q4
Forced NOP
NOP
Execute
NOP
Example:
HERE
INCFSZ
CNT, 1
NZERO
:
ZERO
:
Before Instruction
PC
=
Address (HERE)
After Instruction
CNT
=
CNT + 1
If CNT
=
0;
PC =
Address(ZERO)
If CNT
≠
0;
PC =
Address(NZERO)