2000-04-25 07:57:30 +08:00
|
|
|
@c Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
|
1999-05-03 15:29:11 +08:00
|
|
|
@c This is part of the GAS manual.
|
|
|
|
@c For copying conditions, see the file as.texinfo.
|
|
|
|
|
|
|
|
@ifset GENERIC
|
|
|
|
@page
|
|
|
|
@node ARM-Dependent
|
|
|
|
@chapter ARM Dependent Features
|
|
|
|
@end ifset
|
|
|
|
|
|
|
|
@ifclear GENERIC
|
|
|
|
@node Machine Dependencies
|
|
|
|
@chapter ARM Dependent Features
|
|
|
|
@end ifclear
|
|
|
|
|
|
|
|
@cindex ARM support
|
|
|
|
@cindex Thumb support
|
|
|
|
@menu
|
|
|
|
* ARM Options:: Options
|
|
|
|
* ARM Syntax:: Syntax
|
|
|
|
* ARM Floating Point:: Floating Point
|
|
|
|
* ARM Directives:: ARM Machine Directives
|
|
|
|
* ARM Opcodes:: Opcodes
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node ARM Options
|
|
|
|
@section Options
|
|
|
|
@cindex ARM options (none)
|
|
|
|
@cindex options for ARM (none)
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@table @code
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-marm} command line option, ARM
|
2000-04-25 07:57:30 +08:00
|
|
|
@item -marm@code{[2|250|3|6|60|600|610|620|7|7m|7d|7dm|7di|7dmi|70|700|700i|710|710c|7100|7500|7500fe|7tdmi|8|810|9|9tdmi|920|strongarm|strongarm110|strongarm1100]}
|
1999-05-03 15:29:11 +08:00
|
|
|
This option specifies the target processor. The assembler will issue an
|
|
|
|
error message if an attempt is made to assemble an instruction which
|
|
|
|
will not execute on the target processor.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-marmv} command line option, ARM
|
2000-04-25 07:57:30 +08:00
|
|
|
@item -marmv@code{[2|2a|3|3m|4|4t|5|5t]}
|
1999-05-03 15:29:11 +08:00
|
|
|
This option specifies the target architecture. The assembler will issue
|
|
|
|
an error message if an attempt is made to assemble an instruction which
|
|
|
|
will not execute on the target architecture.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-mthumb} command line option, ARM
|
|
|
|
@item -mthumb
|
|
|
|
This option specifies that only Thumb instructions should be assembled.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-mall} command line option, ARM
|
|
|
|
@item -mall
|
|
|
|
This option specifies that any Arm or Thumb instruction should be assembled.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-mfpa} command line option, ARM
|
2000-08-14 17:02:45 +08:00
|
|
|
@item -mfpa @code{[10|11]}
|
1999-05-03 15:29:11 +08:00
|
|
|
This option specifies the floating point architecture in use on the
|
|
|
|
target processor.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-mfpe-old} command line option, ARM
|
|
|
|
@item -mfpe-old
|
|
|
|
Do not allow the assemble of floating point multiple instructions.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-mno-fpu} command line option, ARM
|
|
|
|
@item -mno-fpu
|
|
|
|
Do not allow the assembly of any floating point instructions.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-mthumb-interwork} command line option, ARM
|
|
|
|
@item -mthumb-interwork
|
|
|
|
This option specifies that the output generated by the assembler should
|
|
|
|
be marked as supporting interworking.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-mapcs} command line option, ARM
|
2000-08-14 17:02:45 +08:00
|
|
|
@item -mapcs @code{[26|32]}
|
1999-05-03 15:29:11 +08:00
|
|
|
This option specifies that the output generated by the assembler should
|
|
|
|
be marked as supporting the indicated version of the Arm Procedure.
|
|
|
|
Calling Standard.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
|
|
|
@cindex @code{-mapcs-float} command line option, ARM
|
1999-05-03 15:29:11 +08:00
|
|
|
@item -mapcs-float
|
|
|
|
This indicates the the floating point variant of the APCS should be
|
|
|
|
used. In this variant floating point arguments are passed in FP
|
2000-01-11 06:22:56 +08:00
|
|
|
registers rather than integer registers.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
|
|
|
@cindex @code{-mapcs-reentrant} command line option, ARM
|
1999-05-03 15:29:11 +08:00
|
|
|
@item -mapcs-reentrant
|
|
|
|
This indicates that the reentrant variant of the APCS should be used.
|
|
|
|
This variant supports position independent code.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-EB} command line option, ARM
|
|
|
|
@item -EB
|
|
|
|
This option specifies that the output generated by the assembler should
|
|
|
|
be marked as being encoded for a big-endian processor.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-EL} command line option, ARM
|
|
|
|
@item -EL
|
|
|
|
This option specifies that the output generated by the assembler should
|
|
|
|
be marked as being encoded for a little-endian processor.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{-k} command line option, ARM
|
|
|
|
@cindex PIC code generation for ARM
|
|
|
|
@item -k
|
|
|
|
This option enables the generation of PIC (position independent code).
|
2000-04-25 07:57:30 +08:00
|
|
|
|
|
|
|
@cindex @code{-moabi} command line option, ARM
|
1999-05-03 15:29:11 +08:00
|
|
|
@item -moabi
|
|
|
|
This indicates that the code should be assembled using the old ARM ELF
|
|
|
|
conventions, based on a beta release release of the ARM-ELF
|
|
|
|
specifications, rather than the default conventions which are based on
|
|
|
|
the final release of the ARM-ELF specifications.
|
2000-04-25 07:57:30 +08:00
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@end table
|
|
|
|
|
|
|
|
|
|
|
|
@node ARM Syntax
|
|
|
|
@section Syntax
|
|
|
|
@menu
|
|
|
|
* ARM-Chars:: Special Characters
|
|
|
|
* ARM-Regs:: Register Names
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node ARM-Chars
|
|
|
|
@subsection Special Characters
|
|
|
|
|
|
|
|
@cindex line comment character, ARM
|
|
|
|
@cindex ARM line comment character
|
2000-01-11 06:22:56 +08:00
|
|
|
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
|
|
|
|
the first character of a line, the whole line is treated as a comment.
|
|
|
|
|
|
|
|
@cindex line separator, ARM
|
|
|
|
@cindex statement separator, ARM
|
|
|
|
@cindex ARM line separator
|
|
|
|
On ARM systems running the GNU/Linux operating system, @samp{;} can be
|
|
|
|
used instead of a newline to separate statements.
|
|
|
|
|
|
|
|
@cindex immediate character, ARM
|
|
|
|
@cindex ARM immediate character
|
|
|
|
Either @samp{#} or @samp{$} can be used to indicate immediate operands.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
|
|
|
@cindex identifiers, ARM
|
|
|
|
@cindex ARM identifiers
|
|
|
|
*TODO* Explain about /data modifier on symbols.
|
|
|
|
|
|
|
|
@node ARM-Regs
|
|
|
|
@subsection Register Names
|
|
|
|
|
|
|
|
@cindex ARM register names
|
|
|
|
@cindex register names, ARM
|
|
|
|
*TODO* Explain about ARM register naming, and the predefined names.
|
|
|
|
|
|
|
|
@node ARM Floating Point
|
|
|
|
@section Floating Point
|
|
|
|
|
|
|
|
@cindex floating point, ARM (@sc{ieee})
|
|
|
|
@cindex ARM floating point (@sc{ieee})
|
|
|
|
The ARM family uses @sc{ieee} floating-point numbers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@node ARM Directives
|
|
|
|
@section ARM Machine Directives
|
|
|
|
|
|
|
|
@cindex machine directives, ARM
|
|
|
|
@cindex ARM machine directives
|
|
|
|
@table @code
|
|
|
|
|
2000-04-25 07:57:30 +08:00
|
|
|
@cindex @code{align} directive, ARM
|
|
|
|
@item .align @var{expression} [, @var{expression}]
|
|
|
|
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
|
|
|
|
behave as if the argument had been 2 (ie pad to the next four byte
|
|
|
|
boundary). This is for compatability with ARM's own assembler.
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{req} directive, ARM
|
|
|
|
@item @var{name} .req @var{register name}
|
|
|
|
This creates an alias for @var{register name} called @var{name}. For
|
|
|
|
example:
|
|
|
|
|
|
|
|
@smallexample
|
|
|
|
foo .req r0
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
@cindex @code{code} directive, ARM
|
2000-08-14 17:02:45 +08:00
|
|
|
@item .code @code{[16|32]}
|
1999-05-03 15:29:11 +08:00
|
|
|
This directive selects the instruction set being generated. The value 16
|
|
|
|
selects Thumb, with the value 32 selecting ARM.
|
|
|
|
|
|
|
|
@cindex @code{thumb} directive, ARM
|
|
|
|
@item .thumb
|
|
|
|
This performs the same action as @var{.code 16}.
|
|
|
|
|
|
|
|
@cindex @code{arm} directive, ARM
|
|
|
|
@item .arm
|
|
|
|
This performs the same action as @var{.code 32}.
|
|
|
|
|
|
|
|
@cindex @code{force_thumb} directive, ARM
|
|
|
|
@item .force_thumb
|
|
|
|
This directive forces the selection of Thumb instructions, even if the
|
|
|
|
target processor does not support those instructions
|
|
|
|
|
|
|
|
@cindex @code{thumb_func} directive, ARM
|
|
|
|
@item .thumb_func
|
|
|
|
This directive specifies that the following symbol is the name of a
|
|
|
|
Thumb encoded function. This information is necessary in order to allow
|
|
|
|
the assembler and linker to generate correct code for interworking
|
|
|
|
between Arm and Thumb instructions and should be used even if
|
2000-06-26 01:59:22 +08:00
|
|
|
interworking is not going to be performed. The presence of this
|
|
|
|
directive also implies @code{.thumb}
|
1999-05-03 15:29:11 +08:00
|
|
|
|
1999-07-08 09:49:09 +08:00
|
|
|
@cindex @code{thumb_set} directive, ARM
|
|
|
|
@item .thumb_set
|
|
|
|
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
|
|
|
|
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
|
|
|
|
way that the @code{.thumb_func} directive does.
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
@cindex @code{.ltorg} directive, ARM
|
|
|
|
@item .ltorg
|
|
|
|
This directive causes the current contents of the literal pool to be
|
|
|
|
dumped into the current section (which is assumed to be the .text
|
|
|
|
section) at the current location (aligned to a word boundary).
|
|
|
|
|
|
|
|
@cindex @code{.pool} directive, ARM
|
|
|
|
@item .pool
|
|
|
|
This is a synonym for .ltorg.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
@node ARM Opcodes
|
|
|
|
@section Opcodes
|
|
|
|
|
|
|
|
@cindex ARM opcodes
|
|
|
|
@cindex opcodes for ARM
|
1999-07-05 15:39:01 +08:00
|
|
|
@code{@value{AS}} implements all the standard ARM opcodes. It also
|
|
|
|
implements several pseudo opcodes, including several synthetic load
|
|
|
|
instructions.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
1999-07-05 15:39:01 +08:00
|
|
|
@table @code
|
|
|
|
|
|
|
|
@cindex @code{NOP} pseudo op, ARM
|
|
|
|
@item NOP
|
|
|
|
@smallexample
|
|
|
|
nop
|
|
|
|
@end smallexample
|
1999-05-03 15:29:11 +08:00
|
|
|
|
1999-07-05 15:39:01 +08:00
|
|
|
This pseudo op will always evaluate to a legal ARM instruction that does
|
|
|
|
nothing. Currently it will evaluate to MOV r0, r0.
|
1999-05-03 15:29:11 +08:00
|
|
|
|
1999-07-05 15:39:01 +08:00
|
|
|
@cindex @code{LDR reg,=<label>} pseudo op, ARM
|
|
|
|
@item LDR
|
1999-05-03 15:29:11 +08:00
|
|
|
@smallexample
|
|
|
|
ldr <register> , = <expression>
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
If expression evaluates to a numeric constant then a MOV or MVN
|
|
|
|
instruction will be used in place of the LDR instruction, if the
|
|
|
|
constant can be generated by either of these instructions. Otherwise
|
|
|
|
the constant will be placed into the nearest literal pool (if it not
|
|
|
|
already there) and a PC relative LDR instruction will be generated.
|
|
|
|
|
1999-07-05 15:39:01 +08:00
|
|
|
@cindex @code{ADR reg,<label>} pseudo op, ARM
|
|
|
|
@item ADR
|
|
|
|
@smallexample
|
|
|
|
adr <register> <label>
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
This instruction will load the address of @var{label} into the indicated
|
|
|
|
register. The instruction will evaluate to a PC relative ADD or SUB
|
|
|
|
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
|
|
|
|
the ADR instruction, then an error will be generated. This instruction
|
|
|
|
will not make use of the literal pool.
|
|
|
|
|
|
|
|
@cindex @code{ADRL reg,<label>} pseudo op, ARM
|
|
|
|
@item ADRL
|
|
|
|
@smallexample
|
|
|
|
adrl <register> <label>
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
This instruction will load the address of @var{label} into the indicated
|
|
|
|
register. The instruction will evaluate to one or two a PC relative ADD
|
|
|
|
or SUB instructions depending upon where the label is located. If a
|
|
|
|
second instruction is not needed a NOP instruction will be generated in
|
|
|
|
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
|
|
|
|
(and section) as the ADRL instruction, then an error will be generated.
|
|
|
|
This instruction will not make use of the literal pool.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
1999-05-03 15:29:11 +08:00
|
|
|
For information on the ARM or Thumb instruction sets, see @cite{ARM
|
|
|
|
Software Development Toolkit Reference Manual}, Advanced RISC Machines
|
|
|
|
Ltd.
|
|
|
|
|