English
Language : 

PIC18F258 Datasheet, PDF (308/384 Pages) Microchip Technology – High Performance, 28/40-Pin Enhanced FLASH Microcontrollers with CAN
PIC18FXX8
POP
Pop Top of Return Stack
Syntax:
[ label ] POP
Operands:
None
Operation:
(TOS) → bit bucket
Status Affected: 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
Q3
Q4
Decode
No
POP TOS
No
operation
value
operation
Example:
POP
GOTO
Before Instruction
TOS
Stack (1 level down)
After Instruction
TOS
PC
NEW
= 0x0031A2
= 0x014332
= 0x014332
= NEW
PUSH
Push Top of Return Stack
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
[ label ] PUSH
None
(PC+2) → TOS
None
0000 0000 0000 0101
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 the user to
implement a software stack by
modifying TOS, and then push it
onto the return stack.
1
1
Q Cycle Activity:
Q1
Q2
Decode
PUSH PC+2
onto return
stack
Q3
No
operation
Q4
No
operation
Example:
PUSH
Before Instruction
TOS
PC
After Instruction
PC
TOS
Stack (1 level down)
= 0x00345A
= 0x000124
= 0x000126
= 0x000126
= 0x00345A
DS41159B-page 306
 2002 Microchip Technology Inc.