PIC16F5X
MOVWF
Move W to f
OPTION
Load OPTION Register
Syntax:
[ label ] OPTION
None
Syntax:
[ label ] MOVWF
0 ≤ f ≤ 31
f
Operands:
Operation:
Operands:
Operation:
(W) → OPTION
(W) → (f)
Status Affected: None
Status Affected: None
Encoding:
0000
0000
0010
Encoding:
0000
001f
ffff
Description:
The content of the W register is
loaded into the Option register.
Description:
Move data from the W register to
register ‘f’.
Words:
1
Words:
1
Cycles:
Example:
1
Cycles:
Example:
1
OPTION
MOVWF TEMP_REG
Before Instruction
Before Instruction
TEMP_REG = 0xFF
W
=
0x07
0x07
After Instruction
OPTION
W
=
0x4F
=
After Instruction
TEMP_REG = 0x4F
0x4F
W
=
RETLW
Return with Literal in W
NOP
No Operation
Syntax:
[ label ] RETLW k
0 ≤ k ≤ 255
Syntax:
[ label ] NOP
None
Operands:
Operation:
Operands:
Operation:
k → (W);
TOS → PC
No operation
Status Affected: None
Status Affected: None
Encoding:
Description:
Words:
0000
0000
0000
Encoding:
1000
kkkk
kkkk
No operation.
Description:
The W register is loaded with the
eight-bit literal ‘k’. The program
counter is loaded from the top of
the stack (the return address). This
is a two-cycle instruction.
1
Cycles:
1
Example:
NOP
Words:
1
2
Cycles:
Example:
CALL TABLE;W contains
;table offset
;value.
•
•
•
;W now has table
;value.
TABLE
ADDWF PC ;W = offset
RETLW k1 ;Begin table
RETLW k2
;
•
•
•
RETLW kn ; End of table
Before Instruction
W
=
=
0x07
After Instruction
W
value of k8
© 2007 Microchip Technology Inc.
DS41213D-page 49