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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17542 invoked from network); 23 Jun 2023 14:01:38 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 23 Jun 2023 14:01:38 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 7980240BDF; Sat, 24 Jun 2023 00:01:34 +1000 (AEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by minnie.tuhs.org (Postfix) with ESMTPS id AE33E40BD9 for ; Sat, 24 Jun 2023 00:01:25 +1000 (AEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E830A5C0134 for ; Fri, 23 Jun 2023 10:01:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 23 Jun 2023 10:01:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=papnet.eu; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1687528884; x=1687615284; bh=v4 hOyDrAZbIxq+QtbDWG3y9ju1wiTFdrLQ+u6WS8qBE=; b=SLYGj0hn1YSVm8wXcU 7TO3WGrQMRotAQWCPXZhYPjHzTa7SxRoHtAcvodbvqCSMc1t2TTzzWSqIqUYNPO/ F0WrFk+IbLqQ5CRnM5S/9OL3LtPfeZlSlo7/F0T8J4dRF/WSOhpI9WG1IZkEGcnu v+qW/yjBQ1AhF95GOiGVf/EBbof7jl+zpGuNr1VLDqVNMAh2S75iv6eKgdYI4k5H voM5gOnwRVudhHE/adMl7TGYZoRf+1RGpQUEXE6waAquLqAQdX28nNuAhc8gMABB PWXIVxMoPu3mrs9QkYG0cmg43GZFV1QoCrbggO0EAZOaYdoB4HBFAqIVajG7XvHV QLmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687528884; x=1687615284; bh=v4hOyDrAZbIxq +QtbDWG3y9ju1wiTFdrLQ+u6WS8qBE=; b=L1c47RLG6TxBXGJUcmIHy118zkTUW /b4rqLrYgYWed2p5MFlledMOg+DqOP5xfD5N2yhtBdcNM37NVBQxIs5c/DAuT4HH fc6aPQ7bQCVpQDaf5kWdL+hsFhmFHyPz9bs3K4XDy8j6t7Symb3rmpBfoW+QCPOG 6dMtrT9dOqqXr0PJ1Aw8IccSGfOm94TxXnm30OUpwTYBvEbk2qHNnzqxpRE/AaxI 6ybNKW6481JRU0o3wu/UQXYH8OyoxRA+8aQW48DRiEuSqLWaRRbDn/jKd0hFMm4s eByKSrjN86EUIDC7NoYi8S56+rG4kL9cY1ZDHh6mRFAbHjTR61bq/Oynw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeeggedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomheptehnghgvlhhoucfrrghpvghnhhhofhhfuceorggrphesphgr phhnvghtrdgvuheqnecuggftrfgrthhtvghrnhepieekhffgfeejteekgfevudefudelhf dtgeeiveefieefkefhveelvdethfeukeeknecuffhomhgrihhnpehgihhthhhusgdrtgho mhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrg hpsehprghpnhgvthdrvghu X-ME-Proxy: Feedback-ID: i47c14439:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 23 Jun 2023 10:01:23 -0400 (EDT) Date: Fri, 23 Jun 2023 16:01:21 +0200 From: Angelo Papenhoff To: tuhs@tuhs.org Message-ID: References: <1e651370-3ada-e211-c277-409d6563500d@f4grx.net> <202306080331.3583Vrw7057546@ultimate.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Message-ID-Hash: 5YNMYV75UK56ZGCPBV3ZTYF2DU3F3L5A X-Message-ID-Hash: 5YNMYV75UK56ZGCPBV3ZTYF2DU3F3L5A X-MailFrom: aap@papnet.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: Software written in B List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 23/06/23, Sebastien F4GRX wrote: > For my information, where are the initialization values for the > ctab[128] vector coming from? Probably some mix between last1120c and what made sense to me. Actually found a bug in my compiler related to this, will have to check my earlier (tree) compiler for this too. > Do you still have the version that generates a tree before codegen? https://github.com/aap/b/blob/master/bc.b > I know that generating code while parsing is possible for stack based > machines, this is also how Crenshaw describes it in its document (but > for 68k). What I found somewhat difficult and why i opted for the tree-approach was mainly handling lvalues (but also conditional operators get a bit easier). If you have 'x = y', the compiler is supposed to generate va; 1 / lval of x a; 2 / rval of y b1 / = but when you pop the = it's already too late to change the 'a' to a 'va'. So my solution was to remember one operator of output so i can combine it with the next one. I'm still not entirely happy with it (the build() function especially), but it doesn't seem entirely wrong and does generate matching B code. Still, if people have suggestions how to do this better, I'd love to get some feedback on this. aap