PIC17C75X
SLEEP
SUBLW
Subtract WREG from Literal
[ label ] SUBLW k
0 ≤ k ≤ 255
Enter SLEEP mode
Syntax:
Syntax:
[ label ] SLEEP
None
Operands:
Operation:
Status Affected:
Encoding:
Description:
Operands:
Operation:
k – (WREG) → (WREG)
OV, C, DC, Z
00h → WDT;
0 → WDT postscaler;
1 → TO;
1011
0010
kkkk
kkkk
0 → PD
WREG is subtracted from the eight bit
literal 'k'. The result is placed in
WREG.
Status Affected:
Encoding:
TO, PD
0000
0000
0000
0011
Words:
Cycles:
1
1
The power-down status bit (PD) is
cleared. The time-out status bit (TO)
is set. Watchdog Timer and its pres-
caler are cleared.
Description:
Q Cycle Activity:
Q1
The processor is put into SLEEP
mode with the oscillator stopped.
Q2
Q3
Q4
Decode
Read
Process
Data
Write to
WREG
literal 'k'
Words:
Cycles:
1
1
SUBLW 0x02
Example 1:
Q Cycle Activity:
Q1
Before Instruction
WREG
=
1
?
Q2
Q3
Q4
C
=
Decode
No
operation
Process
Data
Go to
sleep
After Instruction
WREG
C
Z
=
=
=
1
1
0
; result is positive
SLEEP
Example:
Before Instruction
Example 2:
TO
=
?
Before Instruction
PD
=
?
WREG
C
=
=
2
?
After Instruction
TO
PD
=
=
1 †
0
After Instruction
WREG
=
=
=
0
1
1
† If WDT causes wake-up, this bit is cleared
C
Z
; result is zero
Example 3:
Before Instruction
WREG
C
=
=
3
?
After Instruction
WREG
C
Z
=
=
=
FF ; (2’s complement)
0
1
; result is negative
1997 Microchip Technology Inc.
DS30264A-page 211