PIC16C925/926
RETFIE
Return from Interrupt
Syntax:
Operands:
Operation:
Status Affected:
[ label ] RETFIE
None
TOS → PC,
1 → GIE
None
Encoding:
00
0000 0000 1001
Description:
Words:
Cycles:
Return from Interrupt. Stack is POPed
and Top-of-Stack (TOS) is loaded in
the PC. Interrupts are enabled by set-
ting Global Interrupt Enable bit, GIE
(INTCON<7>). This is a two-cycle
instruction.
1
2
Q Cycle Activity:
Q1
Q2
Q3
Q4
1st Cycle Decode No Set the Pop from
Operation GIE bit the Stack
2nd Cycle No
No
No
No
Operation Operation Operation Operation
Example
RETFIE
After Interrupt:
PC = TOS
GIE = 1
RETLW
Return with Literal in W
Syntax:
Operands:
Operation:
Status Affected:
[ label ] RETLW k
0 ≤ k ≤ 255
k → (W);
TOS → PC
None
Encoding:
11
01xx kkkk kkkk
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.
Words:
1
Cycles:
2
Q Cycle Activity:
Q1
Q2
Q3
Q4
1st Cycle
Decode
Read
literal ’k’
No
Operation
Write to W,
Pop from
the Stack
2nd Cycle No
No
No
No
Operation Operation Operation Operation
Example
CALL TABLE ;W contains table
;offset value
;W now has table value
•
•
TABLE ADDWF PC
RETLW k1
RETLW k2
•
•
•
RETLW kn
Before Instruction:
W = 0x07
;W = offset
;Begin table
;
; End of table
After Instruction:
W = value of k8
DS39544A-page 126
Preliminary
2001 Microchip Technology Inc.