The Z88 Development Kit - Running

The frontend of z88dk is called zcc, it is this that you should call if you want to do any compilations. To invoke the frontend use the command:

        zcc [flags]  [files to be compiled/linked]

The files can be either C files (.c) , preprocessed C files(.i), compiled C files (.asm), optimised compiled file (.opt) or assembled files (.obj), any combination of them can be mixed together and the relevant processes done on them.

Processing of a file list is done on each file in turn (i.e. preprocess, compile, optimise, assemble) at the end all files may be linked into a single executable if desired.

Options to control the action of the frontend:

     +[file]       Name of config file (including full path and suffix).
                   This option overrides the file give by ZCCFILE.
                   You shouldn't need this option unless you are compiling
                   for other Z80 machines.
     -a            Produce .asm (or .opt) file only
     -c            Do not link object files
     -E            Preprocess files only, leave output in .i file
     -o [file]     Specify output file for binary (default is a.bas for BASIC
                   programs and a.bin for application binaries)
     -On           Optimize compiler output (to .opt file)
                   n can be either 0 (none) 1,2,3, level 2 is recommended.
                   Level 3 is suitable for large programs (includes certain
                   lib functions to reduce size of code(!))
     -v            Verbose - echo commands as they are executed
     -vn           Don't be verbose

Options to control library usage:

     -l[name]      Link in a library - supply just the name (after placing them
                   in the correct directory)
     -lm           Link in the generic Z80 maths library
     -lmz          Link in and generate code for OZ's maths routines
     -lmalloc      Link in the near malloc routines
     -lgfx         Link in the graphics routines (for BASIC progams)
     -lgfxapp      Link in the graphics routines (for applications)
     -lz88         Link in some Z88 application routines (eg mailboxing)
     -lnet         Link the ths socket routines for ZSock
     -m            Generate .map files when assembling/linking

Options to control the type code produced:

     -unsigned     Implicitly define everything as unsigned unless explictly
                   told otherwise.
     -create-app   Create an application image (i.e. bank 63,62 etc)
     -make-app     (App) Notify the compiler that you're trying to make an
                   application
     -reqpag=      (App) Number of 256 byte pages required for bad
                   application
     -zorg=        (App) Origin for a Z88 application
     -safedata=    (App) Amount of safedata required by your code
     -defvars=     (App) Where static variables should be dropped (only
                   valid for single file compilations, but see later)
     -expandz88    (App) Expanded z88 required
     -no-expandz88 (App) Expanded z88 not required (these two flags toggle
                   some startup code to check for an expanded machine)

     -startup=3    Produce standalone code that can be run from a set
                   address from BASIC. Use -zorg= to change the address
     -R            (Use with above) produces relocatable code that can be
                   loaded into a DIM'd BASIC array.
     -smartpf      Intelligent printfroutine handling
     -no-smartpf   Turn off the intelligent printf handling
     -make-lib     Shortcut to generate .obj files from library .c files
     -stackoffset  Sets the stack offset for shared libs (complicated -
                   email me for details)
                   

Miscellaneous options:

     -z80-verb     Allow z80asm to be verbose, this tends to generate a lot
                   of output to the screen so may not be desired.
     -cc           Intersperse C code as comments in the assembler output, warni
ng:
                   this *will* clobber some optimizations. 
     -Wall         Turn on all the compiler warnings
     -Wnone        Turn off all compiler warnings
     -Wn[num]      Turn off the compiler warning [num]
     -W[num]       Turn on the compiler warning [num]
     -asxx         Cause the compiler to emit asxx compatible code

In addition, the flags, -D, -I, -U are passed through to the preprocessor.

Any unrecognised options are passed through to the compiler (to allow for improvements in the future.)

The following "quick" guides exist:


Dom 1.3.2000