We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
main() { char a[10]="srikanth";
//----assembly code starts.....
//--------asm ends......... // c code
}
Inline assembly is a very specific nonstandard feature of a toolchain. You have specified none as your MCU.
If you are using C51, for example, there is really not such thing as an 'inline assembler' like in other compilers. When you use the ASM/ENDASM directives the compiler simply includes the text into the source listing generated with the SRC directive, to be assembled by the A51 assembler. That is messy and dangerous. I totally agree with Erik in that you should always use separate .A51 assembly routines callable as C functions, in which case you would access the C data objects using the EXTERN assembler directive, and the access method will depend on the data object storage class.
If you are using ARM RVCT, for example, then you have a true optimizing inline assembler, and you can access C variables directly by their names.
Whatever the case may be, the integration with C is described in the toolchain manuals.