1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-13 15:27:28 +00:00
PDP-10.its/doc/c/recipe.text
Lars Brinkhoff aec62f3117 Edit SAIL files to be like the originals from ITS.
Rename according to SAIL file C.LIB[C,SYS].  Fix E stuff and remove
trailing ^C and ^@s.
2018-10-30 08:36:56 +01:00

94 lines
5.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Description of Files and Instructions
The following files will be made available:
1. The source of the machine-independent parts of the C
compiler.
2. The machine-dependent source for four versions of the C
compiler: one which I use to produce code for the DEC
PDP-10, another which produces output in the form of macro
definitions for an abstract machine called the CMAC machine,
one which produces (relatively poor) code for the DEC
PDP-11, and one which produces code for the HIS-6000. The
PDP-10 version stores one character per word and produces
code for the MIDAS assembler; people running DEC operating
systems or TENEX are likely to make changes. The CMAC
version is designed to be used for the initial bootstrap of
the compiler onto new host machines. The PDP-11 version is
a hack and has only been partially tested; it is provided
only as an example. The HIS-6000 version is that given in
TR-149, upgraded to reflect changes in the compiler system.
It has not been significantly tested in its present form; it
also is provided primarily for informational purposes.
3. The source of GT, the program which processes machine
descriptions and produces compiler tables.
4. A test program.
5. The compiled CMAC code for the CMAC version of the compiler,
GT, and the test program.
6. A set of MIDAS macro definitions which implement the CMAC
macros on the PDP-10. Some changes may be necessary for
other PDP-10 assemblers and systems.
7. The source of a simple control routine which calls the
compiler phases. This is provided primarily to show the
algorithm.
8. Some of the basic support routines for my PDP-10
implementation (in MIDAS for the ITS operating system).
9. A set of run-time support routines for UNIX.
10. Some minor documentation. All recipients should first
obtain MAC TR-149 (A Portable Compiler for the Language C --
the major documentation of the compiler, although slightly
obsolete) and Bell Laboratories Computing Science Technical
Report No. 31 (The C Programming Language -- defines C and a
"standard" portable I/O library, which is somewhat different
than the one I use). The documentation includes a copy of a
revised C Reference manual which pertains to the portable C
compiler implementation.
- 2 -
The following procedure is used to construct a compiler on your
host machine:
1. If you have access to a UNIX system, compile the compiler
and GT using the UNIX C compiler and load it up with the
given support routines. Some of the UNIX C compiler tables
will have to be enlarged, as follows: preprocessor name
table (200 -> 300 names, 2000 -> 3000 characters), c0 symbol
table (200 -> 300 entries), c0 dimension/struct table
(100 ->150 entries), c0 string buffer (256 -> 3000
characters). Do not run the optimizer on c43.c.
2. Otherwise, write macro definitions for the CMAC macros which
translate them into assembly language on your machine. This
can probably be done using assembler macros; if not, you may
have to use (or write) some other simple macro processor.
3. Implement the small set of I/O routines used by the
compiler. These need not be fancy; efficiency is not a
major consideration at this stage.
4. Using the macro definitions of (1), convert the compiled
CMAC code (5 above) into assembly language.
5. Assemble the test program and load it with the I/O routines
of (2). Run the test program to check out your macro
definitions.
6. Now assemble and load the compiler phases. There are 5
separate phases supplied. Devise some way of calling the
phases in the right sequence with the right parameters,
using the control routine (7 above) as guidance. On some
systems, this function must be performed with job control
cards.
7. You now have (hopefully) a running C compiler which produces
CMAC object code. Try it out on the test program and
compare the output with the CMAC file provided.
8. The next step is to prepare a machine description and C
routine macros for your host machine. People with PDP-10's
can use those supplied, perhaps making some small changes.
Others will have to write these from scratch, using MAC
TR-149 and the supplied machine descriptions as guides.
9. Assemble and load the GT program. Then, process the machine
description using GT. Break up the output file into new
compiler source files. Using your running CMAC compiler,
compile these new files and assemble them. Then, load up
the new compiler.
10. Test this new compiler on the test program; if successful,
test it out on the compiler itself.