AS(1) — USER COMMANDS
NAME
as − Sun-1, Sun-2 and Sun-3, and Sun-4 assemblers
Sun-1, Sun-2 and Sun-3 SYNOPSIS
as [ −L ] [ −R ] [ −o objfile ] [ −O ] [ −d2 ] [ −e ] [ −h ] [ −j ] [ −J ] [ −mc68010 ]
[ −mc68020 ] filename
Sun-4 SYNOPSIS
as [ −L ] [ −R ] [ −o objfile ] [ −P [[ −Ipath ] [ −D name ] [ −D name=def ] [ −U name ]]...]
[ −O [n]] [ −S [C]] filename ...
DESCRIPTION
as translates the assembly source file, filename into an executable object file, objfile. The Sun-4 assembler recognizes the filename argument ‘−’ as the standard input.
All undefined symbols in the assembly are treated as global.
OPTIONS
Common OPTIONS
−LSave defined labels beginning with an L , which are normally discarded to save space in the resultant symbol table. The compilers generate many such temporary labels.
−RMake the initialized data segment read-only by concatenating it to the text segment. This eliminates the need to run editor scripts on assembly code to make initialized data read-only and shared.
−o objfile
The next argument is taken as the name of the object file to be produced. If the −o flag isn’t used, the object file is named a.out.
Sun-1, Sun-2 and Sun-3 OPTIONS
−d2Instruction offsets that involve forward or external references, and with unspecified size, are two bytes long. (See also the −j option.)
−eAllow control sections to begin on any two-byte boundary, rather than only on four-byte boundaries.
−hSuppress span-dependent instruction calculations. Restrict branches to medium length. Force calls to take the most general form. This option is used when the assembly must be minimized, even at the expense of program size and run-time performance. It results in a smaller and faster program than one produced by the −J option, but some very large programs may be unable to use it due to the limits of medium-length branches.
−jUse short (pc-relative) branches to resolve jump and jump-to-subroutine instructions to external routines. This is for compact programs for which the -d2 option is inappropriate due to large-program relocation.
−JSuppress span-dependent instruction calculations and force branches and calls to take the most general form. This is useful when assembly time must be minimized, even at the expense of program size and run-time performance.
−OPerform span-dependent instruction resolution over entire files rather than just individual procedures.
Sun-4 OPTIONS
−PRun cpp, the C preprocessor, on the files being assembled. The preprocessor is run separately on each input file, not on their concatenation. The preprocessor output is passed to the assembler.
−Ipath
−Dname
−Dname=def
−Uname
When −P is in effect, these cpp options are passed to the C preprocessor, without interpretation by as. Otherwise, they are ignored.
−O[n]Enable peephole optimization corresponding to optimization level n (1 if n not specified) of the Sun high-level language compilers. This option can be used safely only when assembling code produced by a Sun compiler.
−S[C]Produce a disassembly of the emitted code to the standard output. This is most useful in combination with the −O option, to review optimized code. Adding the character C to the option prevents comment lines from appearing in the output.
FILES
/tmp/as∗ default temporary file
SEE ALSO
Assembly Language Reference Manual
BUGS
The Pascal compiler, pc, qualifies a nested procedure name by chaining the names of the enclosing procedures. This sometimes results in names long enough to abort the Sun-1/2/3 assembler, which currently limits identifiers to 512 characters (the Sun-4 assembler does not have this restriction).
Sun Release 3.2 — Last change: 26 January 1987