
A BCPL Native System for 386/486/Pentium based machines
and the DEC Alpha (64-bit implementation)

This directory contain a version of a BCPL system that compiles into
native assembly language. It currently has codegenerators for Intel
based machines running under Linux and the DEC Alpha.  It uses simple
codegenerators (cvsial386, cvsialalpha) that translate an experimental
internal assembly language (Sial) into assembly language. It should be
possible to modify these codegemerators for other architectures. Such
a translation should take no more than 3 days. Native code runs about
ten times faster that the interpretive version.

The native distribution of BCPL is part of the standard bcpl distribution
contained in the file bcpl.tgz (or bcpl.zip). Under Linux, bcpl.tgz should
be placed in the directory BCPL and extracted by the command:

      tar zxvf bcpl.tgz

This will create and fill the directories

      BCPL/cintcode
&
      BCPL/bcplprogs
&
      BCPL/natbcpl

Ensure that both shell variables PATH and BCPLPATH include the
cintcode directory (..../BCPL/cintcode).

First ensure the BCPL Cintcode system is properly installed. To do
this change to the cintcode directory, possibly edit Makefile for the
architecture, and then type make.

    cd ..../BCPL/cintcode
    <edit Makefile to suite your system - the default is Linux>
    make

This should recompile the BCPL Cintcode system, a program called

        cinterp

The above 'make' will actually start 'cinterp using

        ./cinterp

just in case you don't have the current directory, '.', in your search
path,   and then proceed to compile standard commands within 'cinterp'
by automatically running the 2 CINTERP commands

        c compall
        logout

This generates a lot of output.

If you need to, you can get out of the BCPL Cintcode system by typing
CTRL-C, or 'logout' if you have a prompt, probably something like '0>'.

Now enter the directory BCPL/natbcpl, possibly edit Makefile for the
architecture and libhdr for the Manifest constant B2Wsh (=2 or =3) for
32 bit or 64 bit machines, respectively, and then type make. (This
only works under Linux (possibly Cygwin) and the DEC ALPHA at the
moment)

   cd ../natbcpl
   <edit Makefile and libhdr>
   make vclean
   make

This will build the native BCPL system and compile and run some
example programs.

This native code version of BCPL has just been revised and improved
incorporating many suggestions made by Colin Liebenrood.


Martin Richards                      http://www.cl.cam.ac.ul/users/mr/
22 April 2004                        mr@cl.cam.ac.uk

