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.

TMS320C6748: TMS320C6748 : Problem in Assembly Execution

Part Number: TMS320C6748

Hello everyone.

In my code, there is an for loop(8 iteration), inside it i am calling a function which is executing  assembly code .

Ex:- for(k=0; k<8; k++)

{

Assembly_func();

}

At k=0, Assembly_func() gets called and it gets  executing my assembly code one time. once execution return to C code , compiler cannot read the parameter K and flow of execution comes out of for loop.

In CCS view variables it is showing as Cannot read 0x000376D: data is not present

Note: i am using the address of K in assembly code and its value is 0 after completely execution of assembly code and in for loop it should get incremented(k++).

what would be the reason as it should iterate 8 times but that is not happening?

Thanks and Regards

Asif

  • You can turn off optimization (remove -o3 flag) and retain only -g flag for the C code compilation to know details.

    Please note that when optimization is turned on, some of the stack variables can be a register (internal) and CCS may not have access knowledge to display that info.

    >>i am using the address of K in assembly code and its value is 0 after completely execution of assembly code 

    - Are you modifying the value of K inside the assembly and somehow make the value such that it terminates the loop? There is nothing wrong technically in accessing the loop variable, but it looked weird to update the loop variable inside the assembly code.

    You should be able to resolve questions after you compile it with Debug (-g, turning off -o3 flag) for the compilation and single step the code.

  • Hii Aravind,

    Thanks for your response.

    Actually iam just using the value of 'k' in my assembly code for some calculation purpose, and iam sure the value of k is not modified 

    and i turned off the optimization and retain only -g flag from debug options, still my problem is not get solved.

    Do i need to change some other settings ?

    Thanks and Regards

    Asif

  • If "k" is an argument for your assembly function, you should pass that value as an argument..

    example:

    Ex:- for(k=0; k<8; k++)

    {

    Assembly_func(k);

    }

  • HIi Arvind,

    I am using the other arguments as well with their addresses apart from 'k'.

    In ccs what iam observing is once assembly code gets executed,i guess  the address of k is changing in main code .

    That's the reason it is showing as Cannot read 0x000376D: data is not present

    Any suggestion from your side to solve the problem?

  • Please check if you are preserving all the C calling conventions and not corrupting stack.

    www.ti.com/.../sprui04b.pdf

  • Thanks for your response.

    My problem is solved.

    Thanks and Regards

    Asif