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-Boots…)
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]."