Run a code from RAM

I have 32k code and xdata - 32KB size in my design.
If i want to place a C function into RAM and execute from the RAM how should i do it?what are all the settings i need to do? whether can it be done?

For example if we call function2 from function1, can this function1 be placed inside the RAM?

Will there be any errors?

Parents
  • I have 32k code and xdata - 32KB size in my design.

    What memory types are these ? Is the code memory some type of (flash) ROM and the xdata some type of RAM ?

    If i want to place a C function into RAM and execute from the RAM how should i do it?

    The '51 can only execute code that is in code memory (unless you roll your own command interpreter). Whether the code memory is RAM or ROM is fairly irrelevant. Note that the '51 cannot write to code memory space (because it is assumed to be some type of ROM).

Reply
  • I have 32k code and xdata - 32KB size in my design.

    What memory types are these ? Is the code memory some type of (flash) ROM and the xdata some type of RAM ?

    If i want to place a C function into RAM and execute from the RAM how should i do it?

    The '51 can only execute code that is in code memory (unless you roll your own command interpreter). Whether the code memory is RAM or ROM is fairly irrelevant. Note that the '51 cannot write to code memory space (because it is assumed to be some type of ROM).

Children
More questions in this forum