ARM Technical Support Knowledge Articles

HOW DO I USE INLINE ASSEMBLY

Applies to: C166 C Compiler

Answer


Information in this article applies to:


QUESTION

I can't figure out how to use inline assembly code in my C166 programs. How does it work?

ANSWER

In essence, you must use #pragma asm and #pragma endasm around your assembly code. For example:

void my_func (void)
{

#pragma asm
   NOP
#pragma endasm

}

Then, compile your file using the SRC directive. For example:

c166 mycode.c SRC

The compiler generates a .SRC file which you must assemble with the A166 Macro Assembler.

Note: C166 Version 5 or higher provides an extended in-line assembler that does not longer require the SRC mode of the Compiler.

MORE INFORMATION

Article last edited on: 2005-07-15 10:38:58

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential