|
PIC18F4680 Datasheet, PDF (406/484 Pages) Microchip Technology – Enhanced Flash Microcontrollers with ECAN Technology, 10-Bit A/D and nanoWatt Technology | |||
|
◁ |
PIC18F2585/2680/4585/4680
25.2.2 EXTENDED INSTRUCTION SET
ADDFSR
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Q1
Decode
Add Literal to FSR
ADDFSR f, k
0 ⤠k ⤠63
f â [ 0, 1, 2 ]
FSR(f) + k â FSR(f)
None
1110 1000 ffkk kkkk
The 6-bit literal âkâ is added to the
contents of the FSR specified by âfâ.
1
1
Q2
Read
literal âkâ
Q3
Process
Data
Q4
Write to
FSR
Example:
ADDFSR 2, 23h
Before Instruction
FSR2 =
After Instruction
FSR2 =
03FFh
0422h
ADDULNK
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Add Literal to FSR2 and Return
ADDULNK k
0 ⤠k ⤠63
FSR2 + k â FSR2,
PC = (TOS)
None
1110 1000 11kk kkkk
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.
1
2
Q Cycle Activity:
Q1
Decode
No
Operation
Q2
Read
literal âkâ
No
Operation
Q3
Process
Data
No
Operation
Q4
Write to
FSR
No
Operation
Example:
ADDULNK 23h
Before Instruction
FSR2 =
PC
=
TOS =
After Instruction
FSR2 =
PC
=
TOS =
03FFh
0100h
02AFh
0422h
02AFh
TOS â 1
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).
DS39625B-page 404
Preliminary
 2004 Microchip Technology Inc.
|
▷ |