Contents of the READ.ME file
* The MICRO-C 1.5 Compiler *
MICRO-C is a tiny compiler for a subset of the 'C' language. It has been
designed to be VERY portable, and can be moved between different processors
and operating systems with relative ease.
For more information on the compiler, see the file MC.DOC in the DOCUMENT
archive. This file is quite large, make sure your in no hurry before printing
it on a slow printer. The table of contents page is printed last, and should
be inserted between the title page and page 1.
* Getting Started *
When installing MICRO-C on an IBM P.C. or compatible system with a hard
disk drive, simply insert the distribution diskette into a floppy drive,
Enter the appriopriate A: or B: command to switch to that drive, and type
"INSTALL". This will invoke the Micro-Installer program (Written in MICRO-C
of course), which will perform all commands necessary to install MICRO-C on
your hard drive. The fully unpacked MICRO-C package occupies about 800K.
NOTE: INSTALL is menu driven, and allows you to choose what portions of the
distribution package to install, and where to put them (directory). It will not
install over existing directories or files, and does not modify AUTOEXEC.BAT,
CONFIG.SYS or anything else on your disk. You may examime the INSTALL.DAT file
to see the actual commands executed.
Once you have installed the system, refer to the section entitled "THE
COMMAND CO-ORDINATOR" in the MC.DOC file for information on how to compile
programs using the 'CC' command. You should either include the MICRO-C
directory (\MC) in your PATH, or copy the CC.COM file to a directory which
is already in your PATH. Also, make sure that the MASM, LINK and EXE2BIN
commands are available. The MCDIR and MCTMP environment variables should be
set up as described in the document before attempting to use CC.
Once you have everything set up, you may wish to CD to the EXAMPLES
sub-directory, and try compiling some of the programs located there.
* MICRO-C under MS-DOS *
* Implementation notes *
The 8086/MS-DOS implementation of the compiler produces code for the
Microsoft MASM (or compatible) assembler in either the TINY or SMALL models.
It has been tested with MASM 4.0 and MASM 5.1. The LINK utility is required
to create a ".EXE" file. When using the TINY model, EXE2BIN is also needed
to convert that file to ".COM" format. NOTE that programs produced for the
TINY model will execute as ".EXE" files, however, due to PSP being outside
of the data/code segment, command line parameters are only available when
the program is converted to ".COM" format.
The memory model to use is selected by the runtime library, which MUST
BE FIRST in the list of object files passed to the linker. The 8086RL_T.OBJ
file distributed with MICRO-C is configured for the TINY model, and the
8086RL_S.OBJ file is configured for the SMALL model.
The variables ARGC and ARGV (Note capitals) are available in the runtime
library module for use as EXTERNAL references from your programs. This makes
it easy for a function other than 'main()' to access the programs arguments.
The variables PSP and ENV are also available to determine the PROGRAM SEGMENT
PREFIX and ENVIRONMENT segments.
ie: extern int ARGC; /* Count of arguments */
extern char *ARGV; /* Array of ptrs to args */
extern int PSP; /* PSP segment */
extern int ENV; /* Environment segment */
If you are using a DOS version prior to 3.0, the argv (program name)
argument will not work correctly.
Although the MICRO-C compiler is capable of compiling itself, the MCC.COM
file distributed on this disk was compiled using the TURBO-C 2.0 compiler,
with full optimization enabled and all code producing options (such as stack
checking, debugging aids. etc) turned off. This results in a very small and
fast version of MICRO-C.
The MICRO-C documentation, commands, libraries, header files, and all
source code is provided in compressed "archive" files. A utility program
has been included on the distribution disk called "MAR" (Micro-ARchiver)
which will decompress the archive files and retrieve the original source
files. For example:
mar document - List files in documentation archive
mar +r examples - Retrieve files from archive to current dir
mar +r c_source *.c - Retrieve only '.c' source files
mar +a c_source - Add all files from current dir to archive
mar +a l_source *.c - Add all '.c' files from current dir
mar +a l_source t=d:x.x - Add all files to archive, temporary files
will be placed in D:X.X
NOTE: If you use the Micro-Installer program to install MICRO-C, the files
will be automatically uncompressed into appropriate sub-directories.
All of the source and header files ('.c', '.asm', and '.h') were written
using tab stops every 4 characters, which is much more convenient for 'C'
development than the usual MS-DOS tab stops of every 8 characters. Source
for a program called "type4.c" is provided in the EXAMPLES archive, which
reads a file and displays it using spaces to simulate the tabs at 4 character
intervals. To compile this program, use:
The resulting "type4.com" file may be used to view/print the source files
with proper spacing.
("ddunfield" on BIX)
* Files on this disk *
READ.ME - This file
CATALOG - Catalog of available software
INSTALL.COM - Executable MICRO-Installer
INSTALL.DAT - Data file for Micro-Installer
MAR.COM - Executable MICRO-Archiver
DOCUMENT.MAR - Archived Documentation
COMMAND.MAR - Archived Commands
LIBRARY.MAR - Archived Standard Library
HEADERS.MAR - Archived MS-DOS Header files
EXAMPLES.MAR - Archived Source for Example programs
C_SOURCE.MAR - Archived Source for Compiler
L_SOURCE.MAR - Archived Source for Standard Library
U_SOURCE.MAR - Archived Source for Utilities
* Portability Information *
MICRO-C has been tested and is reported to compile OK with the following
Microsoft C 2.03 (Note 2)
Microsoft C 4.0
Microsoft C 5.1
Lattice C 1.04 (Note 2)
Zortech C(++) 1.07
Desmet PCC 1.2 (Note 3)
QNX 1.1 & 1.2 (Quantum) C
Lattice Amiga C 5.05 (Note 1, 3)
Notes: 1) I have not personally tested this, It is second hand
2) Compiler does not interpret more than 8 characters as a
symbol name. This causes some conflicts with MICRO-C
sources. Also, compiler does not support UNSIGNED CHAR
types. Once names changed to be unique within 8 chars,
and unsigned char type removed from code generators,
(You must AND (&) signed char with 255), compiled OK.
3) Compilers library functions return CARRIAGE-RETURN and
LINE-FEED instead of a single NEWLINE character, this
causes problems requiring modification to the various
routines which read input lines & characters.
* MICRO-C Revision History *
1.0 12/88 - Initial release of compiler, genasm, intercg, io and test.
Initial release of 6809 code generator & runtime library.
Initial release of 8080 code generator & runtime library.
1.1 04/89 - Initial release of 8086 code generator & runtime library.
Improved handling of '#define' and substitution.
Added full support for COMMA operator.
Improved pointers and arrays, allows pointer indexing.
Better error checking on all forms of indirection.
Better handling of global, static and external symbols.
Any un-initialized "static" variables (or array elements)
are set to zero.
1.2 07/89 - Initial release of Extended Preprocessor.
Initial release of Peephole Optimizer.
Convertion to "standard" octal and hex constant formats.
"io" module modified to function as "filter" in a pipe.
1.21 08/89 Support for multi-level pointers. eg: char ***a;
1.22 09/89 Misc code generator improvements.
Modified IO.C to output negative numbers for MASM 5.0.
1.3 11/89 - Supports both TINY and SMALL memory models (for 8086).
Added support for argv (program name) (DOS >= 3.0).
Un-initialized data is no longer saved to disk.
1.31 01/90 Added many more library & MS-DOS functions.
Modified library to use "link library" files, so that
un-used functions are not included in the output image.
Added unreferenced local variable detection.
Changed "static" modifier to inhibit "public" access.
1.32 02/90 Fixed "null character in string" ('\0') bug in compiler.
Fix for mixed int/char with '&&' and '||'.
Added handling for string array initialization.
Fixed bugs in MCO scanner which cause incorrect matches.
More optimizations added to MCO.
Initial release of 68HC11 code generator & runtime library.
1.33 03/90 Misc Library Bug fixes.
Improved GENASM/INTERCG file format.
Improved 8086 runtime library.
More library functions.
Fixed bad post-INC/DEC optimizations in MCO.
1.4 03/90 - Initial release of "Introduction to 'C'" document.
Initial release of Micro-Installer.
Fixed incorrect register stacking when handling complicated
expressions involving partial results in both the accumulator
and the index register, Such as:
y = *a * *b + *c * *d + *e * *f;
(Thanks to Steve Moshier for finding this one).
More library functions.
More example programs.
1.41 04/90 Changed operator grouping to be consistant with standard 'C'.
Fixed handling of "continue" in "do" loops.
Fixed incorrect < > <= >= when left value is a constant.
Fixed *rl.asm sources (Accidently "bugged" in release 1.4)
More library functions.
1.42 05/90 Added "typecast" handling to compiler.
Added support for command line defines to MCP.
Fixed MCP to resolve macros in parameters to macros.
Added "control" keys to CONSOLE interface library.
Enhanced "TSR" function for full POP-UP support.
1.5 06/90 - Initial release of "CC" utility.
Initial release of "make" utility.
Initial release of "touch" utility.
Fixed bug in MCP command line defines.
Changed MCP to return error count in "error_level".
Misc. Library Bug fixes.
More example programs.
More library functions.