Assembler directives are instructions to the assembler to perform various bookkeeping tasks, storage reservation, and other control functions. To distinquish them from other instructions, directive names begin with a period. Table 5-1 lists the assembler directives by category.
Category | Directives |
Compiler-Use-Only Directives |
.bgnb
|
Location Control Directives |
.align
|
Symbol Declaration Directives |
.extern
|
Routine Entry Point Definition Directives |
.aent
|
Data Storage Directives |
.ascii
|
Repeat Block Directives |
.endr
|
Assembler Option Directive |
.set
|
Procedure Attribute Directives |
.edata
|
Version Control Directive |
.verstamp
|
Scheduling and Architecture Subset
Directives |
.arch
|
The following list contains descriptions of the assembly directives (in
alphabetical order):
name
[,symno
]
.ent
and
.end
directives. (The optional
symno
is for compiler use only. It refers to a dense number in a
.T
file (symbol table).)
reg1, reg2
expression
expression
establishes the number of bits to be set to zero.
The maximum value for
expression
is four (which produces octaword alignment).
If the
.align
directive advances the location counter, the assembler fills the
skipped bytes with zeros in data sections and
nop
instructions in text sections.
Normally, the
.word
,
.long
,
.quad
,
.float
,
.double
,
.extended
,
.d_floating
,
.f_floating
,
.g_floating
,
.s_floating
,
.t_floating
,
and
.x_floating
directives automatically align their data appropriately. For example,
.word
does an implicit
.align 1
,
and
.double
does an implicit
.align 3
.
You can disable the automatic alignment feature with
.align 0
.
The assembler reinstates automatic alignment at the next
.text
,
.data
,
.rdata
,
or
.sdata
directive that it encounters.
Labels immediately preceding an automatic or explicit alignment are also realigned. For example,
foo: .align 3
.word 0
is the same as
.align 3
foo: .word 0
model
model
are identical to those you can specify with the
-arch
flag on the
cc
command line.
See
cc
(1)
for details.
string
[ ,
string
] ...
string
from the list into successive locations. The
.ascii
directive does not pad the string with null characters. You must
put quotation marks (") around each string. You can optionally
use the backslash escape characters. For a list of the backslash
characters, see
Section 2.4.3.
string
[ ,
string
] ...
string
in the list into successive locations and adds a null character.
You can optionally use the backslash escape characters.
For a list of the backslash characters, see
Section 2.4.3.
symno
.bgnb
and
.endb
directives delimit the scope of a variable set. The scope
can be an entire procedure, or it can be a nested scope (for
example, a "{}" block in the C language).
The symbol number
symno
refers to a dense number in a
.T
file (symbol table). For an explanation of
.T
files, see
Chapter 8.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.byte
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is an 8-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
name, expression
name
becomes a global common symbol at the head of a block of at least
expression
bytes of storage. The linker overlays like-named common blocks,
using the expression value of the largest block as the byte size of
the overlay.
.data
section.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.d_floating
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 64-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.d_floating
directive automatically aligns its data and any preceding labels
on a double-word boundary. You can disable this feature with the
.align 0
directive .
expression1
[,expression2
]
...
[expressionN
]
.t_floating
.
0
1 lang-handler relocatable-expression
2 lang-handler constant-expression
If
flag
is zero, the assembler adds all subsequent data to the
.xdata
section.
If
flag
is 1 or 2, the assembler creates a function table entry for the next
.ent
directive.
The function table entry contains the language-specific handler
(lang-handler
)
and data
(relocatable-expression
or
constant-expression
).
flags
PDSC_RPD_FLAGS
field of the procedure's run-time procedure descriptor.
Refer to the
Calling Standard for Alpha Systems
for a description of the individual flags.
proc_name
]
.ent
directive sets the beginning of a procedure.
Use the
.ent
and
.end
directives when you want to generate information for the debugger.
symno
.bgnb
directive for details. The
.bgnb
directive sets the beginning of a language block.)
.repeat
directive starts a repeat block.
proc_name
[
lex-level
]
proc_name
.
Use this directive when you want to generate information for
the debugger.
The
.end
directive sets the end of a procedure.
The
lex-level
operand indicates the number of procedures that statically
surround the current procedure.
This operand is only informational. It does not affect the
assembly process; the assembler ignores it.
.err
directive, it quietly ceases to assemble the source file.
This prevents the assembler from continuing to process a program
that is incorrect.
expression1
[,expression2
]
...
[expressionN
]
.x_floating
.
name
[
number
]
name
operand is a global undefined symbol and
number
is the expected size of the external object.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.f_floating
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 32-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.f_floating
directive automatically aligns its data and preceding labels
on a longword boundary. You can disable this feature by using the
.align 0
directive.
file_number file_name_string
.loc
directive causes the assembler to resume generating line
numbers.
expression1
[,expression2
]
...
[expressionN
]
.s_floating
.
mask offset
$f0
.
The
offset
is the distance in bytes from the virtual frame pointer to where
the floating-point registers are saved.
You must use
.ent
before
.fmask
,
and you can use only one
.fmask
for each
.ent
.
Space should be allocated for those registers specified in the
.fmask
.
frame-register frame-size return_pc-register
[local_offset
]
frame-size
is the size of the stack frame, that is, the number of bytes between the
frame register and the virtual frame pointer. The second register
specifies the register that contains the return address. The
local_offset
parameter, which is for use only by compilers, specifies the number
of bytes between the virtual frame pointer and the local variables.
You must use
.ent
before
.frame
,
and you can use only one
.frame
for each
.ent
.
No stack traces can be done in the debugger without the
.frame
directive.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.g_floating
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 64-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.g_floating
directive automatically aligns its data and any preceding labels
on a quadword boundary. You can disable this feature with the
.align 0
directive.
bsr
or
jsr
instruction).
name
name
as an external symbol. If the name is otherwise defined (for
example, by its appearance as a label), the assembler exports
the symbol; otherwise, it imports the symbol.
In general, the assembler imports undefined symbols; that is, it
gives them the UNIX storage class "global undefined" and requires
the linker to resolve them.
address1
[,
address2
]
...
[,addressN
]
The operands for the
.gprel32
directive can optionally have the following form:
addressVal
[ :
addressRep
]
The
addressVal
is the address value. The optional
addressRep
is a non-negative expression that specifies how many times
to replicate the value of
addressVal
.
The expression value
(addressVal
)
and repetition count
(addressRep
)
must be absolute.
The
.gprel32
directive automatically aligns its data and preceding labels
on a longword boundary. You can disable this feature with the
.align 0
directive.
For use by compilers.
Sets the default masks for live registers before a procedure's
return (a
ret
instruction).
label_name
name
,
expression
name
)
a data type of
bss
.
The assembler allocates the named symbol to the
bss
area, and the expression defines the named symbol's length. If a
.globl
directive also specifies the name, the assembler allocates the named
symbol to external
bss
.
The assembler puts
bss
symbols in one of two
bss
areas. If the defined size is less than or equal to the size
specified by the assembler or compiler's
-G
command line option, the assembler puts the symbols in the
sbss
area.
lit4
section. This directive is only valid for
.long
(with non-relocatable expressions),
.f_floating
,
.float
,
and
.s_floating
.
lit4
section. This directive is only valid for
.quad
(with non-relocatable expressions),
.d_floating
,
.g_floating
,
.double
,
and
.t_floating
.
int_bitmask fp_bitmask
br
instructions and
jmp
instructions are treated as external calls; that is; all registers
are assumed to be live. The
.livereg
directive cannot appear before an external
br
instruction because it will affect the next
ret
,
jsr
,
bsr
,
jmp
,
or
call_pal callsys
instruction instead of the
br
instruction.
The directive cannot be used before a
call_pal bpt
instruction. For
call_pal bpt
instructions, the assembler also assumes that all registers are live.
To avoid unsafe optimizations by the reorganizer,
.livereg
notes to the assembler those registers that are live before a jump.
The directive
.livereg
takes two arguments,
int_bitmask
and
fp_bitmask
,
which are 32-bit bitmasks with a bit turned on for
each register that is live before a jump. The most significant bit
corresponds to register
$0
(which is opposite to that used in other assembly directives,
for example,
.mask
and
.fmask
).
The first bitmap indicates live integer registers and the second
indicates live floating-point registers.
When present, this directive causes the assembler to be more
conservative and to preserve the indicated register contents. If
omitted, the assembler assumes the default masks. The
.livereg
directive can be coded before any of the following instructions:
bsr
,
jsr
,
ret
,
jmp
,
and
call_pal callsys
.
file_number line_number
.file
directive. When a
.loc
directive appears in the binary assembly language
.G
file, the file number is a dense number pointing at a file symbol
in the symbol table
.T
file.
For more information about
.G
and
.T
files, see
Chapter 8.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.long
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 32-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.long
directive automatically aligns its data and preceding labels
on a longword boundary. You can disable this feature with the
.align 0
directive.
mask, offset
$0
.
The
offset
is the distance in bytes from the virtual frame pointer to
where the registers are saved.
You must use
.ent
before
.mask
,
and you can use only one
.mask
for each
.ent
.
Space should be allocated for those registers specified in the
.mask
.
reg1, reg2
reg1
and
reg2
will never point to the same memory location when they are used
as indexed registers. The assembler uses this as a hint to
make more liberal assumptions about resource dependency in the program.
options
flag
A
flag
of zero indicates that the procedure does not use
$gp
;
the caller does not need to set up
$pv
prior to calling the procedure or restore
$gp
on return from the procedure.
A
flag
of one indicates that the procedure does use
$gp
;
the caller must set up
$pv
prior to calling the procedure and restore
$gp
on return from the procedure.
If
flag
is not specified, the behavior is as if a value of one was specified.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.quad
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 64-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.quad
directive automatically aligns its data and
preceding labels on a quadword boundary. You can disable this feature
with the
.align 0
directive.
.rdata
section.
expression
.repeat
and
.endr
directives. The
expression
defines how many times the enclosing text and data repeats. With the
.repeat
directive, you cannot
use labels, branch instructions, or values that require
relocation in the block.
Also note that nesting
.repeat
directives is not allowed.
saved_ra_register
saved_ra_register
is the register in which the return address is saved during the
execution of the procedure.
If
.save_ra
is not used, the saved return address register is assumed to be
the same as the
return_pc_register
argument of the
frame
directive.
The
.save_ra
directive is valid only for register frame procedures.
.sdata
section.
option
reorder
,
macro
,
move
,
novolatile
,
and
at
.
Only one option can be specified by a single
.set
directive.
The effects of the options are as follows:
reorder
option permits the assembler to reorder machine-language instructions
to improve performance.
The
noreorder
option prevents the assembler from reordering machine-language
instructions. If a machine-language instruction violates the
hardware pipeline constraints, the assembler issues a warning message.
macro
option permits the assembler to generate multiple machine-language
instructions from a single assembler instruction.
The
nomacro
option causes the assembler to print a warning whenever an assembler
operation generates more than one machine-language instruction.
You must select the
noreorder
option before using the
nomacro
option; otherwise, an error results.
at
option permits the assembler to use the
$at
register for macros, but generates warnings if the source program uses
$at
.
When you use the
noat
option and an assembler operation requires the
$at
register, the assembler issues a warning message; however, the
noat
option does permit source programs to use
$at
without warnings being issued.
nomove
options instructs the assembler to mark each subsequent instruction
so that it cannot be moved during reorganization.
The assembler can still move instructions from below the
nomove
region to above the region or vice versa. The
nomove
option has part of the effect of the "volatile" C declaration; it
prevents otherwise independent loads or stores from occurring in a
different order than intended.
The
move
option cancels the effect of
nomove
.
volatile
option
instructs the assembler that subsequent load and store
instructions may not be moved in relation to each other or
removed by redundant load removal or other optimization.
The
volatile
option is less restrictive than
noreorder
;
it allows the assembler to move other instructions (that is,
instructions other than load and store instructions) without
restrictions.
The
novolatile
option cancels the effect of the
volatile
option.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.s_floating
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 32-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.s_floating
directive automatically aligns its data and preceding labels
on a longword boundary. You can disable this feature with the
.align 0
directive.
expression
expression
.
The assembler fills the space with zeros.
expression
.word
or
.byte
.
It ends at the next segment directive
(.data
,
.text
,
and so forth). It does not emit any code or data, but defines
the labels within it to have values that are the sum of
expression
plus their offsets from the
.struct
itself.
name = expression
or
name = register.
You must define the name only once in the assembly, and you
cannot redefine the name. The expression must be computable when you
assemble the program, and the expression must involve only operators,
constants, or equated symbols. You can use the name as a
constant in any later statement.
.text
section. (This is the default.)
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.t_floating
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 64-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.t_floating
directive automatically aligns its data and any preceding labels
on a quadword boundary. You can disable this feature with the
.align 0
directive.
option
.arch
directive, the generated code will run correctly on all implementations
of the Alpha architecture. The valid values for
option
are identical to those you can specify with the
-arch
flag on the
cc
command line.
See
cc
(1)
for details.
major minor
.verstamp 0 15.
register offset symno
symno
(the dense number) of the surrounding procedure.
name1
[,name2
]
name1
to be a weak symbol during linking.
If
name2
is specified,
name1
is created as a weak symbol with the same value as
name2
.
Weak symbols can be silently redefined at link time.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.word
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 16-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.word
directive automatically aligns its data and preceding
labels on a word boundary.
You can disable this feature with the
.align 0
directive.
expression1
[,expression2
]
...
[expressionN
]
The operands for the
.x_floating
directive can optionally have the following form:
expressionVal
[ :
expressionRep
]
The
expressionVal
is a 128-bit value. The optional
expressionRep
is a non-negative expression that specifies how many times
to replicate the value of
expressionVal
.
The expression value
(expressionVal
)
and repetition count
(expressionRep
)
must be absolute.
The
.x_floating
directive automatically aligns its data and preceding labels
on an octaword boundary. You can disable this feature with the
.align 0
directive.