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.
Hello friends,
I am new to Code Composer Studio assembly level programming,can any one please provide me some links or help for the following 2 things,
1. How to write/build a pure assembly level program in ccsv4 ?
2. How to write/build a program which contains the mixing of Assemble level instructions and high level language(like 'C') instructions in one module(or program) ?
3. What does 'asm( )' instruction do ?
I am using CCSv4.2.1,spectrum digital xds510 jtag usb emulator along with DM3730 evm ( this has TMS320C64x+ as DSP Core and ARM® Cortex™-A8 Core as ARM® Microprocessor (MPU) Subsystem ). Program is targeted for dm3730 evm.
Thanks in Advance,
Best Regards,
Nidhi
sri nidhi said:1. How to write/build a pure assembly level program in ccsv4 ?
In CCS 4.2, you can select the option to create an "Empty Assembly-only Project". From there you can add your assembly files.
sri nidhi said:2. How to write/build a program which contains the mixing of Assemble level instructions and high level language(like 'C') instructions in one module(or program) ?
You can add both source and assembly files in the same project. You should read the C6000 assembly language user's guide if you plan to do so. There is information in there like sharing C headers with your assembly source files. (Section 12).
sri nidhi said:3. What does 'asm( )' instruction do ?
It allows you to call assembly instructions from your 'C' source code. But it comes with some issues, like being a barrier for optimization.I would avoid using 'asm()' as mentioned in slide 41 of this slide: http://processors.wiki.ti.com/images/7/74/Cgt_tips_May2010.pdf
Thanks
ki
Hello Ki-Soo Lee ,
Thanks for the reply,
I went through the links you gave and I was able to build the assembly only programs or C only programs in CCSv4 but I didnot understand the following things,
1.How to call an assembly function from a C function.
2.How to call a C function from an assembly function.
3.how to implement the code for following scenario in ccsv4 ?
The task is- the entry point program is an assembly function and it should do the initialization and then should call the C funtion which executes the rest of the task coded in C language.How to write the code for this scenario.
4.How to implement the code for the following scenario in ccsv4 ?
The task is-My whole task is there in C language and however for doing some tasks I should be able to code in assembly in 2 ways one using 'assembly function coding' and the other using the 'asm()' function.How to write the codes in these 2 methods for this scenario.
For all the above questions If i get some explanation along with the sample codes..It will be helpful.
Thanks in advance.
Best Regards,
Nidhi
sri nidhi said:1.How to call an assembly function from a C function.
2.How to call a C function from an assembly function.
See my attached zip file. It is a project that mixes C and asm files. It calls an asm function from C. From that, you should be able to figure out how to call a C function from asm. Just unzip and import the project into your workspace.
sri nidhi said:3.how to implement the code for following scenario in ccsv4 ?
The task is- the entry point program is an assembly function and it should do the initialization and then should call the C funtion which executes the rest of the task coded in C language.How to write the code for this scenario.
Use the -e linker option to specify the entry point of your application. It can be an address or a symbol defined in your assembly code:
sri nidhi said:4.How to implement the code for the following scenario in ccsv4 ?
The task is-My whole task is there in C language and however for doing some tasks I should be able to code in assembly in 2 ways one using 'assembly function coding' and the other using the 'asm()' function.How to write the codes in these 2 methods for this scenario.
The attached example should have the information you need for the first case. Be sure to read the comments in the source code. They detail how to do this.
The asm() usage is quite simple. Just call the asm() routine and pass in the assembly instruction.
asm("<assembly instruction>");
Thanks
ki
This document provides explanations of how to interface C/C++ and assembly functions.
http://focus.ti.com/lit/ug/spru187s/spru187s.pdf
See section 7 which describes the runtime environment defined for the C/C++ compiler. Specifically sections 7.2 through 7.5 will be most important to you
Jim Noxon