MIT PDP-10 'Info' file converted to Hypertext 'html' format by Henry Baker

Previous Up Next

Stack instructions

The instructions PUSH and POP insert and remove full words in a pushdown list. The address of the top of the list is kept in the right half of the AC referenced by these instructions. The program may keep a control count in the left half of the AC. There are also two subroutine calling instructions (PUSHJ and POPJ) that use this same format pushdown list.
PUSH    C(AC)<-C(AC)+<1,,1>;  C(CR(AC))<-C(E)
The specified accumulator is incremented by adding 1 to each half (in the KI10 and KL10 carry out of the right half is suppressed). If, as result of the addition, the left half of the AC becomes positive, a pushdown overflow condition results (but the instruction procedes to completion). The word addressed by the effective address is fetched and stored on the top of the stack which is addressed by the right half of the (incremented) accumulator.
POP     C(E)<-C(CR(AC)); C(AC)<-C(AC)-<1,,1>
POP undoes PUSH as follows: the word at the top of the stack (addressed by the right half of the selected AC) is fetched and stored at the effective address. Then the AC is decremented by subtracting 1 from both halves (in the KI10 and KL10 carry out of bit 18 is suppressed). If the AC becomes negative as a result of the subtraction a pushdown overflow results.

Often the accumulator used as the pushdown pointer is given the symbolic name P. To initialize a pushdown pointer (e.g., for N words starting at PDLIST), one might do the following:

        MOVE P,[-N,,PDL-1]
Elsewhere in the program should appear:
PDL:    BLOCK   N
which defines the symbolic label PDL and reserves N words following it.