Short: A BCPL interpreter for Amiga Author: Martin Richards, Amiga port by Stefan Haubenthal Uploader: hauben00@marvin.informatik.uni-dortmund.de (Stefan Haubenthal) Type: dev/lang This is a kit for bringing up a BCPL compiler on any machine that has a C compiler. It is the INTCODE compiler kit written by Martin Richards, the inventor of BCPL. Briefly the steps are: 1. Write an interpreter for INTCODE. This has been done for you in C. As far as I know it runs on Unix (BSD flavour), MSDOS (using the Cware compiler) and CP/M (using the C80) compiler. There are also tuned assembly code versions of the interpreter for MSDOS and CP/M. Executables for MSDOS and CP/M are also provided. 2. Ensure that it runs properly by running it on some INTCODE programs like fact.int (factorial) or cgtest.int (code generator tester). 3. The bootstrap: This step is optional because you can keep on using the INTCODE versions of the compiler, but if you want to make any compiler modifications you have to pass this step. Using the INTCODE versions of the BCPL compiler passes: s.int (SYN), and c.int (CG, OCODE to INTCODE backend), recompile the BCPL source (syn.bpl, trn.bpl and cg.bpl) of the compiler passes. Yes, bootstrapping is a self-referential process. Note that the compiler will expect filenames in uppercase, hence the uppercase name links to the header files (*hdr.bpl). The file OPTIONS contains flags that control the behaviour of the passes. The option L7500 is required for the compiler to compiler itself. Then you will have to concatenate the INTCODE library stubs (icint.int) and utility routines (blib.int) to make an INTCODE "executable". The sources of the utility routines are in blib.bpl. The shell script "bcpl" automates these steps for making an INTCODE executable from BCPL source file. 4. You now can compile BCPL programs to your heart's content. If you're really ambitious, you can write a code generator from OCODE to assembly code. The program icint has some option flags. In brief: -pn sets the max program area size to n -gn sets the max global area size to n -s store a compact version of intcode in second file arg -l load a compact version of intcode from first file arg -u complain about unset globals -v verbose, more messages ============================= Archive contents ============================= Original Packed Ratio Date Time Name -------- ------- ----- --------- -------- ------------- 909 546 39.9% 22-Oct-91 15:56:58 bcpl.txt 448 241 46.2% 25-Jan-91 05:59:38 +bcpl 287 210 26.8% 22-Jan-97 21:23:30 +bcpl.rexx 2818 1138 59.6% 24-Mar-88 02:56:22 +blib.bpl 2539 1016 59.9% 24-Mar-88 02:57:30 +blib.int 18694 6955 62.7% 23-Mar-88 03:22:12 +booting.doc 16618 5501 66.8% 24-Mar-88 06:11:24 +c.int 14655 3515 76.0% 24-Mar-88 09:09:06 +cg.bpl 13637 4337 68.1% 24-Mar-88 02:58:24 +cg.int 5355 2492 53.4% 24-Mar-88 09:03:24 +CGHDR 5355 2492 53.4% 24-Mar-88 09:03:24 +cghdr.bpl 6893 2141 68.9% 30-Mar-88 04:35:32 +cgtest.bpl 12152 3828 68.4% 25-Jan-91 06:19:40 +cgtest.int 150 113 24.6% 24-Mar-88 04:10:18 +fact.bpl 3309 1416 57.2% 25-Jan-91 06:16:52 +fact.int 19708 11264 42.8% 18-Jan-97 13:02:56 +icint 10601 3390 68.0% 22-Jan-97 21:52:48 +icint.bpl 8636 2899 66.4% 03-Feb-91 06:11:14 +icint.c 13696 7387 46.0% 10-Oct-91 02:10:44 +icint.com 21789 7357 66.2% 23-Mar-88 03:21:32 +icint.doc 15872 8476 46.5% 04-Feb-91 14:43:08 +icint.exe 2047 808 60.5% 03-Feb-91 08:40:32 +icint.h 442 226 48.8% 24-Mar-88 03:17:48 +iclib.int 9322 2590 72.2% 01-Feb-91 00:32:52 +interp.asm 3760 1263 66.4% 05-Feb-91 00:14:42 +interp.c 4657 1539 66.9% 04-Feb-91 14:35:02 +interp.cware.c 1539 816 46.9% 23-Mar-88 03:23:42 +LIBHDR 180 101 43.8% 06-Feb-91 05:54:06 +Makefile 6 6 0.0% 29-Jan-91 01:45:02 +OPTIONS 2095 1020 51.3% 10-Oct-91 02:37:52 +README 49538 15409 68.8% 24-Mar-88 06:06:52 +s.int 284 173 39.0% 22-Jan-97 22:02:00 +SMakefile 3261 956 70.6% 03-Feb-91 11:49:48 +sub.c 28695 6584 77.0% 25-Jan-91 06:42:46 +syn.bpl 25190 8004 68.2% 25-Jan-91 06:59:46 +syn.int 1924 961 50.0% 25-Jan-91 06:42:14 +SYNHDR 1924 961 50.0% 25-Jan-91 06:42:14 +synhdr.bpl 23648 5007 78.8% 25-Jan-91 06:57:08 +trn.bpl 21492 6441 70.0% 25-Jan-91 06:58:06 +trn.int 2215 1091 50.7% 25-Jan-91 06:53:56 +TRNHDR 2215 1091 50.7% 25-Jan-91 06:53:56 +trnhdr.bpl 67 62 7.4% 22-Jan-97 21:58:18 CHANGES 11300 4811 57.4% 06-Dec-88 17:50:02 +bcpl.doc 4809 1421 70.4% 06-Dec-88 17:50:00 +bcpl.h 1916 894 53.3% 06-Dec-88 17:50:04 +bcpllib.c 1539 752 51.1% 06-Dec-88 17:50:00 +hello.c 2228 909 59.2% 06-Dec-88 17:50:04 +myendcli.c 8842 2836 67.9% 06-Dec-88 17:50:00 +mynewcli.c 8288 2794 66.2% 06-Dec-88 17:50:00 +myrun.c 3029 1423 53.0% 06-Dec-88 17:50:04 +process.doc 9996 3710 62.8% 06-Dec-88 17:50:02 +ramlib.doc -------- ------- ----- --------- -------- 430569 151373 64.8% 24-Jan-97 01:02:46 51 files