Keil Logo

C166: How Do I Use Inline Assembly

Information in this article applies to:

  • C166 All Versions


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


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

void my_func (void)

#pragma asm
#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.


Last Reviewed: Monday, January 11, 2021

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.