This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Global Variable in Assembly !

 Hello everyone,

I am new to Assembly programming. I have to translate a C function  into linear assembly but the problem is that the C function calls a global variable by using "extern int ", what will i do when i translate this code in Assembly.

 

Any help will be highly appreciated.

Regards

 

  • Saad,

    If I understand you correctly, you are trying to figure out how global variables need to be defined in assembly. The usual procedure to define global variable in assembly is as mentioned below

              .global _VARIABLENAME

    I will recommend that you download any DSPLIB from ti.com and check the assembly source files for reference to figure this out. Also refer to the assembly user guide attached for details on assembly instructions and mapping your C code in assembly

    2677.C6000_assembly.pdf

    Regards,

    Rahul

  • Rahul,

    the thing is that i have a global variable int saturation (say), in another c file that is included in the project, i use the line " extern int saturation " and use the same variable. How can i translate this into linear assembly.

    . global directive will make a variable defined in assembly global and i want a variable defined in C to be available to the Assembly function

     

    Thanks for the help :)