fs3862 Fortune Semiconductor Corporation, fs3862 Datasheet - Page 29

no-image

fs3862

Manufacturer Part Number
fs3862
Description
8-bit Mcu With 1k Program Eprom, 64-byte Sram, 5-bit I/o Port, 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
SUBWFC
Syntax
Operation
Flag Affected
Description
Cycle
Example 1:
SUBWFC OPERAND, 1
Example 2:
SUBWFC OPERAND, 1
Example 3:
SUBWFC OPERAND, 1
Rev. 1.3
Subtract W from literal
SUBLW k
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:
Subtract W and Carry from f
SUBWFC f, d
0 ≤ f ≤ FFh
d ∈ [0,1]
[Destination] ← [f] – [W] –C
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 = FEh, C = 0, Z = 0
W = 01h
W = 01h
C = 1
Z = 0
W = 02h
W = 00h
C = 1
Z = 1
W = 03h
W = FFh
C = 0
Z = 0
OPERAND = 33h, W = 01h
C = 1
OPERAND = 32h, C = 1, Z = 0
OPERAND = 02h, W = 01h
C = 0
OPERAND = 00h, C = 1, Z = 1
OPERAND = 04h, W = 05h
C = 0
SUBWF
Syntax
Operation
Flag Affected
Description
Cycle
Example 1:
SUBWF OPERAND, 1
Example 2:
SUBWF OPERAND, 1
Example 3:
SUBWF OPERAND, 1
XORWF
Syntax
Operation
Flag Affected
Description
Cycle
Example:
XORWF OPERAND, 1
Subtract W from f
SUBWFf, d
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:
Exclusive OR W and f
XORWF f, d
0 ≤ f ≤ FFh
d ∈ [0,1]
[Destination] ← [W] XOR [f]
Z
Exclusive OR the content of the
W register and [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:
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
OPERAND = 5Fh, W = ACh
OPERAND = F3h
FS3862
29/32

Related parts for fs3862