/FA, /Fa (Listing File)
Creates a listing file containing assembler code.
The /FA compiler option generates an assembler listing file for each translation unit in the compilation, which generally corresponds to a C or C++ source file. By default, only assembler is included in the listing file, which is encoded as ANSI. The optional c, s, and u arguments to /FA control whether machine code or source code are output together with the assembler listing, and whether the listing is encoded as UTF-8.
By default, each listing file gets the same base name as the source file, and has a .asm extension. When machine code is included by using the c option, the listing file has a .cod extension. You can change the name and extension of the listing file and the directory where it is created by using the /Fa option.
Only assembler language is included in the listing.
Optional. Includes machine code in the listing.
Optional. Includes source code in the listing.
Optional. Encodes the listing file in UTF-8 format, and includes a byte order marker. By default, the file is encoded as ANSI. Use
u to create a listing file that displays correctly on any system, or if you are using Unicode source code files as input to the compiler.
If both s and u are specified, and if a source code file uses a Unicode encoding other than UTF-8, then the code lines in the .asm file may not display correctly.
One source.asm file is created for each source code file in the compilation.
A listing file named filename.asm is placed in the current directory. This is only valid when compiling a single source code file.
A listing file named filename.extension is placed in the current directory. This is only valid when compiling a single source code file.
One source_file.asm file is created and placed in the specified directory for each source code file in the compilation. Note the required trailing backslash. Only paths on the current disk are allowed.
A listing file named filename.asm is placed in the specified directory. This is only valid when compiling a single source code file.
A listing file named filename.extension is placed in the specified directory. This is only valid when compiling a single source code file.
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
Select the Configuration Properties > C/C++ > Output Files property page.
Modify the Assembler Output property to set the /FAc and /FAs options for assembler, machine, and source code. Modify the Use Unicode For Assembler Listing property to set the /FAu option for ANSI or UTF-8 output. Modify the ASM List Location to set the /Fa option for listing file name and location.
Note that setting both Assembler Output and Use Unicode For Assembler Listing properties can cause Command-Line Warning D9025. To combine these options in the IDE, use the Additional Options field in the Command Line property page instead.
To set this compiler option programmatically
The following command line produces a combined source and machine-code listing called HELLO.cod:
CL /FAcs HELLO.CPP
Send feedback about: