This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Switching between code programs

I have two different code programs: Program "B" which is located at 1000h and Program "A" located at 0h (it ends before 1000h) and it's working properly. How can I start executing program "B" from Program "A". I have tried this software reset but it doesn't work:

((void  (code *)  (void)) 0x01000) ();
Note: there is no need for sharing data between programs. I just need to switch between executing one program or another

Parents
  • Do you think there is a way to do this?

    No. Not if you're moving the code from its real address to some other position in memory. That cannot possibly work, because 8051 isn't position-independent. And that's before we even begin to look at what usage of data memory that code may have, which the .hex file you have will tell you nothing about.

Reply
  • Do you think there is a way to do this?

    No. Not if you're moving the code from its real address to some other position in memory. That cannot possibly work, because 8051 isn't position-independent. And that's before we even begin to look at what usage of data memory that code may have, which the .hex file you have will tell you nothing about.

Children
No data