| 1 | This is as.info, produced by makeinfo version 4.3 from as.texinfo.
|
|---|
| 2 |
|
|---|
| 3 | START-INFO-DIR-ENTRY
|
|---|
| 4 | * As: (as). The GNU assembler.
|
|---|
| 5 | * Gas: (as). The GNU assembler.
|
|---|
| 6 | END-INFO-DIR-ENTRY
|
|---|
| 7 |
|
|---|
| 8 | This file documents the GNU Assembler "as".
|
|---|
| 9 |
|
|---|
| 10 | Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002
|
|---|
| 11 | Free Software Foundation, Inc.
|
|---|
| 12 |
|
|---|
| 13 | Permission is granted to copy, distribute and/or modify this document
|
|---|
| 14 | under the terms of the GNU Free Documentation License, Version 1.1 or
|
|---|
| 15 | any later version published by the Free Software Foundation; with no
|
|---|
| 16 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
|---|
| 17 | Texts. A copy of the license is included in the section entitled "GNU
|
|---|
| 18 | Free Documentation License".
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | File: as.info, Node: Balign, Next: Byte, Prev: Asciz, Up: Pseudo Ops
|
|---|
| 22 |
|
|---|
| 23 | `.balign[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR'
|
|---|
| 24 | ==========================================
|
|---|
| 25 |
|
|---|
| 26 | Pad the location counter (in the current subsection) to a particular
|
|---|
| 27 | storage boundary. The first expression (which must be absolute) is the
|
|---|
| 28 | alignment request in bytes. For example `.balign 8' advances the
|
|---|
| 29 | location counter until it is a multiple of 8. If the location counter
|
|---|
| 30 | is already a multiple of 8, no change is needed.
|
|---|
| 31 |
|
|---|
| 32 | The second expression (also absolute) gives the fill value to be
|
|---|
| 33 | stored in the padding bytes. It (and the comma) may be omitted. If it
|
|---|
| 34 | is omitted, the padding bytes are normally zero. However, on some
|
|---|
| 35 | systems, if the section is marked as containing code and the fill value
|
|---|
| 36 | is omitted, the space is filled with no-op instructions.
|
|---|
| 37 |
|
|---|
| 38 | The third expression is also absolute, and is also optional. If it
|
|---|
| 39 | is present, it is the maximum number of bytes that should be skipped by
|
|---|
| 40 | this alignment directive. If doing the alignment would require
|
|---|
| 41 | skipping more bytes than the specified maximum, then the alignment is
|
|---|
| 42 | not done at all. You can omit the fill value (the second argument)
|
|---|
| 43 | entirely by simply using two commas after the required alignment; this
|
|---|
| 44 | can be useful if you want the alignment to be filled with no-op
|
|---|
| 45 | instructions when appropriate.
|
|---|
| 46 |
|
|---|
| 47 | The `.balignw' and `.balignl' directives are variants of the
|
|---|
| 48 | `.balign' directive. The `.balignw' directive treats the fill pattern
|
|---|
| 49 | as a two byte word value. The `.balignl' directives treats the fill
|
|---|
| 50 | pattern as a four byte longword value. For example, `.balignw
|
|---|
| 51 | 4,0x368d' will align to a multiple of 4. If it skips two bytes, they
|
|---|
| 52 | will be filled in with the value 0x368d (the exact placement of the
|
|---|
| 53 | bytes depends upon the endianness of the processor). If it skips 1 or
|
|---|
| 54 | 3 bytes, the fill value is undefined.
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | File: as.info, Node: Byte, Next: Comm, Prev: Balign, Up: Pseudo Ops
|
|---|
| 58 |
|
|---|
| 59 | `.byte EXPRESSIONS'
|
|---|
| 60 | ===================
|
|---|
| 61 |
|
|---|
| 62 | `.byte' expects zero or more expressions, separated by commas. Each
|
|---|
| 63 | expression is assembled into the next byte.
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 | File: as.info, Node: Comm, Next: Data, Prev: Byte, Up: Pseudo Ops
|
|---|
| 67 |
|
|---|
| 68 | `.comm SYMBOL , LENGTH '
|
|---|
| 69 | ========================
|
|---|
| 70 |
|
|---|
| 71 | `.comm' declares a common symbol named SYMBOL. When linking, a
|
|---|
| 72 | common symbol in one object file may be merged with a defined or common
|
|---|
| 73 | symbol of the same name in another object file. If `ld' does not see a
|
|---|
| 74 | definition for the symbol-just one or more common symbols-then it will
|
|---|
| 75 | allocate LENGTH bytes of uninitialized memory. LENGTH must be an
|
|---|
| 76 | absolute expression. If `ld' sees multiple common symbols with the
|
|---|
| 77 | same name, and they do not all have the same size, it will allocate
|
|---|
| 78 | space using the largest size.
|
|---|
| 79 |
|
|---|
| 80 | When using ELF, the `.comm' directive takes an optional third
|
|---|
| 81 | argument. This is the desired alignment of the symbol, specified as a
|
|---|
| 82 | byte boundary (for example, an alignment of 16 means that the least
|
|---|
| 83 | significant 4 bits of the address should be zero). The alignment must
|
|---|
| 84 | be an absolute expression, and it must be a power of two. If `ld'
|
|---|
| 85 | allocates uninitialized memory for the common symbol, it will use the
|
|---|
| 86 | alignment when placing the symbol. If no alignment is specified, `as'
|
|---|
| 87 | will set the alignment to the largest power of two less than or equal
|
|---|
| 88 | to the size of the symbol, up to a maximum of 16.
|
|---|
| 89 |
|
|---|
| 90 | The syntax for `.comm' differs slightly on the HPPA. The syntax is
|
|---|
| 91 | `SYMBOL .comm, LENGTH'; SYMBOL is optional.
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 | File: as.info, Node: Data, Next: Def, Prev: Comm, Up: Pseudo Ops
|
|---|
| 95 |
|
|---|
| 96 | `.data SUBSECTION'
|
|---|
| 97 | ==================
|
|---|
| 98 |
|
|---|
| 99 | `.data' tells `as' to assemble the following statements onto the end
|
|---|
| 100 | of the data subsection numbered SUBSECTION (which is an absolute
|
|---|
| 101 | expression). If SUBSECTION is omitted, it defaults to zero.
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 | File: as.info, Node: Def, Next: Desc, Prev: Data, Up: Pseudo Ops
|
|---|
| 105 |
|
|---|
| 106 | `.def NAME'
|
|---|
| 107 | ===========
|
|---|
| 108 |
|
|---|
| 109 | Begin defining debugging information for a symbol NAME; the
|
|---|
| 110 | definition extends until the `.endef' directive is encountered.
|
|---|
| 111 |
|
|---|
| 112 | This directive is only observed when `as' is configured for COFF
|
|---|
| 113 | format output; when producing `b.out', `.def' is recognized, but
|
|---|
| 114 | ignored.
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 | File: as.info, Node: Desc, Next: Dim, Prev: Def, Up: Pseudo Ops
|
|---|
| 118 |
|
|---|
| 119 | `.desc SYMBOL, ABS-EXPRESSION'
|
|---|
| 120 | ==============================
|
|---|
| 121 |
|
|---|
| 122 | This directive sets the descriptor of the symbol (*note Symbol
|
|---|
| 123 | Attributes::) to the low 16 bits of an absolute expression.
|
|---|
| 124 |
|
|---|
| 125 | The `.desc' directive is not available when `as' is configured for
|
|---|
| 126 | COFF output; it is only for `a.out' or `b.out' object format. For the
|
|---|
| 127 | sake of compatibility, `as' accepts it, but produces no output, when
|
|---|
| 128 | configured for COFF.
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 | File: as.info, Node: Dim, Next: Double, Prev: Desc, Up: Pseudo Ops
|
|---|
| 132 |
|
|---|
| 133 | `.dim'
|
|---|
| 134 | ======
|
|---|
| 135 |
|
|---|
| 136 | This directive is generated by compilers to include auxiliary
|
|---|
| 137 | debugging information in the symbol table. It is only permitted inside
|
|---|
| 138 | `.def'/`.endef' pairs.
|
|---|
| 139 |
|
|---|
| 140 | `.dim' is only meaningful when generating COFF format output; when
|
|---|
| 141 | `as' is generating `b.out', it accepts this directive but ignores it.
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 | File: as.info, Node: Double, Next: Eject, Prev: Dim, Up: Pseudo Ops
|
|---|
| 145 |
|
|---|
| 146 | `.double FLONUMS'
|
|---|
| 147 | =================
|
|---|
| 148 |
|
|---|
| 149 | `.double' expects zero or more flonums, separated by commas. It
|
|---|
| 150 | assembles floating point numbers. The exact kind of floating point
|
|---|
| 151 | numbers emitted depends on how `as' is configured. *Note Machine
|
|---|
| 152 | Dependencies::.
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 | File: as.info, Node: Eject, Next: Else, Prev: Double, Up: Pseudo Ops
|
|---|
| 156 |
|
|---|
| 157 | `.eject'
|
|---|
| 158 | ========
|
|---|
| 159 |
|
|---|
| 160 | Force a page break at this point, when generating assembly listings.
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 | File: as.info, Node: Else, Next: Elseif, Prev: Eject, Up: Pseudo Ops
|
|---|
| 164 |
|
|---|
| 165 | `.else'
|
|---|
| 166 | =======
|
|---|
| 167 |
|
|---|
| 168 | `.else' is part of the `as' support for conditional assembly; *note
|
|---|
| 169 | `.if': If.. It marks the beginning of a section of code to be
|
|---|
| 170 | assembled if the condition for the preceding `.if' was false.
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 | File: as.info, Node: Elseif, Next: End, Prev: Else, Up: Pseudo Ops
|
|---|
| 174 |
|
|---|
| 175 | `.elseif'
|
|---|
| 176 | =========
|
|---|
| 177 |
|
|---|
| 178 | `.elseif' is part of the `as' support for conditional assembly;
|
|---|
| 179 | *note `.if': If.. It is shorthand for beginning a new `.if' block that
|
|---|
| 180 | would otherwise fill the entire `.else' section.
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 | File: as.info, Node: End, Next: Endef, Prev: Elseif, Up: Pseudo Ops
|
|---|
| 184 |
|
|---|
| 185 | `.end'
|
|---|
| 186 | ======
|
|---|
| 187 |
|
|---|
| 188 | `.end' marks the end of the assembly file. `as' does not process
|
|---|
| 189 | anything in the file past the `.end' directive.
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 | File: as.info, Node: Endef, Next: Endfunc, Prev: End, Up: Pseudo Ops
|
|---|
| 193 |
|
|---|
| 194 | `.endef'
|
|---|
| 195 | ========
|
|---|
| 196 |
|
|---|
| 197 | This directive flags the end of a symbol definition begun with
|
|---|
| 198 | `.def'.
|
|---|
| 199 |
|
|---|
| 200 | `.endef' is only meaningful when generating COFF format output; if
|
|---|
| 201 | `as' is configured to generate `b.out', it accepts this directive but
|
|---|
| 202 | ignores it.
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 | File: as.info, Node: Endfunc, Next: Endif, Prev: Endef, Up: Pseudo Ops
|
|---|
| 206 |
|
|---|
| 207 | `.endfunc'
|
|---|
| 208 | ==========
|
|---|
| 209 |
|
|---|
| 210 | `.endfunc' marks the end of a function specified with `.func'.
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 | File: as.info, Node: Endif, Next: Equ, Prev: Endfunc, Up: Pseudo Ops
|
|---|
| 214 |
|
|---|
| 215 | `.endif'
|
|---|
| 216 | ========
|
|---|
| 217 |
|
|---|
| 218 | `.endif' is part of the `as' support for conditional assembly; it
|
|---|
| 219 | marks the end of a block of code that is only assembled conditionally.
|
|---|
| 220 | *Note `.if': If.
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 | File: as.info, Node: Equ, Next: Equiv, Prev: Endif, Up: Pseudo Ops
|
|---|
| 224 |
|
|---|
| 225 | `.equ SYMBOL, EXPRESSION'
|
|---|
| 226 | =========================
|
|---|
| 227 |
|
|---|
| 228 | This directive sets the value of SYMBOL to EXPRESSION. It is
|
|---|
| 229 | synonymous with `.set'; *note `.set': Set..
|
|---|
| 230 |
|
|---|
| 231 | The syntax for `equ' on the HPPA is `SYMBOL .equ EXPRESSION'.
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 | File: as.info, Node: Equiv, Next: Err, Prev: Equ, Up: Pseudo Ops
|
|---|
| 235 |
|
|---|
| 236 | `.equiv SYMBOL, EXPRESSION'
|
|---|
| 237 | ===========================
|
|---|
| 238 |
|
|---|
| 239 | The `.equiv' directive is like `.equ' and `.set', except that the
|
|---|
| 240 | assembler will signal an error if SYMBOL is already defined. Note a
|
|---|
| 241 | symbol which has been referenced but not actually defined is considered
|
|---|
| 242 | to be undefined.
|
|---|
| 243 |
|
|---|
| 244 | Except for the contents of the error message, this is roughly
|
|---|
| 245 | equivalent to
|
|---|
| 246 | .ifdef SYM
|
|---|
| 247 | .err
|
|---|
| 248 | .endif
|
|---|
| 249 | .equ SYM,VAL
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 | File: as.info, Node: Err, Next: Exitm, Prev: Equiv, Up: Pseudo Ops
|
|---|
| 253 |
|
|---|
| 254 | `.err'
|
|---|
| 255 | ======
|
|---|
| 256 |
|
|---|
| 257 | If `as' assembles a `.err' directive, it will print an error message
|
|---|
| 258 | and, unless the `-Z' option was used, it will not generate an object
|
|---|
| 259 | file. This can be used to signal error an conditionally compiled code.
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 | File: as.info, Node: Exitm, Next: Extern, Prev: Err, Up: Pseudo Ops
|
|---|
| 263 |
|
|---|
| 264 | `.exitm'
|
|---|
| 265 | ========
|
|---|
| 266 |
|
|---|
| 267 | Exit early from the current macro definition. *Note Macro::.
|
|---|
| 268 |
|
|---|
| 269 |
|
|---|
| 270 | File: as.info, Node: Extern, Next: Fail, Prev: Exitm, Up: Pseudo Ops
|
|---|
| 271 |
|
|---|
| 272 | `.extern'
|
|---|
| 273 | =========
|
|---|
| 274 |
|
|---|
| 275 | `.extern' is accepted in the source program--for compatibility with
|
|---|
| 276 | other assemblers--but it is ignored. `as' treats all undefined symbols
|
|---|
| 277 | as external.
|
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 | File: as.info, Node: Fail, Next: File, Prev: Extern, Up: Pseudo Ops
|
|---|
| 281 |
|
|---|
| 282 | `.fail EXPRESSION'
|
|---|
| 283 | ==================
|
|---|
| 284 |
|
|---|
| 285 | Generates an error or a warning. If the value of the EXPRESSION is
|
|---|
| 286 | 500 or more, `as' will print a warning message. If the value is less
|
|---|
| 287 | than 500, `as' will print an error message. The message will include
|
|---|
| 288 | the value of EXPRESSION. This can occasionally be useful inside
|
|---|
| 289 | complex nested macros or conditional assembly.
|
|---|
| 290 |
|
|---|
| 291 |
|
|---|
| 292 | File: as.info, Node: File, Next: Fill, Prev: Fail, Up: Pseudo Ops
|
|---|
| 293 |
|
|---|
| 294 | `.file STRING'
|
|---|
| 295 | ==============
|
|---|
| 296 |
|
|---|
| 297 | `.file' tells `as' that we are about to start a new logical file.
|
|---|
| 298 | STRING is the new file name. In general, the filename is recognized
|
|---|
| 299 | whether or not it is surrounded by quotes `"'; but if you wish to
|
|---|
| 300 | specify an empty file name, you must give the quotes-`""'. This
|
|---|
| 301 | statement may go away in future: it is only recognized to be compatible
|
|---|
| 302 | with old `as' programs. In some configurations of `as', `.file' has
|
|---|
| 303 | already been removed to avoid conflicts with other assemblers. *Note
|
|---|
| 304 | Machine Dependencies::.
|
|---|
| 305 |
|
|---|
| 306 |
|
|---|
| 307 | File: as.info, Node: Fill, Next: Float, Prev: File, Up: Pseudo Ops
|
|---|
| 308 |
|
|---|
| 309 | `.fill REPEAT , SIZE , VALUE'
|
|---|
| 310 | =============================
|
|---|
| 311 |
|
|---|
| 312 | REPEAT, SIZE and VALUE are absolute expressions. This emits REPEAT
|
|---|
| 313 | copies of SIZE bytes. REPEAT may be zero or more. SIZE may be zero or
|
|---|
| 314 | more, but if it is more than 8, then it is deemed to have the value 8,
|
|---|
| 315 | compatible with other people's assemblers. The contents of each REPEAT
|
|---|
| 316 | bytes is taken from an 8-byte number. The highest order 4 bytes are
|
|---|
| 317 | zero. The lowest order 4 bytes are VALUE rendered in the byte-order of
|
|---|
| 318 | an integer on the computer `as' is assembling for. Each SIZE bytes in
|
|---|
| 319 | a repetition is taken from the lowest order SIZE bytes of this number.
|
|---|
| 320 | Again, this bizarre behavior is compatible with other people's
|
|---|
| 321 | assemblers.
|
|---|
| 322 |
|
|---|
| 323 | SIZE and VALUE are optional. If the second comma and VALUE are
|
|---|
| 324 | absent, VALUE is assumed zero. If the first comma and following tokens
|
|---|
| 325 | are absent, SIZE is assumed to be 1.
|
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 | File: as.info, Node: Float, Next: Func, Prev: Fill, Up: Pseudo Ops
|
|---|
| 329 |
|
|---|
| 330 | `.float FLONUMS'
|
|---|
| 331 | ================
|
|---|
| 332 |
|
|---|
| 333 | This directive assembles zero or more flonums, separated by commas.
|
|---|
| 334 | It has the same effect as `.single'. The exact kind of floating point
|
|---|
| 335 | numbers emitted depends on how `as' is configured. *Note Machine
|
|---|
| 336 | Dependencies::.
|
|---|
| 337 |
|
|---|
| 338 |
|
|---|
| 339 | File: as.info, Node: Func, Next: Global, Prev: Float, Up: Pseudo Ops
|
|---|
| 340 |
|
|---|
| 341 | `.func NAME[,LABEL]'
|
|---|
| 342 | ====================
|
|---|
| 343 |
|
|---|
| 344 | `.func' emits debugging information to denote function NAME, and is
|
|---|
| 345 | ignored unless the file is assembled with debugging enabled. Only
|
|---|
| 346 | `--gstabs' is currently supported. LABEL is the entry point of the
|
|---|
| 347 | function and if omitted NAME prepended with the `leading char' is used.
|
|---|
| 348 | `leading char' is usually `_' or nothing, depending on the target. All
|
|---|
| 349 | functions are currently defined to have `void' return type. The
|
|---|
| 350 | function must be terminated with `.endfunc'.
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 | File: as.info, Node: Global, Next: Hidden, Prev: Func, Up: Pseudo Ops
|
|---|
| 354 |
|
|---|
| 355 | `.global SYMBOL', `.globl SYMBOL'
|
|---|
| 356 | =================================
|
|---|
| 357 |
|
|---|
| 358 | `.global' makes the symbol visible to `ld'. If you define SYMBOL in
|
|---|
| 359 | your partial program, its value is made available to other partial
|
|---|
| 360 | programs that are linked with it. Otherwise, SYMBOL takes its
|
|---|
| 361 | attributes from a symbol of the same name from another file linked into
|
|---|
| 362 | the same program.
|
|---|
| 363 |
|
|---|
| 364 | Both spellings (`.globl' and `.global') are accepted, for
|
|---|
| 365 | compatibility with other assemblers.
|
|---|
| 366 |
|
|---|
| 367 | On the HPPA, `.global' is not always enough to make it accessible to
|
|---|
| 368 | other partial programs. You may need the HPPA-only `.EXPORT' directive
|
|---|
| 369 | as well. *Note HPPA Assembler Directives: HPPA Directives.
|
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 | File: as.info, Node: Hidden, Next: hword, Prev: Global, Up: Pseudo Ops
|
|---|
| 373 |
|
|---|
| 374 | `.hidden NAMES'
|
|---|
| 375 | ===============
|
|---|
| 376 |
|
|---|
| 377 | This one of the ELF visibility directives. The other two are
|
|---|
| 378 | `.internal' (*note `.internal': Internal.) and `.protected' (*note
|
|---|
| 379 | `.protected': Protected.).
|
|---|
| 380 |
|
|---|
| 381 | This directive overrides the named symbols default visibility (which
|
|---|
| 382 | is set by their binding: local, global or weak). The directive sets
|
|---|
| 383 | the visibility to `hidden' which means that the symbols are not visible
|
|---|
| 384 | to other components. Such symbols are always considered to be
|
|---|
| 385 | `protected' as well.
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 | File: as.info, Node: hword, Next: Ident, Prev: Hidden, Up: Pseudo Ops
|
|---|
| 389 |
|
|---|
| 390 | `.hword EXPRESSIONS'
|
|---|
| 391 | ====================
|
|---|
| 392 |
|
|---|
| 393 | This expects zero or more EXPRESSIONS, and emits a 16 bit number for
|
|---|
| 394 | each.
|
|---|
| 395 |
|
|---|
| 396 | This directive is a synonym for `.short'; depending on the target
|
|---|
| 397 | architecture, it may also be a synonym for `.word'.
|
|---|
| 398 |
|
|---|
| 399 |
|
|---|
| 400 | File: as.info, Node: Ident, Next: If, Prev: hword, Up: Pseudo Ops
|
|---|
| 401 |
|
|---|
| 402 | `.ident'
|
|---|
| 403 | ========
|
|---|
| 404 |
|
|---|
| 405 | This directive is used by some assemblers to place tags in object
|
|---|
| 406 | files. `as' simply accepts the directive for source-file compatibility
|
|---|
| 407 | with such assemblers, but does not actually emit anything for it.
|
|---|
| 408 |
|
|---|
| 409 |
|
|---|
| 410 | File: as.info, Node: If, Next: Incbin, Prev: Ident, Up: Pseudo Ops
|
|---|
| 411 |
|
|---|
| 412 | `.if ABSOLUTE EXPRESSION'
|
|---|
| 413 | =========================
|
|---|
| 414 |
|
|---|
| 415 | `.if' marks the beginning of a section of code which is only
|
|---|
| 416 | considered part of the source program being assembled if the argument
|
|---|
| 417 | (which must be an ABSOLUTE EXPRESSION) is non-zero. The end of the
|
|---|
| 418 | conditional section of code must be marked by `.endif' (*note `.endif':
|
|---|
| 419 | Endif.); optionally, you may include code for the alternative
|
|---|
| 420 | condition, flagged by `.else' (*note `.else': Else.). If you have
|
|---|
| 421 | several conditions to check, `.elseif' may be used to avoid nesting
|
|---|
| 422 | blocks if/else within each subsequent `.else' block.
|
|---|
| 423 |
|
|---|
| 424 | The following variants of `.if' are also supported:
|
|---|
| 425 | `.ifdef SYMBOL'
|
|---|
| 426 | Assembles the following section of code if the specified SYMBOL
|
|---|
| 427 | has been defined. Note a symbol which has been referenced but not
|
|---|
| 428 | yet defined is considered to be undefined.
|
|---|
| 429 |
|
|---|
| 430 | `.ifc STRING1,STRING2'
|
|---|
| 431 | Assembles the following section of code if the two strings are the
|
|---|
| 432 | same. The strings may be optionally quoted with single quotes.
|
|---|
| 433 | If they are not quoted, the first string stops at the first comma,
|
|---|
| 434 | and the second string stops at the end of the line. Strings which
|
|---|
| 435 | contain whitespace should be quoted. The string comparison is
|
|---|
| 436 | case sensitive.
|
|---|
| 437 |
|
|---|
| 438 | `.ifeq ABSOLUTE EXPRESSION'
|
|---|
| 439 | Assembles the following section of code if the argument is zero.
|
|---|
| 440 |
|
|---|
| 441 | `.ifeqs STRING1,STRING2'
|
|---|
| 442 | Another form of `.ifc'. The strings must be quoted using double
|
|---|
| 443 | quotes.
|
|---|
| 444 |
|
|---|
| 445 | `.ifge ABSOLUTE EXPRESSION'
|
|---|
| 446 | Assembles the following section of code if the argument is greater
|
|---|
| 447 | than or equal to zero.
|
|---|
| 448 |
|
|---|
| 449 | `.ifgt ABSOLUTE EXPRESSION'
|
|---|
| 450 | Assembles the following section of code if the argument is greater
|
|---|
| 451 | than zero.
|
|---|
| 452 |
|
|---|
| 453 | `.ifle ABSOLUTE EXPRESSION'
|
|---|
| 454 | Assembles the following section of code if the argument is less
|
|---|
| 455 | than or equal to zero.
|
|---|
| 456 |
|
|---|
| 457 | `.iflt ABSOLUTE EXPRESSION'
|
|---|
| 458 | Assembles the following section of code if the argument is less
|
|---|
| 459 | than zero.
|
|---|
| 460 |
|
|---|
| 461 | `.ifnc STRING1,STRING2.'
|
|---|
| 462 | Like `.ifc', but the sense of the test is reversed: this assembles
|
|---|
| 463 | the following section of code if the two strings are not the same.
|
|---|
| 464 |
|
|---|
| 465 | `.ifndef SYMBOL'
|
|---|
| 466 | `.ifnotdef SYMBOL'
|
|---|
| 467 | Assembles the following section of code if the specified SYMBOL
|
|---|
| 468 | has not been defined. Both spelling variants are equivalent.
|
|---|
| 469 | Note a symbol which has been referenced but not yet defined is
|
|---|
| 470 | considered to be undefined.
|
|---|
| 471 |
|
|---|
| 472 | `.ifne ABSOLUTE EXPRESSION'
|
|---|
| 473 | Assembles the following section of code if the argument is not
|
|---|
| 474 | equal to zero (in other words, this is equivalent to `.if').
|
|---|
| 475 |
|
|---|
| 476 | `.ifnes STRING1,STRING2'
|
|---|
| 477 | Like `.ifeqs', but the sense of the test is reversed: this
|
|---|
| 478 | assembles the following section of code if the two strings are not
|
|---|
| 479 | the same.
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 | File: as.info, Node: Incbin, Next: Include, Prev: If, Up: Pseudo Ops
|
|---|
| 483 |
|
|---|
| 484 | `.incbin "FILE"[,SKIP[,COUNT]]'
|
|---|
| 485 | ===============================
|
|---|
| 486 |
|
|---|
| 487 | The `incbin' directive includes FILE verbatim at the current
|
|---|
| 488 | location. You can control the search paths used with the `-I'
|
|---|
| 489 | command-line option (*note Command-Line Options: Invoking.). Quotation
|
|---|
| 490 | marks are required around FILE.
|
|---|
| 491 |
|
|---|
| 492 | The SKIP argument skips a number of bytes from the start of the
|
|---|
| 493 | FILE. The COUNT argument indicates the maximum number of bytes to
|
|---|
| 494 | read. Note that the data is not aligned in any way, so it is the user's
|
|---|
| 495 | responsibility to make sure that proper alignment is provided both
|
|---|
| 496 | before and after the `incbin' directive.
|
|---|
| 497 |
|
|---|
| 498 |
|
|---|
| 499 | File: as.info, Node: Include, Next: Int, Prev: Incbin, Up: Pseudo Ops
|
|---|
| 500 |
|
|---|
| 501 | `.include "FILE"'
|
|---|
| 502 | =================
|
|---|
| 503 |
|
|---|
| 504 | This directive provides a way to include supporting files at
|
|---|
| 505 | specified points in your source program. The code from FILE is
|
|---|
| 506 | assembled as if it followed the point of the `.include'; when the end
|
|---|
| 507 | of the included file is reached, assembly of the original file
|
|---|
| 508 | continues. You can control the search paths used with the `-I'
|
|---|
| 509 | command-line option (*note Command-Line Options: Invoking.). Quotation
|
|---|
| 510 | marks are required around FILE.
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 | File: as.info, Node: Int, Next: Internal, Prev: Include, Up: Pseudo Ops
|
|---|
| 514 |
|
|---|
| 515 | `.int EXPRESSIONS'
|
|---|
| 516 | ==================
|
|---|
| 517 |
|
|---|
| 518 | Expect zero or more EXPRESSIONS, of any section, separated by commas.
|
|---|
| 519 | For each expression, emit a number that, at run time, is the value of
|
|---|
| 520 | that expression. The byte order and bit size of the number depends on
|
|---|
| 521 | what kind of target the assembly is for.
|
|---|
| 522 |
|
|---|
| 523 |
|
|---|
| 524 | File: as.info, Node: Internal, Next: Irp, Prev: Int, Up: Pseudo Ops
|
|---|
| 525 |
|
|---|
| 526 | `.internal NAMES'
|
|---|
| 527 | =================
|
|---|
| 528 |
|
|---|
| 529 | This one of the ELF visibility directives. The other two are
|
|---|
| 530 | `.hidden' (*note `.hidden': Hidden.) and `.protected' (*note
|
|---|
| 531 | `.protected': Protected.).
|
|---|
| 532 |
|
|---|
| 533 | This directive overrides the named symbols default visibility (which
|
|---|
| 534 | is set by their binding: local, global or weak). The directive sets
|
|---|
| 535 | the visibility to `internal' which means that the symbols are
|
|---|
| 536 | considered to be `hidden' (i.e., not visible to other components), and
|
|---|
| 537 | that some extra, processor specific processing must also be performed
|
|---|
| 538 | upon the symbols as well.
|
|---|
| 539 |
|
|---|
| 540 |
|
|---|
| 541 | File: as.info, Node: Irp, Next: Irpc, Prev: Internal, Up: Pseudo Ops
|
|---|
| 542 |
|
|---|
| 543 | `.irp SYMBOL,VALUES'...
|
|---|
| 544 | =======================
|
|---|
| 545 |
|
|---|
| 546 | Evaluate a sequence of statements assigning different values to
|
|---|
| 547 | SYMBOL. The sequence of statements starts at the `.irp' directive, and
|
|---|
| 548 | is terminated by an `.endr' directive. For each VALUE, SYMBOL is set
|
|---|
| 549 | to VALUE, and the sequence of statements is assembled. If no VALUE is
|
|---|
| 550 | listed, the sequence of statements is assembled once, with SYMBOL set
|
|---|
| 551 | to the null string. To refer to SYMBOL within the sequence of
|
|---|
| 552 | statements, use \SYMBOL.
|
|---|
| 553 |
|
|---|
| 554 | For example, assembling
|
|---|
| 555 |
|
|---|
| 556 | .irp param,1,2,3
|
|---|
| 557 | move d\param,sp@-
|
|---|
| 558 | .endr
|
|---|
| 559 |
|
|---|
| 560 | is equivalent to assembling
|
|---|
| 561 |
|
|---|
| 562 | move d1,sp@-
|
|---|
| 563 | move d2,sp@-
|
|---|
| 564 | move d3,sp@-
|
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 | File: as.info, Node: Irpc, Next: Lcomm, Prev: Irp, Up: Pseudo Ops
|
|---|
| 568 |
|
|---|
| 569 | `.irpc SYMBOL,VALUES'...
|
|---|
| 570 | ========================
|
|---|
| 571 |
|
|---|
| 572 | Evaluate a sequence of statements assigning different values to
|
|---|
| 573 | SYMBOL. The sequence of statements starts at the `.irpc' directive,
|
|---|
| 574 | and is terminated by an `.endr' directive. For each character in VALUE,
|
|---|
| 575 | SYMBOL is set to the character, and the sequence of statements is
|
|---|
| 576 | assembled. If no VALUE is listed, the sequence of statements is
|
|---|
| 577 | assembled once, with SYMBOL set to the null string. To refer to SYMBOL
|
|---|
| 578 | within the sequence of statements, use \SYMBOL.
|
|---|
| 579 |
|
|---|
| 580 | For example, assembling
|
|---|
| 581 |
|
|---|
| 582 | .irpc param,123
|
|---|
| 583 | move d\param,sp@-
|
|---|
| 584 | .endr
|
|---|
| 585 |
|
|---|
| 586 | is equivalent to assembling
|
|---|
| 587 |
|
|---|
| 588 | move d1,sp@-
|
|---|
| 589 | move d2,sp@-
|
|---|
| 590 | move d3,sp@-
|
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| 593 | File: as.info, Node: Lcomm, Next: Lflags, Prev: Irpc, Up: Pseudo Ops
|
|---|
| 594 |
|
|---|
| 595 | `.lcomm SYMBOL , LENGTH'
|
|---|
| 596 | ========================
|
|---|
| 597 |
|
|---|
| 598 | Reserve LENGTH (an absolute expression) bytes for a local common
|
|---|
| 599 | denoted by SYMBOL. The section and value of SYMBOL are those of the
|
|---|
| 600 | new local common. The addresses are allocated in the bss section, so
|
|---|
| 601 | that at run-time the bytes start off zeroed. SYMBOL is not declared
|
|---|
| 602 | global (*note `.global': Global.), so is normally not visible to `ld'.
|
|---|
| 603 |
|
|---|
| 604 | Some targets permit a third argument to be used with `.lcomm'. This
|
|---|
| 605 | argument specifies the desired alignment of the symbol in the bss
|
|---|
| 606 | section.
|
|---|
| 607 |
|
|---|
| 608 | The syntax for `.lcomm' differs slightly on the HPPA. The syntax is
|
|---|
| 609 | `SYMBOL .lcomm, LENGTH'; SYMBOL is optional.
|
|---|
| 610 |
|
|---|
| 611 |
|
|---|
| 612 | File: as.info, Node: Lflags, Next: Line, Prev: Lcomm, Up: Pseudo Ops
|
|---|
| 613 |
|
|---|
| 614 | `.lflags'
|
|---|
| 615 | =========
|
|---|
| 616 |
|
|---|
| 617 | `as' accepts this directive, for compatibility with other
|
|---|
| 618 | assemblers, but ignores it.
|
|---|
| 619 |
|
|---|
| 620 |
|
|---|
| 621 | File: as.info, Node: Line, Next: Ln, Prev: Lflags, Up: Pseudo Ops
|
|---|
| 622 |
|
|---|
| 623 | `.line LINE-NUMBER'
|
|---|
| 624 | ===================
|
|---|
| 625 |
|
|---|
| 626 | Change the logical line number. LINE-NUMBER must be an absolute
|
|---|
| 627 | expression. The next line has that logical line number. Therefore any
|
|---|
| 628 | other statements on the current line (after a statement separator
|
|---|
| 629 | character) are reported as on logical line number LINE-NUMBER - 1. One
|
|---|
| 630 | day `as' will no longer support this directive: it is recognized only
|
|---|
| 631 | for compatibility with existing assembler programs.
|
|---|
| 632 |
|
|---|
| 633 | _Warning:_ In the AMD29K configuration of as, this command is not
|
|---|
| 634 | available; use the synonym `.ln' in that context.
|
|---|
| 635 |
|
|---|
| 636 | Even though this is a directive associated with the `a.out' or
|
|---|
| 637 | `b.out' object-code formats, `as' still recognizes it when producing
|
|---|
| 638 | COFF output, and treats `.line' as though it were the COFF `.ln' _if_
|
|---|
| 639 | it is found outside a `.def'/`.endef' pair.
|
|---|
| 640 |
|
|---|
| 641 | Inside a `.def', `.line' is, instead, one of the directives used by
|
|---|
| 642 | compilers to generate auxiliary symbol information for debugging.
|
|---|
| 643 |
|
|---|
| 644 |
|
|---|
| 645 | File: as.info, Node: Linkonce, Next: List, Prev: Ln, Up: Pseudo Ops
|
|---|
| 646 |
|
|---|
| 647 | `.linkonce [TYPE]'
|
|---|
| 648 | ==================
|
|---|
| 649 |
|
|---|
| 650 | Mark the current section so that the linker only includes a single
|
|---|
| 651 | copy of it. This may be used to include the same section in several
|
|---|
| 652 | different object files, but ensure that the linker will only include it
|
|---|
| 653 | once in the final output file. The `.linkonce' pseudo-op must be used
|
|---|
| 654 | for each instance of the section. Duplicate sections are detected
|
|---|
| 655 | based on the section name, so it should be unique.
|
|---|
| 656 |
|
|---|
| 657 | This directive is only supported by a few object file formats; as of
|
|---|
| 658 | this writing, the only object file format which supports it is the
|
|---|
| 659 | Portable Executable format used on Windows NT.
|
|---|
| 660 |
|
|---|
| 661 | The TYPE argument is optional. If specified, it must be one of the
|
|---|
| 662 | following strings. For example:
|
|---|
| 663 | .linkonce same_size
|
|---|
| 664 | Not all types may be supported on all object file formats.
|
|---|
| 665 |
|
|---|
| 666 | `discard'
|
|---|
| 667 | Silently discard duplicate sections. This is the default.
|
|---|
| 668 |
|
|---|
| 669 | `one_only'
|
|---|
| 670 | Warn if there are duplicate sections, but still keep only one copy.
|
|---|
| 671 |
|
|---|
| 672 | `same_size'
|
|---|
| 673 | Warn if any of the duplicates have different sizes.
|
|---|
| 674 |
|
|---|
| 675 | `same_contents'
|
|---|
| 676 | Warn if any of the duplicates do not have exactly the same
|
|---|
| 677 | contents.
|
|---|
| 678 |
|
|---|
| 679 |
|
|---|
| 680 | File: as.info, Node: Ln, Next: Linkonce, Prev: Line, Up: Pseudo Ops
|
|---|
| 681 |
|
|---|
| 682 | `.ln LINE-NUMBER'
|
|---|
| 683 | =================
|
|---|
| 684 |
|
|---|
| 685 | `.ln' is a synonym for `.line'.
|
|---|
| 686 |
|
|---|
| 687 |
|
|---|
| 688 | File: as.info, Node: MRI, Next: Nolist, Prev: Macro, Up: Pseudo Ops
|
|---|
| 689 |
|
|---|
| 690 | `.mri VAL'
|
|---|
| 691 | ==========
|
|---|
| 692 |
|
|---|
| 693 | If VAL is non-zero, this tells `as' to enter MRI mode. If VAL is
|
|---|
| 694 | zero, this tells `as' to exit MRI mode. This change affects code
|
|---|
| 695 | assembled until the next `.mri' directive, or until the end of the
|
|---|
| 696 | file. *Note MRI mode: M.
|
|---|
| 697 |
|
|---|
| 698 |
|
|---|
| 699 | File: as.info, Node: List, Next: Long, Prev: Linkonce, Up: Pseudo Ops
|
|---|
| 700 |
|
|---|
| 701 | `.list'
|
|---|
| 702 | =======
|
|---|
| 703 |
|
|---|
| 704 | Control (in conjunction with the `.nolist' directive) whether or not
|
|---|
| 705 | assembly listings are generated. These two directives maintain an
|
|---|
| 706 | internal counter (which is zero initially). `.list' increments the
|
|---|
| 707 | counter, and `.nolist' decrements it. Assembly listings are generated
|
|---|
| 708 | whenever the counter is greater than zero.
|
|---|
| 709 |
|
|---|
| 710 | By default, listings are disabled. When you enable them (with the
|
|---|
| 711 | `-a' command line option; *note Command-Line Options: Invoking.), the
|
|---|
| 712 | initial value of the listing counter is one.
|
|---|
| 713 |
|
|---|
| 714 |
|
|---|
| 715 | File: as.info, Node: Long, Next: Macro, Prev: List, Up: Pseudo Ops
|
|---|
| 716 |
|
|---|
| 717 | `.long EXPRESSIONS'
|
|---|
| 718 | ===================
|
|---|
| 719 |
|
|---|
| 720 | `.long' is the same as `.int', *note `.int': Int..
|
|---|
| 721 |
|
|---|
| 722 |
|
|---|
| 723 | File: as.info, Node: Macro, Next: MRI, Prev: Long, Up: Pseudo Ops
|
|---|
| 724 |
|
|---|
| 725 | `.macro'
|
|---|
| 726 | ========
|
|---|
| 727 |
|
|---|
| 728 | The commands `.macro' and `.endm' allow you to define macros that
|
|---|
| 729 | generate assembly output. For example, this definition specifies a
|
|---|
| 730 | macro `sum' that puts a sequence of numbers into memory:
|
|---|
| 731 |
|
|---|
| 732 | .macro sum from=0, to=5
|
|---|
| 733 | .long \from
|
|---|
| 734 | .if \to-\from
|
|---|
| 735 | sum "(\from+1)",\to
|
|---|
| 736 | .endif
|
|---|
| 737 | .endm
|
|---|
| 738 |
|
|---|
| 739 | With that definition, `SUM 0,5' is equivalent to this assembly input:
|
|---|
| 740 |
|
|---|
| 741 | .long 0
|
|---|
| 742 | .long 1
|
|---|
| 743 | .long 2
|
|---|
| 744 | .long 3
|
|---|
| 745 | .long 4
|
|---|
| 746 | .long 5
|
|---|
| 747 |
|
|---|
| 748 | `.macro MACNAME'
|
|---|
| 749 | `.macro MACNAME MACARGS ...'
|
|---|
| 750 | Begin the definition of a macro called MACNAME. If your macro
|
|---|
| 751 | definition requires arguments, specify their names after the macro
|
|---|
| 752 | name, separated by commas or spaces. You can supply a default
|
|---|
| 753 | value for any macro argument by following the name with `=DEFLT'.
|
|---|
| 754 | For example, these are all valid `.macro' statements:
|
|---|
| 755 |
|
|---|
| 756 | `.macro comm'
|
|---|
| 757 | Begin the definition of a macro called `comm', which takes no
|
|---|
| 758 | arguments.
|
|---|
| 759 |
|
|---|
| 760 | `.macro plus1 p, p1'
|
|---|
| 761 | `.macro plus1 p p1'
|
|---|
| 762 | Either statement begins the definition of a macro called
|
|---|
| 763 | `plus1', which takes two arguments; within the macro
|
|---|
| 764 | definition, write `\p' or `\p1' to evaluate the arguments.
|
|---|
| 765 |
|
|---|
| 766 | `.macro reserve_str p1=0 p2'
|
|---|
| 767 | Begin the definition of a macro called `reserve_str', with two
|
|---|
| 768 | arguments. The first argument has a default value, but not
|
|---|
| 769 | the second. After the definition is complete, you can call
|
|---|
| 770 | the macro either as `reserve_str A,B' (with `\p1' evaluating
|
|---|
| 771 | to A and `\p2' evaluating to B), or as `reserve_str ,B' (with
|
|---|
| 772 | `\p1' evaluating as the default, in this case `0', and `\p2'
|
|---|
| 773 | evaluating to B).
|
|---|
| 774 |
|
|---|
| 775 | When you call a macro, you can specify the argument values either
|
|---|
| 776 | by position, or by keyword. For example, `sum 9,17' is equivalent
|
|---|
| 777 | to `sum to=17, from=9'.
|
|---|
| 778 |
|
|---|
| 779 | `.endm'
|
|---|
| 780 | Mark the end of a macro definition.
|
|---|
| 781 |
|
|---|
| 782 | `.exitm'
|
|---|
| 783 | Exit early from the current macro definition.
|
|---|
| 784 |
|
|---|
| 785 | `\@'
|
|---|
| 786 | `as' maintains a counter of how many macros it has executed in
|
|---|
| 787 | this pseudo-variable; you can copy that number to your output with
|
|---|
| 788 | `\@', but _only within a macro definition_.
|
|---|
| 789 |
|
|---|
| 790 |
|
|---|
| 791 | File: as.info, Node: Nolist, Next: Octa, Prev: MRI, Up: Pseudo Ops
|
|---|
| 792 |
|
|---|
| 793 | `.nolist'
|
|---|
| 794 | =========
|
|---|
| 795 |
|
|---|
| 796 | Control (in conjunction with the `.list' directive) whether or not
|
|---|
| 797 | assembly listings are generated. These two directives maintain an
|
|---|
| 798 | internal counter (which is zero initially). `.list' increments the
|
|---|
| 799 | counter, and `.nolist' decrements it. Assembly listings are generated
|
|---|
| 800 | whenever the counter is greater than zero.
|
|---|
| 801 |
|
|---|
| 802 |
|
|---|
| 803 | File: as.info, Node: Octa, Next: Org, Prev: Nolist, Up: Pseudo Ops
|
|---|
| 804 |
|
|---|
| 805 | `.octa BIGNUMS'
|
|---|
| 806 | ===============
|
|---|
| 807 |
|
|---|
| 808 | This directive expects zero or more bignums, separated by commas.
|
|---|
| 809 | For each bignum, it emits a 16-byte integer.
|
|---|
| 810 |
|
|---|
| 811 | The term "octa" comes from contexts in which a "word" is two bytes;
|
|---|
| 812 | hence _octa_-word for 16 bytes.
|
|---|
| 813 |
|
|---|
| 814 |
|
|---|
| 815 | File: as.info, Node: Org, Next: P2align, Prev: Octa, Up: Pseudo Ops
|
|---|
| 816 |
|
|---|
| 817 | `.org NEW-LC , FILL'
|
|---|
| 818 | ====================
|
|---|
| 819 |
|
|---|
| 820 | Advance the location counter of the current section to NEW-LC.
|
|---|
| 821 | NEW-LC is either an absolute expression or an expression with the same
|
|---|
| 822 | section as the current subsection. That is, you can't use `.org' to
|
|---|
| 823 | cross sections: if NEW-LC has the wrong section, the `.org' directive
|
|---|
| 824 | is ignored. To be compatible with former assemblers, if the section of
|
|---|
| 825 | NEW-LC is absolute, `as' issues a warning, then pretends the section of
|
|---|
| 826 | NEW-LC is the same as the current subsection.
|
|---|
| 827 |
|
|---|
| 828 | `.org' may only increase the location counter, or leave it
|
|---|
| 829 | unchanged; you cannot use `.org' to move the location counter backwards.
|
|---|
| 830 |
|
|---|
| 831 | Because `as' tries to assemble programs in one pass, NEW-LC may not
|
|---|
| 832 | be undefined. If you really detest this restriction we eagerly await a
|
|---|
| 833 | chance to share your improved assembler.
|
|---|
| 834 |
|
|---|
| 835 | Beware that the origin is relative to the start of the section, not
|
|---|
| 836 | to the start of the subsection. This is compatible with other people's
|
|---|
| 837 | assemblers.
|
|---|
| 838 |
|
|---|
| 839 | When the location counter (of the current subsection) is advanced,
|
|---|
| 840 | the intervening bytes are filled with FILL which should be an absolute
|
|---|
| 841 | expression. If the comma and FILL are omitted, FILL defaults to zero.
|
|---|
| 842 |
|
|---|
| 843 |
|
|---|
| 844 | File: as.info, Node: P2align, Next: PopSection, Prev: Org, Up: Pseudo Ops
|
|---|
| 845 |
|
|---|
| 846 | `.p2align[wl] ABS-EXPR, ABS-EXPR, ABS-EXPR'
|
|---|
| 847 | ===========================================
|
|---|
| 848 |
|
|---|
| 849 | Pad the location counter (in the current subsection) to a particular
|
|---|
| 850 | storage boundary. The first expression (which must be absolute) is the
|
|---|
| 851 | number of low-order zero bits the location counter must have after
|
|---|
| 852 | advancement. For example `.p2align 3' advances the location counter
|
|---|
| 853 | until it a multiple of 8. If the location counter is already a
|
|---|
| 854 | multiple of 8, no change is needed.
|
|---|
| 855 |
|
|---|
| 856 | The second expression (also absolute) gives the fill value to be
|
|---|
| 857 | stored in the padding bytes. It (and the comma) may be omitted. If it
|
|---|
| 858 | is omitted, the padding bytes are normally zero. However, on some
|
|---|
| 859 | systems, if the section is marked as containing code and the fill value
|
|---|
| 860 | is omitted, the space is filled with no-op instructions.
|
|---|
| 861 |
|
|---|
| 862 | The third expression is also absolute, and is also optional. If it
|
|---|
| 863 | is present, it is the maximum number of bytes that should be skipped by
|
|---|
| 864 | this alignment directive. If doing the alignment would require
|
|---|
| 865 | skipping more bytes than the specified maximum, then the alignment is
|
|---|
| 866 | not done at all. You can omit the fill value (the second argument)
|
|---|
| 867 | entirely by simply using two commas after the required alignment; this
|
|---|
| 868 | can be useful if you want the alignment to be filled with no-op
|
|---|
| 869 | instructions when appropriate.
|
|---|
| 870 |
|
|---|
| 871 | The `.p2alignw' and `.p2alignl' directives are variants of the
|
|---|
| 872 | `.p2align' directive. The `.p2alignw' directive treats the fill
|
|---|
| 873 | pattern as a two byte word value. The `.p2alignl' directives treats the
|
|---|
| 874 | fill pattern as a four byte longword value. For example, `.p2alignw
|
|---|
| 875 | 2,0x368d' will align to a multiple of 4. If it skips two bytes, they
|
|---|
| 876 | will be filled in with the value 0x368d (the exact placement of the
|
|---|
| 877 | bytes depends upon the endianness of the processor). If it skips 1 or
|
|---|
| 878 | 3 bytes, the fill value is undefined.
|
|---|
| 879 |
|
|---|
| 880 |
|
|---|
| 881 | File: as.info, Node: Previous, Next: Print, Prev: PopSection, Up: Pseudo Ops
|
|---|
| 882 |
|
|---|
| 883 | `.previous'
|
|---|
| 884 | ===========
|
|---|
| 885 |
|
|---|
| 886 | This is one of the ELF section stack manipulation directives. The
|
|---|
| 887 | others are `.section' (*note Section::), `.subsection' (*note
|
|---|
| 888 | SubSection::), `.pushsection' (*note PushSection::), and `.popsection'
|
|---|
| 889 | (*note PopSection::).
|
|---|
| 890 |
|
|---|
| 891 | This directive swaps the current section (and subsection) with most
|
|---|
| 892 | recently referenced section (and subsection) prior to this one.
|
|---|
| 893 | Multiple `.previous' directives in a row will flip between two sections
|
|---|
| 894 | (and their subsections).
|
|---|
| 895 |
|
|---|
| 896 | In terms of the section stack, this directive swaps the current
|
|---|
| 897 | section with the top section on the section stack.
|
|---|
| 898 |
|
|---|
| 899 |
|
|---|
| 900 | File: as.info, Node: PopSection, Next: Previous, Prev: P2align, Up: Pseudo Ops
|
|---|
| 901 |
|
|---|
| 902 | `.popsection'
|
|---|
| 903 | =============
|
|---|
| 904 |
|
|---|
| 905 | This is one of the ELF section stack manipulation directives. The
|
|---|
| 906 | others are `.section' (*note Section::), `.subsection' (*note
|
|---|
| 907 | SubSection::), `.pushsection' (*note PushSection::), and `.previous'
|
|---|
| 908 | (*note Previous::).
|
|---|
| 909 |
|
|---|
| 910 | This directive replaces the current section (and subsection) with
|
|---|
| 911 | the top section (and subsection) on the section stack. This section is
|
|---|
| 912 | popped off the stack.
|
|---|
| 913 |
|
|---|
| 914 |
|
|---|
| 915 | File: as.info, Node: Print, Next: Protected, Prev: Previous, Up: Pseudo Ops
|
|---|
| 916 |
|
|---|
| 917 | `.print STRING'
|
|---|
| 918 | ===============
|
|---|
| 919 |
|
|---|
| 920 | `as' will print STRING on the standard output during assembly. You
|
|---|
| 921 | must put STRING in double quotes.
|
|---|
| 922 |
|
|---|
| 923 |
|
|---|
| 924 | File: as.info, Node: Protected, Next: Psize, Prev: Print, Up: Pseudo Ops
|
|---|
| 925 |
|
|---|
| 926 | `.protected NAMES'
|
|---|
| 927 | ==================
|
|---|
| 928 |
|
|---|
| 929 | This one of the ELF visibility directives. The other two are
|
|---|
| 930 | `.hidden' (*note Hidden::) and `.internal' (*note Internal::).
|
|---|
| 931 |
|
|---|
| 932 | This directive overrides the named symbols default visibility (which
|
|---|
| 933 | is set by their binding: local, global or weak). The directive sets
|
|---|
| 934 | the visibility to `protected' which means that any references to the
|
|---|
| 935 | symbols from within the components that defines them must be resolved
|
|---|
| 936 | to the definition in that component, even if a definition in another
|
|---|
| 937 | component would normally preempt this.
|
|---|
| 938 |
|
|---|
| 939 |
|
|---|
| 940 | File: as.info, Node: Psize, Next: Purgem, Prev: Protected, Up: Pseudo Ops
|
|---|
| 941 |
|
|---|
| 942 | `.psize LINES , COLUMNS'
|
|---|
| 943 | ========================
|
|---|
| 944 |
|
|---|
| 945 | Use this directive to declare the number of lines--and, optionally,
|
|---|
| 946 | the number of columns--to use for each page, when generating listings.
|
|---|
| 947 |
|
|---|
| 948 | If you do not use `.psize', listings use a default line-count of 60.
|
|---|
| 949 | You may omit the comma and COLUMNS specification; the default width is
|
|---|
| 950 | 200 columns.
|
|---|
| 951 |
|
|---|
| 952 | `as' generates formfeeds whenever the specified number of lines is
|
|---|
| 953 | exceeded (or whenever you explicitly request one, using `.eject').
|
|---|
| 954 |
|
|---|
| 955 | If you specify LINES as `0', no formfeeds are generated save those
|
|---|
| 956 | explicitly specified with `.eject'.
|
|---|
| 957 |
|
|---|
| 958 |
|
|---|
| 959 | File: as.info, Node: Purgem, Next: PushSection, Prev: Psize, Up: Pseudo Ops
|
|---|
| 960 |
|
|---|
| 961 | `.purgem NAME'
|
|---|
| 962 | ==============
|
|---|
| 963 |
|
|---|
| 964 | Undefine the macro NAME, so that later uses of the string will not be
|
|---|
| 965 | expanded. *Note Macro::.
|
|---|
| 966 |
|
|---|
| 967 |
|
|---|
| 968 | File: as.info, Node: PushSection, Next: Quad, Prev: Purgem, Up: Pseudo Ops
|
|---|
| 969 |
|
|---|
| 970 | `.pushsection NAME , SUBSECTION'
|
|---|
| 971 | ================================
|
|---|
| 972 |
|
|---|
| 973 | This is one of the ELF section stack manipulation directives. The
|
|---|
| 974 | others are `.section' (*note Section::), `.subsection' (*note
|
|---|
| 975 | SubSection::), `.popsection' (*note PopSection::), and `.previous'
|
|---|
| 976 | (*note Previous::).
|
|---|
| 977 |
|
|---|
| 978 | This directive is a synonym for `.section'. It pushes the current
|
|---|
| 979 | section (and subsection) onto the top of the section stack, and then
|
|---|
| 980 | replaces the current section and subsection with `name' and
|
|---|
| 981 | `subsection'.
|
|---|
| 982 |
|
|---|
| 983 |
|
|---|
| 984 | File: as.info, Node: Quad, Next: Rept, Prev: PushSection, Up: Pseudo Ops
|
|---|
| 985 |
|
|---|
| 986 | `.quad BIGNUMS'
|
|---|
| 987 | ===============
|
|---|
| 988 |
|
|---|
| 989 | `.quad' expects zero or more bignums, separated by commas. For each
|
|---|
| 990 | bignum, it emits an 8-byte integer. If the bignum won't fit in 8
|
|---|
| 991 | bytes, it prints a warning message; and just takes the lowest order 8
|
|---|
| 992 | bytes of the bignum.
|
|---|
| 993 |
|
|---|
| 994 | The term "quad" comes from contexts in which a "word" is two bytes;
|
|---|
| 995 | hence _quad_-word for 8 bytes.
|
|---|
| 996 |
|
|---|
| 997 |
|
|---|
| 998 | File: as.info, Node: Rept, Next: Sbttl, Prev: Quad, Up: Pseudo Ops
|
|---|
| 999 |
|
|---|
| 1000 | `.rept COUNT'
|
|---|
| 1001 | =============
|
|---|
| 1002 |
|
|---|
| 1003 | Repeat the sequence of lines between the `.rept' directive and the
|
|---|
| 1004 | next `.endr' directive COUNT times.
|
|---|
| 1005 |
|
|---|
| 1006 | For example, assembling
|
|---|
| 1007 |
|
|---|
| 1008 | .rept 3
|
|---|
| 1009 | .long 0
|
|---|
| 1010 | .endr
|
|---|
| 1011 |
|
|---|
| 1012 | is equivalent to assembling
|
|---|
| 1013 |
|
|---|
| 1014 | .long 0
|
|---|
| 1015 | .long 0
|
|---|
| 1016 | .long 0
|
|---|
| 1017 |
|
|---|
| 1018 |
|
|---|
| 1019 | File: as.info, Node: Sbttl, Next: Scl, Prev: Rept, Up: Pseudo Ops
|
|---|
| 1020 |
|
|---|
| 1021 | `.sbttl "SUBHEADING"'
|
|---|
| 1022 | =====================
|
|---|
| 1023 |
|
|---|
| 1024 | Use SUBHEADING as the title (third line, immediately after the title
|
|---|
| 1025 | line) when generating assembly listings.
|
|---|
| 1026 |
|
|---|
| 1027 | This directive affects subsequent pages, as well as the current page
|
|---|
| 1028 | if it appears within ten lines of the top of a page.
|
|---|
| 1029 |
|
|---|
| 1030 |
|
|---|
| 1031 | File: as.info, Node: Scl, Next: Section, Prev: Sbttl, Up: Pseudo Ops
|
|---|
| 1032 |
|
|---|
| 1033 | `.scl CLASS'
|
|---|
| 1034 | ============
|
|---|
| 1035 |
|
|---|
| 1036 | Set the storage-class value for a symbol. This directive may only be
|
|---|
| 1037 | used inside a `.def'/`.endef' pair. Storage class may flag whether a
|
|---|
| 1038 | symbol is static or external, or it may record further symbolic
|
|---|
| 1039 | debugging information.
|
|---|
| 1040 |
|
|---|
| 1041 | The `.scl' directive is primarily associated with COFF output; when
|
|---|
| 1042 | configured to generate `b.out' output format, `as' accepts this
|
|---|
| 1043 | directive but ignores it.
|
|---|
| 1044 |
|
|---|
| 1045 |
|
|---|
| 1046 | File: as.info, Node: Section, Next: Set, Prev: Scl, Up: Pseudo Ops
|
|---|
| 1047 |
|
|---|
| 1048 | `.section NAME'
|
|---|
| 1049 | ===============
|
|---|
| 1050 |
|
|---|
| 1051 | Use the `.section' directive to assemble the following code into a
|
|---|
| 1052 | section named NAME.
|
|---|
| 1053 |
|
|---|
| 1054 | This directive is only supported for targets that actually support
|
|---|
| 1055 | arbitrarily named sections; on `a.out' targets, for example, it is not
|
|---|
| 1056 | accepted, even with a standard `a.out' section name.
|
|---|
| 1057 |
|
|---|
| 1058 | COFF Version
|
|---|
| 1059 | ------------
|
|---|
| 1060 |
|
|---|
| 1061 | For COFF targets, the `.section' directive is used in one of the
|
|---|
| 1062 | following ways:
|
|---|
| 1063 |
|
|---|
| 1064 | .section NAME[, "FLAGS"]
|
|---|
| 1065 | .section NAME[, SUBSEGMENT]
|
|---|
| 1066 |
|
|---|
| 1067 | If the optional argument is quoted, it is taken as flags to use for
|
|---|
| 1068 | the section. Each flag is a single character. The following flags are
|
|---|
| 1069 | recognized:
|
|---|
| 1070 | `b'
|
|---|
| 1071 | bss section (uninitialized data)
|
|---|
| 1072 |
|
|---|
| 1073 | `n'
|
|---|
| 1074 | section is not loaded
|
|---|
| 1075 |
|
|---|
| 1076 | `w'
|
|---|
| 1077 | writable section
|
|---|
| 1078 |
|
|---|
| 1079 | `d'
|
|---|
| 1080 | data section
|
|---|
| 1081 |
|
|---|
| 1082 | `r'
|
|---|
| 1083 | read-only section
|
|---|
| 1084 |
|
|---|
| 1085 | `x'
|
|---|
| 1086 | executable section
|
|---|
| 1087 |
|
|---|
| 1088 | `s'
|
|---|
| 1089 | shared section (meaningful for PE targets)
|
|---|
| 1090 |
|
|---|
| 1091 | `a'
|
|---|
| 1092 | ignored. (For compatibility with the ELF version)
|
|---|
| 1093 |
|
|---|
| 1094 | If no flags are specified, the default flags depend upon the section
|
|---|
| 1095 | name. If the section name is not recognized, the default will be for
|
|---|
| 1096 | the section to be loaded and writable. Note the `n' and `w' flags
|
|---|
| 1097 | remove attributes from the section, rather than adding them, so if they
|
|---|
| 1098 | are used on their own it will be as if no flags had been specified at
|
|---|
| 1099 | all.
|
|---|
| 1100 |
|
|---|
| 1101 | If the optional argument to the `.section' directive is not quoted,
|
|---|
| 1102 | it is taken as a subsegment number (*note Sub-Sections::).
|
|---|
| 1103 |
|
|---|
| 1104 | ELF Version
|
|---|
| 1105 | -----------
|
|---|
| 1106 |
|
|---|
| 1107 | This is one of the ELF section stack manipulation directives. The
|
|---|
| 1108 | others are `.subsection' (*note SubSection::), `.pushsection' (*note
|
|---|
| 1109 | PushSection::), `.popsection' (*note PopSection::), and `.previous'
|
|---|
| 1110 | (*note Previous::).
|
|---|
| 1111 |
|
|---|
| 1112 | For ELF targets, the `.section' directive is used like this:
|
|---|
| 1113 |
|
|---|
| 1114 | .section NAME [, "FLAGS"[, @TYPE[, @ENTSIZE]]]
|
|---|
| 1115 |
|
|---|
| 1116 | The optional FLAGS argument is a quoted string which may contain any
|
|---|
| 1117 | combination of the following characters:
|
|---|
| 1118 | `a'
|
|---|
| 1119 | section is allocatable
|
|---|
| 1120 |
|
|---|
| 1121 | `w'
|
|---|
| 1122 | section is writable
|
|---|
| 1123 |
|
|---|
| 1124 | `x'
|
|---|
| 1125 | section is executable
|
|---|
| 1126 |
|
|---|
| 1127 | `M'
|
|---|
| 1128 | section is mergeable
|
|---|
| 1129 |
|
|---|
| 1130 | `S'
|
|---|
| 1131 | section contains zero terminated strings
|
|---|
| 1132 |
|
|---|
| 1133 | The optional TYPE argument may contain one of the following
|
|---|
| 1134 | constants:
|
|---|
| 1135 | `@progbits'
|
|---|
| 1136 | section contains data
|
|---|
| 1137 |
|
|---|
| 1138 | `@nobits'
|
|---|
| 1139 | section does not contain data (i.e., section only occupies space)
|
|---|
| 1140 |
|
|---|
| 1141 | Note on targets where the `@' character is the start of a comment (eg
|
|---|
| 1142 | ARM) then another character is used instead. For example the ARM port
|
|---|
| 1143 | uses the `%' character.
|
|---|
| 1144 |
|
|---|
| 1145 | If FLAGS contains `M' flag, TYPE argument must be specified as well
|
|---|
| 1146 | as ENTSIZE argument. Sections with `M' flag but not `S' flag must
|
|---|
| 1147 | contain fixed size constants, each ENTSIZE octets long. Sections with
|
|---|
| 1148 | both `M' and `S' must contain zero terminated strings where each
|
|---|
| 1149 | character is ENTSIZE bytes long. The linker may remove duplicates
|
|---|
| 1150 | within sections with the same name, same entity size and same flags.
|
|---|
| 1151 |
|
|---|
| 1152 | If no flags are specified, the default flags depend upon the section
|
|---|
| 1153 | name. If the section name is not recognized, the default will be for
|
|---|
| 1154 | the section to have none of the above flags: it will not be allocated
|
|---|
| 1155 | in memory, nor writable, nor executable. The section will contain data.
|
|---|
| 1156 |
|
|---|
| 1157 | For ELF targets, the assembler supports another type of `.section'
|
|---|
| 1158 | directive for compatibility with the Solaris assembler:
|
|---|
| 1159 |
|
|---|
| 1160 | .section "NAME"[, FLAGS...]
|
|---|
| 1161 |
|
|---|
| 1162 | Note that the section name is quoted. There may be a sequence of
|
|---|
| 1163 | comma separated flags:
|
|---|
| 1164 | `#alloc'
|
|---|
| 1165 | section is allocatable
|
|---|
| 1166 |
|
|---|
| 1167 | `#write'
|
|---|
| 1168 | section is writable
|
|---|
| 1169 |
|
|---|
| 1170 | `#execinstr'
|
|---|
| 1171 | section is executable
|
|---|
| 1172 |
|
|---|
| 1173 | This directive replaces the current section and subsection. The
|
|---|
| 1174 | replaced section and subsection are pushed onto the section stack. See
|
|---|
| 1175 | the contents of the gas testsuite directory `gas/testsuite/gas/elf' for
|
|---|
| 1176 | some examples of how this directive and the other section stack
|
|---|
| 1177 | directives work.
|
|---|
| 1178 |
|
|---|
| 1179 |
|
|---|
| 1180 | File: as.info, Node: Set, Next: Short, Prev: Section, Up: Pseudo Ops
|
|---|
| 1181 |
|
|---|
| 1182 | `.set SYMBOL, EXPRESSION'
|
|---|
| 1183 | =========================
|
|---|
| 1184 |
|
|---|
| 1185 | Set the value of SYMBOL to EXPRESSION. This changes SYMBOL's value
|
|---|
| 1186 | and type to conform to EXPRESSION. If SYMBOL was flagged as external,
|
|---|
| 1187 | it remains flagged (*note Symbol Attributes::).
|
|---|
| 1188 |
|
|---|
| 1189 | You may `.set' a symbol many times in the same assembly.
|
|---|
| 1190 |
|
|---|
| 1191 | If you `.set' a global symbol, the value stored in the object file
|
|---|
| 1192 | is the last value stored into it.
|
|---|
| 1193 |
|
|---|
| 1194 | The syntax for `set' on the HPPA is `SYMBOL .set EXPRESSION'.
|
|---|
| 1195 |
|
|---|
| 1196 |
|
|---|
| 1197 | File: as.info, Node: Short, Next: Single, Prev: Set, Up: Pseudo Ops
|
|---|
| 1198 |
|
|---|
| 1199 | `.short EXPRESSIONS'
|
|---|
| 1200 | ====================
|
|---|
| 1201 |
|
|---|
| 1202 | `.short' is normally the same as `.word'. *Note `.word': Word.
|
|---|
| 1203 |
|
|---|
| 1204 | In some configurations, however, `.short' and `.word' generate
|
|---|
| 1205 | numbers of different lengths; *note Machine Dependencies::.
|
|---|
| 1206 |
|
|---|
| 1207 |
|
|---|
| 1208 | File: as.info, Node: Single, Next: Size, Prev: Short, Up: Pseudo Ops
|
|---|
| 1209 |
|
|---|
| 1210 | `.single FLONUMS'
|
|---|
| 1211 | =================
|
|---|
| 1212 |
|
|---|
| 1213 | This directive assembles zero or more flonums, separated by commas.
|
|---|
| 1214 | It has the same effect as `.float'. The exact kind of floating point
|
|---|
| 1215 | numbers emitted depends on how `as' is configured. *Note Machine
|
|---|
| 1216 | Dependencies::.
|
|---|
| 1217 |
|
|---|
| 1218 |
|
|---|
| 1219 | File: as.info, Node: Size, Next: Skip, Prev: Single, Up: Pseudo Ops
|
|---|
| 1220 |
|
|---|
| 1221 | `.size'
|
|---|
| 1222 | =======
|
|---|
| 1223 |
|
|---|
| 1224 | This directive is used to set the size associated with a symbol.
|
|---|
| 1225 |
|
|---|
| 1226 | COFF Version
|
|---|
| 1227 | ------------
|
|---|
| 1228 |
|
|---|
| 1229 | For COFF targets, the `.size' directive is only permitted inside
|
|---|
| 1230 | `.def'/`.endef' pairs. It is used like this:
|
|---|
| 1231 |
|
|---|
| 1232 | .size EXPRESSION
|
|---|
| 1233 |
|
|---|
| 1234 | `.size' is only meaningful when generating COFF format output; when
|
|---|
| 1235 | `as' is generating `b.out', it accepts this directive but ignores it.
|
|---|
| 1236 |
|
|---|
| 1237 | ELF Version
|
|---|
| 1238 | -----------
|
|---|
| 1239 |
|
|---|
| 1240 | For ELF targets, the `.size' directive is used like this:
|
|---|
| 1241 |
|
|---|
| 1242 | .size NAME , EXPRESSION
|
|---|
| 1243 |
|
|---|
| 1244 | This directive sets the size associated with a symbol NAME. The
|
|---|
| 1245 | size in bytes is computed from EXPRESSION which can make use of label
|
|---|
| 1246 | arithmetic. This directive is typically used to set the size of
|
|---|
| 1247 | function symbols.
|
|---|
| 1248 |
|
|---|
| 1249 |
|
|---|
| 1250 | File: as.info, Node: Sleb128, Next: Space, Prev: Skip, Up: Pseudo Ops
|
|---|
| 1251 |
|
|---|
| 1252 | `.sleb128 EXPRESSIONS'
|
|---|
| 1253 | ======================
|
|---|
| 1254 |
|
|---|
| 1255 | SLEB128 stands for "signed little endian base 128." This is a
|
|---|
| 1256 | compact, variable length representation of numbers used by the DWARF
|
|---|
| 1257 | symbolic debugging format. *Note `.uleb128': Uleb128.
|
|---|
| 1258 |
|
|---|
| 1259 |
|
|---|
| 1260 | File: as.info, Node: Skip, Next: Sleb128, Prev: Size, Up: Pseudo Ops
|
|---|
| 1261 |
|
|---|
| 1262 | `.skip SIZE , FILL'
|
|---|
| 1263 | ===================
|
|---|
| 1264 |
|
|---|
| 1265 | This directive emits SIZE bytes, each of value FILL. Both SIZE and
|
|---|
| 1266 | FILL are absolute expressions. If the comma and FILL are omitted, FILL
|
|---|
| 1267 | is assumed to be zero. This is the same as `.space'.
|
|---|
| 1268 |
|
|---|
| 1269 |
|
|---|
| 1270 | File: as.info, Node: Space, Next: Stab, Prev: Sleb128, Up: Pseudo Ops
|
|---|
| 1271 |
|
|---|
| 1272 | `.space SIZE , FILL'
|
|---|
| 1273 | ====================
|
|---|
| 1274 |
|
|---|
| 1275 | This directive emits SIZE bytes, each of value FILL. Both SIZE and
|
|---|
| 1276 | FILL are absolute expressions. If the comma and FILL are omitted, FILL
|
|---|
| 1277 | is assumed to be zero. This is the same as `.skip'.
|
|---|
| 1278 |
|
|---|
| 1279 | _Warning:_ `.space' has a completely different meaning for HPPA
|
|---|
| 1280 | targets; use `.block' as a substitute. See `HP9000 Series 800
|
|---|
| 1281 | Assembly Language Reference Manual' (HP 92432-90001) for the
|
|---|
| 1282 | meaning of the `.space' directive. *Note HPPA Assembler
|
|---|
| 1283 | Directives: HPPA Directives, for a summary.
|
|---|
| 1284 |
|
|---|
| 1285 | On the AMD 29K, this directive is ignored; it is accepted for
|
|---|
| 1286 | compatibility with other AMD 29K assemblers.
|
|---|
| 1287 |
|
|---|
| 1288 | _Warning:_ In most versions of the GNU assembler, the directive
|
|---|
| 1289 | `.space' has the effect of `.block' *Note Machine Dependencies::.
|
|---|
| 1290 |
|
|---|
| 1291 |
|
|---|
| 1292 | File: as.info, Node: Stab, Next: String, Prev: Space, Up: Pseudo Ops
|
|---|
| 1293 |
|
|---|
| 1294 | `.stabd, .stabn, .stabs'
|
|---|
| 1295 | ========================
|
|---|
| 1296 |
|
|---|
| 1297 | There are three directives that begin `.stab'. All emit symbols
|
|---|
| 1298 | (*note Symbols::), for use by symbolic debuggers. The symbols are not
|
|---|
| 1299 | entered in the `as' hash table: they cannot be referenced elsewhere in
|
|---|
| 1300 | the source file. Up to five fields are required:
|
|---|
| 1301 |
|
|---|
| 1302 | STRING
|
|---|
| 1303 | This is the symbol's name. It may contain any character except
|
|---|
| 1304 | `\000', so is more general than ordinary symbol names. Some
|
|---|
| 1305 | debuggers used to code arbitrarily complex structures into symbol
|
|---|
| 1306 | names using this field.
|
|---|
| 1307 |
|
|---|
| 1308 | TYPE
|
|---|
| 1309 | An absolute expression. The symbol's type is set to the low 8
|
|---|
| 1310 | bits of this expression. Any bit pattern is permitted, but `ld'
|
|---|
| 1311 | and debuggers choke on silly bit patterns.
|
|---|
| 1312 |
|
|---|
| 1313 | OTHER
|
|---|
| 1314 | An absolute expression. The symbol's "other" attribute is set to
|
|---|
| 1315 | the low 8 bits of this expression.
|
|---|
| 1316 |
|
|---|
| 1317 | DESC
|
|---|
| 1318 | An absolute expression. The symbol's descriptor is set to the low
|
|---|
| 1319 | 16 bits of this expression.
|
|---|
| 1320 |
|
|---|
| 1321 | VALUE
|
|---|
| 1322 | An absolute expression which becomes the symbol's value.
|
|---|
| 1323 |
|
|---|
| 1324 | If a warning is detected while reading a `.stabd', `.stabn', or
|
|---|
| 1325 | `.stabs' statement, the symbol has probably already been created; you
|
|---|
| 1326 | get a half-formed symbol in your object file. This is compatible with
|
|---|
| 1327 | earlier assemblers!
|
|---|
| 1328 |
|
|---|
| 1329 | `.stabd TYPE , OTHER , DESC'
|
|---|
| 1330 | The "name" of the symbol generated is not even an empty string.
|
|---|
| 1331 | It is a null pointer, for compatibility. Older assemblers used a
|
|---|
| 1332 | null pointer so they didn't waste space in object files with empty
|
|---|
| 1333 | strings.
|
|---|
| 1334 |
|
|---|
| 1335 | The symbol's value is set to the location counter, relocatably.
|
|---|
| 1336 | When your program is linked, the value of this symbol is the
|
|---|
| 1337 | address of the location counter when the `.stabd' was assembled.
|
|---|
| 1338 |
|
|---|
| 1339 | `.stabn TYPE , OTHER , DESC , VALUE'
|
|---|
| 1340 | The name of the symbol is set to the empty string `""'.
|
|---|
| 1341 |
|
|---|
| 1342 | `.stabs STRING , TYPE , OTHER , DESC , VALUE'
|
|---|
| 1343 | All five fields are specified.
|
|---|
| 1344 |
|
|---|
| 1345 |
|
|---|
| 1346 | File: as.info, Node: String, Next: Struct, Prev: Stab, Up: Pseudo Ops
|
|---|
| 1347 |
|
|---|
| 1348 | `.string' "STR"
|
|---|
| 1349 | ===============
|
|---|
| 1350 |
|
|---|
| 1351 | Copy the characters in STR to the object file. You may specify more
|
|---|
| 1352 | than one string to copy, separated by commas. Unless otherwise
|
|---|
| 1353 | specified for a particular machine, the assembler marks the end of each
|
|---|
| 1354 | string with a 0 byte. You can use any of the escape sequences
|
|---|
| 1355 | described in *Note Strings: Strings.
|
|---|
| 1356 |
|
|---|
| 1357 |
|
|---|
| 1358 | File: as.info, Node: Struct, Next: SubSection, Prev: String, Up: Pseudo Ops
|
|---|
| 1359 |
|
|---|
| 1360 | `.struct EXPRESSION'
|
|---|
| 1361 | ====================
|
|---|
| 1362 |
|
|---|
| 1363 | Switch to the absolute section, and set the section offset to
|
|---|
| 1364 | EXPRESSION, which must be an absolute expression. You might use this
|
|---|
| 1365 | as follows:
|
|---|
| 1366 | .struct 0
|
|---|
| 1367 | field1:
|
|---|
| 1368 | .struct field1 + 4
|
|---|
| 1369 | field2:
|
|---|
| 1370 | .struct field2 + 4
|
|---|
| 1371 | field3:
|
|---|
| 1372 | This would define the symbol `field1' to have the value 0, the symbol
|
|---|
| 1373 | `field2' to have the value 4, and the symbol `field3' to have the value
|
|---|
| 1374 | 8. Assembly would be left in the absolute section, and you would need
|
|---|
| 1375 | to use a `.section' directive of some sort to change to some other
|
|---|
| 1376 | section before further assembly.
|
|---|
| 1377 |
|
|---|
| 1378 |
|
|---|
| 1379 | File: as.info, Node: SubSection, Next: Symver, Prev: Struct, Up: Pseudo Ops
|
|---|
| 1380 |
|
|---|
| 1381 | `.subsection NAME'
|
|---|
| 1382 | ==================
|
|---|
| 1383 |
|
|---|
| 1384 | This is one of the ELF section stack manipulation directives. The
|
|---|
| 1385 | others are `.section' (*note Section::), `.pushsection' (*note
|
|---|
| 1386 | PushSection::), `.popsection' (*note PopSection::), and `.previous'
|
|---|
| 1387 | (*note Previous::).
|
|---|
| 1388 |
|
|---|
| 1389 | This directive replaces the current subsection with `name'. The
|
|---|
| 1390 | current section is not changed. The replaced subsection is put onto
|
|---|
| 1391 | the section stack in place of the then current top of stack subsection.
|
|---|
| 1392 |
|
|---|
| 1393 |
|
|---|
| 1394 | File: as.info, Node: Symver, Next: Tag, Prev: SubSection, Up: Pseudo Ops
|
|---|
| 1395 |
|
|---|
| 1396 | `.symver'
|
|---|
| 1397 | =========
|
|---|
| 1398 |
|
|---|
| 1399 | Use the `.symver' directive to bind symbols to specific version nodes
|
|---|
| 1400 | within a source file. This is only supported on ELF platforms, and is
|
|---|
| 1401 | typically used when assembling files to be linked into a shared library.
|
|---|
| 1402 | There are cases where it may make sense to use this in objects to be
|
|---|
| 1403 | bound into an application itself so as to override a versioned symbol
|
|---|
| 1404 | from a shared library.
|
|---|
| 1405 |
|
|---|
| 1406 | For ELF targets, the `.symver' directive can be used like this:
|
|---|
| 1407 | .symver NAME, NAME2@NODENAME
|
|---|
| 1408 | If the symbol NAME is defined within the file being assembled, the
|
|---|
| 1409 | `.symver' directive effectively creates a symbol alias with the name
|
|---|
| 1410 | NAME2@NODENAME, and in fact the main reason that we just don't try and
|
|---|
| 1411 | create a regular alias is that the @ character isn't permitted in
|
|---|
| 1412 | symbol names. The NAME2 part of the name is the actual name of the
|
|---|
| 1413 | symbol by which it will be externally referenced. The name NAME itself
|
|---|
| 1414 | is merely a name of convenience that is used so that it is possible to
|
|---|
| 1415 | have definitions for multiple versions of a function within a single
|
|---|
| 1416 | source file, and so that the compiler can unambiguously know which
|
|---|
| 1417 | version of a function is being mentioned. The NODENAME portion of the
|
|---|
| 1418 | alias should be the name of a node specified in the version script
|
|---|
| 1419 | supplied to the linker when building a shared library. If you are
|
|---|
| 1420 | attempting to override a versioned symbol from a shared library, then
|
|---|
| 1421 | NODENAME should correspond to the nodename of the symbol you are trying
|
|---|
| 1422 | to override.
|
|---|
| 1423 |
|
|---|
| 1424 | If the symbol NAME is not defined within the file being assembled,
|
|---|
| 1425 | all references to NAME will be changed to NAME2@NODENAME. If no
|
|---|
| 1426 | reference to NAME is made, NAME2@NODENAME will be removed from the
|
|---|
| 1427 | symbol table.
|
|---|
| 1428 |
|
|---|
| 1429 | Another usage of the `.symver' directive is:
|
|---|
| 1430 | .symver NAME, NAME2@@NODENAME
|
|---|
| 1431 | In this case, the symbol NAME must exist and be defined within the
|
|---|
| 1432 | file being assembled. It is similar to NAME2@NODENAME. The difference
|
|---|
| 1433 | is NAME2@@NODENAME will also be used to resolve references to NAME2 by
|
|---|
| 1434 | the linker.
|
|---|
| 1435 |
|
|---|
| 1436 | The third usage of the `.symver' directive is:
|
|---|
| 1437 | .symver NAME, NAME2@@@NODENAME
|
|---|
| 1438 | When NAME is not defined within the file being assembled, it is
|
|---|
| 1439 | treated as NAME2@NODENAME. When NAME is defined within the file being
|
|---|
| 1440 | assembled, the symbol name, NAME, will be changed to NAME2@@NODENAME.
|
|---|
| 1441 |
|
|---|