NOTE: C51
Keil uses 16 bit pointers and I have a file which is larger than 64k.
the file is a bunch of structures (all pointed to) that I acces as structures
This creates pure havoc when a structure crosses a 4k boundary.
example: at 0fffe U16 shortvalue U8 charvalue if you access charvalue as str_pointer->charvalue, you get the contents of location 0, not 10000.
these values are NOT accessed by 'regular' code, but by U8 ReadFlash(U32 address)
any suggestions. The only one I have come up with is rather 'unpleasnt' i is to use #defines instead of structures as in above example #define shortvalue 0 #define charvalue 2
this makes [str_pointer->charvalue] into [str_pointer + charvalue] which the compiler treats 'correctly' as a 32 bit addition.
Erik
PS I have begged and begged the creator of these files to 'gap the files' where a 64k cross happens but get a "no way Jose"
A quick thought: if you can temporarily transform your C51 from big endian to little endian, when reading the section where it goes wrong... don't know if that is possible with this processor, though.