I read some topics about placing a const to fixed address by linker. The method is to locate all section, isn't it? My problem is to locate 7 arrays of const(predefined): a1[50]..a7[50]. I want to place a1[] at 0xC07D00, a2[] at 0xC07E00, a3[] at 0xC07F00 and etc. So, how i can do it? Is it true that theese arrays will be united in NCONST class? Thanks!
The only way I know how to do this is in "C" is to create a seperate file for each near const array that you want to create. Then add some definitions under the L166 locate, user sections (using the filename for each seperate array, a1.c a2.c and so on) then add ?NC?A1%NCONST(0C07E00h),?NC?A2%NCONST(0C07F00h), and so on for each entry... They should all be united into the NCONST class since you are under 64K. You should see a default linker setting of NCODE (0xC00000-0xC0FFFF). -Chris
U r right! I read the documentation more carefully and think that it's only one method for this - to separate arrays into different files. But what about limits of 64K? What will be happened if my array's size exceeds 64K?
If you have multiple arrays and they can exceed 64Kbytes in size (each) then you will have to change your memory type to "xhuge" basically giving you an unlimited size. But also note that this is less efficient than when using the DPP's (the "near" memory modifier uses the DPP's).
also I have found that structs (I do not know about arrays, but why should that be different?) that cross 64k boundaries are handled erroneously since the offset calculation is 16 bit based. Erik
i asked this because i am using the 98K continious array previously downloaded to flash. I access it by XVAR definition and have no problems. Does it differ from using array of 'xhuge' type?
XVAR is a macro to access xhuge data, please have a look to the Keil web site. http://www.keil.com/support/man/docs/c166/c166_xvar.htm