AT&T Assembly pseudo-directive

Source: Internet
Author: User
Tags abs emit numeric require
AT/t Assembly instructions AT&T Assembly pseudo-directiveRecently, I've been looking at the OS stuff, which uses a lot of AT&T compilations, and here are the Chinese and English versions of the pseudo-commands that we've hit online. The English version can also be viewed by entering the following command:

Info as
Read the "Pseudo Ops" node

7 Assembler Directives
All assembler directives has names that begin with a period ('. '). The rest
Of the name is letters, usually in lower case.
This chapter discusses directives that is available regardless of the target
machine configuration for the GNU assembler. Some Machine Configurations Provi
De additional directives. See Chapter 8 [Machine Dependencies], page 61.

7 Assembler Commands
All assembler command names are represented by a period ('. ') Beginning The rest of the command name is the letter, usually lowercase.
This chapter discusses the available commands, regardless of the gun assembler configuration for the target machine. The configuration of some machines provides additional commands
。 See chapter 8th [Machine Relevance], page 61st.

7.1. Abort
This directive stops the assembly immediately. It's for compatibility with OT
Her assemblers. The original idea is that the assembly language source would
Be piped into the assembler. If the sender of the source quit, it could use th
is directive tells as to quit also. One day. Abort would not be supported.

7.1. Abort
This order immediately terminates the assembly process. This is to be compatible with other compilers. The early idea is that the assembly language source code will
Be transported into the assembler. If the program that sends the source code exits, it can use this command to notify as exit. May in the future
Use. Abort is no longer supported


7.2. ABORT
When producing COFF output, as accepts the directive as a synonym for '. Abor
T '.
When producing b.out output, as accepts the directive, but ignores it.

7.2. ABORT
When generating the COFF output, the assembler accepts this command as. Abort.
When produced b.out output, the assembler allows the command to be used, but ignores it.


7.3. Align abs-expr, abs-expr, abs-expr
Pad the location counter (in the subsection) to a particular storage B
Oundary. The first expression (which must be absolute) is the alignment Requir
Ed, as described below.
The second expression (also absolute) gives the fill value to being stored in the
Padding bytes. It (and the comma) may be omitted. If It is omitted, the Paddi
Ng bytes is normally zero. However, on some systems, if the sections is marked
As containing code and the fill value is omitted, the space was filled with no
-op instructions.
The third expression is also absolute, and is also optional. If It is present,
It is the maximum number of bytes, should be skipped by this alignment di
Rective. If doing the alignment would require skipping more bytes than the SPE
Cified Maximum, then the alignment are not do at all. You can omit the Fill V
Alue (the second argument) entirely by simply using both commas after the Requi
Red Alignment; This can is useful if want the alignment to being filled with
No-op instructions when appropriate.
The required alignment is specified varies from the system to system. For
The a29k, Hppa, m68k, m88k, w65, SPARC, and Hitachi SH, and i386 using ELF for
Mat, the first expression is the alignment request in bytes. For example '. AL
IGN 8 ' Advances the location counter until it is a multiple of 8. If the Loca
tion counter is already a multiple of 8, no change is needed.
For other systems, including the i386 using A.out format, and the arm and Stro
Ngarm, it is the number of Low-order zero bits the location counter must has
After advancement. For example '. Align 3 ' advances the location counter Unti
L it a multiple of 8. If the location counter is already a multiple of 8, no C
Hange is needed.
This inconsistency was due to the different behaviors of the various native
Emblers for these systems which gas must emulate. Gas also provides. Balign an
D. p2align directives, described later, which have a consistent behavior Acros
s all architectures (but is specific to gas).


7.3. Align abs-expr, abs-expr, abs-expr
Increments the position counter (in the current sub-segment) so that it points to the specified storage boundary. The first expression argument (the result must be
Pure number) is a required parameter: the Boundary datum, as described in the following.
The second expression parameter (the result must be a pure number) gives the value of the padding byte, which fills the position counter with this value
Over the place. This parameter (and comma) can be omitted, and if omitted, the value of the padding byte is usually 0. But in some
On the system, if this paragraph is identified as containing code, and the padding value is omitted, the space is populated with the no-op instruction.

The result of the 3rd argument expression must also be a purely numeric parameter, which is optional. If there is a 3rd argument,
It represents the maximum number of bytes allowed to be crossed by this alignment command. If the completion of this alignment requires skipping bytes than the specified
If you have more than the maximum value, you cannot complete the alignment at all. You can simply use a two comma after the boundary datum to omit the fill
Value parameter (second parameter); If you want the alignment operation to be automatically populated with the No-op command at the appropriate time, this method
will be very effective.
The definition of a boundary baseline varies by system. A29k,hppa,m68k,m88k,w65,sparc,hitachi SH,
and using Elf-formatted i386, the first expression is a boundary datum, in bytes. For example '. Align 8 ' move backwards
Position counter to a multiple of 8. If the address is already a multiple of 8, you do not need to move.
Some other systems, including I386,arm and StrongARM using the a.out format, represent the position counter after moving,
The low-order number of consecutive 0 in the counter. For example '. Align 3 ' moves the position counter back to a multiple of 8
The lowest 3 bits of the digital device are 0). If the address is already 8 times times the number, you do not need to move.
The reason for this difference is that gas needs to mimic the different actions of various assemblers. Gas also provides. Balign and
The. P2align command, which is described in detail later in this article, uses the same actions on all models (but requires the following two commands to
Gas clearly indicates the model).


7.4. ASCII "string" ...
. ASCII expects zero or more string literals (see section 3.6.1.1 [Strings], PA
GE) separated by commas. It assembles each string (with no automatic Traili
Ng Zero Byte) into consecutive addresses.

7.4. ASCII "string" ...
. ASCII without parameters or with multiple comma-separated strings (see 3.6.1.1 [Strings], page 19th). It put
Each string that is assembled (not automatically appended 0 bytes at the end of the string) is stored in a contiguous address.


7.5. Asciz "string" ...
. Asciz is just like. ASCII, and each string was followed by a zero byte. The "
Z "in". Asciz ' stands for "zero".

7.5. Asciz "string" ...
. Asciz is similar to. ASCII, but automatically appends a 0 byte at the end of each string. The ' z ' representation in '. Asciz '
"Zero".


7.6. Balign[wl] abs-expr, abs-expr, abs-expr
Pad the location counter (in the subsection) to a particular storage B
Oundary. The first expression (which must be absolute) is the alignment reques
T in bytes. For example '. Balign 8 ' Advances the location counter until it I
s a multiple of 8. If the location counter is already a multiple of 8, no Chan
GE is needed.
The second expression (also absolute) gives the fill value to being stored in the
Padding bytes. It (and the comma) may be omitted. If It is omitted, the Paddi
Ng bytes is normally zero. However, on some systems, if the sections is marked
As containing code and the fill value is omitted, the space was filled with no
-op instructions.
The third expression is also absolute, and is also optional. If It is present,
It is the maximum number of bytes, should be skipped by this alignment di
Rective. If doing the alignment would require skipping more bytes than the SPE
Cified Maximum, then the alignment are not do at all. You can omit the Fill V
Alue (the second argument) entirely by simply using both commas after the Requi
Red Alignment; This can is useful if want the alignment to being filled with
No-op instructions when appropriate.
The. BALIGNW and. BALIGNL directives are variants of the. balign directive. Th
E. BALIGNW Directive treats the fill pattern as a and a of byte word value. The. ba
LIGNL Directives treats the fill pattern as a four byte longword value. For ex
Ample,. BALIGNW 4,0x368d would align to a multiple of 4. If It skips the bytes,
They'll be filled in with the value 0x368d (the exact placement of the byte
s depends upon the endianness of the processor). If it skips 1 or 3 bytes, the
Fill value is undefined.

7.6
. balign[wl] abs-expr, abs-expr, abs-expr
Increments the position counter (in the current sub-segment) so that it points to the specified storage boundary. The first expression argument (the result must be a pure
The number of the level) is a required parameter: the Boundary datum, in bytes. For example, '. Balign 8 ' moves the position counter backwards
Until the value of the counter is equal to a multiple of 8. If the position counter is already a multiple of 8, you do not need to move.
The 2nd expression parameter (the result must be a pure number) gives the value of the padding byte, which fills the position counter with this value
Place to live. The 2nd parameter (and comma) can be omitted. If it is omitted, the value of the padding byte is usually 0. But in some
On the system, if this paragraph is identified as containing code, and the padding value is omitted, the empty area is populated with the no-op instruction.
The result of the 3rd parameter must also be a purely numeric parameter, which is optional. If there is a 3rd argument, it represents
This alignment command allows you to skip the maximum number of bytes. If this alignment is done, the number of bytes skipped will be greater than the specified maximum
More values, you cannot complete the alignment at all. You can simply use a two comma after the boundary datum parameter to omit the fill
Value parameter (second parameter); If you want the alignment operation to automatically populate with the NO-OP directive when appropriate, this method
will be very effective.

. BALIGNW and. Balignl are the variations of the. Balign command: BALIGNW uses 2 bytes to fill the blank area: b
The ALIGNL is populated with 4 bytes. For example,. BALIGNW 4,0x368d Aligns the address to a multiple of 4 if it skips 2
Bytes, gas will populate these 2 bytes with 0x368d (the exact location of the bytes depends on how the processor is stored).
If it skips 1 or 3 bytes, the padding value is ambiguous.


7.7. Byte expressions
. Byte expects zero or more expressions, separated by commas. Each expression I
s assembled into the next byte.

7.7.byte expressions
. Byte has no arguments or multiple expression arguments, and the expressions are separated by commas. Each expression parameter is remitted
To weave the next byte.


7.8. comm Symbol, length
. comm declares a common symbol named symbol. When linking, a common symbol in
One object file is merged with a defined or common symbol of the same name
In another object file. If LD does not see a definition for the Symbol–just
One or more common symbols–then it'll allocate length bytes of uninitialize
D memory. Length must is an absolute expression. If LD sees multiple common sy
Mbols with the same name, and they don't all have the same size, it'll allo
Cate space using the largest size.
When using ELF, the. comm directive takes an optional third argument. This is
The desired alignment of the symbol, specified as a byte boundary (for example
, an alignment of means that the least significant 4 bits of the address sh
Ould be zero). The alignment must is an absolute expression, and it must is a
Power of. If LD allocates uninitialized memory for the common symbol, it w
Ill use the alignment when placing the symbol. If no alignment is specified, a
s would set the alignment to the largest power of both less than or equal to the
Size of the symbol, up to a maximum of 16.
The syntax for. Comm differs slightly on the HPPA. The syntax is ' symbol. com
m, length '; symbol is optional.

7.8. comm Symbol, length
The. Comm declares a generic symbol named symbol (common symbol). When connected, the pass-through in the target file
Symbols may be incorporated into other target files with defined symbols, or incorporated into other target files with the same name as the common character
No. If LD cannot find the definition of the symbol--only one or more common symbols--allocate length bytes
of uninitialized memory. Length must be a purely expressive expression. If LD finds multiple common symbols with the same name, and
And their lengths are different, LD allocates memory according to the maximum length value among them.
When using the ELF format, the. Comm can use the 3rd parameter. It represents the boundary datum that the symbol needs to align (for example, the boundary
A benchmark of 16 o'clock means that the minimum 4 bits of the symbol storage address should be 0). The 3rd argument expression result must be purely
Number, and must be a power of 2. When LD allocates uninitialized memory for the generic symbol, it is used when storing the symbol
A parameter. If no boundary datum is specified, as will set the boundary datum to the logarithm of the length of the symbol at base 2, and
Rounding down. The maximum value is 16.
The syntax of the. Comm is slightly different on the Hppa. The syntax is ' symbol. comm, length '; parameter symbol
is optional.


7.9. Data subsection
. Data tells as to assemble the following statements onto the end of the data s
Ubsection numbered Subsection (which is an absolute expression). If subsection
is omitted, it defaults to zero.

7.9. Data subsection
. Data notifies the as Assembly of subsequent statements, appending them to a table numbered subsection (subsection must be purely
Dashi) at the end of the data segment. If the argument subsection omitted, the default is 0.


7.10. def name
Begin defining debugging information for a symbol name; The definition extends
Until the. endef directive is encountered. This directive are only observed WH
En as is configured for COFF format output; When producing B.out, '. def ' is
recognized, but ignored.

7.10. def name
Start defining debug information for the symbol ' name '; the definition area extends to the encounter. Endef command. This command is configured as C only in as
Off format, the '. def ' command can be used when the output is in b.out format, but is ignored.

7.11. desc symbol, Abs-expression
This directive sets the descriptor of the "symbol" (see section 5.5 [Symbol Attr
Ibutes],page to the low all bits of an absolute expression.
The '. Desc ' directive is not available if as is configured for COFF output
; It is only for a.out or B.out object format. For the sake of compatibility,
As accepts it, but produces no output, when configured for COFF.

7.11. desc symbol, Abs-expression
This command sets the descriptor for the symbolic symbol with a low 16-bit value of a purely expression (see 5.5[symbol Properties], page 30th
)。 When as is configured as COFF output, the '. Desc ' command is not valid; it applies only to a.out or b.out destination formats. For
For compatibility, when configured as COFF, as accepts this command, but does not produce output.


7.12. Dim
This directive are generated by compilers to include auxiliary debugging inform
ation in the symbol table. It's only permitted inside. Def/.endef pairs.
'. Dim ' is only meaningful when generating COFF format output; When as is Gen
Erating B.out, it accepts this directive but ignores it.

7.12. Dim
This command is generated by the compiler to include secondary debugging information in the symbol table. It can only be def/.endef in.
Use this command between the
'. Dim ' is only meaningful when generating COFF format output; When generating b.out, as accepts this command, but ignores it



7.13. Double Flonums
. Double expects zero or more flonums, separated by commas. It assembles Floati
Ng point numbers. The exact kind of floating point numbers emitted depends on
How as is configured. See Chapter 8 [Machine Dependencies], page 61.

7.13. Double Flonums
. Double followed by 0 or more floating-point numbers separated by a comma. This instruction compiles a floating-point number. Of the generated floating-point numbers
The exact type is dependent on the configuration of AS. See chapter 8th [Machine Relevance], page 61st.


7.14. Eject
Force a page break at the when generating assembly listings.

7.14. Eject
Forces the manifest page to break at this point when generating the assembly manifest.


7.15. Else
. else is part of the as support for conditional assembly; See section 7.35 [. I
F], page 43. It marks the beginning of a section of code to be assembled if th
e condition for the preceding
. If was false.

7.15. Else
. else is one of the conditional assembly directives that support as; see 7.35[.if], page 43rd. If the condition of the preceding. If command
is not established, it means a piece of code that needs to be assembled. else.


7.16. ElseIf
. ElseIf is part of the as support for conditional assembly; See section 7.35 [
. If],page 43. It's shorthand for beginning a new if block that would otherwi
Se fill the entire. else section.

7.16. ElseIf
. ElseIf is one of the conditional assembly directives that support as. See section 7.35 [. If], page 43rd. It can be in the. Esle segment
Quickly produce a new. If block.


7.17. End
. End marks the end of the assembly file. As does not process anything in the F
Ile past the. end directive.

7.17. End
The. End marks the end of the assembly file. As does not process any statements after the. End command.


7.18. Endef
This directive flags the end of a symbol definition begun with. def.
'. Endef ' is only meaningful when generating COFF format output; If as is con
Figured to generate b.out, it accepts this directive but ignores it.

7.18. Endef
This command marks the end of the symbol definition starting with. def.
The '. Endef ' command is only meaningful in generating output from the COFF format, if as is configured to generate B.out output, although a
s accepts this command, but ignores it.


7.19. Endfunc
. Endfunc marks the end of a function specified with. Func.

7.19. Endfunc
. Endfunc marks the end of a function defined by the. Func command.


7.20. endif
. EndIf is part of the as support for conditional assembly; It marks the end of
A block of code that was only assembled conditionally. See section 7.35 [. If],
Page 43.

7.20. endif
. endif is one of the directives that support the conditional assembly of AS. It marks the end of the conditional assembly code block. See section 7.35 [
. If], page 43rd.


7.21. equ symbol, expression
This directive sets the value of symbol to expression. It is synonymous with '
. set '; See section 7.68 [. Set], page 53.
The syntax for equ in the HPPA is ' symbol. EQU expression '.

7.21. equ symbol, expression
This command sets the symbolic symbol value to expression. It is equivalent to the '. Set ' command. See 7.68[.set], page 53rd.

The equ syntax on Hppa is ' symbol. EQU expression '.


7.22. equiv symbol, expression
The. equiv directive is like. Equ and. Set, except that the assembler would sig
NAL An error if symbol is already defined.
Except for the contents of the error message, this is roughly equivalent to

. ifdef SYM
. err
. endif
. equ Sym,val

7.22. equiv symbol, expression
. equiv similar to the. equ &. Set command, except that if the symbol is already defined, as will emit an error message
No.
In addition to the content of the error message, it is broadly equivalent to:
. ifdef SYM
. err
. endif
. equ Sym,val

7.23. Err
If as assembles a. err directive, it would print an error message and, unless T
He-z option was used, it would not be generate an object file. This can is used T
O Signal error an conditionally compiled code.

7.23. Err
If as compiles a. Err command, an error message is printed, unless the-Z option is used, as does not generate the target text
Thing It can be used in conditional compilation code to emit an error message.


7.24. Exitm
Exit early from the current macro definition. See section 7.50 [Macro], page 4
7.

7.24. Exitm
Exits early from the current macro definition body. See 7.50 [Macro], page 47th.

7.25. extern
. extern is accepted in the source Program-for compatibility and other ASSEMB
Lers-but it is ignored. As treats all undefined symbols as external.

7.25. extern
. extern can be used in the source program-to be compatible with other assemblers-but is ignored. As will all undefined characters
Numbers are treated as external symbols.


7.26. Fail expression
Generates an error or a warning. If the value of the expression is in or more
, as would print a warning message. If the value is less than, as would prin
T an error message. The message would include the value of expression. This can
Occasionally be useful inside complex nested macros or conditional assembly.


7.26. Fail expression
Generates a fault (error) or warning (warning). If the value of expression is greater than or equal to 500,as prints a
"Warning" message. An "error" message is printed if the value of expression is less than 500,as. The message contains
The value of expression. This is occasionally used in complex macro nesting or conditional assembly.


7.27. File string
. File tells as that we is about to start a new logical file. string is the NE
W file name.
In general, the filename was recognized whether or not it was surrounded by quot
Es ' "; But if you wish to specify a empty file name, you must give the quo
tes– "". This statement could go away in Future:it are only recognized to be COM
Patible with the old as programs. In some configurations of as,. File have already
been removed to avoid conflicts and other assemblers. See Chapter 8 [Machine
Dependencies], page 61.

7.27. File string
. file notification as we are ready to open a new logical file. String is the new file name. In general, the file name
Whether to use quotation marks ' "' is OK, but if you want to specify an empty file name, you must use quotation marks-" ". The language
The sentence may no longer be used in the future-it is allowed only for compatibility with older versions of the as program. In some configurations of AS,
The. File has been deleted to avoid conflicts with other assemblers. See chapter 8th [Machine Dependencies], page 61st



7.28. Fill repeat, size, value
Repeat, size and value are absolute expressions. This emits repeat copies of S
ize bytes. Repeat May zero or

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.