LINKZ80(1)                                                          LINKZ80(1)

       linkz80 - ALDS Z80 linker

       linkz80 options filename[.ext]

       The linker reads filename.rel or filename.cmd and creates object output
       filename.hex (absolute object)  The linker may  create  a
       globals file filename.gbl if there are global symbols in the link.

       -x  causes the linker to output a cross reference of addresses into the
       map file.

       -s causes the linker to output a symbol  table  listing  into  the  map

       -m causes the linker to output a psect table listing into the map file.

       -l re-directs stdout/stderr output to a file filename.log,  which  con-
       tains pass complete messages and each line with an error.

       -p directs the listing file, if produced, to be printed upon completion
       of the link.

       -d will delete the listing file, if produced and printed, after  print-
       ing is complete.

       -e  will  print  the listing file ONLY if errors were not produced. The
       use of the -e flag automatically elects the -p flag.

       -f will cause ALL symbols, referenced or unreferenced to be printed  in
       the cross reference.

       -i  will cause the linker to 'mail' an appropriate message upon comple-
       tion or termination of the link.

       -t will cause the linker to format it's map output for 80 column print-

       -z  will cause the linker to output xenix format object code which con-
       sists of just pure binary, no headers, defs' filled with zeros.

       The setenv variable may be used with the linker allowing the  files  to
       be  INCLUDEd or LOADed by a one word environment variable.  As an exam-
       ple, you may have a directory (say /x/y/z) in which you  have  normally
       included  files.  Then  in  your .cshrc or .login file, you may wish to

             setenv EQU '/x/y/z'

       Once done and it becomes part of your environment,  you  can  state  in
       your linker command file:

            INCLUDE   'EQU:file'

       The  linker  will  pick  up  the  "EQU"  variable  and  expand  it into

Linker Command File
       The linker command file is set up to issue commands to the linker as to
       what  files to link, as well as some commands to execute.  Each command
       must appear on a line by itself.  File names must be enclosed in single
       quote marks.  The following link commands are supported:

       Set  the  current program counter to the code/org address.  The address
       may be a simple hexadecimal value, label, or a complex expression.  The
       expression evaluator is set to handle:
       +    addition
       -    subtraction
       *    multiplication
       /    division
       $    current program count
       <    shift left
       >    shift right
       |    arithmetic or
       ^    arithmetic xor
       &    arithmetic and
       ()   parenthetical expression

       The  expression  evaluator  can lookup previously defined PUBLIC labels
       and use the value in the expression.  For example,

            CODE OVERLAY+(5*2)

       is perfectly acceptable as long as OVERLAY has been previously defined,
       either from a previously read in relocatable or global file.

       This  is  used  to include a GLOBAL file and put it's contents into the
       symbol table.

       This is used to include a relocatable file for linking.

       Causes the linker to put the program counter on the next modulo 
       boundary.   may be the letter 'P' for next 256 byte boundary, or
       it may be a complex expression.

       Used to define a label and it's value.  This is  quite  useful  if  you
       wish  to  define  a  buffer  at the end of a program link or define the
       value(s) of some variable(s). An example would be:

            DEFINE    BUFFER    $
            DEFINE    BUFFER1   $+10

       which would define the variable BUFFER at whatever the current  program
       counter  is,  BUFFER1  at  the current pc plus 16 bytes.  Using DEFINE,
       there is NO WAY to alter or add to the program counter.

       Instructs the linker to  fill  define  storages  (defs)  with  .
        may be any expression.

END [transfer address]
       Tells  the  linker  that  we  are at the end of the link.  The optional
       transfer address may be a simple value, label, or complex expression.
       The linker will attempt two opens of a file.  If  unsuccessful  on  the
       first  attempt,  it will alter the upper/lower case of the file name to
       its counter part and attempt a second open.

       The linker will attempt to open any .gbl file with the file name speci-
       fied.  Should the attempt fail, the linker will attempt another open of
       the same file with /usr/include/ prefixed to the filename.

       -    object code produced
       -    no psect map
       -    no symbol table listing
       -    no cross reference listing
       -    warnings and error messages to stdout

       *.rel                Z80 alds relocatable files
       *.hex                Absolute object output file
       *.map                Listing output file
       *.gbl                Global output file
       *.log                Log output file
       /usr/local/linkz80   Actual linker program

       For a description of the language, see the Model II ALDS Manual.

       svcnum (3)           Globals file of SVC numbers
       sysgbl (3)           Globals file of system equates

       Ron Light, Tandy Systems Design

       The expression evaluator used in the linker forces all  numeric  values
       to be hexadecimal.

                              Version 15 Jan 1986                   LINKZ80(1)