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

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
SUBFWB
Example 1:
Example 2:
Example 3:
7/99 Microchip Technology Inc.
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
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
SUBFWB
SUBFWB
SUBFWB
3
2
1
FF
2
0
0
1
2
5
1
2
3
1
0
0
1
2
0
0
2
1
1
0
; result is negative
; result is positive
; result is zero
REG, 1, 0
REG, 0, 0
REG, 1, 0
Preliminary
SUBLW
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example 1:
Example 2:
Example 3:
Before Instruction
After Instruction
Before Instruction
After Instruction
Before Instruction
After Instruction
Decode
WREG
C
WREG
C
Z
N
WREG
C
WREG
C
Z
N
WREG
C
WREG
C
Z
N
Q1
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
literal ’k’
Subtract WREG from literal
[ label ] SUBLW k
0
k – (WREG)
N,OV, C, DC, Z
WREG is subtracted from the
eight bit literal 'k'. The result is
placed in WREG.
1
1
SUBLW
SUBLW
SUBLW
Read
Q2
0000
1
?
1
1
0
0
2
?
0
1
1
0
3
?
FF
0
0
1
k
PIC18CXX2
255
; (2’s complement)
0x02
0x02
0x02
; result is positive
; result is negative
1000
; result is zero
Process
Data
Q3
DS39026B-page 227
WREG
kkkk
Write to
WREG
Q4
kkkk

Related parts for PIC18C242