PIC18F2331/2431/4331/4431
LFSR
Load FSR
MOVF
Move f
Syntax:
[ label ] LFSR f,k
Syntax:
[ label ] MOVF f [,d [,a]]
Operands:
0 f 2
0 k 4095
Operands:
0 f 255
d [0,1]
a [0,1]
Operation:
k FSRf
Operation:
f dest
Status Affected:
Encoding:
None
Status Affected:
Encoding:
N, Z
1110
1111
1110
0000
00ff
k kkk
k kkk
11
kkkk
0101
00da
ffff
ffff
7
Description:
The 12-bit literal ‘k’ is loaded into the
file select register pointed to by ‘f’.
Description:
The contents of register, ‘f’, are moved
to a destination dependent upon the
status of ‘d’. If ‘d’ is ‘0’, the result is
placed in W. If ‘d’ is ‘1’, the result is
placed back in register, ‘f’. Location, ‘f’,
can be anywhere in the 256-byte bank.
If ‘a’ is ‘0’, the Access Bank will be
selected, overriding the BSR value. If
‘a’ = 1, then the bank will be selected as
per the BSR value.
Words:
Cycles:
2
2
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
Read literal
‘k’ MSB
Process
Data
Write
literal ‘k’
MSB to
FSRfH
Decode
Read literal
‘k’ LSB
Process
Data
Write literal
‘k’ to FSRfL
Words:
Cycles:
1
1
Q Cycle Activity:
Q1
Example:
LFSR 2, 0x3AB
Q2
Q3
Q4
After Instruction
FSR2H
Decode
Read
register ‘f’
Process
Data
Write
W
=
=
0x03
0xAB
FSR2L
Example:
MOVF
REG, W
0x22
Before Instruction
REG
W
=
=
0xFF
After Instruction
REG
W
=
=
0x22
0x22
2010 Microchip Technology Inc.
DS39616D-page 307