Reads and assembles a source file.
as [ -a Mode ] [ -o ObjectFile ] [ -n Name ] [ -u ] [ -l [ ListFile ] ] [ -W | -w ] [ -x [ XCrossFile ] ] [ -s [ ListFile ] ] [ -m ModeName ] [ File ]
The as command reads and assembles the named File (by convention, this file ends with a .s suffix). If you do not specify a File, the as command reads and assembles standard input. It stores its output, by default, in a file named a.out. The output is stored in the XCOFF file format.
All flags for the as command are optional.
|-a Mode||Specifies the mode in which the as command operates. By default, the as command operates in 32-bit mode, but the mode can be explicitly set by using the flag -a32 for 32-bit mode operation or -a64 for 64-bit mode operation.|
|File||Specifies the source file. If no file is specified, the source code is taken from standard input.|
|-l[ListFile]||Produces an assembler listing. If you do not specify a file name,
a default name is produced by replacing the suffix extension of the source
file name with a .lst extension. By convention, the
source file suffix is a .s. For example:
produces a default name of:
If the source code is from standard input and the -l flag is used without specifying an assembler-listing file name, the listing file name is a.lst.
|-m ModeName||Indicates the assembly mode. This flag has lower priority than
the .machine pseudo-op.
If this flag is not used and no .machine pseudo-op is present in the source program, the default assembly mode is used. The default assembly mode has the POWER family/PowerPC intersection as the target environment, but treats all POWER family/PowerPC incompatibility errors (including instructions outside the POWER family/PowerPC intersection and invalid form errors) as instructional warnings.
If an assembly mode that is not valid is specified and no .machine pseudo-op is present in the source program, an error is reported and the default assembly mode is used for instruction validation in pass 1 of the assembler.
If the -m flag is used, the ModeName variable can specify one of the following values:
|-n Name||Specifies the name that appears in the header of the assembler listing. By default, the header contains the name of the assembler source file.|
|-o ObjectFile||Writes the output of the assembly process to the specified file instead of to the a.out file.|
|-s[ListFile]||Indicates whether or not a mnemonics cross-reference for POWER family and
PowerPC is included in the assembler listing. If this flag is omitted,
no mnemonics cross-reference is produced. If this flag is used, the
assembler listing will have POWER family mnemonics if the source contains
PowerPC mnemonics, and will have PowerPC mnemonics if the source contains
POWER family mnemonics.
Because the -s flag is used to change the assembler-listing format, it implies the -l flag. If both option flags are used and different assembler-listing file names (specified by the ListFile variable) are given, the listing file name specified by the ListFile variable used with the -l flag is used. If an assembler-listing file name is not specified with either the -l or -s flag, a default assembler listing file name is produced by replacing the suffix extension of the source file name with a .lst extension.
|-u||Accepts an undefined symbol as an extern so that an error message is not displayed. Otherwise, undefined symbols are flagged with error messages.|
|-W||Turns off all warning message reporting, including the instructional warning messages (the POWER family and PowerPC incompatibility warnings).|
|-w||Turns on warning message reporting, including reporting of instructional
warning messages (the POWER family and PowerPC incompatibility
Note: When neither -W nor -w is specified, the instructional warnings are reported, but other warnings are suppressed.
|-x[XCrossFile]||Produces cross reference output. If you do not specify a file
name, a default name is produced by replacing the suffix extension of the
source file name with an .xref extension.
Conventionally, the suffix is a .s. For
produces a default name of:
Note: The assembler does not generate an object file when the -x flag is used.
|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.|
as -l -o file.o file.s
as -s -m 601 -o file.o file.s
as -lxxx.lst -o file.o file.s
|/usr/ccs/bin/as||Contains the as command|
|a.out||The default output file.|
The ld command, m4 command.
The Assembler Language Reference manual.