|
1 | 1 | ---
|
2 |
| -title: "-FA, -Fa (Listing File) | Microsoft Docs" |
| 2 | +title: "/FA, /Fa (Listing File) | Microsoft Docs" |
3 | 3 | ms.custom: ""
|
4 | 4 | ms.date: "11/04/2016"
|
5 | 5 | ms.reviewer: ""
|
@@ -45,54 +45,68 @@ translation.priority.ht:
|
45 | 45 | - "zh-tw"
|
46 | 46 | ---
|
47 | 47 | # /FA, /Fa (Listing File)
|
48 |
| -Creates a listing file containing assembly code. |
| 48 | +Creates a listing file containing assembler code. |
49 | 49 |
|
50 | 50 | ## Syntax
|
51 | 51 |
|
52 |
| -``` |
53 |
| -/FA[c|s|u] |
54 |
| -/Fapathname |
55 |
| -``` |
| 52 | +`/FA`[`c`\][`s`\][`u`] |
| 53 | +`/Fa`_pathname_ |
56 | 54 |
|
57 | 55 | ## Remarks
|
58 |
| - The arguments control the generation of source code and machine code and the extension of the listing file. |
| 56 | +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. |
| 57 | + |
| 58 | +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. |
| 59 | + |
| 60 | +### /FA arguments |
| 61 | +none |
| 62 | +Only assembler language is included in the listing. |
| 63 | + |
| 64 | +`c` |
| 65 | +Optional. Includes machine code in the listing. |
| 66 | + |
| 67 | +`s` |
| 68 | +Optional. Includes source code in the listing. |
| 69 | + |
| 70 | +`u` |
| 71 | +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. |
| 72 | + |
| 73 | +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. |
| 74 | + |
| 75 | +### /Fa argument |
| 76 | +none |
| 77 | +One *source*.asm file is created for each source code file in the compilation. |
| 78 | + |
| 79 | +*filename* |
| 80 | +A listing file named *filename*.asm is placed in the current directory. This is only valid when compiling a single source code file. |
59 | 81 |
|
60 |
| - The following table describes the various values to **/FA**. It is possible to specify more than one value to **/FA**. For example, you can specify **/FAsu**. |
| 82 | +*filename.extension* |
| 83 | +A listing file named *filename.extension* is placed in the current directory. This is only valid when compiling a single source code file. |
61 | 84 |
|
62 |
| -|Option|Listing contents and file extension| |
63 |
| -|------------|-----------------------------------------| |
64 |
| -|**/FA**|Assembly code; .asm| |
65 |
| -|**/FAc**|Machine and assembly code; .cod| |
66 |
| -|**/FAs**|Source and assembly code; .asm<br /><br /> If **/FAcs** is specified, the file extension will be .cod| |
67 |
| -|**/FAu**|Causes the output file to be created in UTF-8 format, with a byte order marker. By default, the file encoding is ANSI, but use **/FAu** if you want a listing file that displays correctly on any system, or if you are using Unicode source code files as input to the compiler.<br /><br /> If **/FAsu** is specified, and if a source code file uses Unicode encoding other than UTF-8, then the code lines in the .asm file may not display correctly.| |
| 85 | +*directory*\ |
| 86 | +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. |
68 | 87 |
|
69 |
| - By default, the listing file gets the same base name as the source file. You can change the name of the listing file and the directory where it is created using the **/Fa** option. |
| 88 | +*directory*\\*filename* |
| 89 | +A listing file named *filename*.asm is placed in the specified *directory*. This is only valid when compiling a single source code file. |
70 | 90 |
|
71 |
| -|/Fa usage|Result| |
72 |
| -|----------------|------------| |
73 |
| -|**/Fa**|One *source_file*.asm is created for each source code file in the compilation.| |
74 |
| -|**/Fa** *filename*|*filename*.asm is placed in the current directory. Only valid when compiling a single source code file.| |
75 |
| -|**/Fa** *filename.extension*|*filename.extension* is placed in the current directory. Only valid when compiling a single source code file.| |
76 |
| -|**/Fa** *directory*\|One *source_file*.asm 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.| |
77 |
| -|**/Fa** *directory*\\*filename*|*filename*.asm is placed in the specified `directory`. Only valid when compiling a single source code file.| |
78 |
| -|**/Fa** *directory*\\*filename.extension*|*filename.extension* is placed in the specified `directory`. Only valid when compiling a single source code file.| |
| 91 | +*directory*\\*filename.extension* |
| 92 | +A listing file named *filename.extension* is placed in the specified *directory*. This is only valid when compiling a single source code file. |
79 | 93 |
|
80 | 94 | ### To set this compiler option in the Visual Studio development environment
|
81 | 95 |
|
82 |
| -1. Open the project's **Property Pages** dialog box. For details, see [Setting Visual C++ Project Properties](../../ide/working-with-project-properties.md). |
| 96 | +1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md). |
83 | 97 |
|
84 |
| -2. Click the **C/C++** folder. |
| 98 | +2. Open the **C/C++** folder and select the **Output Files** property page. |
85 | 99 |
|
86 |
| -3. Click the **Output Files** property page. |
| 100 | +3. 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. |
87 | 101 |
|
88 |
| -4. Modify the **ASM List Location** (**/Fa**) or **Assembler Output** (**/FA**) property (**/FAu** must be specified in the **Command Line** property page, **Additional Options** box.. |
| 102 | +Note that setting both **Assembler Output** and **Use Unicode For Assembler Listing** properties can cause [Command-Line Warning D9025](../../error-messages/tool-errors/command-line-warning-d9025.md). To combine these options in the IDE, use the **Additional Options** field in the **Command Line** property page instead. |
89 | 103 |
|
90 | 104 | ### To set this compiler option programmatically
|
91 | 105 |
|
92 |
| -- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerListingLocation%2A> or <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerOutput%2A>. To specify **/FAu**, see <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>. |
| 106 | +- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerListingLocation%2A> or <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AssemblerOutput%2A>. To specify `/FAu`, see <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>. |
93 | 107 |
|
94 | 108 | ## Example
|
95 |
| - The following command line produces a combined source and machine-code listing called HELLO.cod: |
| 109 | +The following command line produces a combined source and machine-code listing called HELLO.cod: |
96 | 110 |
|
97 | 111 | ```
|
98 | 112 | CL /FAcs HELLO.CPP
|
|
0 commit comments