OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [doc/] [c-arm.texi] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
@c Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
@c Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
@c Free Software Foundation, Inc.
@c Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@c For copying conditions, see the file as.texinfo.
 
 
@ifset GENERIC
@ifset GENERIC
@page
@page
@node ARM-Dependent
@node ARM-Dependent
@chapter ARM Dependent Features
@chapter ARM Dependent Features
@end ifset
@end ifset
 
 
@ifclear GENERIC
@ifclear GENERIC
@node Machine Dependencies
@node Machine Dependencies
@chapter ARM Dependent Features
@chapter ARM Dependent Features
@end ifclear
@end ifclear
 
 
@cindex ARM support
@cindex ARM support
@cindex Thumb support
@cindex Thumb support
@menu
@menu
* ARM Options::              Options
* ARM Options::              Options
* ARM Syntax::               Syntax
* ARM Syntax::               Syntax
* ARM Floating Point::       Floating Point
* ARM Floating Point::       Floating Point
* ARM Directives::           ARM Machine Directives
* ARM Directives::           ARM Machine Directives
* ARM Opcodes::              Opcodes
* ARM Opcodes::              Opcodes
* ARM Mapping Symbols::      Mapping Symbols
* ARM Mapping Symbols::      Mapping Symbols
@end menu
@end menu
 
 
@node ARM Options
@node ARM Options
@section Options
@section Options
@cindex ARM options (none)
@cindex ARM options (none)
@cindex options for ARM (none)
@cindex options for ARM (none)
 
 
@table @code
@table @code
 
 
@cindex @code{-mcpu=} command line option, ARM
@cindex @code{-mcpu=} command line option, ARM
@item -mcpu=@var{processor}[+@var{extension}@dots{}]
@item -mcpu=@var{processor}[+@var{extension}@dots{}]
This option specifies the target processor.  The assembler will issue an
This option specifies the target processor.  The assembler will issue an
error message if an attempt is made to assemble an instruction which
error message if an attempt is made to assemble an instruction which
will not execute on the target processor.  The following processor names are
will not execute on the target processor.  The following processor names are
recognized:
recognized:
@code{arm1},
@code{arm1},
@code{arm2},
@code{arm2},
@code{arm250},
@code{arm250},
@code{arm3},
@code{arm3},
@code{arm6},
@code{arm6},
@code{arm60},
@code{arm60},
@code{arm600},
@code{arm600},
@code{arm610},
@code{arm610},
@code{arm620},
@code{arm620},
@code{arm7},
@code{arm7},
@code{arm7m},
@code{arm7m},
@code{arm7d},
@code{arm7d},
@code{arm7dm},
@code{arm7dm},
@code{arm7di},
@code{arm7di},
@code{arm7dmi},
@code{arm7dmi},
@code{arm70},
@code{arm70},
@code{arm700},
@code{arm700},
@code{arm700i},
@code{arm700i},
@code{arm710},
@code{arm710},
@code{arm710t},
@code{arm710t},
@code{arm720},
@code{arm720},
@code{arm720t},
@code{arm720t},
@code{arm740t},
@code{arm740t},
@code{arm710c},
@code{arm710c},
@code{arm7100},
@code{arm7100},
@code{arm7500},
@code{arm7500},
@code{arm7500fe},
@code{arm7500fe},
@code{arm7t},
@code{arm7t},
@code{arm7tdmi},
@code{arm7tdmi},
@code{arm7tdmi-s},
@code{arm7tdmi-s},
@code{arm8},
@code{arm8},
@code{arm810},
@code{arm810},
@code{strongarm},
@code{strongarm},
@code{strongarm1},
@code{strongarm1},
@code{strongarm110},
@code{strongarm110},
@code{strongarm1100},
@code{strongarm1100},
@code{strongarm1110},
@code{strongarm1110},
@code{arm9},
@code{arm9},
@code{arm920},
@code{arm920},
@code{arm920t},
@code{arm920t},
@code{arm922t},
@code{arm922t},
@code{arm940t},
@code{arm940t},
@code{arm9tdmi},
@code{arm9tdmi},
@code{arm9e},
@code{arm9e},
@code{arm926e},
@code{arm926e},
@code{arm926ej-s},
@code{arm926ej-s},
@code{arm946e-r0},
@code{arm946e-r0},
@code{arm946e},
@code{arm946e},
@code{arm946e-s},
@code{arm946e-s},
@code{arm966e-r0},
@code{arm966e-r0},
@code{arm966e},
@code{arm966e},
@code{arm966e-s},
@code{arm966e-s},
@code{arm968e-s},
@code{arm968e-s},
@code{arm10t},
@code{arm10t},
@code{arm10tdmi},
@code{arm10tdmi},
@code{arm10e},
@code{arm10e},
@code{arm1020},
@code{arm1020},
@code{arm1020t},
@code{arm1020t},
@code{arm1020e},
@code{arm1020e},
@code{arm1022e},
@code{arm1022e},
@code{arm1026ej-s},
@code{arm1026ej-s},
@code{arm1136j-s},
@code{arm1136j-s},
@code{arm1136jf-s},
@code{arm1136jf-s},
@code{arm1156t2-s},
@code{arm1156t2-s},
@code{arm1156t2f-s},
@code{arm1156t2f-s},
@code{arm1176jz-s},
@code{arm1176jz-s},
@code{arm1176jzf-s},
@code{arm1176jzf-s},
@code{mpcore},
@code{mpcore},
@code{mpcorenovfp},
@code{mpcorenovfp},
@code{cortex-a8},
@code{cortex-a8},
@code{cortex-a9},
@code{cortex-a9},
@code{cortex-r4},
@code{cortex-r4},
@code{cortex-m3},
@code{cortex-m3},
@code{ep9312} (ARM920 with Cirrus Maverick coprocessor),
@code{ep9312} (ARM920 with Cirrus Maverick coprocessor),
@code{i80200} (Intel XScale processor)
@code{i80200} (Intel XScale processor)
@code{iwmmxt} (Intel(r) XScale processor with Wireless MMX(tm) technology coprocessor)
@code{iwmmxt} (Intel(r) XScale processor with Wireless MMX(tm) technology coprocessor)
and
and
@code{xscale}.
@code{xscale}.
The special name @code{all} may be used to allow the
The special name @code{all} may be used to allow the
assembler to accept instructions valid for any ARM processor.
assembler to accept instructions valid for any ARM processor.
 
 
In addition to the basic instruction set, the assembler can be told to
In addition to the basic instruction set, the assembler can be told to
accept various extension mnemonics that extend the processor using the
accept various extension mnemonics that extend the processor using the
co-processor instruction space.  For example, @code{-mcpu=arm920+maverick}
co-processor instruction space.  For example, @code{-mcpu=arm920+maverick}
is equivalent to specifying @code{-mcpu=ep9312}.  The following extensions
is equivalent to specifying @code{-mcpu=ep9312}.  The following extensions
are currently supported:
are currently supported:
@code{+maverick}
@code{+maverick}
@code{+iwmmxt}
@code{+iwmmxt}
and
and
@code{+xscale}.
@code{+xscale}.
 
 
@cindex @code{-march=} command line option, ARM
@cindex @code{-march=} command line option, ARM
@item -march=@var{architecture}[+@var{extension}@dots{}]
@item -march=@var{architecture}[+@var{extension}@dots{}]
This option specifies the target architecture.  The assembler will issue
This option specifies the target architecture.  The assembler will issue
an error message if an attempt is made to assemble an instruction which
an error message if an attempt is made to assemble an instruction which
will not execute on the target architecture.  The following architecture
will not execute on the target architecture.  The following architecture
names are recognized:
names are recognized:
@code{armv1},
@code{armv1},
@code{armv2},
@code{armv2},
@code{armv2a},
@code{armv2a},
@code{armv2s},
@code{armv2s},
@code{armv3},
@code{armv3},
@code{armv3m},
@code{armv3m},
@code{armv4},
@code{armv4},
@code{armv4xm},
@code{armv4xm},
@code{armv4t},
@code{armv4t},
@code{armv4txm},
@code{armv4txm},
@code{armv5},
@code{armv5},
@code{armv5t},
@code{armv5t},
@code{armv5txm},
@code{armv5txm},
@code{armv5te},
@code{armv5te},
@code{armv5texp},
@code{armv5texp},
@code{armv6},
@code{armv6},
@code{armv6j},
@code{armv6j},
@code{armv6k},
@code{armv6k},
@code{armv6z},
@code{armv6z},
@code{armv6zk},
@code{armv6zk},
@code{armv7},
@code{armv7},
@code{armv7-a},
@code{armv7-a},
@code{armv7-r},
@code{armv7-r},
@code{armv7-m},
@code{armv7-m},
@code{iwmmxt}
@code{iwmmxt}
and
and
@code{xscale}.
@code{xscale}.
If both @code{-mcpu} and
If both @code{-mcpu} and
@code{-march} are specified, the assembler will use
@code{-march} are specified, the assembler will use
the setting for @code{-mcpu}.
the setting for @code{-mcpu}.
 
 
The architecture option can be extended with the same instruction set
The architecture option can be extended with the same instruction set
extension options as the @code{-mcpu} option.
extension options as the @code{-mcpu} option.
 
 
@cindex @code{-mfpu=} command line option, ARM
@cindex @code{-mfpu=} command line option, ARM
@item -mfpu=@var{floating-point-format}
@item -mfpu=@var{floating-point-format}
 
 
This option specifies the floating point format to assemble for.  The
This option specifies the floating point format to assemble for.  The
assembler will issue an error message if an attempt is made to assemble
assembler will issue an error message if an attempt is made to assemble
an instruction which will not execute on the target floating point unit.
an instruction which will not execute on the target floating point unit.
The following format options are recognized:
The following format options are recognized:
@code{softfpa},
@code{softfpa},
@code{fpe},
@code{fpe},
@code{fpe2},
@code{fpe2},
@code{fpe3},
@code{fpe3},
@code{fpa},
@code{fpa},
@code{fpa10},
@code{fpa10},
@code{fpa11},
@code{fpa11},
@code{arm7500fe},
@code{arm7500fe},
@code{softvfp},
@code{softvfp},
@code{softvfp+vfp},
@code{softvfp+vfp},
@code{vfp},
@code{vfp},
@code{vfp10},
@code{vfp10},
@code{vfp10-r0},
@code{vfp10-r0},
@code{vfp9},
@code{vfp9},
@code{vfpxd},
@code{vfpxd},
@code{vfpv2}
@code{vfpv2}
@code{vfpv3}
@code{vfpv3}
@code{vfpv3-d16}
@code{vfpv3-d16}
@code{arm1020t},
@code{arm1020t},
@code{arm1020e},
@code{arm1020e},
@code{arm1136jf-s},
@code{arm1136jf-s},
@code{maverick}
@code{maverick}
and
and
@code{neon}.
@code{neon}.
 
 
In addition to determining which instructions are assembled, this option
In addition to determining which instructions are assembled, this option
also affects the way in which the @code{.double} assembler directive behaves
also affects the way in which the @code{.double} assembler directive behaves
when assembling little-endian code.
when assembling little-endian code.
 
 
The default is dependent on the processor selected.  For Architecture 5 or
The default is dependent on the processor selected.  For Architecture 5 or
later, the default is to assembler for VFP instructions; for earlier
later, the default is to assembler for VFP instructions; for earlier
architectures the default is to assemble for FPA instructions.
architectures the default is to assemble for FPA instructions.
 
 
@cindex @code{-mthumb} command line option, ARM
@cindex @code{-mthumb} command line option, ARM
@item -mthumb
@item -mthumb
This option specifies that the assembler should start assembling Thumb
This option specifies that the assembler should start assembling Thumb
instructions; that is, it should behave as though the file starts with a
instructions; that is, it should behave as though the file starts with a
@code{.code 16} directive.
@code{.code 16} directive.
 
 
@cindex @code{-mthumb-interwork} command line option, ARM
@cindex @code{-mthumb-interwork} command line option, ARM
@item -mthumb-interwork
@item -mthumb-interwork
This option specifies that the output generated by the assembler should
This option specifies that the output generated by the assembler should
be marked as supporting interworking.
be marked as supporting interworking.
 
 
@cindex @code{-mapcs} command line option, ARM
@cindex @code{-mapcs} command line option, ARM
@item -mapcs @code{[26|32]}
@item -mapcs @code{[26|32]}
This option specifies that the output generated by the assembler should
This option specifies that the output generated by the assembler should
be marked as supporting the indicated version of the Arm Procedure.
be marked as supporting the indicated version of the Arm Procedure.
Calling Standard.
Calling Standard.
 
 
@cindex @code{-matpcs} command line option, ARM
@cindex @code{-matpcs} command line option, ARM
@item -matpcs
@item -matpcs
This option specifies that the output generated by the assembler should
This option specifies that the output generated by the assembler should
be marked as supporting the Arm/Thumb Procedure Calling Standard.  If
be marked as supporting the Arm/Thumb Procedure Calling Standard.  If
enabled this option will cause the assembler to create an empty
enabled this option will cause the assembler to create an empty
debugging section in the object file called .arm.atpcs.  Debuggers can
debugging section in the object file called .arm.atpcs.  Debuggers can
use this to determine the ABI being used by.
use this to determine the ABI being used by.
 
 
@cindex @code{-mapcs-float} command line option, ARM
@cindex @code{-mapcs-float} command line option, ARM
@item -mapcs-float
@item -mapcs-float
This indicates the floating point variant of the APCS should be
This indicates the floating point variant of the APCS should be
used.  In this variant floating point arguments are passed in FP
used.  In this variant floating point arguments are passed in FP
registers rather than integer registers.
registers rather than integer registers.
 
 
@cindex @code{-mapcs-reentrant} command line option, ARM
@cindex @code{-mapcs-reentrant} command line option, ARM
@item -mapcs-reentrant
@item -mapcs-reentrant
This indicates that the reentrant variant of the APCS should be used.
This indicates that the reentrant variant of the APCS should be used.
This variant supports position independent code.
This variant supports position independent code.
 
 
@cindex @code{-mfloat-abi=} command line option, ARM
@cindex @code{-mfloat-abi=} command line option, ARM
@item -mfloat-abi=@var{abi}
@item -mfloat-abi=@var{abi}
This option specifies that the output generated by the assembler should be
This option specifies that the output generated by the assembler should be
marked as using specified floating point ABI.
marked as using specified floating point ABI.
The following values are recognized:
The following values are recognized:
@code{soft},
@code{soft},
@code{softfp}
@code{softfp}
and
and
@code{hard}.
@code{hard}.
 
 
@cindex @code{-eabi=} command line option, ARM
@cindex @code{-eabi=} command line option, ARM
@item -meabi=@var{ver}
@item -meabi=@var{ver}
This option specifies which EABI version the produced object files should
This option specifies which EABI version the produced object files should
conform to.
conform to.
The following values are recognized:
The following values are recognized:
@code{gnu},
@code{gnu},
@code{4}
@code{4}
and
and
@code{5}.
@code{5}.
 
 
@cindex @code{-EB} command line option, ARM
@cindex @code{-EB} command line option, ARM
@item -EB
@item -EB
This option specifies that the output generated by the assembler should
This option specifies that the output generated by the assembler should
be marked as being encoded for a big-endian processor.
be marked as being encoded for a big-endian processor.
 
 
@cindex @code{-EL} command line option, ARM
@cindex @code{-EL} command line option, ARM
@item -EL
@item -EL
This option specifies that the output generated by the assembler should
This option specifies that the output generated by the assembler should
be marked as being encoded for a little-endian processor.
be marked as being encoded for a little-endian processor.
 
 
@cindex @code{-k} command line option, ARM
@cindex @code{-k} command line option, ARM
@cindex PIC code generation for ARM
@cindex PIC code generation for ARM
@item -k
@item -k
This option specifies that the output of the assembler should be marked
This option specifies that the output of the assembler should be marked
as position-independent code (PIC).
as position-independent code (PIC).
 
 
@cindex @code{--fix-v4bx} command line option, ARM
@cindex @code{--fix-v4bx} command line option, ARM
@item --fix-v4bx
@item --fix-v4bx
Allow @code{BX} instructions in ARMv4 code.  This is intended for use with
Allow @code{BX} instructions in ARMv4 code.  This is intended for use with
the linker option of the same name.
the linker option of the same name.
 
 
@end table
@end table
 
 
 
 
@node ARM Syntax
@node ARM Syntax
@section Syntax
@section Syntax
@menu
@menu
* ARM-Chars::                Special Characters
* ARM-Chars::                Special Characters
* ARM-Regs::                 Register Names
* ARM-Regs::                 Register Names
* ARM-Relocations::          Relocations
* ARM-Relocations::          Relocations
@end menu
@end menu
 
 
@node ARM-Chars
@node ARM-Chars
@subsection Special Characters
@subsection Special Characters
 
 
@cindex line comment character, ARM
@cindex line comment character, ARM
@cindex ARM line comment character
@cindex ARM line comment character
The presence of a @samp{@@} on a line indicates the start of a comment
The presence of a @samp{@@} on a line indicates the start of a comment
that extends to the end of the current line.  If a @samp{#} appears as
that extends to the end of the current line.  If a @samp{#} appears as
the first character of a line, the whole line is treated as a comment.
the first character of a line, the whole line is treated as a comment.
 
 
@cindex line separator, ARM
@cindex line separator, ARM
@cindex statement separator, ARM
@cindex statement separator, ARM
@cindex ARM line separator
@cindex ARM line separator
The @samp{;} character can be used instead of a newline to separate
The @samp{;} character can be used instead of a newline to separate
statements.
statements.
 
 
@cindex immediate character, ARM
@cindex immediate character, ARM
@cindex ARM immediate character
@cindex ARM immediate character
Either @samp{#} or @samp{$} can be used to indicate immediate operands.
Either @samp{#} or @samp{$} can be used to indicate immediate operands.
 
 
@cindex identifiers, ARM
@cindex identifiers, ARM
@cindex ARM identifiers
@cindex ARM identifiers
*TODO* Explain about /data modifier on symbols.
*TODO* Explain about /data modifier on symbols.
 
 
@node ARM-Regs
@node ARM-Regs
@subsection Register Names
@subsection Register Names
 
 
@cindex ARM register names
@cindex ARM register names
@cindex register names, ARM
@cindex register names, ARM
*TODO* Explain about ARM register naming, and the predefined names.
*TODO* Explain about ARM register naming, and the predefined names.
 
 
@node ARM Floating Point
@node ARM Floating Point
@section Floating Point
@section Floating Point
 
 
@cindex floating point, ARM (@sc{ieee})
@cindex floating point, ARM (@sc{ieee})
@cindex ARM floating point (@sc{ieee})
@cindex ARM floating point (@sc{ieee})
The ARM family uses @sc{ieee} floating-point numbers.
The ARM family uses @sc{ieee} floating-point numbers.
 
 
@node ARM-Relocations
@node ARM-Relocations
@subsection ARM relocation generation
@subsection ARM relocation generation
 
 
@cindex data relocations, ARM
@cindex data relocations, ARM
@cindex ARM data relocations
@cindex ARM data relocations
Specific data relocations can be generated by putting the relocation name
Specific data relocations can be generated by putting the relocation name
in parentheses after the symbol name.  For example:
in parentheses after the symbol name.  For example:
 
 
@smallexample
@smallexample
        .word foo(TARGET1)
        .word foo(TARGET1)
@end smallexample
@end smallexample
 
 
This will generate an @samp{R_ARM_TARGET1} relocation against the symbol
This will generate an @samp{R_ARM_TARGET1} relocation against the symbol
@var{foo}.
@var{foo}.
The following relocations are supported:
The following relocations are supported:
@code{GOT},
@code{GOT},
@code{GOTOFF},
@code{GOTOFF},
@code{TARGET1},
@code{TARGET1},
@code{TARGET2},
@code{TARGET2},
@code{SBREL},
@code{SBREL},
@code{TLSGD},
@code{TLSGD},
@code{TLSLDM},
@code{TLSLDM},
@code{TLSLDO},
@code{TLSLDO},
@code{GOTTPOFF}
@code{GOTTPOFF}
and
and
@code{TPOFF}.
@code{TPOFF}.
 
 
For compatibility with older toolchains the assembler also accepts
For compatibility with older toolchains the assembler also accepts
@code{(PLT)} after branch targets.  This will generate the deprecated
@code{(PLT)} after branch targets.  This will generate the deprecated
@samp{R_ARM_PLT32} relocation.
@samp{R_ARM_PLT32} relocation.
 
 
@cindex MOVW and MOVT relocations, ARM
@cindex MOVW and MOVT relocations, ARM
Relocations for @samp{MOVW} and @samp{MOVT} instructions can be generated
Relocations for @samp{MOVW} and @samp{MOVT} instructions can be generated
by prefixing the value with @samp{#:lower16:} and @samp{#:upper16}
by prefixing the value with @samp{#:lower16:} and @samp{#:upper16}
respectively.  For example to load the 32-bit address of foo into r0:
respectively.  For example to load the 32-bit address of foo into r0:
 
 
@smallexample
@smallexample
        MOVW r0, #:lower16:foo
        MOVW r0, #:lower16:foo
        MOVT r0, #:upper16:foo
        MOVT r0, #:upper16:foo
@end smallexample
@end smallexample
 
 
@node ARM Directives
@node ARM Directives
@section ARM Machine Directives
@section ARM Machine Directives
 
 
@cindex machine directives, ARM
@cindex machine directives, ARM
@cindex ARM machine directives
@cindex ARM machine directives
@table @code
@table @code
 
 
@cindex @code{align} directive, ARM
@cindex @code{align} directive, ARM
@item .align @var{expression} [, @var{expression}]
@item .align @var{expression} [, @var{expression}]
This is the generic @var{.align} directive.  For the ARM however if the
This is the generic @var{.align} directive.  For the ARM however if the
first argument is zero (ie no alignment is needed) the assembler will
first argument is zero (ie no alignment is needed) the assembler will
behave as if the argument had been 2 (ie pad to the next four byte
behave as if the argument had been 2 (ie pad to the next four byte
boundary).  This is for compatibility with ARM's own assembler.
boundary).  This is for compatibility with ARM's own assembler.
 
 
@cindex @code{req} directive, ARM
@cindex @code{req} directive, ARM
@item @var{name} .req @var{register name}
@item @var{name} .req @var{register name}
This creates an alias for @var{register name} called @var{name}.  For
This creates an alias for @var{register name} called @var{name}.  For
example:
example:
 
 
@smallexample
@smallexample
        foo .req r0
        foo .req r0
@end smallexample
@end smallexample
 
 
@cindex @code{unreq} directive, ARM
@cindex @code{unreq} directive, ARM
@item .unreq @var{alias-name}
@item .unreq @var{alias-name}
This undefines a register alias which was previously defined using the
This undefines a register alias which was previously defined using the
@code{req}, @code{dn} or @code{qn} directives.  For example:
@code{req}, @code{dn} or @code{qn} directives.  For example:
 
 
@smallexample
@smallexample
        foo .req r0
        foo .req r0
        .unreq foo
        .unreq foo
@end smallexample
@end smallexample
 
 
An error occurs if the name is undefined.  Note - this pseudo op can
An error occurs if the name is undefined.  Note - this pseudo op can
be used to delete builtin in register name aliases (eg 'r0').  This
be used to delete builtin in register name aliases (eg 'r0').  This
should only be done if it is really necessary.
should only be done if it is really necessary.
 
 
@cindex @code{dn} and @code{qn} directives, ARM
@cindex @code{dn} and @code{qn} directives, ARM
@item @var{name} .dn @var{register name} [@var{.type}] [[@var{index}]]
@item @var{name} .dn @var{register name} [@var{.type}] [[@var{index}]]
@item @var{name} .qn @var{register name} [@var{.type}] [[@var{index}]]
@item @var{name} .qn @var{register name} [@var{.type}] [[@var{index}]]
 
 
The @code{dn} and @code{qn} directives are used to create typed
The @code{dn} and @code{qn} directives are used to create typed
and/or indexed register aliases for use in Advanced SIMD Extension
and/or indexed register aliases for use in Advanced SIMD Extension
(Neon) instructions.  The former should be used to create aliases
(Neon) instructions.  The former should be used to create aliases
of double-precision registers, and the latter to create aliases of
of double-precision registers, and the latter to create aliases of
quad-precision registers.
quad-precision registers.
 
 
If these directives are used to create typed aliases, those aliases can
If these directives are used to create typed aliases, those aliases can
be used in Neon instructions instead of writing types after the mnemonic
be used in Neon instructions instead of writing types after the mnemonic
or after each operand.  For example:
or after each operand.  For example:
 
 
@smallexample
@smallexample
        x .dn d2.f32
        x .dn d2.f32
        y .dn d3.f32
        y .dn d3.f32
        z .dn d4.f32[1]
        z .dn d4.f32[1]
        vmul x,y,z
        vmul x,y,z
@end smallexample
@end smallexample
 
 
This is equivalent to writing the following:
This is equivalent to writing the following:
 
 
@smallexample
@smallexample
        vmul.f32 d2,d3,d4[1]
        vmul.f32 d2,d3,d4[1]
@end smallexample
@end smallexample
 
 
Aliases created using @code{dn} or @code{qn} can be destroyed using
Aliases created using @code{dn} or @code{qn} can be destroyed using
@code{unreq}.
@code{unreq}.
 
 
@cindex @code{code} directive, ARM
@cindex @code{code} directive, ARM
@item .code @code{[16|32]}
@item .code @code{[16|32]}
This directive selects the instruction set being generated. The value 16
This directive selects the instruction set being generated. The value 16
selects Thumb, with the value 32 selecting ARM.
selects Thumb, with the value 32 selecting ARM.
 
 
@cindex @code{thumb} directive, ARM
@cindex @code{thumb} directive, ARM
@item .thumb
@item .thumb
This performs the same action as @var{.code 16}.
This performs the same action as @var{.code 16}.
 
 
@cindex @code{arm} directive, ARM
@cindex @code{arm} directive, ARM
@item .arm
@item .arm
This performs the same action as @var{.code 32}.
This performs the same action as @var{.code 32}.
 
 
@cindex @code{force_thumb} directive, ARM
@cindex @code{force_thumb} directive, ARM
@item .force_thumb
@item .force_thumb
This directive forces the selection of Thumb instructions, even if the
This directive forces the selection of Thumb instructions, even if the
target processor does not support those instructions
target processor does not support those instructions
 
 
@cindex @code{thumb_func} directive, ARM
@cindex @code{thumb_func} directive, ARM
@item .thumb_func
@item .thumb_func
This directive specifies that the following symbol is the name of a
This directive specifies that the following symbol is the name of a
Thumb encoded function.  This information is necessary in order to allow
Thumb encoded function.  This information is necessary in order to allow
the assembler and linker to generate correct code for interworking
the assembler and linker to generate correct code for interworking
between Arm and Thumb instructions and should be used even if
between Arm and Thumb instructions and should be used even if
interworking is not going to be performed.  The presence of this
interworking is not going to be performed.  The presence of this
directive also implies @code{.thumb}
directive also implies @code{.thumb}
 
 
This directive is not neccessary when generating EABI objects.  On these
This directive is not neccessary when generating EABI objects.  On these
targets the encoding is implicit when generating Thumb code.
targets the encoding is implicit when generating Thumb code.
 
 
@cindex @code{thumb_set} directive, ARM
@cindex @code{thumb_set} directive, ARM
@item .thumb_set
@item .thumb_set
This performs the equivalent of a @code{.set} directive in that it
This performs the equivalent of a @code{.set} directive in that it
creates a symbol which is an alias for another symbol (possibly not yet
creates a symbol which is an alias for another symbol (possibly not yet
defined).  This directive also has the added property in that it marks
defined).  This directive also has the added property in that it marks
the aliased symbol as being a thumb function entry point, in the same
the aliased symbol as being a thumb function entry point, in the same
way that the @code{.thumb_func} directive does.
way that the @code{.thumb_func} directive does.
 
 
@cindex @code{.ltorg} directive, ARM
@cindex @code{.ltorg} directive, ARM
@item .ltorg
@item .ltorg
This directive causes the current contents of the literal pool to be
This directive causes the current contents of the literal pool to be
dumped into the current section (which is assumed to be the .text
dumped into the current section (which is assumed to be the .text
section) at the current location (aligned to a word boundary).
section) at the current location (aligned to a word boundary).
@code{GAS} maintains a separate literal pool for each section and each
@code{GAS} maintains a separate literal pool for each section and each
sub-section.  The @code{.ltorg} directive will only affect the literal
sub-section.  The @code{.ltorg} directive will only affect the literal
pool of the current section and sub-section.  At the end of assembly
pool of the current section and sub-section.  At the end of assembly
all remaining, un-empty literal pools will automatically be dumped.
all remaining, un-empty literal pools will automatically be dumped.
 
 
Note - older versions of @code{GAS} would dump the current literal
Note - older versions of @code{GAS} would dump the current literal
pool any time a section change occurred.  This is no longer done, since
pool any time a section change occurred.  This is no longer done, since
it prevents accurate control of the placement of literal pools.
it prevents accurate control of the placement of literal pools.
 
 
@cindex @code{.pool} directive, ARM
@cindex @code{.pool} directive, ARM
@item .pool
@item .pool
This is a synonym for .ltorg.
This is a synonym for .ltorg.
 
 
@cindex @code{.fnstart} directive, ARM
@cindex @code{.fnstart} directive, ARM
@item .fnstart
@item .fnstart
Marks the start of a function with an unwind table entry.
Marks the start of a function with an unwind table entry.
 
 
@cindex @code{.fnend} directive, ARM
@cindex @code{.fnend} directive, ARM
@item .fnend
@item .fnend
Marks the end of a function with an unwind table entry.  The unwind index
Marks the end of a function with an unwind table entry.  The unwind index
table entry is created when this directive is processed.
table entry is created when this directive is processed.
 
 
If no personality routine has been specified then standard personality
If no personality routine has been specified then standard personality
routine 0 or 1 will be used, depending on the number of unwind opcodes
routine 0 or 1 will be used, depending on the number of unwind opcodes
required.
required.
 
 
@cindex @code{.cantunwind} directive, ARM
@cindex @code{.cantunwind} directive, ARM
@item .cantunwind
@item .cantunwind
Prevents unwinding through the current function.  No personality routine
Prevents unwinding through the current function.  No personality routine
or exception table data is required or permitted.
or exception table data is required or permitted.
 
 
@cindex @code{.personality} directive, ARM
@cindex @code{.personality} directive, ARM
@item .personality @var{name}
@item .personality @var{name}
Sets the personality routine for the current function to @var{name}.
Sets the personality routine for the current function to @var{name}.
 
 
@cindex @code{.personalityindex} directive, ARM
@cindex @code{.personalityindex} directive, ARM
@item .personalityindex @var{index}
@item .personalityindex @var{index}
Sets the personality routine for the current function to the EABI standard
Sets the personality routine for the current function to the EABI standard
routine number @var{index}
routine number @var{index}
 
 
@cindex @code{.handlerdata} directive, ARM
@cindex @code{.handlerdata} directive, ARM
@item .handlerdata
@item .handlerdata
Marks the end of the current function, and the start of the exception table
Marks the end of the current function, and the start of the exception table
entry for that function.  Anything between this directive and the
entry for that function.  Anything between this directive and the
@code{.fnend} directive will be added to the exception table entry.
@code{.fnend} directive will be added to the exception table entry.
 
 
Must be preceded by a @code{.personality} or @code{.personalityindex}
Must be preceded by a @code{.personality} or @code{.personalityindex}
directive.
directive.
 
 
@cindex @code{.save} directive, ARM
@cindex @code{.save} directive, ARM
@item .save @var{reglist}
@item .save @var{reglist}
Generate unwinder annotations to restore the registers in @var{reglist}.
Generate unwinder annotations to restore the registers in @var{reglist}.
The format of @var{reglist} is the same as the corresponding store-multiple
The format of @var{reglist} is the same as the corresponding store-multiple
instruction.
instruction.
 
 
@smallexample
@smallexample
@exdent @emph{core registers}
@exdent @emph{core registers}
  .save @{r4, r5, r6, lr@}
  .save @{r4, r5, r6, lr@}
  stmfd sp!, @{r4, r5, r6, lr@}
  stmfd sp!, @{r4, r5, r6, lr@}
@exdent @emph{FPA registers}
@exdent @emph{FPA registers}
  .save f4, 2
  .save f4, 2
  sfmfd f4, 2, [sp]!
  sfmfd f4, 2, [sp]!
@exdent @emph{VFP registers}
@exdent @emph{VFP registers}
  .save @{d8, d9, d10@}
  .save @{d8, d9, d10@}
  fstmdx sp!, @{d8, d9, d10@}
  fstmdx sp!, @{d8, d9, d10@}
@exdent @emph{iWMMXt registers}
@exdent @emph{iWMMXt registers}
  .save @{wr10, wr11@}
  .save @{wr10, wr11@}
  wstrd wr11, [sp, #-8]!
  wstrd wr11, [sp, #-8]!
  wstrd wr10, [sp, #-8]!
  wstrd wr10, [sp, #-8]!
or
or
  .save wr11
  .save wr11
  wstrd wr11, [sp, #-8]!
  wstrd wr11, [sp, #-8]!
  .save wr10
  .save wr10
  wstrd wr10, [sp, #-8]!
  wstrd wr10, [sp, #-8]!
@end smallexample
@end smallexample
 
 
@cindex @code{.vsave} directive, ARM
@cindex @code{.vsave} directive, ARM
@item .vsave @var{vfp-reglist}
@item .vsave @var{vfp-reglist}
Generate unwinder annotations to restore the VFP registers in @var{vfp-reglist}
Generate unwinder annotations to restore the VFP registers in @var{vfp-reglist}
using FLDMD.  Also works for VFPv3 registers
using FLDMD.  Also works for VFPv3 registers
that are to be restored using VLDM.
that are to be restored using VLDM.
The format of @var{vfp-reglist} is the same as the corresponding store-multiple
The format of @var{vfp-reglist} is the same as the corresponding store-multiple
instruction.
instruction.
 
 
@smallexample
@smallexample
@exdent @emph{VFP registers}
@exdent @emph{VFP registers}
  .vsave @{d8, d9, d10@}
  .vsave @{d8, d9, d10@}
  fstmdd sp!, @{d8, d9, d10@}
  fstmdd sp!, @{d8, d9, d10@}
@exdent @emph{VFPv3 registers}
@exdent @emph{VFPv3 registers}
  .vsave @{d15, d16, d17@}
  .vsave @{d15, d16, d17@}
  vstm sp!, @{d15, d16, d17@}
  vstm sp!, @{d15, d16, d17@}
@end smallexample
@end smallexample
 
 
Since FLDMX and FSTMX are now deprecated, this directive should be
Since FLDMX and FSTMX are now deprecated, this directive should be
used in favour of @code{.save} for saving VFP registers for ARMv6 and above.
used in favour of @code{.save} for saving VFP registers for ARMv6 and above.
 
 
@cindex @code{.pad} directive, ARM
@cindex @code{.pad} directive, ARM
@item .pad #@var{count}
@item .pad #@var{count}
Generate unwinder annotations for a stack adjustment of @var{count} bytes.
Generate unwinder annotations for a stack adjustment of @var{count} bytes.
A positive value indicates the function prologue allocated stack space by
A positive value indicates the function prologue allocated stack space by
decrementing the stack pointer.
decrementing the stack pointer.
 
 
@cindex @code{.movsp} directive, ARM
@cindex @code{.movsp} directive, ARM
@item .movsp @var{reg} [, #@var{offset}]
@item .movsp @var{reg} [, #@var{offset}]
Tell the unwinder that @var{reg} contains an offset from the current
Tell the unwinder that @var{reg} contains an offset from the current
stack pointer.  If @var{offset} is not specified then it is assumed to be
stack pointer.  If @var{offset} is not specified then it is assumed to be
zero.
zero.
 
 
@cindex @code{.setfp} directive, ARM
@cindex @code{.setfp} directive, ARM
@item .setfp @var{fpreg}, @var{spreg} [, #@var{offset}]
@item .setfp @var{fpreg}, @var{spreg} [, #@var{offset}]
Make all unwinder annotations relaive to a frame pointer.  Without this
Make all unwinder annotations relaive to a frame pointer.  Without this
the unwinder will use offsets from the stack pointer.
the unwinder will use offsets from the stack pointer.
 
 
The syntax of this directive is the same as the @code{sub} or @code{mov}
The syntax of this directive is the same as the @code{sub} or @code{mov}
instruction used to set the frame pointer.  @var{spreg} must be either
instruction used to set the frame pointer.  @var{spreg} must be either
@code{sp} or mentioned in a previous @code{.movsp} directive.
@code{sp} or mentioned in a previous @code{.movsp} directive.
 
 
@smallexample
@smallexample
.movsp ip
.movsp ip
mov ip, sp
mov ip, sp
@dots{}
@dots{}
.setfp fp, ip, #4
.setfp fp, ip, #4
sub fp, ip, #4
sub fp, ip, #4
@end smallexample
@end smallexample
 
 
@cindex @code{.unwind_raw} directive, ARM
@cindex @code{.unwind_raw} directive, ARM
@item .raw @var{offset}, @var{byte1}, @dots{}
@item .raw @var{offset}, @var{byte1}, @dots{}
Insert one of more arbitary unwind opcode bytes, which are known to adjust
Insert one of more arbitary unwind opcode bytes, which are known to adjust
the stack pointer by @var{offset} bytes.
the stack pointer by @var{offset} bytes.
 
 
For example @code{.unwind_raw 4, 0xb1, 0x01} is equivalent to
For example @code{.unwind_raw 4, 0xb1, 0x01} is equivalent to
@code{.save @{r0@}}
@code{.save @{r0@}}
 
 
@cindex @code{.cpu} directive, ARM
@cindex @code{.cpu} directive, ARM
@item .cpu @var{name}
@item .cpu @var{name}
Select the target processor.  Valid values for @var{name} are the same as
Select the target processor.  Valid values for @var{name} are the same as
for the @option{-mcpu} commandline option.
for the @option{-mcpu} commandline option.
 
 
@cindex @code{.arch} directive, ARM
@cindex @code{.arch} directive, ARM
@item .arch @var{name}
@item .arch @var{name}
Select the target architecture.  Valid values for @var{name} are the same as
Select the target architecture.  Valid values for @var{name} are the same as
for the @option{-march} commandline option.
for the @option{-march} commandline option.
 
 
@cindex @code{.object_arch} directive, ARM
@cindex @code{.object_arch} directive, ARM
@item .object_arch @var{name}
@item .object_arch @var{name}
Override the architecture recorded in the EABI object attribute section.
Override the architecture recorded in the EABI object attribute section.
Valid values for @var{name} are the same as for the @code{.arch} directive.
Valid values for @var{name} are the same as for the @code{.arch} directive.
Typically this is useful when code uses runtime detection of CPU features.
Typically this is useful when code uses runtime detection of CPU features.
 
 
@cindex @code{.fpu} directive, ARM
@cindex @code{.fpu} directive, ARM
@item .fpu @var{name}
@item .fpu @var{name}
Select the floating point unit to assemble for.  Valid values for @var{name}
Select the floating point unit to assemble for.  Valid values for @var{name}
are the same as for the @option{-mfpu} commandline option.
are the same as for the @option{-mfpu} commandline option.
 
 
@cindex @code{.eabi_attribute} directive, ARM
@cindex @code{.eabi_attribute} directive, ARM
@item .eabi_attribute @var{tag}, @var{value}
@item .eabi_attribute @var{tag}, @var{value}
Set the EABI object attribute number @var{tag} to @var{value}.  The value
Set the EABI object attribute number @var{tag} to @var{value}.  The value
is either a @code{number}, @code{"string"}, or @code{number, "string"}
is either a @code{number}, @code{"string"}, or @code{number, "string"}
depending on the tag.
depending on the tag.
 
 
@end table
@end table
 
 
@node ARM Opcodes
@node ARM Opcodes
@section Opcodes
@section Opcodes
 
 
@cindex ARM opcodes
@cindex ARM opcodes
@cindex opcodes for ARM
@cindex opcodes for ARM
@code{@value{AS}} implements all the standard ARM opcodes.  It also
@code{@value{AS}} implements all the standard ARM opcodes.  It also
implements several pseudo opcodes, including several synthetic load
implements several pseudo opcodes, including several synthetic load
instructions.
instructions.
 
 
@table @code
@table @code
 
 
@cindex @code{NOP} pseudo op, ARM
@cindex @code{NOP} pseudo op, ARM
@item NOP
@item NOP
@smallexample
@smallexample
  nop
  nop
@end smallexample
@end smallexample
 
 
This pseudo op will always evaluate to a legal ARM instruction that does
This pseudo op will always evaluate to a legal ARM instruction that does
nothing.  Currently it will evaluate to MOV r0, r0.
nothing.  Currently it will evaluate to MOV r0, r0.
 
 
@cindex @code{LDR reg,=<label>} pseudo op, ARM
@cindex @code{LDR reg,=<label>} pseudo op, ARM
@item LDR
@item LDR
@smallexample
@smallexample
  ldr <register> , = <expression>
  ldr <register> , = <expression>
@end smallexample
@end smallexample
 
 
If expression evaluates to a numeric constant then a MOV or MVN
If expression evaluates to a numeric constant then a MOV or MVN
instruction will be used in place of the LDR instruction, if the
instruction will be used in place of the LDR instruction, if the
constant can be generated by either of these instructions.  Otherwise
constant can be generated by either of these instructions.  Otherwise
the constant will be placed into the nearest literal pool (if it not
the constant will be placed into the nearest literal pool (if it not
already there) and a PC relative LDR instruction will be generated.
already there) and a PC relative LDR instruction will be generated.
 
 
@cindex @code{ADR reg,<label>} pseudo op, ARM
@cindex @code{ADR reg,<label>} pseudo op, ARM
@item ADR
@item ADR
@smallexample
@smallexample
  adr <register> <label>
  adr <register> <label>
@end smallexample
@end smallexample
 
 
This instruction will load the address of @var{label} into the indicated
This instruction will load the address of @var{label} into the indicated
register.  The instruction will evaluate to a PC relative ADD or SUB
register.  The instruction will evaluate to a PC relative ADD or SUB
instruction depending upon where the label is located.  If the label is
instruction depending upon where the label is located.  If the label is
out of range, or if it is not defined in the same file (and section) as
out of range, or if it is not defined in the same file (and section) as
the ADR instruction, then an error will be generated.  This instruction
the ADR instruction, then an error will be generated.  This instruction
will not make use of the literal pool.
will not make use of the literal pool.
 
 
@cindex @code{ADRL reg,<label>} pseudo op, ARM
@cindex @code{ADRL reg,<label>} pseudo op, ARM
@item ADRL
@item ADRL
@smallexample
@smallexample
  adrl <register> <label>
  adrl <register> <label>
@end smallexample
@end smallexample
 
 
This instruction will load the address of @var{label} into the indicated
This instruction will load the address of @var{label} into the indicated
register.  The instruction will evaluate to one or two PC relative ADD
register.  The instruction will evaluate to one or two PC relative ADD
or SUB instructions depending upon where the label is located.  If a
or SUB instructions depending upon where the label is located.  If a
second instruction is not needed a NOP instruction will be generated in
second instruction is not needed a NOP instruction will be generated in
its place, so that this instruction is always 8 bytes long.
its place, so that this instruction is always 8 bytes long.
 
 
If the label is out of range, or if it is not defined in the same file
If the label is out of range, or if it is not defined in the same file
(and section) as the ADRL instruction, then an error will be generated.
(and section) as the ADRL instruction, then an error will be generated.
This instruction will not make use of the literal pool.
This instruction will not make use of the literal pool.
 
 
@end table
@end table
 
 
For information on the ARM or Thumb instruction sets, see @cite{ARM
For information on the ARM or Thumb instruction sets, see @cite{ARM
Software Development Toolkit Reference Manual}, Advanced RISC Machines
Software Development Toolkit Reference Manual}, Advanced RISC Machines
Ltd.
Ltd.
 
 
@node ARM Mapping Symbols
@node ARM Mapping Symbols
@section Mapping Symbols
@section Mapping Symbols
 
 
The ARM ELF specification requires that special symbols be inserted
The ARM ELF specification requires that special symbols be inserted
into object files to mark certain features:
into object files to mark certain features:
 
 
@table @code
@table @code
 
 
@cindex @code{$a}
@cindex @code{$a}
@item $a
@item $a
At the start of a region of code containing ARM instructions.
At the start of a region of code containing ARM instructions.
 
 
@cindex @code{$t}
@cindex @code{$t}
@item $t
@item $t
At the start of a region of code containing THUMB instructions.
At the start of a region of code containing THUMB instructions.
 
 
@cindex @code{$d}
@cindex @code{$d}
@item $d
@item $d
At the start of a region of data.
At the start of a region of data.
 
 
@end table
@end table
 
 
The assembler will automatically insert these symbols for you - there
The assembler will automatically insert these symbols for you - there
is no need to code them yourself.  Support for tagging symbols ($b,
is no need to code them yourself.  Support for tagging symbols ($b,
$f, $p and $m) which is also mentioned in the current ARM ELF
$f, $p and $m) which is also mentioned in the current ARM ELF
specification is not implemented.  This is because they have been
specification is not implemented.  This is because they have been
dropped from the new EABI and so tools cannot rely upon their
dropped from the new EABI and so tools cannot rely upon their
presence.
presence.
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.