PIC16CR54C
SLEEP
Enter SLEEP Mode
SUBWF
Subtract W from f
Syntax:
Syntax:
[label]
[label] SUBWF f,d
SLEEP
Operands:
0 ≤ f ≤ 31
Operands:
Operation:
None
d
[0,1]
00h → WDT;
0 → WDT prescaler;
1 → TO;
Operation:
(f) – (W) → (dest)
Status Affected: C, DC, Z
0 → PD
0000
10df
ffff
Encoding:
Status Affected: TO, PD
Subtract (2’s complement method) the
W register from 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'.
Description:
0000
0000
0011
Encoding:
Time-out status bit (TO) is set. The
power down status bit (PD) is cleared.
The WDT and its prescaler are
cleared.
Description:
Words:
1
1
Cycles:
The processor is put into SLEEP mode
with the oscillator stopped. See sec-
tion on SLEEP for more details.
SUBWF
REG1, 1
Example 1:
Before Instruction
Words:
1
REG1
W
C
=
=
=
3
2
?
Cycles:
Example:
1
SLEEP
After Instruction
REG1
W
C
=
=
=
1
2
1
; result is positive
Example 2:
Before Instruction
REG1
W
C
=
=
=
2
2
?
After Instruction
REG1
W
C
=
=
=
0
2
1
; result is zero
Example 3:
Before Instruction
REG1
W
C
=
=
=
1
2
?
After Instruction
REG1
W
C
=
=
=
FF
2
0
; result is negative
DS40191A-page 46
Preliminary
1998 Microchip Technology Inc.