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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31421 invoked from network); 27 Aug 2020 08:52:04 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 27 Aug 2020 08:52:04 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 31B1F9CAC3; Thu, 27 Aug 2020 18:51:57 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id C2AD89C9FE; Thu, 27 Aug 2020 18:51:12 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=planet.nl header.i=@planet.nl header.b="yTKyymzM"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 1BA9193D54; Thu, 27 Aug 2020 18:51:09 +1000 (AEST) X-Greylist: delayed 784 seconds by postgrey-1.36 at minnie.tuhs.org; Thu, 27 Aug 2020 18:51:04 AEST Received: from cpsmtpb-ews01.kpnxchange.com (cpsmtpb-ews01.kpnxchange.com [213.75.39.4]) by minnie.tuhs.org (Postfix) with ESMTP id 8624B93D49 for ; Thu, 27 Aug 2020 18:51:04 +1000 (AEST) Received: from cpsps-ews12.kpnxchange.com ([10.94.84.179]) by cpsmtpb-ews01.kpnxchange.com with Microsoft SMTPSVC(8.5.9600.16384); Thu, 27 Aug 2020 10:37:59 +0200 X-Brand: 7abm2Q== X-KPN-SpamVerdict: e1=0;e2=0;e3=0;e4=(e1=10;e3=10;e2=11;e4=10);EVW:Whi te;BM:NotScanned;FinalVerdict:Clean X-CMAE-Analysis: v=2.4 cv=b5oMXvKx c=1 sm=1 tr=0 ts=5f4770e7 cx=a_idp_e a=dZ5u/0G9QtS9WKCcNUBnHQ==:117 a=soxbC+bCkqwFbqeW/W/r+Q==:17 a=x1i13A_MHe4A:10 a=IkcTkHD0fZMA:10 a=y4yBn9ojGxQA:10 a=AoeSMSUmAAAA:8 a=gOdBnbtuAAAA:8 a=vjIlDdqUoGbHaDXfPugA:9 a=QEXdDO2ut3YA:10 a=IA4qIw_M-6cA:10 a=lvNDOE9i95YA:10 a=2UY7SMgi64q-0UtCmZ5F:22 a=P7UeQyBGz4biAeVHYFYK:22 X-CM-AcctID: kpn@feedback.cloudmark.com Received: from smtp.kpnmail.nl ([195.121.84.13]) by cpsps-ews12.kpnxchange.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384); Thu, 27 Aug 2020 10:37:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=planet.nl; s=planet01; h=to:date:message-id:subject:mime-version:content-type:from; bh=O6MnmdPwQNsBcLeMjn48ZH3yHm8AnFCGTdYTSfYRQDM=; b=yTKyymzM4GZaxpf4XkySao6gOj7lq0oV0IcRpNTViEkmVB1JzNduP6IgvMBKxzAILN3YDflJzZBhj mbbHRpGaTVqtWolVojUDUcxA59aV37/lUK4ZAY1xsfa5XHvM/WtgcoJk58ghKjEwEVi1QG3bCE5JMw Q8v8a0bbNyl2aHco= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|p4nCy3QgwXv2LqEwM/St9QnmCE6XVBz+dmLl86bqLKi2zJ54IdgOlC/e4boRXwg Cfi85sCkgLWUOOzNIR8Lhkg== X-Originating-IP: 80.101.112.122 Received: from mba2.fritz.box (sqlite.xs4all.nl [80.101.112.122]) by smtp.kpnmail.nl (Halon) with ESMTPSA id 9c971d52-e840-11ea-97ba-005056998788; Thu, 27 Aug 2020 10:37:59 +0200 (CEST) From: Paul Ruizendaal Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Message-Id: <91C9F0D7-181D-4677-AFCD-155D45858788@planet.nl> Date: Thu, 27 Aug 2020 10:37:58 +0200 To: TUHS main list X-Mailer: Apple Mail (2.3445.104.11) X-OriginalArrivalTime: 27 Aug 2020 08:37:59.0462 (UTC) FILETIME=[5E8CCC60:01D67C4D] X-RcptDomain: minnie.tuhs.org 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: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Doug, =E2=80=9CIn fact Dennis's compiler did not use AID instructions for that = purpose.=E2=80=9D Whilst local variables are indeed accessed as an offset from the base = pointer, I=E2=80=99m not sure that the above statement is correct. In = the V6 compiler (-sp) was certainly used to push arguments to the stack, = and when the register allocation overflowed, the interim results were = pushed to the stack as well with (-sp). See c10.c, the case CALL in rcexpr(), the function comarg() and sptab = (which is right at the end of table.s) Links: https://www.tuhs.org/cgi-bin/utree.pl?file=3DV6/usr/source/c/c10.c https://www.tuhs.org/cgi-bin/utree.pl?file=3DV6/usr/source/c/table.s For interim result pushing/popping I refer to the FS and SS macro=E2=80=99= s. Dennis discusses these in his =E2=80=9CA tour of the C compiler=E2=80=9D= paper. https://www.jslite.net/cgi-bin/9995/doc/tip/doc/old-ctour.pdf Of course this is all implementational detail, not a core design aspect = - as Richard Miller showed in his port to the Interdata architecture = (including a port of the Ritchie C compiler). Maybe the sentence should = have read: "In fact Dennis's compiler did not rely on having AID = instructions for that purpose." Paul @Warren: at moments like these I really like having the line highlight = feature that we discussed before Summer.