1as(1)                            User Commands                           as(1)
2
3
4

NAME

6       as - assembler
7

SYNOPSIS

9   SPARC
10       as [-b] [-i] [-K {pic,PIC}] [-L] [-m] [-n] [-o outfile]
11            [-P] [-Dname] [-Dname=def] [-Ipath] [-Uname]... [-q]
12            [-Qy | n] [-s] [-S [a | b | c | l | A | B | C | L]]
13            [-T] [-V]
14            [-xarch=v7 | -xarch=v8 | -xarch=v8a | -xarch=v8plus |
15             -xarch=v8plusa | -xarch=v8plusb | -xarch=v8plusd |
16             -xarch=v8plusv | -xarch=v9 | -xarch=v9a |
17             -xarch=v9b | -xarch=v9d | -xarch=v9v]
18            [-xF] [-Y dirname] filename...
19
20
21   x86
22       as [-b] [-i] [-K PIC] [-L] [-m] [-n] [-o outfile] [-P]
23            [-Dname] [-Dname=def] [-Ipath] [-Uname]... [-Qy | n]
24            [-s] [-S [a | b | c | l | A | B | C | L]] [-T] [-V]
25            [-xarch=generic64 | -xarch=amd64] [-Y dirname]
26            [-xmodel= [ SMALL | KERNEL ]] filename...
27
28

DESCRIPTION

30       The  as  command  creates  object  files  from assembly language source
31       files.
32

OPTIONS

34   Common Options
35       The following flags are common to both SPARC and x86. They can be spec‐
36       ified in any order:
37
38       -b                     Generates extra symbol table information.
39
40
41       -i                     Ignore  line  number information from preproces‐
42                              sor.
43
44
45       -K pic | PIC           Generates position-independent code.
46
47
48       -L                     Saves all symbols,  including  temporary  labels
49                              that  are  normally  discarded to save space, in
50                              the ELF symbol table.
51
52
53       -m                     Runs the m4(1) macro processor on the  input  to
54                              the assembler.
55
56
57       -n                     Suppresses all the warnings while assembling.
58
59
60       -o outfile             Puts  the  output of the assembly in outfile. By
61                              default, the  output  file  name  is  formed  by
62                              removing  the  .s  suffix, if there is one, from
63                              the input file name and appending a .o suffix.
64
65
66       -P                     Runs cpp(1), the C preprocessor,  on  the  files
67                              being  assembled.  The preprocessor is run sepa‐
68                              rately on each input file, not on their concate‐
69                              nation. The preprocessor output is passed to the
70                              assembler.
71
72
73       -Dname                 When the -P option is in effect,  these  options
74       -Dname=def             are  passed  to  the cpp(1) preprocessor without
75                              interpretation by  the  as  command;  otherwise,
76                              they are ignored.
77
78
79       -Ipath                 When  the -P option is in effect, this option is
80                              passed to the cpp(1) preprocessor without inter‐
81                              pretation  by  the  as command; otherwise, it is
82                              ignored.
83
84
85       -Uname                 When the -P option is in effect, this option  is
86                              passed to the cpp(1) preprocessor without inter‐
87                              pretation by the as command;  otherwise,  it  is
88                              ignored.
89
90
91       -Qy | n                If  y  is  specified,  this  option produces the
92                              assembler version  information  in  the  comment
93                              section of the output object file. If n is spec‐
94                              ified, the information is suppressed.
95
96
97       -s                     Places all  stabs  in  the  .stabs  section.  By
98                              default,  stabs  are  placed  in stabs.excl sec‐
99                              tions, which are  stripped  out  by  the  static
100                              linker,  ld(1), during final execution. When the
101                              -s option is used, stabs  remain  in  the  final
102                              executable   because   .stab  sections  are  not
103                              stripped by the static linker.
104
105
106       -S[a|b|c|l|A|B|C|L]    Produces a disassembly of the  emitted  code  to
107                              the  standard output. Adding each of the follow‐
108                              ing characters to the -S option produces:
109
110                              a    disassembling with address
111
112
113                              b    disassembling with ".bof"
114
115
116                              c    disassembling with comments
117
118
119                              l    disassembling with line numbers
120
121                              Capital letters turn the switch off for the cor‐
122                              responding option.
123
124
125       -T                     This  is  a  migration  option  for 4.x assembly
126                              files to be assembled on 5.x systems. With  this
127                              option,  the  symbol names in 4.x assembly files
128                              are interpreted as 5.x symbol names.
129
130
131       -V                     Writes the version number of the assembler being
132                              run on the standard error output.
133
134
135       -xF                    Allows  function  reordering  by the Performance
136                              Analyzer. If you compile with  the  -xF  option,
137                              and  then  run the Performance Analyzer, you can
138                              generate a map  file  that  shows  an  optimized
139                              order  for the functions. The subsequent link to
140                              build the executable file can be directed to use
141                              that  map  file  by  using the linker -M mapfile
142                              option. It places each function  from  the  exe‐
143                              cutable file into a separate section.
144
145
146       -Y dirname             Specify directory m4 and/or cm4def.
147
148
149   Options for SPARC only
150       -q                Performs  a  quick  assembly.  When  the -q option is
151                         used, many  error  checks  are  not  performed.  This
152                         option disables many error checks. Use of this option
153                         to assemble handwritten assembly language is not rec‐
154                         ommended.
155
156
157       -xarch=v7         This   option   instructs  the  assembler  to  accept
158                         instructions defined in  the  SPARC  version  7  (V7)
159                         architecture.  The  resulting  object  code is in ELF
160                         format.
161
162
163       -xarch=v8         This  option  instructs  the  assembler   to   accept
164                         instructions  defined  in  the SPARC-V8 architecture,
165                         less the quad-precision floating-point  instructions.
166                         The resulting object code is in ELF format.
167
168
169       -xarch=v8a        This   option   instructs  the  assembler  to  accept
170                         instructions defined in  the  SPARC-V8  architecture,
171                         less  the  quad-precision floating-point instructions
172                         and less the fsmuld instruction. The resulting object
173                         code  is in ELF format. This is the default choice of
174                         the -xarch=options.
175
176
177       -xarch=v8plus     This  option  instructs  the  assembler   to   accept
178                         instructions  defined  in  the SPARC-V9 architecture,
179                         less the quad-precision floating-point  instructions.
180                         The  resulting  object code is in ELF format. It does
181                         not execute on a Solaris V8 system (a machine with  a
182                         V8 processor). It   executes on a Solaris V8+ system.
183                         This combination is a SPARC 64-bit  processor  and  a
184                         32-bit OS.
185
186
187       -xarch=v8plusa    This   option   instructs  the  assembler  to  accept
188                         instructions defined in  the  SPARC-V9  architecture,
189                         less  the quad-precision floating-point instructions,
190                         plus the instructions in the Visual  Instruction  Set
191                         (VIS).  The  resulting object code is in V8+ ELF for‐
192                         mat. It does not execute on a Solaris  V8  system  (a
193                         machine  with  a  V8  processor).  It  executes  on a
194                         Solaris V8+ system
195
196
197       -xarch=v8plusb    This option enables the assembler to accept  instruc‐
198                         tions  defined in the SPARC-V9 architecture, plus the
199                         instructions in the  Visual  Instruction  Set  (VIS),
200                         with  UltraSPARC-III extensions. The resulting object
201                         code is in V8+ ELF32 format.
202
203
204       -xarch=v8plusd    This option enables the assembler to accept  instruc‐
205                         tions  DEFIned  in  UltraSPARC Architecture 2009. The
206                         resulting object code is in V8+ ELF32 format.
207
208
209       -xarch=v8plusv    This option enables the assembler to accept  instruc‐
210                         tions   defined   in  UltraSPARC  Architecture  2005,
211                         including the extensions dealing with the sun4v  vir‐
212                         tual  machine  model. The resulting object code is in
213                         V8+ ELF32 format.
214
215
216       -xarch=v9         This option limits the instruction set to the  SPARC-
217                         V9 architecture. The resulting .o object files are in
218                         64-bit ELF format and can only be linked  with  other
219                         object  files  in the same format. The resulting exe‐
220                         cutable can only be run on a 64-bit  SPARC  processor
221                         running 64-bit Solaris with the 64-bit kernel.
222
223
224       -xarch=v9a        This  option limits the instruction set to the SPARC-
225                         V9 architecture, adding the  Visual  Instruction  Set
226                         (VIS)  and  extensions specific to UltraSPARC proces‐
227                         sors. The resulting .o object files are in 64-bit ELF
228                         format and can only be linked with other object files
229                         in the same format. The resulting executable can only
230                         be  run  on  a  64-bit SPARC processor running 64-bit
231                         Solaris with the 64-bit kernel.
232
233
234       -xarch=v9b        This option enables the assembler to accept  instruc‐
235                         tions  defined in the SPARC-V9 architecture, plus the
236                         Visual Instruction  Set  (VIS),  with  UltraSPARC-III
237                         extensions.  The  resulting  .o  object  files are in
238                         ELF64 format and can only be  linked  with  other  V9
239                         object  files  in the same format. The resulting exe‐
240                         cutable can only be run on a 64-bit processor running
241                         a  64-bit  Solaris  operating  environment  with  the
242                         64-bit kernel.
243
244
245       -xarch=v9d        This option enables the assembler to accept  instruc‐
246                         tions  defined  in  UltraSPARC Architecture 2009. The
247                         resulting object code is in ELF64 format.
248
249
250       -xarch=v9v        This option enables the assembler to accept  instruc‐
251                         tions   defined   in  UltraSPARC  Architecture  2005,
252                         including the extensions dealing with the sun4v  vir‐
253                         tual  machine  model. The resulting object code is in
254                         ELF64 format.
255
256
257   Options for x86 Only
258       -xarch>=generic64           Limits the instruction set  to  AMD64.  The
259                                   resulting object code is in 64-bit ELF for‐
260                                   mat.
261
262
263       -xarch=amd64                Limits the instruction set  to  AMD64.  The
264                                   resulting object code is in 64-bit ELF for‐
265                                   mat.
266
267
268       -xmodel=[SMALL | KERNEL]    For AMD64 only, generate R_X86_64_32S relo‐
269                                   catable  type  for static data access under
270                                   KERNEL.  Otherwise,  generate   R_X86_64_32
271                                   under SMALL. SMALL is the default.
272
273

OPERANDS

275       The following operand is supported:
276
277       filename    Assembly language source file
278
279

ENVIRONMENT VARIABLES

281       TMPDIR    The as command normally creates temporary files in the direc‐
282                 tory /tmp. Another directory can be specified by setting  the
283                 environment  variable  TMPDIR  to  the  chosen directory. (If
284                 TMPDIR is not a valid directory, then as uses /tmp).
285
286

FILES

288       By default, as creates its temporary files in /tmp.
289

ATTRIBUTES

291       See attributes(5) for descriptions of the following attributes:
292
293
294
295
296       ┌─────────────────────────────┬─────────────────────────────┐
297       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
298       ├─────────────────────────────┼─────────────────────────────┤
299       │Availability                 │SUNWsprot                    │
300       └─────────────────────────────┴─────────────────────────────┘
301

SEE ALSO

303       cpp(1),ld(1),   m4(1),   nm(1),   strip(1),    tmpnam(3C),    a.out(4),
304       attributes(5)
305
306
307       dbx and analyzer manual pages available with Sun Studio documentation.
308

NOTES

310       If  the  -m  option,  which invokes the m4(1) macro processor, is used,
311       keywords for m4  cannot  be  used  as  symbols  (variables,  functions,
312       labels) in the input file, since m4 cannot determine which keywords are
313       assembler symbols and which keywords are real m4 macros.
314
315
316       Whenever possible, access the assembler through  a  compilation  system
317       interface program.
318
319
320       All undefined symbols are treated as global.
321
322
323
324SunOS 5.11                        24 Aug 2009                            as(1)
Impressum