On Monday, 27 March 2017 at 6:49:30 +1100, Dave Horsfall wrote:
And as for subroutine calls on the -8, let's not go there... As I dimly
recall, it planted the return address into the first word of the called
routine and jumped to the second instruction; to return, you did an
indirect jump to the first word. Recursion? What was that?
This was fairly typical of the day. I've used other machines (UNIVAC,
Control Data) that did the same. Later models added a second call
method that stored the return address in a register instead, only
marginally easier for recursion.
At Uni I was given a relatively simple task to do in PDP-8 assembler:
a triple precision routine (36 bits!) to clip a value to ensure it
stayed between two limits. Simple, eh? Not on the PDP-8. Three
parameters, each three words long. only one register, no index
registers. I didn't finish it. Revisiting now, I still don't know
how to do it elegantly. How *did* the PDP-8 pass parameters?
Greg
--
Sent from my desktop computer.
Finger grog(a)lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read
http://lemis.com/broken-MUA