1.1.1. Introduction

The relocatable object file format is a subset of the IEEE-695 standard.  
Relocatable files generated by LADsoft tools should be intelligible to an 
IEEE695 standard linker; however LINK does not meet the IEEE695 minimal 
standards and may not be useful with programs generated by translators 
other than those provided by LADsoft.

The IEEE695 ASCII format was selected for readability.  At some time in 
the future it may be replaced with a binary format to speed links; however 
this is not currently necessary.

This document is not a comprehensive guide to IEEE695; it is instead a 
brief guide to the subset used in the LADsoft tools.

LADsoft tools may generate extra named sections with debug information
in them; such sections will have the characters "??" as the first characters
of the section name.

2.1.1. Brief guide to linker format

Each line in the relocatable object file starts with a two-letter command 
and ends with a '.'.  Symbols with periods in them may be embedded in the 
text so the location of the ending period is context-sensitive.

Command list:

MB - module begin.  This gives the system type and file name.  System
        type is up to the implementer, X680Y0PHIDOS where X is I (integer)
        or F (floating point) and Y is the processor type of the highest-
        level instruction which was coded.

ME - module end.

DT - module date and time

CS - checksum.  Placement and usage is arbitrary.

AD - defines the bits in a minimum architectural unit (byte in our 
        case) and the max number of architectural units/address.  It
        also defines the endianness-'M' is big-endian and 'L' is
        little-endian.

ST# - defines a section #, gives it various attributes and a name.
        The linker may add more attributes depending on the 
        specification file- 'C' means it is to be merged commonly with
        other sections of the same name.

SA# - defines the alignment for a section.  The assembler generates a 
        number depending on the .align statements in the sections along 
        with any processor-specific requirements.
                
ASS# - defines the size of a section.  Used for linking

ASL# - defines the location of a section.  Linker outputs this in a 
        .ABS file but it will not be present in .o files

ASG - defines the start address of a program

NX# - define an external symbol name

NN# - define a local symbol name

NI# - define a public symbol name

ASI# - define the section and offset for a public symbol
        This is in standard IEEE expression format; however the linker
        assumes fixed fields rather than evaluating the expression

ASN# - define the section and offset for a local symbol
        This is in standard IEEE expression format; however the linker
        assumes fixed fields rather than evaluating the expression

CO# - define a comment with comment level #.
        Currently defined levels are:
        $100 - link pass seperator
        $101 - header end marker
        $102 - dependency file specifications
        $103 - undefined
        $104 - linker configuration record
        $105 - line number dependency files

SB# - Section begin.  Data loaded after this will go in the section
        this indicates.

LD - pure data that doesn't have to be fixed up.  This is a hex dump.

LR - a fixup record.
        This is composed of two expressions seperated by a comma,
        and enclosed by parenthesis.  The first expression is the
        calculation for the fixup value; and the second expression
        is the size of the fixup.  Note that LR records define
        data IN ADDITION TO the data defined in an LD record.

        Each expression may be composed of constants, the operators
        '+','-'.'*','/', and internal variables.  The internal
        variables recognized are the following:

        L#   - low limit of section
        P    - current program counter
        R#   - relocation offset of section
        X#   - an external variable
        Y#   - the segment of an external variable (x86 only)

        where the '#' is replaced by the number of a variable or section.
        The P variable is unique; it gives the current value of the
        program counter.  The 'Y' variable is actually not a part of
        the IEEE standard, it is added to allow the linker to operate
        with the x86 segmentation structure.  It should only appear
        from a translator that is translating to 16-bit assembly
        in one of the large 16-bit models, and the linker will never
        generate it if it is not present in the input files.
        
        No load address is provided in LR and LD instructions; the load 
        address is derived from the corresponding L variable (ASL#
        instruction) and the number of bytes previously loaded.
