# 3.8 Linear assembly implementation of fir filters on tms320c62x

 Page 1 / 1
This module is an exercise to implement FIR filters using TI linear assembly on TMS320C62x.

## What is linear assembly?

TI's linear assembly language enables you to write an assembly-like programs without worrying about register usage, pipelining, delayslots, etc. The assembler optimizer program reads the linear assembly code to figure out the algorithm, and then it producesan optimized list of assembly code to perform the operations. The linear assembly programming lets you:

• use symbolic names,
• forget pipeline issues,
• ignore putting NOPs, parallel bars, functional units, register names,
• more efficiently use CPU resources than C.

The linear assembly files have `.sa` extensions. When you have a linear assembly file in your Code Composer Studio project, the assembly optimizer isinvoked automatically to generate optimized actual assembly routine. You can consider the linear assemblylanguage as a tool to describe algorithms. To effectively convey the intent of the programmer to the assemblyoptimizer for proper optimization, there are quite a few extra directives in linear assembly.

## C callable linear assembly procedure

The following is an example of C callable linear assembly routine that computes the dot product of two vectors. Itimplements a C function

`short dotp(short* a, short* x, int count);`

If `a[]` and `x[]` are two length-40 vectors, the C function call has the form

```short a[]; short x[]; short z; ... ... z = dotp(a,x,40); ...```

(see below how the arguments are passed and the pointers are used.) In the following, you learn various assembler directivesused below and how the optimized assembly code is generated by the assembler optimizer.

```_dotp: .cproc ap,xp,cnt .reg a,x,prod,y MVK 40,cnt loop: .trip 40 LDH *ap++,a LDH *ax++,x MPY a,x,prod ADD y,prod,y SUB cnt,1,cnt [cnt] B loop .return y .endproc```

The `.cproc` directive starts a C callable procedure. It must be used with `.endproc` to end a C procedure. `_dotp:` is the label used to name the procedure. By using `.cproc` to start the procedure, the assembly optimizer performs someoperations automatically in a `.cproc` region in order to make the function conform to the C callingconventions and to C register usage convention. The following optional variables ( `ap,xp,cnt` above) represent function parameters. The variable entries are very similar to parameters declared in a C function.

The arguments to the `.cproc` directive can be either machine-register names or symbolic names. Whenregister names are specified, its position in the argument list must correspond to the argument passing conventionsfor C. For example, the first argument in C function must be register A4. When symbolic names are specified, theassembly optimizer ensures proper allocation and initialization (if necessary) of registers at thebeginning of the procedure. To represent a 40-bit argument, a register pair can be specified as anargument. In this lab, however, we only use 32bit values as arguments.

The `.reg` directive allows you to use descriptive names for values that will be stored in registers. It isvalid only within procedures only.

The `.return` directive functionality is equivalent to the return statement in C code. It placesthe optional argument in the appropriate register for a return value as per the C calling conventions. If noargument is specified, no value is returned, similar to a `void` function in C code. To perform a conditional `.return` , you can simply put conditional branch around a `.return` as:

```[!cc] B around .return around:```

The `.trip` directive specifies the value of the trip count. The trip count indicates how many times a loop will iterate. By giving this extra information to the assembler optimizer, abetter optimization is achieved for loops. The label preceding `.trip` directive represents the beginning of the loop. This is a required parameter.

For more information on writing C callable linear assembly procedure, refer to TMS320C6x Optimizing C Compiler User's Guide . For C6x assembly instructions, refer to TMS320C62x/C67x CPU and Instruction Set Reference Guide .

Write a C callable FIR filtering routine in linear assembly. When using different optimization levels, what is the numberof clock cycles of each FIR filtering?

where we get a research paper on Nano chemistry....?
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
where are the solutions?
where are the solutions?