15
15 – 85
MISC
STACK CONTROL
TOPPCSTACK
A special version of the Register-to-Register Move instruction, Type 17, is provided
for reading (and popping) or writing (and pushing) the top value of the PC stack.
The normal POP PC instruction does not save the value popped from the stack, so to
save this value into a register you must use the following special instruction:
reg
=
TOPPCSTACK;
{pop PC stack into reg}
{“toppcstack” may also be lowercase}
The PC stack is also popped by this instruction, after a one-cycle delay. A NOP
should usually be placed after the special instruction, to allow the pop to occur
properly:
reg
=
TOPPCSTACK;
NOP;
{allow pop to occur correctly}
There is no standard PUSH PC stack instruction. To push a specific value onto the
PC stack, therefore, use the following special instruction:
TOPPCSTACK
=
reg;
{push reg contents onto PC stack}
The stack is pushed immediately, in the same cycle.
Note that “TOPPCSTACK” may not be used as a register in any other instruction type!
Examples:
AX0
=
TOPPCSTACK;
{pop PC stack into AX0}
NOP;
TOPPCSTACK
=
I7;
{push contents of I7 onto PC stack}
Only the following registers may be used in the special TOPPCSTACK instructions:
ALU, MAC, & Shifter Registers
DAG Registers
AX0
AR
SI
I0
I4
M0
M4
L0
L4
AX1
MR0
SE
I1
I5
M1
M5
L1
L5
MX0
MR1
SR0
I2
I6
M2
M6
L2
L6
MX1
MR
SR1
I3
I7
M3
M7
L3
L7
AY0
AY1
MY0
MY1
There are several restrictions on the use of the special TOPPCSTACK instructions;
they are described in Chapter 3, Program Control.
(instruction continues on next page)