PIC16F785-I/P Microchip Technology Inc., PIC16F785-I/P Datasheet - Page 136

no-image

PIC16F785-I/P

Manufacturer Part Number
PIC16F785-I/P
Description
MCU, 8-Bit, 2KW Flash, 128 RAM, 18 I/O, DIP-20
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F785-I/P

A/d Inputs
12-Channel, 10-Bit
Comparators
2
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
17
Memory Type
Flash
Number Of Bits
8
Package Type
20-pin PDIP
Programmable Memory
3.5K Bytes
Ram Size
128 Bytes
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device
PIC16F785/HV785
DS41249D-page 134
SUBLW
Syntax:
Operands:
Operation:
Status
Affected:
Encoding:
Description:
SUBWF
Syntax:
Operands:
Operation:
Status
Affected:
Encoding:
Description:
SWAPF
Syntax:
Operands:
Operation:
Status
Affected:
Encoding:
Description:
Subtract W from f
[label]
0
d
(f) - (W)
C, DC, Z
00
Subtract (2’s complement method)
W register from register ‘f’. If ‘d’ is
‘0’, the result is stored in the W
register. If ‘d’ is ‘1’, the result is
stored back in register ‘f’.
C = 1; result is positive or zero
C = 0; result is negative
Subtract W from Literal
[label]
0
k - (W)
C, DC, Z
11
The W register is subtracted (2’s
complement method) from the
eight-bit literal ‘k’. The result is
placed in the W register.
C = 1; result is positive or zero
C = 0; result is negative
Swap Nibbles in f
[ label
]
0
d
(f<3:0>)
(f<7:4>)
None
00
The upper and lower nibbles of
register ‘f’ are exchanged. If ‘d’
is ‘0’, the result is placed in W
register. If ‘d’ is ‘1’, the result is
placed in register ‘f’.
f
k
[0,1]
f
[0,1]
127
255
127
SUBWF f,d
0010
SUBLW k
110x
W)
dest)
SWAPF f,d
1110
(dest<7:4>),
(dest<3:0>)
dfff
kkkk
dfff
ffff
kkkk
ffff
Preliminary
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example:
TRIS
XORLW
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Load TRIS Register
[ label ] TRIS
5
(W)
None
00
The instruction is supported for
code compatibility with the
PIC16C5X products. Since TRIS
registers are readable and
writable, the user can directly
address them.
1
1
To maintain upward compati-
bility with future PICmicro
products, do not use this
instruction.
Exclusive OR Literal with W
[label]
0
(W) .XOR. k
Z
11
The contents of the W register
are XOR’ed with the eight-bit
literal ‘k’. The result is placed
in the W register.
f
© 2006 Microchip Technology Inc.
k
6
TRIS register f;
255
0000
1010
XORLW k
f
0110
W)
kkkk
0fff
kkkk
®

Related parts for PIC16F785-I/P