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

Interfacing global variable defined in C to Assembly function.

Hi, I have defined global variable in C. I wanted to access that global variable in Assmebly function without passing parameter. Can you please guide me.
Example:
In my C program:-
extern unsigned char lb;
. main()
{ .
}

I want to use same variable lb in assembly...
how to use it??

Regards,
Pranav

  • I want to use same variable lb in assembly...
    how to use it??

    That would be easy to answer, but what good would it do? The method will be the same regardless of processor and tools, with maybe a small change in 'naming' e.g. "PUBLIC" could be "ENTRY"

    You are clearly trying to run before you have learned to crawl.

    work your way through the "getting started giude" and then, if it is still not clear come back.

    Erik

  • There is a whole section in the C51 manual titled interfacing C to assembler - the clue is in the name...!