I am using keil and 8051 microcontroller. I want to convert a part of my code written in C into assembly. So for that I wanted to use a variable declared in C file in assembly file.How can I use? I have checked in keil manual also ,there they have given one example code ,in that they have used the variable declared in asm file but not in C. So now how can I do that?
"But have not got any idea on how to pass a variable as a parameter? I have gone through the C51's parameter passing topic but I didnt get any idea." In that case, do as Reinhard suggested: Create an outline in 'C', and use the SRC directive to convert this to assembler. Then you can write your own assembler "body" to the function. You have already been given the link (twice) to the knowledgebase article that describes this. "can u please tell me the syntax for declaring that variable as extern in assembly file." You could find this for yourself in a moment in the assembler Manual but, as already explained, this will not work here!