Search notes:

cl /FA

cl /FA translation-unit.c creates an assembler listing for the translation unit.
Without further options, the generated file has the suffix .asm.
cl /FAs adds the source file text into the generated file.
cl /FAc adds machine (byte) code into the generated file. The default suffix is then .cod.
cl /FAcs adds both source file text and machine code into the compiled file.
Unlike the gnu compiler, The assembler output that is produced with /FA cannot be fed to macro assembler (ml.exe, ml64.exe), see also this stackoverflow question.
The following PowerShell script creates x86 and x64 .asm files with /FA, /FAs, /FAc and /FAu so that it's possible to diff the output.
$hostDir = (get-item ( where.exe cl.exe ) ).directory.parent.fullname

& "$hostDir\x64\cl.exe" simple-program.c /c /FA /Faoutput.x64.asm
& "$hostDir\x86\cl.exe" simple-program.c /c /FA /Faoutput.x86.asm

& "$hostDir\x64\cl.exe" simple-program.c /c /FAc /Faoutput.c.x64.asm
& "$hostDir\x86\cl.exe" simple-program.c /c /FAc /Faoutput.c.x86.asm

& "$hostDir\x64\cl.exe" simple-program.c /c /FAs /Faoutput.s.x64.asm
& "$hostDir\x86\cl.exe" simple-program.c /c /FAs /Faoutput.s.x86.asm

& "$hostDir\x64\cl.exe" simple-program.c /c /FAu /Faoutput.u.x64.asm
& "$hostDir\x86\cl.exe" simple-program.c /c /FAu /Faoutput.u.x86.asm
Github repository about-cl, path: /options/F/A/simple-program/run.ps1
#include <stdio.h>

int main() {
   printf("Hello world\n");
   return 0;
}
Github repository about-cl, path: /options/F/A/simple-program/simple-program.c

See also

Files that are created with the /FA compiler switch contain the following include:
include listing.inc
cl /F…

Index