Datasheet
FS98O22
Rev. 1.6 142/146
RRF
Rotate right [f] through Carry
Syntax RRF f, d
0 ≤ f ≤ FFh
d ∈ [0,1]
Operation
[Destination<n-1>]
←
[f<n>]
[Destination<7>] ← C
C ← [f<7>]
Flag Affected C
Description
[f] is rotated one bit to the right through the Carry bit. If d is 0, the result is
stored in the W register. If d is 1, the result is stored back in [f].
Cycle 1
Example:
RRF OPERAND, 0
Before instruction:
C = 0
OPERAND = 95h
After instruction:
C = 1
W = 4Ah, OPERAND = 95h
SLEEP
Oscillator stop
Syntax SLEEP
Operation CPU oscillator is stopped
Flag Affected PD
Description CPU oscillator is stopped. CPU can be waked up by external interrupt sources.
29
Cycle 1
SUBLW
Subtract W from literal
Syntax SUBLW k
0 ≤ k ≤ FFh
Operation
[W] ← k – [W]
Flag Affected C, DC, Z
Description Subtract the content of the W register from the eight-bit literal “k”. The result is stored
in the W register.
Cycle 1
Example 1:
SUBLW 02h
Before instruction:
W = 01h
After instruction:
W = 01h
C = 1
Z = 0
Example 2:
SUBLW 02h
Before instruction:
W = 02h
After instruction:
W = 00h
C = 1
Z = 1
Example 3:
SUBLW 02h
Before instruction:
W = 03h
After instruction:
W = FFh
C = 0
Z = 0
29
Please make sure all interrupt flags are cleared before running SLEEP; "NOP" command must follow HALT and
SLEEP commands.
FORTUNE'
Properties
For Reference Only