Keil™, An ARM® Company

C166 User's Guide

Inline Assembly

Inline assembly is assembly code that you can insert into your C programs. The Keil C166 C Compiler supports two different methods of inline assembly.

  • Traditional Inline Assembly:
    Traditional inline assembly requires that you place your assembly instructions between ASM and ENDASM directives and that you compile your C source file into a .SRC file using the SRC directive which you must assemble with the Keil A166 Assembler.
  • Extended Inline Assembly:
    Integrated inline assembly inserts the assembly code directly into the object file output by the compiler and requires no further processing by the assembler. Inline assembly source blocks are marked by the __asm keyword.

The following table compares the inline assembler methods.

Inline Assembly ComparisonTraditionalIntegrated
Direct to ObjectNOYES
Access to C VariablesNOYES
Source-Level DebuggingNOYES
C166 InstructionsYESYES
C167 InstructionsYESYES
XC16x InstructionsYESYES
ST10 InstructionsYESYES
MAC InstructionsYESYES