Академический Документы
Профессиональный Документы
Культура Документы
S1 M Tech SP
Contents
Assembler Directives
Linear Assembly ASM Statement within C C Callable Assembly Function
ASSEMBLER DIRECTIVES
Message for the assembler, not an instruction Resolved during the assembling process. Does not produce executable code. Directives .text and .data indicate a section for
C oll eg e of E ng g: C he rth al a
ASSEMBLER DIRECTIVES
CONT...
Other commonly used assembler directives are: 1) .short: to initialize a 16-bit integer. 2) .int: to initialize a 32-bit integer. 3) .float: to initialize a 32-bit IEEE singleprecision constant. 4) .double: to initialize a 64-bit IEEE doubleC oll eg e of E ng g: C he rth al a
precision constant.
4
LINEAR ASSEMBLY
Assembly like language written without parallel instructions, functional units etc.
Linear assembly code is a cross between assembly and C. Uses syntax same as assembly code, like ADD, SUB & MPY with operands same as in C.
5
C oll eg e of E ng g: C he rth al a
assigns the functional unit and register to use . finds instructions that can execute in parallel . performs software pipelining.
C oll eg e of E ng g: C he rth al a
Optimizer produces assembly coded program. Assembly-coded program by the assembler optimizer is more efficient than from the C compiler optimizer. Linear assembly code should include the .cproc and .endproc directives.
C oll eg e of E ng g: C he rth al a
Assembly instructions can be incorporated within a C program using the asm statement The syntax is asm (assembly code); assembly code part has the same format as a valid assembly statement.
C oll eg e of E ng g: C he rth al a
CONT...
The compiler does not check it for syntax error but copies directly into the compiled output file. If the assembly statement has a syntax error, the assembler would detect it. The asm statement can provide access to hardware features.
C oll eg e of E ng g: C he rth al a
Commonly C program includes some critical DSP functions written in assembly language. Improves the performance. Writing a C callable assembly function become common.
C oll eg e of E ng g: C he rth al a
11
12
C oll eg e of E ng g: C he rth al a
13
A1 is set as a loop counter. The branch statement is conditional based on register A1. Loop section of code starts with the label or address and ends with the branch statement B.
C oll eg e of E ng g: C he rth al a
The resulting sum is accumulated in A4, which is passed to result in the C program.
14
REFERENCES
Digital Signal Processing and Applications with the C6713 and C6416 DSK By Rulph Chassaing
Texas instruments Application Report SPRA806 - December 2001
C oll eg e of E ng g: C he rth al a
15
THANK YOU
16