Keil™, An ARM® Company

CARM User's Guide

Discontinued

Source (SRC) File

The compiler can generate an assembler source file (.SRC) from a valid C source file. Refer to the SRC directive for information on how this directive is used.

There are several reasons to create an assembly source file:

  • You need to hand optimize the assembler output from the compiler.
  • You are writing a routine in assembly code and want to prototype the function and arguments in C.

No matter what your reason for creating a source file, the steps required are always the same:

  1. Create a C source file.
  2. Add any required inline assembly instructions.
  3. Compile using the SRC directive.
  4. Rename the .SRC file so that it is not overwritten by subsequent compilations of the original C source (if required).
  5. Make changes to the created assembler source file.
  6. Assemble using the assembler.

Note

  • When the SRC directive is used, the compiler outputs an assembler source (.SRC) file. No object (.OBJ) file is output.
  • C symbolic and source-level debugging is not available once a C source file is converted to an assembler source file.