欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC18F4431-I/P 参数 Datasheet PDF下载

PIC18F4431-I/P图片预览
型号: PIC18F4431-I/P
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚增强型闪存微控制器采用纳瓦技术,高性能PWM和A / D [28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High-Performance PWM and A/D]
分类和应用: 闪存微控制器
文件页数/大小: 392 页 / 3127 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F4431-I/P的Datasheet PDF文件第315页浏览型号PIC18F4431-I/P的Datasheet PDF文件第316页浏览型号PIC18F4431-I/P的Datasheet PDF文件第317页浏览型号PIC18F4431-I/P的Datasheet PDF文件第318页浏览型号PIC18F4431-I/P的Datasheet PDF文件第320页浏览型号PIC18F4431-I/P的Datasheet PDF文件第321页浏览型号PIC18F4431-I/P的Datasheet PDF文件第322页浏览型号PIC18F4431-I/P的Datasheet PDF文件第323页  
PIC18F2331/2431/4331/4431  
SUBLW  
Subtract W from Literal  
SUBWF  
Syntax:  
Subtract W from f  
Syntax:  
[ label ] SUBLW  
0 k 255  
k
[ label ] SUBWF f [,d [,a]]  
Operands:  
Operation:  
Status Affected:  
Encoding:  
Description:  
Operands:  
0 f 255  
d [0,1]  
a [0,1]  
k – (W) W  
N, OV, C, DC, Z  
Operation:  
(f) – (W) dest  
0000  
1000  
kkkk  
kkkk  
Status Affected:  
Encoding:  
N, OV, C, DC, Z  
W is subtracted from the 8-bit  
literal, ‘k’. The result is placed in W.  
0101  
11da  
ffff  
ffff  
Description:  
Subtract W from register, ‘f’ (2’s  
complement method). If ‘d’ is ‘0’, the  
result is stored in W. If ‘d’ is ‘1’, the  
result is stored back in register, ‘f’.  
If = ‘a’ is ‘0’, the Access Bank will be  
selected, overriding the BSR value. If  
‘a’ is ‘1’, then the bank will be selected  
as per the BSR value.  
Words:  
Cycles:  
1
1
Q Cycle Activity:  
Q1  
Q2  
Q3  
Q4  
Decode  
Read  
literal ‘k’  
Process  
Data  
Write to  
W
Example 1:  
SUBLW 0x02  
Words:  
Cycles:  
1
1
Before Instruction  
W
C
=
=
1
?
Q Cycle Activity:  
Q1  
Q2  
Q3  
Q4  
After Instruction  
Decode  
Read  
register ‘f’  
Process  
Data  
Write to  
destination  
W
C
Z
=
1
=
=
=
1
0
0
; result is positive  
Example 1:  
SUBWF REG  
N
Before Instruction  
Example 2:  
SUBLW 0x02  
REG  
W
C
=
=
=
3
2
?
Before Instruction  
W
C
=
=
2
?
After Instruction  
REG  
W
C
Z
N
=
1
2
1
0
0
After Instruction  
=
=
=
=
W
C
Z
=
0
; result is positive  
=
=
=
1
1
0
; result is zero  
N
Example 2:  
Before Instruction  
SUBWF REG, W  
Example 3:  
Before Instruction  
SUBLW 0x02  
REG  
W
C
=
=
=
2
2
?
W
C
=
=
3
?
After Instruction  
After Instruction  
W
C
Z
=
FF ; (2’s complement)  
REG  
W
C
Z
N
=
2
0
=
=
=
0
0
1
; result is negative  
=
=
=
=
1
1
0
; result is zero  
N
Example 3:  
Before Instruction  
SUBWF REG  
REG  
W
C
=
=
=
0x01  
0x02  
?
After Instruction  
REG  
W
C
Z
N
=
0xFFh ; (2’s complement)  
0x02  
0x00 ; result is negative  
0x00  
0x01  
=
=
=
=
2010 Microchip Technology Inc.  
DS39616D-page 319  
 复制成功!