I am writing in C51 for Cypress EZ-USB device, that has 8KB of flat memory - that is, data and code fetches read the same memory. How can I specify this in complier or linker options? Currently, when I write xdata BYTE something[42]; then something is placed into the memory already occupied by some CODE memory. How can I support flat memory organization? I hope I am not supposed to deprive the linker of its job an write CODE(0x80) XDATA(0x1A44), no? :)
In the 8051 world, people usually call this sort of architecture "von Neumann" memory. You might want to search the Knowledgebase and forums with that phrase. Here's a start: http://www.keil.com/support/docs/856.htm That method just divides up your memory for the linker. If you want the boundary between code and xdata to float along with changing code sizes, you'll have to dig a little deeper.
Drat! So I do take linker's job... If linkers had unions, they might have been worried!