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

fix a constant address of code

I would like to fix an address to start my code always at the same address. I have all books C51, A51, BL51, etc but I've lost my L51 book...

I use in the option file of linker the instruction CODE(4000H). It works but it's not enough: I want to specify the address (for example 4100H) of the main() function. I supposed we need to specify the order of files linked and the address of my first file to link... but I don't know how?!

Please, could you help me?

Parents
  • "I need to put my code from 4000H"

    That sounds like a fixed address to me!?

    The knowledge base article refers to locating items at a fixed address in code space - that sounded like what you want to do?

    You can follow the same technique to fix the location (ie, address) of main()

Reply
  • "I need to put my code from 4000H"

    That sounds like a fixed address to me!?

    The knowledge base article refers to locating items at a fixed address in code space - that sounded like what you want to do?

    You can follow the same technique to fix the location (ie, address) of main()

Children