PIC18C242 MICROCHIP [Microchip Technology], PIC18C242 Datasheet - Page 228

no-image

PIC18C242

Manufacturer Part Number
PIC18C242
Description
High-Performance Microcontrollers with 10-Bit A/D
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18C242-I/SO
Manufacturer:
MICROCHIP
Quantity:
2 000
Part Number:
PIC18C242/JW
Manufacturer:
NS
Quantity:
10
PIC18CXX2
SUBWF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
DS39026B-page 228
Decode
Q1
register ’f’
Subtract WREG from f
[ label ] SUBWF f,d,a
0
d
a
(f) – (WREG)
N,OV, C, DC, Z
Subtract WREG from register 'f'
(2’s complement method). If 'd' is
0, the result is stored in WREG. If
'd' is 1, the result is stored back in
register 'f' (default). 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 (default).
1
1
Read
Q2
0101
f
[0,1]
[0,1]
255
11da
Process
Data
Q3
dest
ffff
destination
Write to
Q4
ffff
Preliminary
SUBWF
Example 1:
Example 2:
Example 3:
Before Instruction
After Instruction
Before Instruction
After Instruction
Before Instruction
After Instruction
REG
WREG
C
REG
WREG
C
Z
N
REG
WREG
C
REG
WREG
C
Z
N
REG
WREG
C
REG
WREG
C
Z
N
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
Subtract WREG from f (cont’d)
SUBWF
SUBWF
SUBWF
3
2
?
1
2
1
0
0
2
2
?
2
0
1
1
0
1
2
?
FFh
2
0
0
1
7/99 Microchip Technology Inc.
; result is positive
; result is zero
;(2’s complement)
; result is negative
REG, 1, 0
REG, 0, 0
REG, 1, 0

Related parts for PIC18C242