fs3862 Fortune Semiconductor Corporation, fs3862 Datasheet - Page 23

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
ADDLW
Syntax
Operation
Flag Affected
Description
Cycle
Example:
ADDLW 08h
ADDWF
Syntax
Operation
Flag Affected
Description
Cycle
Example 1:
ADDWF OPERAND, 0
Example 2:
ADDWF OPERAND, 1
Rev. 1.3
12.2
Struction Description
Add Literal to W
ADDLW k
0 ≤ k ≤ FFh
[W] ← [W] + k
C, DC, Z
The content of Work register add
literal “k” in Work register
1
Before instruction:
After instruction:
Add W to f
ADDWF f, d
0 ≤ f ≤ FFh
d ∈ [0,1]
[Destination] ← [f] + [W]
C, CD, Z
Add 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:
Before instruction:
After instruction:
W = 08h
W = 10h
OPERAND = C2h
W = 17h
OPERAND = C2h
W = D9h
OPERAND = C2h
W = 17h
OPERAND = D9h
W = 17h
ADDPCW
Syntax
Operation
Flag Affected
Description
Cycle
Example 1:
ADDPCW
Example 2:
ADDPCW
Example 3:
ADDPCW
ADDWFC
Syntax
Operation
Flag Affected
Description
Cycle
Example
ADDWFC OPERAND,1
Add W to PC
ADDPCW
[PC] ← [PC] + 1 + [W], [W] < 79h
[PC] ← [PC] + 1 + ([W] – 100h),
otherwise
None
The relative address PC + 1 + W
are loaded into PC.
2
Before instruction:
After instruction:
Before instruction:
After instruction:
Before instruction:
After instruction:
Add W, f and Carry
ADDWFC f, d
0 ≤ f ≤ FFh
d ∈ [0,1]
[Destination] ← [f] + [W] + C
C, DC, Z
Add the content of the W register,
[f] and 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.
1
Before instruction:
After instruction:
W = 7Fh, PC = 0212h
PC = 0292h
W = 80h, PC = 0212h
PC = 0193h
W = FEh, PC = 0212h
PC = 0211h
C = 1
OPERAND = 02h
W = 4Dh
C = 0
OPERAND = 50h
W = 4Dh
FS3862
23/32

Related parts for fs3862