I want to write 2 C51 programs, and they don't not run simulanesouly. One of the hex will reside at CODE area, the other will locate at XDATA area. Because the two hex file have some common functions. I want to save XDATA area space, how could I link some functions in XDATA HEX program to the CODE HEX program ? Is it possible or not? Thank for your reviewing .....
The 8051 architecture cannot execute code from XDATA space - only from CODE space. The only way to do this would be if your particular hardware has some special features that allow memory to be "re-mapped" from XDATA to CODE. Sounds like what you actually need is Code Banking - one of your "programs" goes in one Bank, the other "program" goes in another Bank, and the common stuff in the Common Area. Look it up in the Linker Manual ("Macro Assembler & Utilities User Guide") Out of interest, what exactly are you trying to do with these 2 independent "programs?"
Dear Neil Thanks for your help. Because I want to use the first Hex Program(CODE Area) to load second program from NOR flash to XDATA area. In sequnece, run the program in XDATA area. Because the NOR flash can update data easily. If we put all the program in ROM, that would be some risk when production. Maybe we have to reclaim all the controller.
" Because the NOR flash can update data easily. If we put all the program in ROM, that would be some risk when production. Maybe we have to reclaim all the controller." Are you aware that there are a number of 8051 derivatives available with built-in bootloaders that allow you to easily change the firmware without removing the microcontroller from the circuit?
View all questions in Keil forum