|
|||||||||||
|
Technical Support On-Line Manuals CARM User's Guide |
CARM User's GuideDiscontinued Inline AssemblyThe extended inline assembler merges assembly instructions with the assembly code generated by the compiler and creates an object file. There is nothing to assemble with the AARM Assembler. Extended inline assembler blocks begin with the __asm keyword. For example:
__asm { instruction ; comment }
__asm { ; open inline-assembly block
instruction ; comment
.
.
.
} // close inline-assembly block
Where
For example:
int AddUp (
int n,
int *pTab)
{
if (n == 0) return(0);
__asm
{
mov r0, #0 ; clear result
ldav r2, r0, pTab ; R2=start of table
ldav r3, r0, n ; R3=table length
lsl r3, r3, #2
lM:
sub r3, #4
ldr r1, [r2,r3]
add r0, r1
cmp r3, #0 ; end of table ?
bgt lM ; loop if not eot
}
// Return Value in R0
}
Note
| ||||||||||
|
|||||||||||