What does PUSHJ do? (was Re: was "C on the PDP-8 ... ")

vrs vrs at msn.com
Wed May 11 17:06:23 CDT 2005


> It was thus said that the Great Brad Parker once stated:
> >
> > heh.  I remember puzzling at the the "pushj"'s and "popj"'s in the FOCAL
> > source code.  This was before I had seen a pdp-11 or dec-10.
>
>   What does PUSHJ actually do?  I remember reading about it in Steven
Levy's
> Hackers, but never got what was so special about it.

PUSHJ does a CALL, using a software implementation of a stack, which allows
the target subroutine to be recursive.  JMS stores the return address in the
entry point, so it won't do (without help) for recursive routines.
(Similarly, POPJ is like RET.)

Both are quite odd, if you are used to the PDP-8 calling conventions, and
unfamiliar with stacks.  (Once you have used them for a while, they seem
obvious.)

    Vince



More information about the cctalk mailing list