At this time when the two of you are active here, can I get an answer to the following which I have sougtht an answer to for some time both through support and this forum. Is there - or will there be - a means of allowing a struct to cross a 64k boundary. The code generated by the compiler does 16 bit math so members in the second page are erroneously accessed. This is for address calculation, not actual access since my system has a "flash page" port and a "read flash" function that set that port. Note" I am NOT talking of "placing in any 64k page", I AM talking about accessing a member of a struct that happen to be in the following 64k page. PLEASE no words about banks, I am not using it since 99.99% of the run time my program is happy in 64k code and data. Erik
It seems to be summed-up in http://www.keil.com/support/docs/2269.htm "The Keil CX51 C Compiler limits individual objects to 64K in size. So, pointer accesses using normal data objects are restricted to a single segment (64K) and 16-bit math is used. "By forcing long pointer arithmetic, you signal the compiler that you want 24-bit address calculations to be performed."
Since some customers need 'linear' 16MB addressing, we change the behaviour of far when the index is a long type We think that this is an acceptable solution. OK, in english: Long or not as type of the index is used by CX51 as a switch between 16 and 24 bit arithmetic for calculating the address. Correct? also: is that the case for C51? Erik PS I can accept the argument (code size) for a switch; however I think the switch chosen is "dangerous" as to potential lurking bugs (you can have a product where the data is, say, 48k day 100 and 67k day 1000 - CRASH). The product is yours, you do what you see best; however since the base is always the same i.e. ONE declaration and the index can be 55 different entities, I would much rather have had a "farx" or such as the switch.