Version 9.0 of Icon for MS-DOS Ralph E. Griswold Department of Computer Science, The University of Arizona 1.__Introduction Version 9.0 of Icon for MS-DOS should run on any PC or PC clone running MS-DOS 3.0 or higher. A math co-processor is sup- ported and used if present; otherwise software emulation is used. Approximate 500K of free RAM is needed to run Icon satisfac- torily. Two versions of Icon's executor system are provided. One supports arithmetic on integers of unlimited magnitude and the other does not. The latter is considerably smaller than the former and can be used if you do not have enough RAM for the former. This implementation of Icon is in the public domain and may be copied and used without restriction. The Icon Project makes no warranties of any kind as to the correctness of this material or its suitability for any application. The responsibility for the use of Icon lies entirely with the user. The basic reference for Version 8 of Icon is the second edi- tion of the book The Icon Programming Language [1]. This book is available from the Icon Project at The University of Arizona. It also can be ordered through any bookstore that handles special orders. The new features of Version 9.0 of Icon are described in an accompanying technical report [2]. 2.__Installing_MS-DOS_Icon Three executable binary files are needed to use Icon: icont.exe translator iconx.exe executor ixhdr.exe bootstrap header These files should be located at a place on your PATH specifica- tion. In addition, icont.exe and ixhdr.exe must be in the same directory. There are two forms of icont and iconx: ones without large- integer arithmetic and ones with it. The former are named icont.exe and iconx.exe as distributed, while the latter are named icontl.exe and iconxl.exe. The distribution is contained in several files in LHA format. These files have the extension lzh. If you do not have a copy of IPD247a - 1 - June 29, 1994 lha.exe, execute the self-extracting archive lha213.exe on the distribution diskette. This will produce lha.exe and documenta- tion. The distribution files are: docs.lzh documents icon.lzh executable binary files readme installation overview and recent notes samples.lzh Icon programs and data To install the .exe files, set your current directory to the desired place, place the appropriate distribution diskette in a drive, and dearchive the files there using lha.exe. For example, using drive A to dearchive the executable binary files, the fol- lowing will do: a:lha x a:icon.lzh The same technique can be used for extracting the remaining files. Pick the translator and executor that fit your needs, place them at a location on your path, and rename them to icont.exe and iconx.exe if necessary. For example, if you want the executor that supports large-integer arithmetic, the following will do: rename icontl.exe icont.exe rename iconxl.exe iconx.exe 3.__Running_MS-DOS_Icon_-_Basic_Information Files containing Icon programs must have the extension .icn. Such files should be plain text files (without line numbers or other extraneous information). The Icon translator, icont, produces an ``icode'' file that is executed using iconx.exe. There are two forms of icode files: 1. Executable icode files that invoke iconx.exe automati- cally when they are run. These icode files have the extension exe. 2. Non-executable icode files that are run by iconx with the icode file as an argument. These icode files have the extension icx. Non-executable icode files require about 8K less RAM to run than executable files, but they are more awkward to run. Note: Executable icode files do not stand alone; they require iconx.exe to run. IPD247a - 2 - June 29, 1994 Producing_Executable_Icode_Files Executable icode files are produced by default. An Icon pro- gram in the file prog.icn is translated by icont prog.icn If your translator is named differently, simply use that name. For example, if your translator is named icontl.exe, use icontl prog.icn The result is an icode file with the name prog.exe. This file can be run by prog Alternatively, icont can be instructed to execute the icode file after translation by appending a -x to the command line, as in icont prog.icn -x This only works if your executor is named iconx.exe, since the -x option looks for this name. In the sections that follow, it is assumed that the executor is named iconx.exe. If icont is run with the -x option, the file prog.exe is left and can be run subsequently using an explicitly named executor as described above. The extension .icn is optional on the command line. For exam- ple, it is sufficient to use icont prog Producing_Non-Executable_Icode_Files To produce a non-executable icode file, use the option -I, as in icont -I prog The result is an icode file named prog.icx. It can be run by iconx prog Note that the icx extension is not necessary. iconx will find an icode file if it is in the current direc- tory or at place given on your PATH specification. IPD247a - 3 - June 29, 1994 Except for the icode file extension and the method of running non-executable icode files, the remarks in the previous section apply. 4.__Testing_the_Installation There are a few programs on the distribution diskette that can be used for testing the installation and getting a feel for run- ning Icon: hello.icn This program prints the Icon version number, time, and date. Run this test as icont hello hello Note that this can be done in one step with icont hello -x cross.icn This program prints all the ways that two words intersect in a common character. The file cross.dat contains typical data. Run this test as icont cross -x