[TUHS] PDP-11 MARK (was: Early Unix function calls: expensive?)

Greg 'groggy' Lehey grog at lemis.com
Wed Jan 6 09:04:40 AEST 2016


On Tuesday,  5 January 2016 at 21:35:47 +0100, Johnny Billquist wrote:
> On 2016-01-05 18:43, Ronald Natalie<ron at ronnatalie.com> wrote:
>>
>> Just never figured out how to make good use of the MARK instruction on the PDP-11.
>
> Not surprising. As others noted, few ever did. And apparently none
> responding actually do either.
>
> It *is* a stupid instruction in many ways. And it's not for multiple
> returns either.
>
> It's an odd way of handling stack cleanup without a frame pointer.

Thanks for the (omitted) explanation.  At first sight, the instruction
almost seems to make sense for functions with a variable number of
parameters, but of course there are simpler ways to do it.

I wonder if this is a case of "it sounded like a good idea at the
time" (when the instruction set was being designed), and it took a
while for people to realize that it wasn't of any use.

I recall a similar issue with the Siemens 306, their first stack-based
machine, round about 1975.  They had function call and return
instructions which manipulated the stack pointer, but it seemed that
nobody used them: they didn't work.  From memory, the call instruction
incremented the stack pointer and stored PC.  The return call
instruction decemented the stack pointer and loaded PC--from the wrong
location.

I never used the 306 myself, but I often wondered if they modified one
of the instructions to DTRT.

Greg
--
Sent from my desktop computer.
Finger grog at FreeBSD.org for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft MUA reports
problems, please read http://tinyurl.com/broken-mua
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20160106/691b97e6/attachment.sig>


More information about the TUHS mailing list