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

integrity of the data memory in "C" calls, from assembler.

I have all of my software code made in 8051 assembler.
The R0-R7 (Bank 0,1)registers, accumulator, and DPTR, are used in the most of my code, like a functions arguments.
How could I do, to call a "C" subrutine and hold the integrity of my code?
What is the best way, to preserve or separate, two parts of differents codes?
Thank you.

Parents
  • Note that you can't just add an isolated 'C' file to an assembler project - 'C' requires a certain amount of initialisation & runtime support.

    By far the easiest way to do this is to ensure that your program's main() is in 'C', and have that call your assembler entry point.

    That could be as simple as:

    void main( void )
    {
       asm_main();
    }
    

Reply
  • Note that you can't just add an isolated 'C' file to an assembler project - 'C' requires a certain amount of initialisation & runtime support.

    By far the easiest way to do this is to ensure that your program's main() is in 'C', and have that call your assembler entry point.

    That could be as simple as:

    void main( void )
    {
       asm_main();
    }
    

Children
No data