as(CP)
as --
assembler
Synopsis
as [-VTm] [-Kabi] [-Q yn] [-Y key,dir] [-o objfile] [-t cpu] file . . .
Description
The
as
command produces an object file from the concatenation
of the specified assembly language input files.
At least one source file must be specified,
except when the -V option is given.
The name ``-''' designates the standard input,
and may be specified anywhere within the list of files.
The recognized assembly language
does not include a general macro processing capability.
Instead,
as provides for optional preprocessing of the input by the m4 command.
[See
m4(CP).]
The following options may be specified in any order:
-V-
Writes the assembler's packaging, release, and version information
on the standard error output.
As a special case,
the assembler does no other processing
if no input files are specified.
-T-
Accepts input that contains old-style (COFF) directives.
Nevertheless,
most such directives are still ineffective,
as the assembler generates an ELF object file.
-m-
Sends the input through the m4 macro processing command prior to assembly.
All file operands are passed unmodified to the m4 command.
(By using the ``--'' option-terminator,
m4 options can be preserved and passed through to the m4 command;
see the EXAMPLES section, below.)
If present,
the predefined macros file,
LIBDIR/cm4defs,
will be given to the m4 command as the initial input file.
-Kabi-
Determines the ABI (Application Binary Interface)
used to produce the output files.
The abi argument can be set to either osr
(the legacy OpenServer Development System ABI) or
udk (the OpenServer Release 6.0.0 Development System ABI).
The default mode depends on which version of the as command
was invoked.
/usr/ccs/bin/as and /usr/bin/as default to
udk mode); /osr5/usr/ccs/bin/as defaults
to osr mode.
-Q yn-
Appends the assembler's release information
to the ``.comment'' section of the generated output object file
if yn is ``y'';
otherwise
(if yn is ``n'' or if no -Q option is specified),
nothing is added.
-Y key,dir-
Uses the directory dir to find
the files specified by key:
the m4 macro processing command (m),
the predefined macros file (d),
or both.
-o objfile-
Causes objfile to be the name of the generated output object file.
If no -o is specified,
then the output object file is created in the current directory
with a name that depends on the specified input files.
If an input file with a name that ends with ``.s'' is present,
the output file name is formed
by replacing the suffix of the first such name with ``.o'';
otherwise,
the output file is ``a.out''.
-t cpu-
Specifies the target processor to be cpu,
which may be ``486'' (the default),
``386'', or ``pentium''.
This option causes code generation specifically tuned
to the selected processor.
Examples
Send, in order, ./cm4defs (if it exists)
and mydefs and sys/file.s through m4
with the macro K predefined to be ``7'',
assemble the output of m4,
and generate the ELF object file output in ./file.o:
as -m -Yd,. -- -DK=7 mydefs sys/file.s
Files
BINDIR/m4-
LIBDIR/cm4defs-
/usr/lib/locale/locale/LC_MESSAGES/uxcds-
language-specific message file [See LANG on
environ(M).]
References
a.out(F),
cc(CP),
Intro(ELF),
ld(CP),
m4(CP),
nm(CP),
strip(CP)
Notices
The m4 macro processor is not line-oriented
and recognizes many regular identifiers as its keywords
(index and len, for example).
Thus,
preprocessing compiler-generated assembly language with m4
requires care.
Whenever possible, you should access the assembler through a
compilation system interface program such as cc.
© 2005 Commands for Programming (CP)
SCO OpenServer Release 6.0.0 -- 02 June 2005