1 @c Copyright (C) 2008-2015 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
7 @chapter RX Dependent Features
10 @node Machine Dependencies
11 @chapter RX Dependent Features
16 * RX-Opts:: RX Assembler Command Line Options
17 * RX-Modifiers:: Symbolic Operand Modifiers
18 * RX-Directives:: Assembler Directives
19 * RX-Float:: Floating Point
28 The Renesas RX port of @code{@value{AS}} has a few target specfic
33 @cindex @samp{-m32bit-doubles}
35 This option controls the ABI and indicates to use a 32-bit float ABI.
36 It has no effect on the assembled instructions, but it does influence
37 the behaviour of the @samp{.double} pseudo-op.
40 @cindex @samp{-m64bit-doubles}
42 This option controls the ABI and indicates to use a 64-bit float ABI.
43 It has no effect on the assembled instructions, but it does influence
44 the behaviour of the @samp{.double} pseudo-op.
46 @cindex @samp{-mbig-endian}
48 This option controls the ABI and indicates to use a big-endian data
49 ABI. It has no effect on the assembled instructions, but it does
50 influence the behaviour of the @samp{.short}, @samp{.hword}, @samp{.int},
51 @samp{.word}, @samp{.long}, @samp{.quad} and @samp{.octa} pseudo-ops.
53 @cindex @samp{-mlittle-endian}
55 This option controls the ABI and indicates to use a little-endian data
56 ABI. It has no effect on the assembled instructions, but it does
57 influence the behaviour of the @samp{.short}, @samp{.hword}, @samp{.int},
58 @samp{.word}, @samp{.long}, @samp{.quad} and @samp{.octa} pseudo-ops.
61 @cindex @samp{-muse-conventional-section-names}
62 @item -muse-conventional-section-names
63 This option controls the default names given to the code (.text),
64 initialised data (.data) and uninitialised data sections (.bss).
66 @cindex @samp{-muse-renesas-section-names}
67 @item -muse-renesas-section-names
68 This option controls the default names given to the code (.P),
69 initialised data (.D_1) and uninitialised data sections (.B_1).
72 @cindex @samp{-msmall-data-limit}
73 @item -msmall-data-limit
74 This option tells the assembler that the small data limit feature of
75 the RX port of GCC is being used. This results in the assembler
76 generating an undefined reference to a symbol called @code{__gp} for
77 use by the relocations that are needed to support the small data limit
78 feature. This option is not enabled by default as it would otherwise
79 pollute the symbol table.
83 This option tells the assembler that the position independent data of the
84 RX port of GCC is being used. This results in the assembler
85 generating an undefined reference to a symbol called @code{__pid_base},
86 and also setting the RX_PID flag bit in the e_flags field of the ELF
87 header of the object file.
89 @cindex @samp{-mint-register}
90 @item -mint-register=@var{num}
91 This option tells the assembler how many registers have been reserved
92 for use by interrupt handlers. This is needed in order to compute the
93 correct values for the @code{%gpreg} and @code{%pidreg} meta registers.
95 @cindex @samp{-mgcc-abi}
97 This option tells the assembler that the old GCC ABI is being used by
98 the assembled code. With this version of the ABI function arguments
99 that are passed on the stack are aligned to a 32-bit boundary.
101 @cindex @samp{-mrx-abi}
103 This option tells the assembler that the official RX ABI is being used
104 by the assembled code. With this version of the ABI function
105 arguments that are passed on the stack are aligned to their natural
106 alignments. This option is the default.
108 @cindex @samp{-mcpu=}
109 @item -mcpu=@var{name}
110 This option tells the assembler the target CPU type. Currently the
111 @code{rx200}, @code{rx600} and @code{rx610} are recognised as valid
112 cpu names. Attempting to assemble an instruction not supported by the
113 indicated cpu type will result in an error message being generated.
115 @cindex @samp{-mno-allow-string-insns}
116 @item -mno-allow-string-insns
117 This option tells the assembler to mark the object file that it is
118 building as one that does not use the string instructions
119 @code{SMOVF}, @code{SCMPU}, @code {SMOVB}, @code{SMOVU}, @code{SUNTIL}
120 @code {SWHILE} or the @code {RMPA} instruction. In addition the mark
121 tells the linker to complain if an attempt is made to link the binary
122 with another one that does use any of these instructions.
124 Note - the inverse of this option, @code{-mallow-string-insns}, is
125 not needed. The assembler automatically detects the use of the
126 the instructions in the source code and labels the resulting
127 object file appropriately. If no string instructions are detected
128 then the object file is labelled as being one that can be linked with
129 either string-using or string-banned object files.
133 @section Symbolic Operand Modifiers
139 The assembler supports one modifier when using symbol addresses
140 in RX instruction operands. The general syntax is the following:
146 The modifier returns the offset from the @var{__gp} symbol to the
147 specified symbol as a 16-bit value. The intent is that this offset
148 should be used in a register+offset move instruction when generating
149 references to small data. Ie, like this:
152 mov.W %gp(_foo)[%gpreg], r1
155 The assembler also supports two meta register names which can be used
156 to refer to registers whose values may not be known to the
157 programmer. These meta register names are:
161 @cindex @samp{%gpreg}
163 The small data address register.
165 @cindex @samp{%pidreg}
167 The PID base address register.
171 Both registers normally have the value r13, but this can change if
172 some registers have been reserved for use by interrupt handlers or if
173 both the small data limit and position independent data features are
174 being used at the same time.
177 @section Assembler Directives
179 @cindex assembler directives, RX
180 @cindex RX assembler directives
182 The RX version of @code{@value{AS}} has the following specific
183 assembler directives:
188 @cindex assembler directive .3byte, RX
189 @cindex RX assembler directive .3byte
190 Inserts a 3-byte value into the output file at the current location.
193 @cindex assembler directive .fetchalign, RX
194 @cindex RX assembler directive .fetchalign
195 If the next opcode following this directive spans a fetch line
196 boundary (8 byte boundary), the opcode is aligned to that boundary.
197 If the next opcode does not span a fetch line, this directive has no
198 effect. Note that one or more labels may be between this directive
199 and the opcode; those labels are aligned as well. Any inserted bytes
200 due to alignment will form a NOP opcode.
205 @section Floating Point
207 @cindex floating point, RX
208 @cindex RX floating point
210 The floating point formats generated by directives are these.
213 @cindex @code{float} directive, RX
216 @code{Single} precision (32-bit) floating point constants.
218 @cindex @code{double} directive, RX
220 If the @option{-m64bit-doubles} command line option has been specified
221 then then @code{double} directive generates @code{double} precision
222 (64-bit) floating point constants, otherwise it generates
223 @code{single} precision (32-bit) floating point constants. To force
224 the generation of 64-bit floating point constants used the @code{dc.d}
230 @section Syntax for the RX
232 * RX-Chars:: Special Characters
236 @subsection Special Characters
238 @cindex line comment character, RX
239 @cindex RX line comment character
240 The presence of a @samp{;} appearing anywhere on a line indicates the
241 start of a comment that extends to the end of that line.
243 If a @samp{#} appears as the first character of a line then the whole
244 line is treated as a comment, but in this case the line can also be a
245 logical line number directive (@pxref{Comments}) or a preprocessor
246 control command (@pxref{Preprocessing}).
248 @cindex line separator, RX
249 @cindex statement separator, RX
250 @cindex RX line separator
251 The @samp{!} character can be used to separate statements on the same