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

putting a function in a specific address in ROM

Hi,

I'm using the keil to compile a project for the 8051.

I want to place a single function in a specific address in the rom.

I found a lot of answers, in the forum, but non of them actually worked.

How can i "tell" the keil that the specific function MUST be at address 0x1234, for example?
if it helps, the function is written in a seperate file.
Thanks, Noam

Parents
  • Sorry, but the only way you could have enough information about the linking process is if you have access to the full source code to the Keil linker.

    You may affect the call-tree optimization. You may affect the mapping from auto variables to global variables. You may affect tail optimizations. You may change the location of other functions that your recompiled function calls back to.

    Another thing. You say your RAM is only one tenth the size of the ROM. How can that be? For your address translation logic to work, it must be able to see ALL code addresses. If both the ROM and RAM memory areas are external, the solution is obviously to build a prototype with just RAM, instead of building a circuit where you have ROM from 0 to 0x9fff. If the address range 0 to 0x9fff happens to be internal to the chip, you will not have any addresses to translate.

Reply
  • Sorry, but the only way you could have enough information about the linking process is if you have access to the full source code to the Keil linker.

    You may affect the call-tree optimization. You may affect the mapping from auto variables to global variables. You may affect tail optimizations. You may change the location of other functions that your recompiled function calls back to.

    Another thing. You say your RAM is only one tenth the size of the ROM. How can that be? For your address translation logic to work, it must be able to see ALL code addresses. If both the ROM and RAM memory areas are external, the solution is obviously to build a prototype with just RAM, instead of building a circuit where you have ROM from 0 to 0x9fff. If the address range 0 to 0x9fff happens to be internal to the chip, you will not have any addresses to translate.

Children