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.

Linear Assembly Projects

Hello,

Can anybody tell me How to create Assembly only projects or Linear Assembly Projects on CCSv5.1 . Is there any file or link through which I can get starting help.

Thanks! 

  • Hi Arun,

    There are no special projects for the assembly or linear assembly.

    In the usual projects itself one would add or include these assembly or linear assembly files.

    Regards,

    Venu

  • Hello Venu,

    Thanks for your reply. I am sorry to say but your Reply increases my Doubt even 10 times.

    Can you Attach some projects like that Take one example of simple Dot product or matrix multiplication in which Linear assembly has been used. I want to check how these things are being handled. I don't know why is this just a Chance or what but whenever I am asking any question related with Linear Assembly here, either I am not getting any reply or not getting any Satisfied response.

    I am sorry for my little knowledge, But I really want to understand this thing on Linear Assembly level.

    Thanks and regards,
    Arun 

  • Hi Arun,

    Can you go through http://www.ti.com/lit/ug/spru187o/spru187o.pdf esp Chapter 4.

    Regards,

    Venu

  • Hello Venu,

    Thanks for your link. Ok, Now, my doubt is I have two files one is .c file for c code and second is for assembly with .asm. Now When I create empty or RTSC project in Code composer studio, How Will I use these two Files, I mean, If I only want Linear assembly to use because I want to put my data in registers only, Not anywhere else, so How would I do that. Does Empty RTSc project can be run with Assembly code, Will it behave like same as with normal c code, or something else is the way to deal with it.

    Thanks and regards,
    Arun 

  • Hello venu,

    Sorry for my little knowledge! I have not deal with Assembly before in my life. As far as I know I have to call that dotp function assembly in my Assembler code, But How to do that in case of 6678 DSP I don't know. Can you help me in that.

    Thanks and regards,
    Arun 

  • Arun, all your assembly code should be C callable and follow the C calling convention.  Basically it means that variables passed into the function need to come in through specific registers, the ones passed out need to go out through specific registers, one register is used for Stack Point, one register is used for Return pointer and that's it.  You create you code w/ the _func name and build as in the documentation that's been provided to you in other threads.

    I'm not sure what specifcally you're trying to achieve w/ 'Put data in registers only', it's got to be in memory at some point and everything is executed out of the registers space (Memory -> Registers - Processed - Registers -> Memories) no issues leaving them in registers when multiple processing needs to be done and this is typically done even when using C.  As data sets get large you'll quickly see the need to push the data back out to memory. 

    As for this, you'll want to create a .c file such as main.c that has a main() function so it's used as the entry point and all related C_init assocated with it.  Within main() have it call your assembly function that you've created with assembly or linear assembly but use the C calling convention as mentioned.

    The reason you're having such a problem getting these questions answered is because what you're wanting to do isn't really feasible 'Run w/ data only in registers', 'build an assembly only project'.  Linear assembly and assembly are there to optimize performance of key routines, they are still meant to be C callable routines and called from a project with C functions.  The architecture is designed so that you can quickly get data from memory into registers, process it and put the data back into memories to free up those registers.  Please keep these in mind. 

    If you haven't done so already, I'd suggest taking a step back making a simply C code with C function to do what you're wanting to do.  Then make an assembly function that does the same thing, make it c callable, then call the function from within C.

    Best Regards,

    Chad

  • Hello Chad,

    First of All Thank you very much for taking pain to explain me in all this detailed way. I was looking for such a  detailed explanation. Next, Actually I want to deal with registers, because I have been using 6678 since long and I have tried to run some codes including Matrix to Matrix multiplication as well. I was basically interested in performance behavior and throughput's by that want to understand its Architecture. I have written codes, Played with memory on RTSC projects by keeping in L1, L2, MSMCSRAM. Now, I was only interested in small data just 2by2 matrix and put in registers and see all of these so I can get some ideas. 

    Anyways, Thank you very much! Let me try to deal with Assembly as the way you told me.

    Thanks and regards,
    Arun