Topic : LX51 OVERLAY directive

Forum : 8051

Original Post
Post Information Post
October 28, 2009 - 7:23pm
Guest

I have an issue with enabling overlay of automatic variables. According to the LX51 documentation an 'OVERLAY' directive should turn on this feature. Instead, I'm getting 203 Error: EXPECTED ITEM MISSING NEAR: "OVERLAY". Does this directive necessarily need parametres.

I noticed that very few variables in my programs are getting overlaid by default - I don't use any indirect function calls.

Replies
Post Information Post
+1
0
-1
October 29, 2009 - 10:14am
Raisonance Support Team

Hi Piotr,

Here is an excerpt from our 8051 linker documentation:

OVERLAY (OL)

Syntax: OVERLAY[(segments !*)]
        OVERLAY[(segment ~ segments)]
        OVERLAY[(segment ! segments)]

Where segments is a list of segments:
    (segment[,segment][…])
or a single segment name.

Description: When used automatic variables will be overlaid in the BIT, DATA and XDATA memory spaces if required, to conserve RAM.

The OVERLAY directive also provides the following functionality:
???? Remove segments from the overlay process
???? Remove call references between segments
???? Add call references between segments

Examples: OVERLAY
All functions whose automatic variables are suitable for overlaying will be overlaid.
    OVERLAY(?PR?X1?FOO !*)
The automatic variables in the segment ?PR?X1?FOO will not be overlaid.
    OVERLAY((?PR?X1?FOO,?PR?X2?FOO) !*)
The automatic variables in the segments ?PR?X1?FOO and ?PR?X2?FOO will not be overlaid.
   OVERLAY(?PR?MAIN?BAR ~ ?PR?X1?FOO)
Segment ?PR?MAIN?BAR calls segment ?PR?X1?FOO.
This directive will remove the call reference.
    OVERLAY(?PR?MAIN?BAR ~ (?PR?X1?FOO,?PR?X2?FOO))
Segment ?PR?MAIN?BAR calls segments ?PR?X1?FOO and ?PR?X2?FOO. This directive will remove those call references.
    OVERLAY(?PR?MAIN?BAR ! ?PR?X1?FOO)
This directive adds a call reference to indicate that segment ?PR?MAIN?BAR calls segment ?PR?X1?FOO.
    OVERLAY(?PR?MAIN?BAR ! (?PR?X1?FOO,?PR?X2?FOO))
This directive adds call references to indicate that segment ?PR?MAIN?BAR calls segments ?PR?X1?FOO and ?PR?X2?FOO.

Note that overlay is a complex mechanism, you *really* should read the documentation to get the whole idea.

Regards,
Bruno

+1
0
-1
October 29, 2009 - 10:31am
Guest

Hi

I think this OVERLAY directive is used by default.
So you might can not using it again.
What you can do is to use NOSEGMENTOVERLAY and SEGMENTOVERLAY for specific segments.

Regards,
Matloub

+1
0
-1
October 29, 2009 - 11:27am
Guest

Hi Bruno,

Thank you for pasting the extract from the documentation (which I have read by the way) - it contains the mistake which forced me to write the initial post.

"Examples: OVERLAY
All functions whose automatic variables are suitable for overlaying will be overlaid."

This example suggests that OVERLAY directive can be passed without parameters. In my case I can't use it without parameters.

Thank you matloub - it's probably the case that OL is turned on by default. I already tried SEGMENTOVERLAY in several cases it works great. However, hardly any variables are overlaid by default and I was wondering if there is any way to automate the process as specifying manually with SEGMENTOVERLAY maybe a bit time consuming.

Regards,
Piotr

+1
0
-1
October 29, 2009 - 4:36pm
Guest

Hi

The description of the option is confusing as it does not say that OVERLAY is used by default in the beginning.
But the overlay is set by default and is done if it does not find any call between function etc.. .

Can you post your map file and the code you expect to be overlaid?

Regards,
Matloub