# Compiling Gammon IV

## Requirements

To compile this program, you need the following:

* The Software Toolworks' C/80 v3.1 compiler for CP/M
* Microsoft MACRO-80 assembler (M80.com)
* Microsoft LINK-80 linker (L80.COM)

All of these tools can also be found here:
http://www.retroarchive.org/cpm/lang/lang.htm

## Configuration

The C compiler needs to be configured in order to be able to compile Gammon IV.

Just use CCONFIG.COM to make the following settings:

  Symbol table size: 512
  String constant table: 3200
  Dump constants after each routine: YES
  Macro table size: 500
  Switch table size: 128
  Structure table size: 200
  Merge duplicate string constants: YES
  Assembler: C/80's AS
  Initialize arrays to zero:  < 256 BYES ONLY
  Generate ROMable code in Macro-80: YES
  Screen size:  24 (doesn't matter)
  Generate slightly larger, faster code: NO
  Sign extension on char to int conversion: YES 
  Device for library files: A: (your choice)

## Compilation

I assume that all of the following files are placed on a hard disk or "big" floppy disk.
If you are compiling this game on a old system with limited disk space, please look into backgmmn.c, where you can find tips on how to distribute the files onto several disks.

The following files are needed:
  BACKGMMN.C, GAMEPLAN.C, GAMEPLAN.HDR, MYLIB2.C,

From the C compiler:
  PRINTF.C, STDLIB.REL, CLIBRARY.REL, C.COM

Assembler/Linker:
  L80.COM, M80.COM

To use the submit scripts, you also need ``SUBMIT.COM`` from your CP/M installation.

Using ``SUBMIT BGMAKE``, all steps of compiling, assembling and linking will run.

Using ``SUBMIT BGCLEAN``, all compiled files and intermediary files will be deleted.

If you don't want to use the script or just want to compile some parts, these steps are taken in the script:

  c -m backgmmn
  m80 =backgmmn
  c -m gameplan
  m80 =gameplan
  l80 backgmmn,gameplan,stdlib/s,clibrary/s,backgmmn/n/e

