-S

Category

Output control

Pragma equivalent

None.

Purpose

Generates an assembler language file for each source file.

The resulting file has a .s suffix and can be assembled to produce object .o files or an executable file (a.out).

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -S---------------------------------------------------------><

Defaults

Not applicable.

Usage

You can invoke the assembler with any compiler invocation command. For example,
xlc myprogram.s

will invoke the assembler, and if successful, the linker to create an executable file, a.out.

If you specify -S with -E or -P, -E or -P takes precedence. Order of precedence holds regardless of the order in which they were specified on the command line.

You can use the -o option to specify the name of the file produced only if no more than one source file is supplied. For example, the following is not valid:
xlc myprogram1.c myprogram2.c -o -S

Predefined macros

None.

Examples

To compile myprogram.c to produce an assembler language file myprogram.s, enter:
xlc myprogram.c -S
To assemble this program to produce an object file myprogram.o, enter:
xlc myprogram.s -c
To compile myprogram.c to produce an assembler language file asmprogram.s, enter:
xlc myprogram.c -S -o asmprogram.s

Related information



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us