User`s guide
Inline Assembly Language and Intrinsics
Inline Assembly Language
136
Targeting MC56F83xx/DSP5685x Controllers
Inline Assembly Overview
To specify assembly-language interpretation for a block of code in your file, use the
asm keyword and standard DSP56800E instruction mnemonics.
NOTE
To make sure that the C compiler recognizes the asm keyword, you
must clear the ANSI Keywords Only checkbox of the C/C++
Language settings panel.
Differences in calling conventions mean that you cannot re-use
DSP56800 assembly code in the DSP56800E compiler.
Listing 7.1
shows how to use the asm keyword with braces, to specify that an entire
function is in assembly language.
Listing 7.1 Function-Level Syntax
asm <function header>
{
<
local declarations>
<assembly instructions>
}
The function header can be any valid C function header; the local declarations are any
valid C local declarations.
Listing 7.2
shows how to use the asm keyword with braces, to specify that a block of
statements or a single statement is in assembly language.
Listing 7.2 Statement-Level Syntax
asm { inline assembly statement
inline assembly statement
...
}
asm {inline assembly statement}
The inline assembly statement is any valid assembly-language statement.