This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Locator order optimization

Dear Sirs,

Looking at A51 manual I read next text:

The Lx51 linker/locator locates segments in according their memory class and follows a predefined order of precedence. The standard allocation algorithm usually produces the best workable solution and does not equiring you to enter any segment names on the command line.

But real process shows that "standard allocation algorithm" is not so smart.

For example, compilation of a test project used some XDATA memory produces next result:

* * * * * * * * * * *  X D A T A   M E M O R Y  * * * * * * * * * * * * *
000000H   000201H   000202H   BYTE   UNIT     XDATA          ?XD?SMB_BUF
000202H   00039DH   00019CH   BYTE   UNIT     XDATA          ?XD?ENV_XDATA
00039EH   000425H   000088H   BYTE   UNIT     XDATA          ?XD?NET_XDATA
000426H   000495H   000070H   BYTE   UNIT     XDATA          ?XD?SETUP_XDATA
000496H   0004C4H   00002FH   BYTE   UNIT     XDATA          ?XD?SETS_XDATA
0004C5H   0004FFH   00003BH   ---    ---      **GAP**
000500H   000543H   000044H   PAGE   UNIT     XDATA          ?XD?NSTAT_XDATA
000544H   0005FFH   0000BCH   ---    ---      **GAP**
000600H   000643H   000044H   PAGE   UNIT     XDATA          ?XD?DENOM_XDATA
000644H   0006FFH   0000BCH   ---    ---      **GAP**
000700H   00073FH   000040H   PAGE   UNIT     XDATA          ?XD?LCD_XDATA

When we do optimize segment locations by hands then result is:
* * * * * * * * * * *  X D A T A   M E M O R Y  * * * * * * * * * * * * *
000000H   000043H   000044H   PAGE   UNIT     XDATA          ?XD?NSTAT_XDATA
000044H   0000B3H   000070H   BYTE   UNIT     XDATA          ?XD?SETUP_XDATA
0000B4H   0000E2H   00002FH   BYTE   UNIT     XDATA          ?XD?SETS_XDATA
0000E3H   0000FFH   00001DH   ---    ---      **GAP**
000100H   000143H   000044H   PAGE   UNIT     XDATA          ?XD?DENOM_XDATA
000144H   0001CBH   000088H   BYTE   UNIT     XDATA          ?XD?NET_XDATA
0001CCH   0001FFH   000034H   ---    ---      **GAP**
000200H   00023FH   000040H   PAGE   UNIT     XDATA          ?XD?LCD_XDATA
000240H   000441H   000202H   BYTE   UNIT     XDATA          ?XD?SMB_BUF
000442H   0005DDH   00019CH   BYTE   UNIT     XDATA          ?XD?ENV_XDATA

And this takes 354 bytes (about 19%) of memory free compared to standard allocation algorithm.

The question is: is there any additional options to make Locator process more "best" or should we take manual control only? How does "standard allocation algorithm" work?

Thanks,
Oleg

0