define overlay directive
Syntax
define overlayname[with param, param...]{extended-selectors; } [ except {section-selectors} ];
For information about extended selectors and except clauses, see Section selection.
Parameters
| The name of the overlay. |
| Customizes the size of the overlay. By default, the size of a overlay is the sum of its parts dependent of its contents. |
| Specifies an upper limit for the size of the overlay. An error is generated if the sections in the overlay do not fit. |
| Specifies a minimum alignment for the overlay. If any section in the overlay has a higher alignment than the minimum alignment, the overlay will have that alignment. |
| Places sections in fixed order—if not specified, the order of the sections will be arbitrary. |
Description
The define overlay directive defines a named set of sections. In contrast to the define block directive, the overlay directive can define the same name several times. Each definition will then be grouped in memory at the same place as all other definitions of the same name. This creates an overlaid memory area, which can be useful for an application that has several independent sub-applications.
Place each sub-application image in ROM and reserve a RAM overlay area that can hold all sub-applications. To execute a sub-application, first copy it from ROM to the RAM overlay.
Note
ILINK does not help you with managing interdependent overlay definitions, apart from generating a diagnostic message for any code reference from one overlay to another overlay.
The size of an overlay will be the same size as the largest definition of that overlay name and the alignment requirements will be the same as for the definition with the highest alignment requirements.
Note
Sections that were overlaid must be split into a RAM and a ROM part and you must take care of all the copying needed.
Warning
Code in overlaid memory areas cannot be debugged—the C-SPY Debugger cannot determine which code is currently loaded.