PIC18CXX2
POP
Pop Top of Return Stack
PUSH
Push Top of Return Stack
[ label ] PUSH
None
Syntax:
[ label ] POP
None
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Operands:
Operation:
Status Affected:
Encoding:
Description:
(TOS) → bit bucket
None
(PC+2) → TOS
None
0000
0000
0000
0110
0000
0000
0000
0101
The TOS value is pulled off the
return stack and is discarded. The
TOS value then becomes the previ-
ous value that was pushed onto the
return stack.
The PC+2 is pushed onto the top of
the return stack. The previous TOS
value is pushed down on the stack.
This instruction allows to implement
a software stack by modifying TOS,
and then push it onto the return
stack.
This instruction is provided to
enable the user to properly manage
the return stack to incorporate a
software stack.
Words:
Cycles:
1
1
Words:
Cycles:
1
1
Q Cycle Activity:
Q1
Q2
Q3
Q4
Q Cycle Activity:
Q1
Decode
PUSH PC+2
onto return
stack
No
operation
No
operation
Q2
Q3
Q4
Decode
No
operation
POP TOS
value
No
operation
PUSH
Example:
POP
GOTO
Example:
Before Instruction
NEW
TOS
PC
=
=
00345Ah
000124h
Before Instruction
TOS
=
0031A2h
After Instruction
Stack (1 level down)= 014332h
PC
=
=
000126h
000126h
TOS
After Instruction
Stack (1 level down)= 00345Ah
TOS
PC
=
=
014332h
NEW
DS39026B-page 220
Preliminary
7/99 Microchip Technology Inc.