
1996 Microchip Technology Inc.
Advance Information
DS40139A-page 45
PIC12C5XX
OPTION
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Load OPTION Register
[ label OPTION
None
(W)
→
OPTION
None
0000
0000
0010
The content of the W register is loaded
into the OPTION register.
1
1
Words:
Cycles:
Example
OPTION
Before Instruction
W
After Instruction
OPTION =
=
0x07
0x07
RETLW
Syntax:
Operands:
Operation:
Return with Literal in W
[ label RETLW k
0
≤
k
≤
255
k
→
(W);
TOS
→
PC
None
Status Affected:
Encoding:
Description:
1000
kkkk
kkkk
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
2
Words:
Cycles:
Example:
TABLE
CALL TABLE ;W contains
;table offset
;value.
;W now has table
;value.
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
RLF
Syntax:
Operands:
Rotate Left f through Carry
[ label RLF f,d
0
≤
f
≤
31
d
∈
[0,1]
See description below
C
Operation:
Status Affected:
Encoding:
Description:
0011
01df
ffff
The contents of register 'f' are rotated
one bit to the left through the Carry
Flag. If 'd' is 0 the result is placed in the
W register. If 'd' is 1 the result is stored
back in register 'f'.
Words:
Cycles:
Example:
Before Instruction
REG1
C
After Instruction
REG1
W
C
1
1
RLF
REG1,0
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
RRF
Syntax:
Operands:
Rotate Right f through Carry
[ label RRF f,d
0
≤
f
≤
31
d
∈
[0,1]
See description below
C
Operation:
Status Affected:
Encoding:
Description:
0011
00df
ffff
The contents of register 'f' are rotated
one bit to the right through the Carry
Flag. If 'd' is 0 the result is placed in the
W register. If 'd' is 1 the result is placed
back in register 'f'.
Words:
Cycles:
Example:
Before Instruction
REG1
C
After Instruction
REG1
W
C
1
1
RRF
REG1,0
=
=
1110 0110
0
=
=
=
1110 0110
0111 0011
0
C
register 'f'
C
register 'f'