Keil Logo

Overlaying Segments

If the overlay process is executed during program linking and locating, it is important that each assembler subroutine be declared with the PROC / ENDP assembler controls or have a unique program segment. This is necessary so that during the overlay process, the references between the functions are calculated, using the references of the individual segments.

The data areas of the assembler subprograms may be included in the overlay analysis when the following points are observed:

  • All segment names must be created using the C251 Compiler segment naming conventions.
  • Each assembler function with local variables must be assigned its own data segment. This data segment must be declared with the relocation type OVERLAYABLE. This data segment may be accessed by other functions only for passing parameters. Parameters must be passed in order.
Example Routines

The following program examples show how to pass parameters to and from assembly routines. The equivalent C source for the assembler program is printed as assembler comment.

  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.