In the version of Kyoto Common Lisp we used there was a bug in the
memory management routines.  We fixed it and are redistributing the
modified files with permission.  This version of KCL was acquired in
the summer of 1987.  We understand the authors of KCL intend to fix
the bug in the KCL distributed source, so it is possible that steps
1 and 2 below are unnecessary.  The bug was that the KCL provided
malloc, calloc, etc would put the malloced string in the relocatable
area.  For the simulator to work, you need malloc, calloc, realloc and
valloc that return strings which KCL will not move.  You can easily
test this by writing routines that do lots of allocation and
interspersing calls to the garbage collector and tests that the
strings are still there.  If KCL mallocs successfully, omit steps 1
and 2 below.

If KCL source is installed in /usr/kcl, and the simulator in
/usr/connect, do the following: 

	1.  Move files in /usr/connect/kcl/c to /usr/kcl/c, modifying
	    alloc.c, gbc.c and string.d.

	2.  Move files in /usr/connect/kcl/h to /usr/kcl/h, modifying
	    cmpinclude.h and object.h

	3.  Move files in /usr/connect/kcl/unixport to /usr/kcl/unixport.
            This will modify the makefile in /usr/kcl/unixport.  You
            should then look at the makefile and modify it if
            necessary (for example if the simulator is not in
            /usr/connect, or you do not want the simulator graphics). 

	4.  In /usr/kcl/unixport, do `make saved_kclsim'.  This will make
	    a version of KCL with the simulator incorporated, called
	    saved_kclsim.


Now you can execute saved_kclsim.  The normal KCL prompt will appear.
Type (sim-init) to the prompt and the simulator will be initialised and
the graphics window constructed (if appropriate).  Type return to the
simulator prompt or click the quit button and control will be returned to
KCL.  To transfer control to the simulator type (sim) to the KCL prompt.
Return to KCL with `return' or the quit button.

There are several Lisp functions defined in defsimulator.lsp for
controlling the simulator from Lisp.  You will have to look at the
code to see what there is.  One general purpose function is "sim-cmd"
which takes a single string as argument.  The string should be a
simulator command just as you would type it to the simulator prompt.
This function returns the index of the unit most recently made.

Look in the KCL documentation for the description of how to write C 
code that is accessible from Lisp.  The % macro is defined to make
everything else on the line a string.  This allows you to take regular
C code, precede each line with a %, and feed it directly into the
Clines function.

If you don't have KCL yet, read ANNOUNCEMENT to see how you can get
hold of it and for a copy of the license.