English
Language : 

PIC18CXX2_13 Datasheet, PDF (216/304 Pages) Microchip Technology – High Performance Microcontrollers with 10-bit A/D
PIC18CXX2
POP
Pop Top of Return Stack
Syntax:
Operands:
Operation:
Status Affected:
[ label ] POP
None
(TOS)  bit bucket
None
Encoding:
0000 0000 0000 0110
Description:
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.
This instruction is provided to
enable the user to properly manage
the return stack to incorporate a
software stack.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1
Q2
Decode
No
operation
Q3
POP TOS
value
Q4
No
operation
Example:
POP
GOTO
NEW
Before Instruction
TOS
= 0031A2h
Stack (1 level down)= 014332h
After Instruction
TOS
PC
= 014332h
= NEW
PUSH
Push Top of Return Stack
Syntax:
Operands:
Operation:
Status Affected:
[ label ] PUSH
None
(PC+2)  TOS
None
Encoding:
0000 0000 0000 0101
Description:
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.
Words:
1
Cycles:
1
Q Cycle Activity:
Q1
Q2
Q3
Q4
Decode
PUSH PC+2
onto return
stack
No
operation
No
operation
Example:
PUSH
Before Instruction
TOS
PC
= 00345Ah
= 000124h
After Instruction
PC
= 000126h
TOS
= 000126h
Stack (1 level down) = 00345Ah
DS39026D-page 216
 1999-2013 Microchip Technology Inc.