Fix copyright notices
[deliverable/binutils-gdb.git] / gas / doc / c-v850.texi
CommitLineData
f7e42eb4 1@c Copyright 1997 Free Software Foundation, Inc.
252b5132
RH
2@c This is part of the GAS manual.
3@c For copying conditions, see the file as.texinfo.
4
5@node V850-Dependent
6@chapter v850 Dependent Features
7
8@cindex V850 support
9@menu
10* V850 Options:: Options
11* V850 Syntax:: Syntax
12* V850 Floating Point:: Floating Point
13* V850 Directives:: V850 Machine Directives
14* V850 Opcodes:: Opcodes
15@end menu
16
17@node V850 Options
18@section Options
19@cindex V850 options (none)
20@cindex options for V850 (none)
21@code{@value{AS}} supports the following additional command-line options
22for the V850 processor family:
23
24@cindex command line options, V850
25@cindex V850 command line options
26@table @code
27
28@cindex @code{-wsigned_overflow} command line option, V850
29@item -wsigned_overflow
30Causes warnings to be produced when signed immediate values overflow the
31space available for then within their opcodes. By default this option
32is disabled as it is possible to receive spurious warnings due to using
33exact bit patterns as immediate constants.
34
35@cindex @code{-wunsigned_overflow} command line option, V850
36@item -wunsigned_overflow
37Causes warnings to be produced when unsigned immediate values overflow
38the space available for then within their opcodes. By default this
39option is disabled as it is possible to receive spurious warnings due to
40using exact bit patterns as immediate constants.
41
42@cindex @code{-mv850} command line option, V850
43@item -mv850
44Specifies that the assembled code should be marked as being targeted at
45the V850 processor. This allows the linker to detect attempts to link
46such code with code assembled for other processors.
47
48@cindex @code{-mv850e} command line option, V850
49@item -mv850e
50Specifies that the assembled code should be marked as being targeted at
51the V850E processor. This allows the linker to detect attempts to link
52such code with code assembled for other processors.
53
54@cindex @code{-mv850any} command line option, V850
55@item -mv850any
56Specifies that the assembled code should be marked as being targeted at
57the V850 processor but support instructions that are specific to the
58extended variants of the process. This allows the production of
59binaries that contain target specific code, but which are also intended
60to be used in a generic fashion. For example libgcc.a contains generic
61routines used by the code produced by GCC for all versions of the v850
62architecture, together with support routines only used by the V850E
63architecture.
64
65@end table
66
67
68@node V850 Syntax
69@section Syntax
70@menu
71* V850-Chars:: Special Characters
72* V850-Regs:: Register Names
73@end menu
74
75@node V850-Chars
76@subsection Special Characters
77
78@cindex line comment character, V850
79@cindex V850 line comment character
80@samp{#} is the line comment character.
81@node V850-Regs
82@subsection Register Names
83
84@cindex V850 register names
85@cindex register names, V850
86@code{@value{AS}} supports the following names for registers:
87@table @code
88@cindex @code{zero} register, V850
89@item general register 0
90r0, zero
91@item general register 1
92r1
93@item general register 2
94r2, hp
95@cindex @code{sp} register, V850
96@item general register 3
97r3, sp
98@cindex @code{gp} register, V850
99@item general register 4
100r4, gp
101@cindex @code{tp} register, V850
102@item general register 5
103r5, tp
104@item general register 6
105r6
106@item general register 7
107r7
108@item general register 8
109r8
110@item general register 9
111r9
112@item general register 10
113r10
114@item general register 11
115r11
116@item general register 12
117r12
118@item general register 13
119r13
120@item general register 14
121r14
122@item general register 15
123r15
124@item general register 16
125r16
126@item general register 17
127r17
128@item general register 18
129r18
130@item general register 19
131r19
132@item general register 20
133r20
134@item general register 21
135r21
136@item general register 22
137r22
138@item general register 23
139r23
140@item general register 24
141r24
142@item general register 25
143r25
144@item general register 26
145r26
146@item general register 27
147r27
148@item general register 28
149r28
150@item general register 29
151r29
152@cindex @code{ep} register, V850
153@item general register 30
154r30, ep
155@cindex @code{lp} register, V850
156@item general register 31
157r31, lp
158@cindex @code{eipc} register, V850
159@item system register 0
160eipc
161@cindex @code{eipsw} register, V850
162@item system register 1
163eipsw
164@cindex @code{fepc} register, V850
165@item system register 2
166fepc
167@cindex @code{fepsw} register, V850
168@item system register 3
169fepsw
170@cindex @code{ecr} register, V850
171@item system register 4
172ecr
173@cindex @code{psw} register, V850
174@item system register 5
175psw
176@cindex @code{ctpc} register, V850
177@item system register 16
178ctpc
179@cindex @code{ctpsw} register, V850
180@item system register 17
181ctpsw
182@cindex @code{dbpc} register, V850
183@item system register 18
184dbpc
185@cindex @code{dbpsw} register, V850
186@item system register 19
187dbpsw
188@cindex @code{ctbp} register, V850
189@item system register 20
190ctbp
191@end table
192
193@node V850 Floating Point
194@section Floating Point
195
196@cindex floating point, V850 (@sc{ieee})
197@cindex V850 floating point (@sc{ieee})
198The V850 family uses @sc{ieee} floating-point numbers.
199
200@node V850 Directives
201@section V850 Machine Directives
202
203@cindex machine directives, V850
204@cindex V850 machine directives
205@table @code
206@cindex @code{offset} directive, V850
207@item .offset @var{<expression>}
208Moves the offset into the current section to the specified amount.
209
210@cindex @code{section} directive, V850
211@item .section "name", <type>
212This is an extension to the standard .section directive. It sets the
213current section to be <type> and creates an alias for this section
214called "name".
215
216@cindex @code{.v850} directive, V850
217@item .v850
218Specifies that the assembled code should be marked as being targeted at
219the V850 processor. This allows the linker to detect attempts to link
220such code with code assembled for other processors.
221
222@cindex @code{.v850e} directive, V850
223@item .v850e
224Specifies that the assembled code should be marked as being targeted at
225the V850E processor. This allows the linker to detect attempts to link
226such code with code assembled for other processors.
227
228@end table
229
230@node V850 Opcodes
231@section Opcodes
232
233@cindex V850 opcodes
234@cindex opcodes for V850
235@code{@value{AS}} implements all the standard V850 opcodes.
236
237@code{@value{AS}} also implements the following pseudo ops:
238
239@table @code
240
241@cindex @code{hi0} pseudo-op, V850
242@item hi0()
243Computes the higher 16 bits of the given expression and stores it into
244the immediate operand field of the given instruction. For example:
245
246 @samp{mulhi hi0(here - there), r5, r6}
247
248computes the difference between the address of labels 'here' and
249'there', takes the upper 16 bits of this difference, shifts it down 16
250bits and then mutliplies it by the lower 16 bits in register 5, putting
251the result into register 6.
252
253@cindex @code{lo} pseudo-op, V850
254@item lo()
255Computes the lower 16 bits of the given expression and stores it into
256the immediate operand field of the given instruction. For example:
257
258 @samp{addi lo(here - there), r5, r6}
259
260computes the difference between the address of labels 'here' and
261'there', takes the lower 16 bits of this difference and adds it to
262register 5, putting the result into register 6.
263
264@cindex @code{hi} pseudo-op, V850
265@item hi()
266Computes the higher 16 bits of the given expression and then adds the
267value of the most significant bit of the lower 16 bits of the expression
268and stores the result into the immediate operand field of the given
269instruction. For example the following code can be used to compute the
270address of the label 'here' and store it into register 6:
271
272 @samp{movhi hi(here), r0, r6}
273 @samp{movea lo(here), r6, r6}
274
275The reason for this special behaviour is that movea performs a sign
276extention on its immediate operand. So for example if the address of
277'here' was 0xFFFFFFFF then without the special behaviour of the hi()
278pseudo-op the movhi instruction would put 0xFFFF0000 into r6, then the
279movea instruction would takes its immediate operand, 0xFFFF, sign extend
280it to 32 bits, 0xFFFFFFFF, and then add it into r6 giving 0xFFFEFFFF
281which is wrong (the fifth nibble is E). With the hi() pseudo op adding
282in the top bit of the lo() pseudo op, the movhi instruction actually
283stores 0 into r6 (0xFFFF + 1 = 0x0000), so that the movea instruction
284stores 0xFFFFFFFF into r6 - the right value.
285
286@cindex @code{hilo} pseudo-op, V850
287@item hilo()
288Computes the 32 bit value of the given expression and stores it into
289the immediate operand field of the given instruction (which must be a
290mov instruction). For example:
291
292 @samp{mov hilo(here), r6}
293
294computes the absolute address of label 'here' and puts the result into
295register 6.
296
297@cindex @code{sdaoff} pseudo-op, V850
298@item sdaoff()
299Computes the offset of the named variable from the start of the Small
300Data Area (whoes address is held in register 4, the GP register) and
301stores the result as a 16 bit signed value in the immediate operand
302field of the given instruction. For example:
303
304 @samp{ld.w sdaoff(_a_variable)[gp],r6}
305
306loads the contents of the location pointed to by the label '_a_variable'
307into register 6, provided that the label is located somewhere within +/-
30832K of the address held in the GP register. [Note the linker assumes
309that the GP register contains a fixed address set to the address of the
310label called '__gp'. This can either be set up automatically by the
311linker, or specifically set by using the @samp{--defsym __gp=<value>}
312command line option].
313
314@cindex @code{tdaoff} pseudo-op, V850
315@item tdaoff()
316Computes the offset of the named variable from the start of the Tiny
317Data Area (whoes address is held in register 30, the EP register) and
318stores the result as a 4,5, 7 or 8 bit unsigned value in the immediate
319operand field of the given instruction. For example:
320
321 @samp{sld.w tdaoff(_a_variable)[ep],r6}
322
323loads the contents of the location pointed to by the label '_a_variable'
324into register 6, provided that the label is located somewhere within +256
325bytes of the address held in the EP register. [Note the linker assumes
326that the EP register contains a fixed address set to the address of the
327label called '__ep'. This can either be set up automatically by the
328linker, or specifically set by using the @samp{--defsym __ep=<value>}
329command line option].
330
331@cindex @code{zdaoff} pseudo-op, V850
332@item zdaoff()
333Computes the offset of the named variable from address 0 and stores the
334result as a 16 bit signed value in the immediate operand field of the
335given instruction. For example:
336
337 @samp{movea zdaoff(_a_variable),zero,r6}
338
339puts the address of the label '_a_variable' into register 6, assuming
340that the label is somewhere within the first 32K of memory. (Strictly
341speaking it also possible to access the last 32K of memory as well, as
342the offsets are signed).
343
344@cindex @code{ctoff} pseudo-op, V850
345@item ctoff()
346Computes the offset of the named variable from the start of the Call
347Table Area (whoes address is helg in system register 20, the CTBP
348register) and stores the result a 6 or 16 bit unsigned value in the
349immediate field of then given instruction or piece of data. For
350example:
351
352 @samp{callt ctoff(table_func1)}
353
354will put the call the function whoes address is held in the call table
355at the location labeled 'table_func1'.
356
357@end table
358
359
360For information on the V850 instruction set, see @cite{V850
361Family 32-/16-Bit single-Chip Microcontroller Architecture Manual} from NEC.
362Ltd.
363
This page took 0.090707 seconds and 4 git commands to generate.