PIC16F688
RETFIE
Return from Interrupt
[ label ] RETFIE
None
RETLW
Return with Literal in W
Syntax:
Syntax:
[ label ] RETLW k
0 ≤ k ≤ 255
Operands:
Operation:
Operands:
Operation:
TOS → PC,
1 → GIE
k → (W);
TOS → PC
Status Affected:
Encoding:
None
Status Affected:
Encoding:
None
00
0000
0000
1001
11
01xx
kkkk
kkkk
Description:
Return from Interrupt. Stack is
POPed and Top-of-Stack (TOS) is
loaded in the PC. Interrupts are
enabled by setting Global
Interrupt Enable bit, GIE
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.
(INTCON<7>). This is a two-cycle
instruction.
Words:
Cycles:
Example
1
2
Words:
Cycles:
Example
1
CALL TABLE;W contains table
2
;offset value
RETFIE
•
•
•
;W now has table value
TABLE
After Interrupt
PC = TOS
ADDWF PC ;W = offset
RETLW k1 ;Begin table
GIE =
1
RETLW k2
;
•
•
•
RETLW kn ; End of table
Before Instruction
W
=
0x07
After Instruction
W
=
value of k8
RETURN
Return from Subroutine
Syntax:
[ label ] RETURN
None
Operands:
Operation:
TOS → PC
Status Affected: None
Description: Return from subroutine. The stack
is POPed and the top of the stack
(TOS) is loaded into the program
counter. This is a two-cycle
instruction.
2004 Microchip Technology Inc.
Preliminary
DS41203B-page 125