16F84 MICROCHIP [Microchip Technology], 16F84 Datasheet - Page 64

no-image

16F84

Manufacturer Part Number
16F84
Description
18-pin Flash/EEPROM 8-Bit Microcontrollers
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
PIC16F8X
RETLW
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example
DS30430C-page 64
2nd Cycle
1st Cycle
TABLE
Return with Literal in W
[ label ]
0
k
TOS
None
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
CALL TABLE
ADDWF PC
RETLW k1
RETLW k2
RETLW kn
Before Instruction
After Instruction
No-Operat
Decode
Q1
11
ion
k
(W);
255
PC
W
W
RETLW k
No-Opera
literal 'k'
;W = offset
;Begin table
;
; End of table
01xx
Read
;W contains table
;offset value
Q2
tion
;W now has table value
=
=
0x07
value of k8
No-Opera
No-Opera
kkkk
Q3
tion
tion
Write to W,
No-Operat
the Stack
Pop from
kkkk
Q4
ion
RETURN
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Q Cycle Activity:
Example
2nd Cycle
1st Cycle
Return from Subroutine
[ label ]
None
TOS
None
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.
1
2
After Interrupt
No-Operat
RETURN
Decode
Q1
00
ion
1998 Microchip Technology Inc.
PC
PC =
RETURN
No-Opera
No-Opera
0000
Q2
tion
tion
TOS
No-Opera
No-Opera
0000
Q3
tion
tion
No-Opera
the Stack
Pop from
1000
Q4
tion

Related parts for 16F84