Cross-compiling to CP/M-86 with Pacific C           John Elliott, 16 Dec 2003
=============================================================================

  The programs in this archive are a quick stab at making Pacific C able to 
cross-compile from DOS to CP/M-86.

  You will need:
* Pacific C. Copy the file 86--DSC.LIB from Pacific's LIB directory to
 the LIB directory in this directory.
* GNU Make (or possibly some other Make utility).

  Once everything is unpacked and 86--DSC.LIB has been copied in, type MAKE to
build the library and sample program.

Using the Library
=================
  The Makefile for SAMPLE.CMD shows how to build using the command-line tools.
Since PACC has no option to omit the standard C run-time, the link has to be
performed manually using HLINK. CPMCRT-S.OBJ must be the first object file
linked.

  To use the library from the IDE, create a small-model project. Edit the
"object file list"; remove the existing C runtime and substitute CPMCRT-S.OBJ.
Similarly, remove 86--DSC.LIB from the library list and substitute
CPM86-S.LIB (which should probably be called 86--CSC.LIB).

  Once the .EXE file has been built, simply type EXE2CMD <file>.EXE <file>.CMD
to convert it to CP/M-86 .CMD format.

LIMITATIONS
===========

* The library is very incomplete. It has been constructed by the simple
expedient of copying some of Hi-Tech's modules out of 86--dsc.lib, and adding
a CP/M-86 specific bdos(), getuid() and setuid().

* There is no argument parsing. The sample program shows how to get at the
raw command line, which isn't quite the same thing.

* On exit, the CP/M Plus return code is not set.

SUGGESTIONS FOR ENHANCEMENTS
============================

1. Complete the library. There are two possibilities:
  a) Write the missing modules from scratch, implementing stdio directly on
    top of FCB calls.
  b) Use the source of the Hi-Tech C 3.09 library for CP/M-80 to implement the
    UNIX I/O functions (open, read, write, etc.) and then link in the Pacific
    stdio on top of them.

2. Add an option to generate a shared code segment in the CMD file rather
  than a normal code segment. This can save memory when multiple instances
  of the .CMD file are run on multitasking CP/M versions.

