I've stored a hex file in my 8051 code memory starting from 0X5000 onwards and want to read it and store it to another processor.How can I implement it in C
STOP STOP you are trying to win the 24 hours of LeMans and have not even passed drivers ed. DO NOT try to do heroics BEFORE you have the elementary down pat. Get some experience with "Blinky" that may fit your current level.
What do you mean by "read it and store it to another processor"? Do you mean you want to use the same hex file and program a different flash for another processor with that data? If so, that would seem to be a job simply for your flash programmer. Or do you mean that the 8051 is supposed to execute some code to perform this task of copying the data to some other processor? In that case, we might need more of an explanation of the architecture.