Keil Logo

Segments, Modules, and Programs

In the initial design stages, the tasks to be performed by the program are defined, and then partitioned into subprograms. Here are brief introductions to the kinds of subprograms used with the Ax51 assembler and Lx51 linker/locator.

A segment is a block of code or data memory. A segment may be relocatable or absolute. A relocatable segment has a name, type, and other attributes. Segments with the same name, from different modules, are considered part of the same segment and are called partial segments. Several partial segments with the same name are combined into one segment by the Lx51 linker/locater. An absolute segment cannot be combined with other segments.

A module contains one or more segments or partial segments. A module is a source code unit that can be translated independently. It contains all symbol definitions that are used within the module. A module might be a single ASCII text file that is created by any standard text editor. However, with you may use the include assembler directive to merge several text files. The Ax51 assembler translates a source file into an object file. Each object file is one module.

After assembly of all modules of the program, Lx51 processes the object module files. The Lx51 linker/locator assigns absolute memory locations to all the relocatable segments, combining segments with the same name and type. Lx51 also resolves all references between modules. Lx51 outputs an absolute object module file with the completed program, and a map file that lists the results of the link/locate process.

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.