Microchip Technology DM163025-1 データシート
PIC18(L)F2X/45K50
DS30684A-page 448
2012 Microchip Technology Inc.
27.2.2
EXTENDED INSTRUCTION SET
ADDFSR
Add Literal to FSR
Syntax:
ADDFSR f, k
Operands:
0
k 63
f
[ 0, 1, 2 ]
Operation:
FSR(f) + k
FSR(f)
Status Affected:
None
Encoding:
1110
1000
ffkk
kkkk
Description:
The 6-bit literal ‘k’ is added to the
contents of the FSR specified by ‘f’.
contents of the FSR specified by ‘f’.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal ‘k’
Process
Data
Write to
FSR
Example:
ADDFSR 2, 23h
Before Instruction
FSR2
=
03FFh
After Instruction
FSR2
=
0422h
ADDULNK
Add Literal to FSR2 and Return
Syntax:
ADDULNK k
Operands:
0
k 63
Operation:
FSR2 + k
FSR2,
(TOS)
PC
Status Affected:
None
Encoding:
1110
1000
11kk
kkkk
Description:
The 6-bit literal ‘k’ is added to the
contents of FSR2. A RETURN is then
executed by loading the PC with the
TOS.
The instruction takes two cycles to
execute; a NOP is performed during
the second cycle.
This may be thought of as a special
case of the ADDFSR instruction,
where f = 3 (binary ‘11’); it operates
only on FSR2.
contents of FSR2. A RETURN is then
executed by loading the PC with the
TOS.
The instruction takes two cycles to
execute; a NOP is performed during
the second cycle.
This may be thought of as a special
case of the ADDFSR instruction,
where f = 3 (binary ‘11’); it operates
only on FSR2.
Words:
1
Cycles:
2
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read
literal ‘k’
Process
Data
Write to
FSR
No
Operation
No
Operation
No
Operation
No
Operation
Example:
ADDULNK 23h
Before Instruction
FSR2
=
03FFh
PC
=
0100h
After Instruction
FSR2
=
0422h
PC
=
(TOS)
Note:
All PIC18 instructions may take an optional label argument preceding the instruction mnemonic for use in
symbolic addressing. If a label is used, the instruction syntax then becomes: {label} instruction argument(s).
symbolic addressing. If a label is used, the instruction syntax then becomes: {label} instruction argument(s).