From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23019 invoked from network); 26 Aug 2020 15:42:22 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 26 Aug 2020 15:42:22 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id BE0D19CA39; Thu, 27 Aug 2020 01:42:15 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id EE3E193D54; Thu, 27 Aug 2020 01:41:37 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=ccil-org.20150623.gappssmtp.com header.i=@ccil-org.20150623.gappssmtp.com header.b="ZIx4b4DI"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id DAB8493D54; Thu, 27 Aug 2020 01:41:34 +1000 (AEST) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by minnie.tuhs.org (Postfix) with ESMTPS id 1478793D49 for ; Thu, 27 Aug 2020 01:41:34 +1000 (AEST) Received: by mail-qk1-f176.google.com with SMTP id p25so2295739qkp.2 for ; Wed, 26 Aug 2020 08:41:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wOMY7cJNGHcOPTm+g63jpKStoWLo2trnFSrf3ITMlhY=; b=ZIx4b4DIS6MAtnUBWw9i42W4BxXz2An6T/mO7ayhZ3EtEfwuqQAM7frzf3MHY/n3D4 Kvvn4/Cjrg/eO6GmBKnGDK2Wf+4oncTdEDOktMwWpx5byoPSwPNqMg/LckdUWO4vE9C3 GkGnaLqlajRnCKjvuMLPhZ3IF4IV954KKv2kNy/iP68TWOLS1Ku6QF4gnKFWbIh4LRGM JYxyYuBGqTxrODNRWnJJQgiv2+jq4UHVL2Zw56Pg8wQJguaED3B35yiS9Fl0/DetlP77 UfvJFaxFWX3IQL80x6eO6LqO//w14DJZWaLSz4eAGwjHkh24mzLDDmgPvFw6nueiAQhb /9DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wOMY7cJNGHcOPTm+g63jpKStoWLo2trnFSrf3ITMlhY=; b=fGIQUA0vDuxkILLMlS4wNfgIekT/9qbfLq6+ZtmJ/9azZXBf6U4pUblA0P5NfKIdQx uDvxRukJnZeKEhsQpOmbvNldcOQyFOLUnngFNxNqX/fGpejdQa60uQg3pBz/CEW2dsem wxZxHSrww3TRcJ5QPhCPhvMe/CeDM4ECKqW+kZ6F8OMJVqgIYDb/M+B9Vx67fopQ3t2O vZX6hKwlYTa+UdwmU49he7oz6BbY1TE8mH225h0VsSH4gEmW/MKg1WPZzyMLJ7WhSdnV bPo5rUrDXoXRMZvCXbhPtTF36XGYj9kVrDc/PVX2UEciSxD8a/ExTUpSlAOELZ5ayYAF 7uTA== X-Gm-Message-State: AOAM533qHYIp7RqIbBBaqTBXHSYy4zaCOCgDzndLEQPm8zOgrG1FFprV cYr8R+XUhklMNHRRYRUAQMUGs4EQt4TQ8FuCQQD6mw== X-Google-Smtp-Source: ABdhPJzoJWVbB7pNrTZNBXys6bATkQDZWYZ/iRMrscpRrD/VHvA0C94OteU3HGTpEsD8mZ31crdPk12vGJHuXgFETew= X-Received: by 2002:a05:620a:6c3:: with SMTP id 3mr14225700qky.426.1598456492918; Wed, 26 Aug 2020 08:41:32 -0700 (PDT) MIME-Version: 1.0 References: <202008261324.07QDOxln046419@tahoe.cs.Dartmouth.EDU> In-Reply-To: <202008261324.07QDOxln046419@tahoe.cs.Dartmouth.EDU> From: John Cowan Date: Wed, 26 Aug 2020 11:41:21 -0400 Message-ID: To: Doug McIlroy Content-Type: multipart/alternative; boundary="0000000000007323f305adc9a7f7" Subject: Re: [TUHS] Memory management in Dennis Ritchie's C Compiler X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000007323f305adc9a7f7 Content-Type: text/plain; charset="UTF-8" On Wed, Aug 26, 2020 at 9:25 AM Doug McIlroy wrote: I hadn't heard this urban legend before. A stack is certainly > manageable without auto-increment/decrement (AID) instructions. Absolutely. I should have qualified my remarks by saying "when writing in assembly language", which was the universal language of all PDP-11 operating systems until Unix. VMS adopted Bliss (which is what C would be like if it had come to us through a different dharma line[*]) as its principal implementation language. > But when the stack contains > local variables that are accessed multiple times, the accesses > are offset from the stack pointer. Or the frame pointer, which has the advantage that the callee can push arbitrary stuff on the stack without having to explicitly account for it later, and the disadvantage that it ties up yet another register when they are in short supply. [*] Don't laugh too hard: you yourself have already been mythologized in precisely this fashion. See < http://www.catb.org/~esr/writings/unix-koans/two_paths.html> and < http://www.catb.org/~esr/writings/unix-koans/zealot.html>. John Cowan http://vrici.lojban.org/~cowan cowan@ccil.org Mark Twain on Cecil Rhodes: I admire him, I freely admit it, and when his time comes I shall buy a piece of the rope for a keepsake. --0000000000007323f305adc9a7f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Aug 26, 2020 at 9:25 AM Doug = McIlroy <doug= @cs.dartmouth.edu> wrote:

I hadn'= ;t heard this urban legend before. A stack is certainly
manageable without auto-increment/decrement (AID) instructions.

Absolutely.=C2=A0 I should have qualified my remarks = by saying "when writing in assembly language", which was the univ= ersal language of all PDP-11 operating systems until Unix.=C2=A0 VMS adopte= d Bliss (which is what C would be like if it had come to us through a diffe= rent dharma line[*]) as its principal implementation=C2=A0language.
=C2=A0
But wh= en the stack contains
local variables that are accessed multiple times, the accesses
are offset from the stack pointer.

Or the f= rame pointer, which has the advantage that the callee can push arbitrary st= uff on the stack without having to explicitly account for it later, and the= disadvantage that it ties up yet another register when they are in short s= upply.

[*] Don't laugh too hard: you yourself = have already been mythologized in precisely this fashion.=C2=A0 See <http:/= /www.catb.org/~esr/writings/unix-koans/two_paths.html> and <http://www.= catb.org/~esr/writings/unix-koans/zealot.html>.

=


John Cowan =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0http://vrici.lojban.org/~c= owan =C2=A0 =C2=A0 =C2=A0 =C2=A0cowan= @ccil.org
Mark Twain on Cecil Rhodes: I admire him, I freely admit i= t,
and when his time comes I shall buy a piece of the rope for a keepsak= e.

--0000000000007323f305adc9a7f7--