16F84 MICROCHIP [Microchip Technology], 16F84 Datasheet - Page 59

no-image

16F84

Manufacturer Part Number
16F84
Description
18-pin Flash/EEPROM 8-Bit Microcontrollers
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
COMF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example
DECF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example
1998 Microchip Technology Inc.
Complement f
[ label ] COMF
0
d
(f)
Z
The contents of register 'f' are comple-
mented. If 'd' is 0 the result is stored in
W. If 'd' is 1 the result is stored back in
register 'f'.
1
1
Before Instruction
After Instruction
Decrement f
[ label ] DECF f,d
0
d
(f) - 1
Z
Decrement register 'f'. If 'd' is 0 the
result is stored in the W register. If 'd' is
1 the result is stored back in register 'f'
1
1
Before Instruction
After Instruction
Decode
COMF
Decode
DECF
Q1
Q1
00
00
f
f
[0,1]
[0,1]
(destination)
127
127
(destination)
REG1
REG1
W
CNT
Z
CNT
Z
register
register
1001
0011
CNT, 1
Read
Read
Q2
Q2
'f'
'f'
REG1,0
=
=
=
=
=
=
=
f,d
Process
Process
dfff
dfff
data
data
Q3
Q3
0x13
0x13
0xEC
0x01
0
0x00
1
destination
destination
ffff
ffff
Write to
Write to
Q4
Q4
.
DECFSZ
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example
If Skip:
Decrement f, Skip if 0
[ label ] DECFSZ f,d
0
d
(f) - 1
skip if result = 0
None
The contents of register 'f' are decre-
mented. If 'd' is 0 the result is placed in the
W register. If 'd' is 1 the result is placed
back in register 'f'.
If the result is 1, the next instruction, is
executed. If the result is 0, then a NOP is
executed instead making it a 2T
tion.
1
1(2)
Before Instruction
After Instruction
(2nd Cycle)
No-Operat
HERE
CONTINUE •
Decode
Q1
Q1
00
ion
f
PC
CNT
if CNT =
PC
if CNT
PC
[0,1]
127
(destination);
PIC16F8X
No-Opera
=
=
=
=
register 'f'
1011
Read
Q2
Q2
DECFSZ
GOTO
tion
address
CNT - 1
0,
address CONTINUE
0,
address HERE+1
DS30430C-page 59
No-Operat
dfff
Process
data
Q3
Q3
ion
HERE
CNT, 1
LOOP
CY
No-Operati
destination
ffff
instruc-
Write to
Q4
Q4
on

Related parts for 16F84