Assembling with the as command

The as command invokes the assembler.

The as command invokes the assembler. The syntax for the as command is as follows:

as [ -a Mode ] [ -oObjectFile ] [ -n Name ] [ -u ] [ -l[ListFile] ]
	[ -W | -w ] [ -x[XCrossFile] ] [ -s [ListFile] ] [ -m ModeName ] [ -M ]
	[ -Eoff|on ] [ -poff|on ] [-i] [-v] [ File ]

The as command reads and assembles the file specified by the File parameter. By convention, this file has a suffix of .s. If no file is specified, the as command reads and assembles standard input. By default, the as command stores its output in a file named a.out. The output is stored in the XCOFF file format.

All flags for the as command are optional.

The ld command is used to link object files. See the ld command for more information.

The assembler respects the setting of the OBJECT_MODE environment variable. If neither -a32 or -a64 is used, the environment is examined for this variable. If the value of the variable is anything other than the values listed in the following table, an error message is generated and the assembler exits with a non-zero return code. The implied behavior corresponding to the valid settings are as follows:

Item Description
OBJECT_MODE=32 Produce 32-bit object code. The default machine setting is com.
OBJECT_MODE=64 Produce 64-bit object code (XCOFF64 files). The default machine setting is ppc64.
OBJECT_MODE=32_64 Invalid.
OBJECT_MODE=anything else Invalid.