x86 Assembly Language Reference Manual

General Pseudo Operations

Below is a list of the pseudo operations supported by the assembler. This is followed by a separate listing of pseudo operations included for the benefit of the debuggers (dbx(1)).


.align val

The align pseudo op causes the next data generated to be aligned modulo val. val should be a positive integer value.


.bcd val

The .bcd pseudo op generates a packed decimal (80-bit) value into the current section. This is not valid for the .bss section. val is a nonfloating-point constant.


.bss

The .bss pseudo op changes the current section to .bss.


.bss tag, bytes

Define symbol tag in the .bss section and add bytes to the value of dot for .bss. This does not change the current section to .bss. bytes must be a positive integer value.


.byte val [, val]

The .byte pseudo op generates initialized bytes into the current section. This is not valid for .bss. Each val must be an 8-bit value.


.comm name, expr [, alignment]

The .comm pseudo op allocates storage in the .data section. The storage is referenced by the symbol name, and has a size in bytes of expr. expr must be a positive integer. name cannot be predefined. If the alignment is given, the address of the name is aligned to a multiple of alignments.


.data

The data pseudo op changes the current section to .data.


.double val

The .double pseudo op generates an 80387 64 bit floating-point constant (IEEE 754) into the current section. Not valid in the .bss section. val is a floating-point constant. val is a string acceptable to atof(3); that is, an optional sign followed by a non-empty string of digits with optional decimal point and optional exponent.


.even

The .even pseudo op aligns the current program counter (.) to an even boundary.


.file "string"

The .file op creates a symbol table entry where string is the symbol name and STT_FILE is the symbol table type. string specifies the name of the source file associated with the object file.


.float val

The .float pseudo op generates an 80387 32 bit floating-point constant (IEEE 754) into the current section. This is not valid in the .bss section. val is a floating-point constant. val is a string acceptable to atof(3); that is, an optional sign followed by a non-empty string of digits with optional decimal point and optional exponent.


.globl symbol [, symbol]*

The globl op declares each symbol in the list to be global; that is, each symbol is either defined externally or defined in the input file and accessible in other files; default bindings for the symbol are overridden.

  • A global symbol definition in one file satisfies an undefined reference to the same global symbol in another file.

  • Multiple definitions of a defined global symbol is not allowed. If a defined global symbol has more than one definition, an error occurs.


Note -

This pseudo-op by itself does not define the symbol.



.ident "string"

The .ident pseudo op creates an entry in the comment section containing string. string is any sequence of characters, not including the double quote (").


.lcomm name, expr

The .lcomm pseudo op allocates storage in the .bss section. The storage is referenced by the symbol name, and has a size of expr. name cannot be predefined, and expr must be a positive integer type. If the alignment is given, the address of name is aligned to a multiple of alignment.


.local symbol [, symbol]*

Declares each symbol in the list to be local; that is, each symbol is defined in the input file and not accessible in other files; default bindings for the symbol are overridden. These symbols take precedence over weak and global symbols.

Because local symbols are not accessible to other files, local symbols of the same name may exist in multiple files.


Note -

This pseudo-op by itself does not define the symbol.



.long val

The .long pseudo op generates a long integer (32-bit, two's complement value) into the current section. This pseudo op is not valid for the .bss section. val is a nonfloating-point constant.


.nonvolatile

Defines the end of a block of instruction. The instructions in the block may not be permuted. This pseudo-op has no effect if:

  • The block of instruction has been previously terminated by a Control Transfer Instruction (CTI) or a label

  • There is no preceding .volatile pseudo-op


.section section_name [, attributes]

Makes the specified section the current section.

The assembler maintains a section stack which is manipulated by the section control directives. The current section is the section that is currently on top of the stack. This pseudo-op changes the top of the section stack.

  • If section_name does not exist, a new section with the specified name and attributes is created.

  • If section_name is a non-reserved section, attributes must be included the first time it is specified by the .section directive.


.set name, expr

The .set pseudo op sets the value of symbol name to expr. This is equivalent to an assignment.


.string "str"

This pseudo op places the characters in str into the object module at the current location and terminates the string with a null. The string must be enclosed in double quotes (""). This pseudo op is not valid for the .bss section.


.text

The .text pseudo op defines the current section as .text.


.value expr [,expr]

The .value pseudo op is used to generate an initialized word (16-bit, two's complement value) into the current section. This pseudo op is not valid in the .bss section. Each expr must be a 16-bit value.


.version string

The .version pseudo op puts the C compiler version number into the .comment section.


.volatile

Defines the beginning of a block of instruction. The instructions in the section may not be changed. The block of instruction should end at a .nonvolatile pseudo-op and should not contain any Control Transfer Instructions (CTI) or labels. The volatile block of instructions is terminated after the last instruction preceding a CTI or label.


.weak symbol [, symbol]

Declares each symbol in the list to be defined either externally, or in the input file and accessible to other files; default bindings of the symbol are overridden by this directive.

  • A weak symbol definition in one file satisfies an undefined reference to a global symbol of the same name in another file.

  • Unresolved weak symbols have a default value of zero; the link editor does not resolve these symbols.

  • If a weak symbol has the same name as a defined global symbol, the weak symbol is ignored and no error results.


Note -

This pseudo-op does not itself define the symbol.



symbol =expr

Assigns the value of expr to symbol.