fs3861 Fortune Semiconductor Corporation, fs3861 Datasheet - Page 32

no-image

fs3861

Manufacturer Part Number
fs3861
Description
Intelligent Charger Management Controller
Manufacturer
Fortune Semiconductor Corporation
Datasheet
SUBLW
Syntax
Operation
Flag Affected
Description
Cycle
Example 1:
SUBLW 02H
Example 2:
SUBLW 02H
Example 3:
SUBLW 02H
Fortune Semiconductor Corp.
Subtract W from literal
SUBLW
0 ≤ k ≤ FFh
[W] ← k – [W]
C, DC, Z
Subtract the content of the W
register from the eight-bit literal
"k". The result is stored in the W
register.
1
Before instruction:
After instruction:
Before instruction:
After instruction:
Before instruction:
After instruction:
W = 01h
W = 01h
C = 1
Z = 0
W = 02h
W = 00h
C = 1
Z = 1
W = 03h
W = FFh
C = 0
Z = 0
k
32/48
SUBWF
Syntax
Operation
Flag Affected
Description
Cycle
Example 1:
SUBWF OPERAND, 1
Example 2:
SUBWF OPERAND, 1
Example 3:
SUBWF OPERAND, 1
Subtract W from f
SUBWF
0 ≤ f ≤ FFh
d ∈ [0,1]
[Destination] ← [f] – [W]
C, DC, Z
Subtract the content of the W
register from [f]. If d is 0, the result
is stored in the W register. If d is
1, the result is stored back in [f],
1
Before instruction:
After instruction:
Before instruction:
After instruction:
Before instruction:
After instruction:
OPERAND = 33h, W = 01h
OPERAND = 32h
C = 1
Z = 0
OPERAND = 01h, W = 01h
OPERAND = 00h
C = 1
Z = 1
OPERAND = 04h, W = 05h
OPERAND = FFh
C = 0
Z = 0
f, d
FS3861
Rev. 1.0

Related parts for fs3861