S

Applies to C Applies to C++

Purpose

Generates an assembler language file (.s) for each source file. The resulting .s files can be assembled to produce object .o files or an executable file (a.out).

Syntax


Syntax Diagram

Notes

You can invoke the assembler with the xlc++ command. For example,

xlc++ myprogram.s

will invoke the assembler, and if successful, the loader 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

Examples

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

Related References

Compiler Command Line Options
E
g
ipa
o
P
tbtable IBM Copyright 2003