English
Language : 

PIC17C75X Datasheet, PDF (197/320 Pages) Microchip Technology – High-Performance 8-Bit CMOS EPROM Microcontrollers
PIC17C75X
DECF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Decode
Decrement f
[ label ] DECF f,d
0 ≤ f ≤ 255
d ∈ [0,1]
(f) – 1 → (dest)
OV, C, DC, Z
0000 011d ffff ffff
Decrement register 'f'. If 'd' is 0 the
result is stored in WREG. If 'd' is 1 the
result is stored back in register 'f'.
1
1
Q2
Read
register 'f'
Q3
Process
Data
Q4
Write to
destination
Example:
DECF CNT, 1
Before Instruction
CNT = 0x01
Z
=0
After Instruction
CNT = 0x00
Z
=1
DECFSZ
Decrement f, skip if 0
Syntax:
[ label ] DECFSZ f,d
Operands:
0 ≤ f ≤ 255
d ∈ [0,1]
Operation:
(f) – 1 → (dest);
skip if result = 0
Status Affected: None
Encoding:
0001 011d ffff ffff
Description:
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'.
If the result is 0, the next instruction,
which is already fetched, is discarded,
and an NOP is executed instead mak-
ing it a two-cycle instruction.
Words:
1
Cycles:
1(2)
Q Cycle Activity:
Q1
Decode
If skip:
Q1
No
operation
Q2
Read
register 'f'
Q2
No
operation
Q3
Process
Data
Q3
No
operation
Q4
Write to
destination
Q4
No
operation
Example:
HERE
DECFSZ
GOTO
CONTINUE
CNT, 1
LOOP
Before Instruction
PC
= Address (HERE)
After Instruction
CNT =
If CNT =
PC =
If CNT ≠
PC =
CNT - 1
0;
Address (CONTINUE)
0;
Address (HERE+1)
© 1997 Microchip Technology Inc.
DS30264A-page 197