home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
i
/
icon
/
DOCS
/
IPD249_DOC
< prev
next >
Wrap
Text File
|
1995-12-01
|
24KB
|
793 lines
Building Version 9 of Icon for MS-DOS
Ralph E. Griswold
Department of Computer Science, The University of Arizona
The implementation of Version 9 of Icon includes both an
interpreter and an optimizing compiler. The interpreter and com-
piler are largely compatible and almost all Icon programs will
run under either, although some features require the specifica-
tion of options when used with the compiler [1]. The interpreter
is appropriate for program development and many production appli-
cations. The compiler can be used to get faster execution speeds
and a stand-alone executable file that can be distributed without
the interpreter.
Note: This document is primarily concerned with building Icon
for MS-DOS, but the source code also can be used to build Icon
for OS/2; see [2].
1.__Requirements
Processors
Version 9 of Icon runs on computers with 8086/88/x86-family
processors. IBM hardware compatibility is not required. Either
MS-DOS or PC-DOS, Version 3.0 or higher, is needed. The inter-
preter requires at least 500KB of conventional memory to run
satisfactorily. The Icon compiler requires a 32-bit processor
with at least 4MB of RAM. A fast 486 with considerably more RAM
is recommended. The Icon compiler generates C code, which then
must be compiled and linked using the C compiler under which the
Icon compiler was built.
C_Compilers
The implementation is written almost entirely in C and RTL
[3], a superset of C for which a translator to C is supplied.
Building the interpreter is straightforward and can be done on
a 16-bit platform with most of the popular C compilers that sup-
port the large memory model. Building the interpreter requires
at least 510KB of free RAM. If there is not sufficient memory,
MS-DOS may hang. If this happens, you may need to remove some
memory-resident programs to build Icon. Building the compiler
requires a 32-bit C compiler. The amount of RAM required depends
on the compiler. 4 MB is typical.
To date, the Version 9 interpreter for Icon for MS-DOS has
been successfully built using the following C compilers:
IPD249 - 1 - December 1, 1995
Borland C++ 3.0
Intel Code Builder 1.0
Microsoft C 6.0
Microsoft C 7.0
Turbo C 2.0
Watcom C/396 9
Zortech C++ 3.0
The Version 9 compiler for Icon has been successfully built using
Intel Code Builder 1.0
Watcom C/396 9
Zortech C++ 3.0
Version 9 also has been configured for Metaware High C 2.3, but
this configuration has not been tested. The use of a C compiler
not listed here involves additional work to provide appropriate
conditional code.
Assembly_Language
Icon's co-expressions require an assembly-language context
switch. An appropriate assembler therefore is necessary to pro-
vide this feature when building Icon entirely from the source
code. However, object files for context switches are provided,
where available, for persons who do not have an assembler. Alter-
natively, co-expressions can be disabled without otherwise
affecting the use of Icon.
Batch_Scripts
Some of the batch scripts for building and testing Icon use
the call command, which allows a batch script to be run from
inside another batch script, with control then returning to the
former one. If you are using an early version of MS-DOS that does
not support call, you will have to decompose the batch scripts
that use it into more elementary ones.
Disk_Space
The material on the distribution diskettes occupies about
4.5MB when unloaded. This amount can be reduced by deleting
files related to the interpreter and to C compilers that will not
be used. About 1.5MB additional space is needed to completely
build and test the Icon interpreter, although it is possible to
get by with less by building incrementally. Building the Icon
compiler requires additional disk space - 3 to 4MB depending on
the C compiler used.
2.__Organization_of_the_Implementation
The source code for Icon is organized in a hierarchy. Files
for various components of Icon are packaged using LHA. A copy of
IPD249 - 2 - December 1, 1995
LHA is included in the distribution. Instructions for unloading
the files are provided on the distribution diskettes.
If the Icon hierarchy is rooted in \icon, the directories
after unloading are:
|-bin------ executable binaries
|
| |-common--- common files
| |
| | |-borland-- Borland C++
| | |-codebldr- Intel Code Builder
| | |-highc---- Metaware High C
|-config---|-msdos----|-msc6----- Microsoft C 6.0
| | |-msc7----- Microsoft C 7.0
| | |-turbo---- Watcom C
| | |-turbo---- Turbo C
| | |-zortech-- Zortech C++
| |
| |-os2------|-cset2-- Cset/2
|
| |-common--- common source
| |-h-------- headers
| |-iconc---- compiler source
|-icon----|-src------|-icont---- translator source
| |-preproc-- pre-processor source
| |-rtt------ run-time translator source
| |-runtime-- run-time source
|
|-tests----|-local---- local test results
|-stand---- standard test results
In the descriptions that follow, path specifications assume that
the Icon hierarchy is unloaded in \icon\bin. If the location is
different for your installation or requires a drive specifica-
tion, interpret the path specifications that follow accordingly.
The distribution diskettes also contain documentation and some
tools that may be useful in building and testing Icon. See the
README files on the distribution diskettes.
Binary_Files
Since rtt.exe cannot be built under all the C compilers that
otherwise support Icon, a copy is included in the distribution.
Several other executable binaries used in various aspects of
building Icon are also included. These executable binaries are
installed in \icon\bin.
Source_Files
The six source-code sub-directories under src contain the fol-
lowing components of Icon:
IPD249 - 3 - December 1, 1995
common files common to different components of Icon.
h header files used by files in the other direc-
tories.
iconc source code for iconc.exe, the optimizing com-
piler.
icont source code for icont.exe, the translator and
linker that converts an Icon source-language pro-
gram into a form suitable for the interpreter.
preproc source code for an ANSI C pre-processor used by
the run-time translator.
rtt source code for rtt.exe, a program used in
translating run-time code to C.
runtime source code for the interpreter, iconx.exe, and
run-time systems for the compiler and interpreter.
Configuration_Directories
In order to simplify the process of compiling Icon under dif-
ferent C compilers, files that are compiler-specific, such as
batch and linker files, are provided in subdirectories of the
config directory. The MS-DOS configurations presently are:
borland Borland C++
codebldr Intel Code Builder
highc Metaware High C
msc6 Microsoft C 6.0
msc7 Microsoft C 7.0
turbo Turbo C
watcom Watcom C
zo