External linking ...

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 .....

Parents
  • 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?"

Reply
  • 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?"

Children
More questions in this forum