By the time I got within touching distance of any computer the era of the PDPs were long over. I have learned from John Skaller that they could exchange control between two stack frames in a single assembly instruction. "Exchange Jump" is what I think it was called. You will have to search the assembly manual for PDP-11 for more. Wikipedia has some details http://en.wikipedia.org/wiki/Coroutine#Implementations_in_as... But I am sure there are HN readers who can speak with way more authority and exhaustiveness than the wikipedia page and can probably point find you a PDP-11 manual. I think you will find this thread interesting http://permalink.gmane.org/gmane.org.user-groups.linux.tolug...
Quoting the most interesting bits from that thread, (although I urge you to read the original):
Of the many styles of subroutine calls on the PDP-10, JSP ac,addr is the fastest,
as it's the only one that doesn't require a memory store.
Its ISP is something like:
ac = PC
PC = effective address [addr in the usual case]
The subroutine return, of course, is:
JRST (ac)
Here, the efective address is the contents of the register.
The coroutine instruction combined the two:
JSP ac,(ac)
This essentially exchanged the PC with ac.
Hi srean - thanks for that recap.
I just did some more digging on this and tried to understand the assembly versions of coroutines. They were very spartan. It was just: POP the next address from the stack into TEMP, PUSH the current PC, then set the PC to TEMP. Notice that there isn't any linking or parameter passing.
Overall, it has been fun reading on all the variants of this idea.
side note: in my first job, there were a few PDP-11s in the lab that I was responsible for. We never turned them on though.
Also, the PDP 10, which you mention above, was one of the most revered machines by hackers.
Quoting the most interesting bits from that thread, (although I urge you to read the original):