Assigning Output Filenames

When the hex conversion utility translates your object file into a data format, it partitions the data into one or more output files. When multiple files are formed by splitting memory words into ROM words, filenames are always assigned in order from least to most significant, where bits in the memory words are numbered from right to left. This is true, regardless of target or endian ordering.

The hex conversion utility follows this sequence when assigning output filenames:

  1. It looks for the ROMS directive. If a file is associated with a range in the ROMS directive and you have included a list of files (files = {. . .}) on that range, the utility takes the filename from the list.
  2. For example, assume that the target data is 16-bit words being converted to two files, each eight bits wide. To name the output files using the ROMS directive, you could specify:

    ROMS { RANGE1: romwidth=8, files={ xyz.b0 xyz.b1 } }

    The utility creates the output files by writing the least significant bits to xyz.b0 and the most significant bits to xyz.b1.

  3. It looks for the --outfile options. You can specify names for the output files by using the --outfile option. If no filenames are listed in the ROMS directive and you use --outfile options, the utility takes the filename from the list of --outfile options. The following line has the same effect as the example above using the ROMS directive:
  4. --outfile=xyz.b0 --outfile=xyz.b1

    If your *.out file contains sections allocated to multiple pages, separate output files are generated for each page. See Section 8.5.4.2 for information about specifying memory pages.

    If both the ROMS directive and --outfile options are used together, the ROMS directive overrides the --outfile options.

  5. It assigns a default filename. If you specify no filenames or fewer names than output files, the utility assigns a default filename. A default filename consists of the base name from the input file plus a 2- to 3-character extension. The extension has three parts:
    1. A format character, based on the output format (see Section 12.15):
    2. a for ASCII-Hex
      i for Intel
      m for Motorola-S
      t for TI-Tagged
      x for Tektronix
    3. The range number in the ROMS directive. Ranges are numbered starting with 0. If there is no ROMS directive, or only one range, the utility omits this character.
    4. The file number in the set of files for the range, starting with 0 for the least significant file.
  6. For example, assume a.out is for a 16-bit target processor and you are creating Intel format output. With no output filenames specified, the utility produces two output files named a.i0, a.i1, a.i2, a.i3.

    If you include the following ROMS directive when you invoke the hex conversion utility, you would have four output files:

    ROMS { range1: o = 0x1000 l = 0x1000 range2: o = 0x2000 l = 0x1000 }
These output files ... Contain data in these locations ...
a.i00 and a.i01 0x1000 through 0x1FFF
a.i10 and a.i11 0x2000 through 0x2FFF