Keil™, An ARM® Company

Technical Support

GENERAL: HOW TO CREATE ASSEMBLY FILES FROM C FILES


Information in this article applies to:

  • C166 Version 3.12
  • C166 Version 4.03
  • C251 Version 2.14
  • C51 Version 5.50
  • C51 Version 6.00 Beta
  • C51 Version 6.00

QUESTION

How do I create an assembler file from my C source file?

ANSWER

Use the SRC directive to create assembler output from the C compiler. The SRC directive causes the compiler to generate an .SRC file with the same name as your C file. You may then assemble the .SRC file with the assembler. Note that if you make changes to the .SRC file, you should rename it to .A51 or .A66 since re-compiling the C file may overwrite the .SRC file.

You may use the SRC directive as the first line in the file. For example:

#pragma src
.
.
.

Or, you may use it on the command line:

c51 myfile.c src

c166 newfile.c src

MORE INFORMATION

  • Refer to SRC in the Cx51 User's Guide.
  • Refer to SRC in the C166 User's Guide.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Monday, March 10, 2008


Did this article provide the answer you needed?
 
Yes
No
Not Sure