I need to writer a C function that mush be in a protected space in flash memory, But I don know how to specify the memory loaction of the function. I'm using a 8051 core with on board flash using the UVision 2 dev sys. ed.
Assigning addresses is the Linker's job - so use the Linker!
If you put the function in a source file on its own you can then specify the address you want the function to reside at via the 'User segments' box under the LX51 locate tab. You need to enter: ?CO?FILENAME(C:0x1234) where 'FILENAME' is the name of your source file and '0x1234' is the address you want the function to be at. Stefan