2012-11-09 Nick Clifton <nickc@redhat.com>
[deliverable/binutils-gdb.git] / gas / doc / c-rx.texi
1 @c Copyright 2008, 2009, 2011
2 @c Free Software Foundation, Inc.
3 @c This is part of the GAS manual.
4 @c For copying conditions, see the file as.texinfo.
5 @ifset GENERIC
6 @page
7 @node RX-Dependent
8 @chapter RX Dependent Features
9 @end ifset
10 @ifclear GENERIC
11 @node Machine Dependencies
12 @chapter RX Dependent Features
13 @end ifclear
14
15 @cindex RX support
16 @menu
17 * RX-Opts:: RX Assembler Command Line Options
18 * RX-Modifiers:: Symbolic Operand Modifiers
19 * RX-Directives:: Assembler Directives
20 * RX-Float:: Floating Point
21 * RX-Syntax:: Syntax
22 @end menu
23
24 @node RX-Opts
25 @section RX Options
26 @cindex options, RX
27 @cindex RX options
28
29 The Renesas RX port of @code{@value{AS}} has a few target specfic
30 command line options:
31
32 @table @code
33
34 @cindex @samp{-m32bit-doubles}
35 @item -m32bit-doubles
36 This option controls the ABI and indicates to use a 32-bit float ABI.
37 It has no effect on the assembled instructions, but it does influence
38 the behaviour of the @samp{.double} pseudo-op.
39 This is the default.
40
41 @cindex @samp{-m64bit-doubles}
42 @item -m64bit-doubles
43 This option controls the ABI and indicates to use a 64-bit float ABI.
44 It has no effect on the assembled instructions, but it does influence
45 the behaviour of the @samp{.double} pseudo-op.
46
47 @cindex @samp{-mbig-endian}
48 @item -mbig-endian
49 This option controls the ABI and indicates to use a big-endian data
50 ABI. It has no effect on the assembled instructions, but it does
51 influence the behaviour of the @samp{.short}, @samp{.hword}, @samp{.int},
52 @samp{.word}, @samp{.long}, @samp{.quad} and @samp{.octa} pseudo-ops.
53
54 @cindex @samp{-mlittle-endian}
55 @item -mlittle-endian
56 This option controls the ABI and indicates to use a little-endian data
57 ABI. It has no effect on the assembled instructions, but it does
58 influence the behaviour of the @samp{.short}, @samp{.hword}, @samp{.int},
59 @samp{.word}, @samp{.long}, @samp{.quad} and @samp{.octa} pseudo-ops.
60 This is the default.
61
62 @cindex @samp{-muse-conventional-section-names}
63 @item -muse-conventional-section-names
64 This option controls the default names given to the code (.text),
65 initialised data (.data) and uninitialised data sections (.bss).
66
67 @cindex @samp{-muse-renesas-section-names}
68 @item -muse-renesas-section-names
69 This option controls the default names given to the code (.P),
70 initialised data (.D_1) and uninitialised data sections (.B_1).
71 This is the default.
72
73 @cindex @samp{-msmall-data-limit}
74 @item -msmall-data-limit
75 This option tells the assembler that the small data limit feature of
76 the RX port of GCC is being used. This results in the assembler
77 generating an undefined reference to a symbol called @code{__gp} for
78 use by the relocations that are needed to support the small data limit
79 feature. This option is not enabled by default as it would otherwise
80 pollute the symbol table.
81
82 @cindex @samp{-mpid}
83 @item -mpid
84 This option tells the assembler that the position independent data of the
85 RX port of GCC is being used. This results in the assembler
86 generating an undefined reference to a symbol called @code{__pid_base},
87 and also setting the RX_PID flag bit in the e_flags field of the ELF
88 header of the object file.
89
90 @cindex @samp{-mint-register}
91 @item -mint-register=@var{num}
92 This option tells the assembler how many registers have been reserved
93 for use by interrupt handlers. This is needed in order to compute the
94 correct values for the @code{%gpreg} and @code{%pidreg} meta registers.
95
96 @cindex @samp{-mgcc-abi}
97 @item -mgcc-abi
98 This option tells the assembler that the old GCC ABI is being used by
99 the assembled code. With this version of the ABI function arguments
100 that are passed on the stack are aligned to a 32-bit boundary.
101
102 @cindex @samp{-mrx-abi}
103 @item -mrx-abi
104 This option tells the assembler that the official RX ABI is being used
105 by the assembled code. With this version of the ABI function
106 arguments that are passed on the stack are aligned to their natural
107 alignments. This option is the default.
108
109 @end table
110
111 @node RX-Modifiers
112 @section Symbolic Operand Modifiers
113
114 @cindex RX modifiers
115 @cindex syntax, RX
116 @cindex %gp
117
118 The assembler supports one modifier when using symbol addresses
119 in RX instruction operands. The general syntax is the following:
120
121 @smallexample
122 %gp(symbol)
123 @end smallexample
124
125 The modifier returns the offset from the @var{__gp} symbol to the
126 specified symbol as a 16-bit value. The intent is that this offset
127 should be used in a register+offset move instruction when generating
128 references to small data. Ie, like this:
129
130 @smallexample
131 mov.W %gp(_foo)[%gpreg], r1
132 @end smallexample
133
134 The assembler also supports two meta register names which can be used
135 to refer to registers whose values may not be known to the
136 programmer. These meta register names are:
137
138 @table @code
139
140 @cindex @samp{%gpreg}
141 @item %gpreg
142 The small data address register.
143
144 @cindex @samp{%pidreg}
145 @item %pidreg
146 The PID base address register.
147
148 @end table
149
150 Both registers normally have the value r13, but this can change if
151 some registers have been reserved for use by interrupt handlers or if
152 both the small data limit and position independent data features are
153 being used at the same time.
154
155 @node RX-Directives
156 @section Assembler Directives
157
158 @cindex assembler directives, RX
159 @cindex RX assembler directives
160
161 The RX version of @code{@value{AS}} has the following specific
162 assembler directives:
163
164 @table @code
165
166 @item .3byte
167 @cindex assembler directive .3byte, RX
168 @cindex RX assembler directive .3byte
169 Inserts a 3-byte value into the output file at the current location.
170
171 @item .fetchalign
172 @cindex assembler directive .fetchalign, RX
173 @cindex RX assembler directive .fetchalign
174 If the next opcode following this directive spans a fetch line
175 boundary (8 byte boundary), the opcode is aligned to that boundary.
176 If the next opcode does not span a fetch line, this directive has no
177 effect. Note that one or more labels may be between this directive
178 and the opcode; those labels are aligned as well. Any inserted bytes
179 due to alignment will form a NOP opcode.
180
181 @end table
182
183 @node RX-Float
184 @section Floating Point
185
186 @cindex floating point, RX
187 @cindex RX floating point
188
189 The floating point formats generated by directives are these.
190
191 @table @code
192 @cindex @code{float} directive, RX
193
194 @item .float
195 @code{Single} precision (32-bit) floating point constants.
196
197 @cindex @code{double} directive, RX
198 @item .double
199 If the @option{-m64bit-doubles} command line option has been specified
200 then then @code{double} directive generates @code{double} precision
201 (64-bit) floating point constants, otherwise it generates
202 @code{single} precision (32-bit) floating point constants. To force
203 the generation of 64-bit floating point constants used the @code{dc.d}
204 directive instead.
205
206 @end table
207
208 @node RX-Syntax
209 @section Syntax for the RX
210 @menu
211 * RX-Chars:: Special Characters
212 @end menu
213
214 @node RX-Chars
215 @subsection Special Characters
216
217 @cindex line comment character, RX
218 @cindex RX line comment character
219 The presence of a @samp{;} appearing anywhere on a line indicates the
220 start of a comment that extends to the end of that line.
221
222 If a @samp{#} appears as the first character of a line then the whole
223 line is treated as a comment, but in this case the line can also be a
224 logical line number directive (@pxref{Comments}) or a preprocessor
225 control command (@pxref{Preprocessing}).
226
227 @cindex line separator, RX
228 @cindex statement separator, RX
229 @cindex RX line separator
230 The @samp{!} character can be used to separate statements on the same
231 line.
This page took 0.039782 seconds and 4 git commands to generate.