167/317
6 - STMicroelectronics Programming Tools
cations must be reused. This code might as well be included in the list of source files to as-
semble; but with the following drawbacks:
A source file may be modified accidentally, leading to a malfunctioning code. The problem is
then difficult to pinpoint since the reused code is generally considered error-free;
The assembly of this code takes time, while using the object form of the same code is quicker
since it only has to be linked with the remainder of the program.
The ST7 programming tools include a librarian that can be used to build library files. If you are
inte rested in using lib raries, we sug gest yo u re fer to the S T7 P rogr amm ing T ools User
Manual, Chapter 7.
In addition to the absolute object file, the linker generates three more files.
The file with a
.MAP
extension is a listing file that summarizes the location of the segments and
the address of the global symbols. This file is intended to be read by the author of the program,
or the engineer who will debug the program.
The files with
.GRP
and
.SYM
extensions are used by the debugger. They contain the same in-
formation as the map file, but their internal format is especially defined to be read by a pro-
gram instead of a human being.
6.2.2 Hex file translator
The .COD file generated by the linker is not suitable for either debugging or PROM program-
ming. It must be translated into one of the available ascii-hex output file formats. The transla-
tion merely consists of formatting the same binary values into to one of the various popular
ascii-hex formats.
The OBSEND object translator is invoked using the following line:
OBSEND <object file>.COD, f, <hex file>, <format>
The formats available are:
Table 9.
Table of the hex file translator options
Format identifier
Format name
<none>
straight binary, in hexadecimal form, with no checksums
f
straight binary, with holes between segments filled with
FFh
values
i
Intel hex (16 bytes per line)
i32
Intel hex, 32 bytes per line
ix
Extended Intel-hex
s
Motorola S format
x
Extended Motorola S format
2
ST format with 2 bytes per address
4
ST format with 4 bytes per address
g
GP industrial binary format