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?
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?
I mean RESERVE will NOT meet our needs.
With V7.02b Keil seem to have changed the LX51 syntax to match BL51. Try downloading this product update.
Thanks for your reply. I have downloaded v702 update. I did not notice they changed the syntax for LX51, do you know where I can find the information for that? Actually I found LX51 v3.51p has a problem that creates big gap (3000H) at XDATA area. I use classic 8051 with code banking. It might be OK for other case.
We still try to understand the nature of your problem here. With RESERVE (B0:0x8000-B0:0x8FFF) you can for example prevent that the linker locates any variables to the memory space 0x8000 - 0x8FFF in Bank 0. So why does RESERVE not do what you want? In a similar way you can reserve any space in xdata space. BL51 does not handle xdata banking, but with your example you refer always to xdata memory. So, if you have not solved your problem, please explain it again to us. In this way we can improve our products.