From: Tom Teixeira <tjteixeira@earthlink.net>
To: tuhs@tuhs.org
Subject: [TUHS] Re: What is the intermediate code generated by the bc interpreter?
Date: Sun, 11 May 2025 11:06:19 -0400 [thread overview]
Message-ID: <b6474b40-25ed-4a09-91ab-9dcb0a2ac0e5@earthlink.net> (raw)
In-Reply-To: <CAFmyUGFcRSN6=d5EngK85jdGBeE-F9VKgauwo-zVgAo0hzxyQg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]
On 5/11/25 6:28 AM, Jackson Helie G wrote:
> I checked Dennis M. Ritchie's "Users' Reference to B" and found an
> example of implementing a B program at the bottom of the manual. It
> said that bc generates intermediate code suitable for ba, and then ba
> generates assembly code. So, I am curious about what the intermediate
> code generated by bc is?
I found this reference
(https://www.softwarepreservation.org/projects/BCPL/cambridge/Richards-Bootstrapping_BCPL-1973.pdf)
written by Martin Richards about the intermediate code of BCPL. I never
saw or used B, but this is one possibility.
But it seems very different from C compilers prior to the Portable C
Compiler, even though code generation was table driven
(https://wolfram.schneider.org/bsd/7thEdManVol2/ctour/ctour.html).
Note, before the RTS group at Project MAC started using UNIX, we had a
home-written operating system for PDP-11/45 and PDP-11/70. I got a BCPL
compiler from somewhere and made some enhancements - such as direct
support for external variables and routines using a linker rather than
the pure BCPL global array. When RTS got access to a VAX-11/780 running
VMS, I was able to modify the Sixth or Seventh edition C compiler to
generate code for the VAX-11/780 and wrote enough of a compatibility
library to port various C programs to VMS. All that vanished once we
were able to install 4BSD on the VAX-11/780. The machine was shared by
the people doing the NIL project (New Implementation of LISP) on the
VAX. I don't remember the details, but this paper coauthored by Guy
Steele (https://www.dreamsongs.com/Files/HOPL2-Uncut.pdf) implies that
NIL shifted their efforts to a different target machine: "In 1978,
Gabriel and Guy Steele set out to implement NIL [Brooks, 1982a] on the
S-1 Mark IIA, a supercomputer being designed and built by the Lawrence
Livermore National Laboratory [Correll, 1979; Hailpern, 1979]."
[-- Attachment #2: Type: text/html, Size: 2967 bytes --]
next prev parent reply other threads:[~2025-05-11 15:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-11 10:28 [TUHS] " Jackson Helie G
2025-05-11 15:06 ` Tom Teixeira [this message]
2025-05-12 6:26 ` [TUHS] " Thalia Archibald via TUHS
2025-05-12 7:14 ` Angelo Papenhoff
2025-05-12 8:10 ` Thalia Archibald via TUHS
2025-05-12 15:21 ` Sebastien F4GRX
2025-05-12 10:58 Noel Chiappa
2025-05-12 13:38 ` Lars Brinkhoff
2025-05-12 13:42 ` Al Kossow
2025-05-12 14:52 ` Tom Teixeira
2025-05-12 15:09 ` arnold
2025-05-12 17:03 ` Lars Brinkhoff
2025-05-12 16:21 Noel Chiappa
2025-05-13 21:58 ` Clem Cole
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b6474b40-25ed-4a09-91ab-9dcb0a2ac0e5@earthlink.net \
--to=tjteixeira@earthlink.net \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).