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

LX51 linker syntax

We try to use LX51 instead of BL51 with new PK51 package (C51 7.0.1 etc).
If we define the linker option for BL51 DA(30H) ID(80H) ST(?STACK) XDATA(3000H), what is equivelant define in LX51. In the other way to say what is the syntax for telling the starting address to locate segment for a memory class?

Parents
  • RESERVE will meet our needs, since "The Lx51 linker/locater will not use ALL memory address within the specified address range". One of my application has Von Neumann architecture, which can use a SINGLE memory address for either program code or data, but not for both. So code and xdata share the same common bank area from 0x0 to 0x7fff. Since a single physical memory can't contain both code and data, I want to map code from 0x0 to 0x2fff and xdata from 0x3000. So I have to tell the linker(LX51) the starting address of xdata space. The is easliy being done in BL51 by define "XDATA(3000H)". But how to do it with LX51? I looked CLASSES and SEGMENTS. I did find a example match my need.

    I figure maybe I can do this CLASSES(XDATA(X:0x3000H-X:0x7fff)) to let xdata start from 0x3000 instead of 0x0;
    or I can do this SEGMENTS(?XD?*(X:3000H)) to tell the linker all xdata segment start from 0x3000.

    But none of the trick above will serve my other need. We have 4 banks, common bank from 0x0 to 0x7fff, bank0/1/2 from 0x8000 to 0xffff. But I want only bank2 start mapping from 8080H. This was done in BL51 by BANK2(8080H, ?PR?func_bank2?file_bank2(9000H)). How to do this in LX51? If I use RESERVE(0x8000 - 0x8080), bank0/1 can't use from 8000H to 8080H either, right?

Reply
  • RESERVE will meet our needs, since "The Lx51 linker/locater will not use ALL memory address within the specified address range". One of my application has Von Neumann architecture, which can use a SINGLE memory address for either program code or data, but not for both. So code and xdata share the same common bank area from 0x0 to 0x7fff. Since a single physical memory can't contain both code and data, I want to map code from 0x0 to 0x2fff and xdata from 0x3000. So I have to tell the linker(LX51) the starting address of xdata space. The is easliy being done in BL51 by define "XDATA(3000H)". But how to do it with LX51? I looked CLASSES and SEGMENTS. I did find a example match my need.

    I figure maybe I can do this CLASSES(XDATA(X:0x3000H-X:0x7fff)) to let xdata start from 0x3000 instead of 0x0;
    or I can do this SEGMENTS(?XD?*(X:3000H)) to tell the linker all xdata segment start from 0x3000.

    But none of the trick above will serve my other need. We have 4 banks, common bank from 0x0 to 0x7fff, bank0/1/2 from 0x8000 to 0xffff. But I want only bank2 start mapping from 8080H. This was done in BL51 by BANK2(8080H, ?PR?func_bank2?file_bank2(9000H)). How to do this in LX51? If I use RESERVE(0x8000 - 0x8080), bank0/1 can't use from 8000H to 8080H either, right?

Children