Skip to content

Instantly share code, notes, and snippets.

@seaneshbaugh
Last active November 1, 2018 16:50
Show Gist options
  • Select an option

  • Save seaneshbaugh/e09abd748ccc07c5463f253df97e4de8 to your computer and use it in GitHub Desktop.

Select an option

Save seaneshbaugh/e09abd748ccc07c5463f253df97e4de8 to your computer and use it in GitHub Desktop.
Instructions for getting up and running with BCPL

Download the BCPL source code.

$ wget http://www.cl.cam.ac.uk/users/mr/BCPL/bcpl.tgz

Unpack the BCPL source code.

$ tar -xf bcpl.tgz

Go to the BCPL source code directory.

$ cd BCPL/cintcode

If you're on OS X open up the Makefile in your preferred text editor and uncomment lines 190 and 191 so that they look like this:

CC = gcc -O4 -m32 -DforMacOSX
ENDER = litender

Set the BCPLROOT, PATH, BCPLPATH, and BCPLHDRS environment variables. Note: This step will need to be done every time you intend to use BCPL. Alternatively you can set this in your shell's initialization file. The below commands assume you're still in the BCPL/cintcode directory.

$ EXPORT BCPLROOT=`pwd`
$ EXPORT PATH=$PATH:$BCPLROOT/bin
$ EXPORT BCPLPATH=$BCPLROOT/cin
$ EXPORT BCPLHDRS=$BCPLROOT/g

Run the make clean command.

$ make clean

Run the make command.

$ make

To run a BCPL source file:

$ cintsys

BCPL 32-bit Cintcode System (21 Oct 2015)
0.000> c b helloworld
bcpl helloworld.b to helloworld hdrs BCPLHDRS t32

BCPL (10 Oct 2014) with simple floating point
Code size =    80 bytes of 32-bit little ender Cintcode
0.027> helloworld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment