User`s guide
Inline Assembly Language and Intrinsics
Inline Assembly Language
137Targeting MC56F83xx/DSP5685x Controllers
Listing 7.3 shows how to use the asm keyword with parentheses, to specify that a
single statement is in assembly language. Note that a semicolon must follow the close
parenthesis.
Listing 7.3 Alternate Single-Statement Syntax
asm (inline assembly statement);
NOTE If you apply the asm keyword to one statement or a block of
statements within a function, you must not define local variables
within any of the inline-assembly statements.
Assembly Language Quick Guide
Keep these rules in mind as you write assembly language functions:
1. Each statement must be a label or a function.
2. A label can be any identifier not already declared as a local variable.
3. All labels must follow the syntax:
[LocalLabel:]
Listing 7.4
illustrates the use of labels.
Listing 7.4 Labels in M56800E Assembly
x1: add x0,y1,a
x2:
add x0,y1,a
x3 add x0,y1,a //ERROR, MISSING COLON
4. All instructions must follow the syntax:
( (instruction) [operands] )
5. Each statement must end with a new line