Fix typos
[deliverable/binutils-gdb.git] / gas / doc / c-vax.texi
CommitLineData
252b5132
RH
1@c Copyright (C) 1991, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
2@c This is part of the GAS manual.
3@c For copying conditions, see the file as.texinfo.
4@c VAX/VMS description exhanced and corrected by Klaus K"aempf, kkaempf@progis.de
5@ifset GENERIC
6@node Vax-Dependent
7@chapter VAX Dependent Features
8@cindex VAX support
9
10@end ifset
11@ifclear GENERIC
12@node Machine Dependencies
13@chapter VAX Dependent Features
14@cindex VAX support
15
16@end ifclear
17
18@menu
19* VAX-Opts:: VAX Command-Line Options
20* VAX-float:: VAX Floating Point
21* VAX-directives:: Vax Machine Directives
22* VAX-opcodes:: VAX Opcodes
23* VAX-branch:: VAX Branch Improvement
24* VAX-operands:: VAX Operands
25* VAX-no:: Not Supported on VAX
26@end menu
27
28
29@node VAX-Opts
30@section VAX Command-Line Options
31
32@cindex command-line options ignored, VAX
33@cindex VAX command-line options ignored
34The Vax version of @code{@value{AS}} accepts any of the following options,
35gives a warning message that the option was ignored and proceeds.
36These options are for compatibility with scripts designed for other
37people's assemblers.
38
39@table @code
40@cindex @code{-D}, ignored on VAX
41@cindex @code{-S}, ignored on VAX
42@cindex @code{-T}, ignored on VAX
43@item @code{-D} (Debug)
44@itemx @code{-S} (Symbol Table)
45@itemx @code{-T} (Token Trace)
46These are obsolete options used to debug old assemblers.
47
48@cindex @code{-d}, VAX option
49@item @code{-d} (Displacement size for JUMPs)
50This option expects a number following the @samp{-d}. Like options
51that expect filenames, the number may immediately follow the
52@samp{-d} (old standard) or constitute the whole of the command line
53argument that follows @samp{-d} (@sc{gnu} standard).
54
55@cindex @code{-V}, redundant on VAX
56@item @code{-V} (Virtualize Interpass Temporary File)
57Some other assemblers use a temporary file. This option
58commanded them to keep the information in active memory rather
59than in a disk file. @code{@value{AS}} always does this, so this
60option is redundant.
61
62@cindex @code{-J}, ignored on VAX
63@item @code{-J} (JUMPify Longer Branches)
64Many 32-bit computers permit a variety of branch instructions
65to do the same job. Some of these instructions are short (and
66fast) but have a limited range; others are long (and slow) but
67can branch anywhere in virtual memory. Often there are 3
68flavors of branch: short, medium and long. Some other
69assemblers would emit short and medium branches, unless told by
70this option to emit short and long branches.
71
72@cindex @code{-t}, ignored on VAX
73@item @code{-t} (Temporary File Directory)
74Some other assemblers may use a temporary file, and this option
75takes a filename being the directory to site the temporary
76file. Since @code{@value{AS}} does not use a temporary disk file, this
77option makes no difference. @samp{-t} needs exactly one
78filename.
79@end table
80
81@cindex VMS (VAX) options
82@cindex options for VAX/VMS
83@cindex VAX/VMS options
84@cindex Vax-11 C compatibility
85@cindex symbols with uppercase, VAX/VMS
86The Vax version of the assembler accepts additional options when
87compiled for VMS:
88
89@table @samp
90@cindex @samp{-h} option, VAX/VMS
91@item -h @var{n}
92External symbol or section (used for global variables) names are not
93case sensitive on VAX/VMS and always mapped to upper case. This is
94contrary to the C language definition which explicitly distinguishes
95upper and lower case. To implement a standard conforming C compiler,
96names must be changed (mapped) to preserve the case information. The
97default mapping is to convert all lower case characters to uppercase and
98adding an underscore followed by a 6 digit hex value, representing a 24
99digit binary value. The one digits in the binary value represent which
100characters are uppercase in the original symbol name.
101
102The @samp{-h @var{n}} option determines how we map names. This takes
103several values. No @samp{-h} switch at all allows case hacking as
104described above. A value of zero (@samp{-h0}) implies names should be
105upper case, and inhibits the case hack. A value of 2 (@samp{-h2})
106implies names should be all lower case, with no case hack. A value of 3
107(@samp{-h3}) implies that case should be preserved. The value 1 is
108unused. The @code{-H} option directs @code{@value{AS}} to display
109every mapped symbol during assembly.
110
111Symbols whose names include a dollar sign @samp{$} are exceptions to the
112general name mapping. These symbols are normally only used to reference
113VMS library names. Such symbols are always mapped to upper case.
114
115@cindex @samp{-+} option, VAX/VMS
116@item -+
117The @samp{-+} option causes @code{@value{AS}} to truncate any symbol
118name larger than 31 characters. The @samp{-+} option also prevents some
119code following the @samp{_main} symbol normally added to make the object
120file compatible with Vax-11 "C".
121
122@cindex @samp{-1} option, VAX/VMS
123@item -1
124This option is ignored for backward compatibility with @code{@value{AS}}
125version 1.x.
126
127@cindex @samp{-H} option, VAX/VMS
128@item -H
129The @samp{-H} option causes @code{@value{AS}} to print every symbol
130which was changed by case mapping.
131@end table
132
133@node VAX-float
134@section VAX Floating Point
135
136@cindex VAX floating point
137@cindex floating point, VAX
138Conversion of flonums to floating point is correct, and
139compatible with previous assemblers. Rounding is
140towards zero if the remainder is exactly half the least significant bit.
141
142@code{D}, @code{F}, @code{G} and @code{H} floating point formats
143are understood.
144
145Immediate floating literals (@emph{e.g.} @samp{S`$6.9})
146are rendered correctly. Again, rounding is towards zero in the
147boundary case.
148
149@cindex @code{float} directive, VAX
150@cindex @code{double} directive, VAX
151The @code{.float} directive produces @code{f} format numbers.
152The @code{.double} directive produces @code{d} format numbers.
153
154@node VAX-directives
155@section Vax Machine Directives
156
157@cindex machine directives, VAX
158@cindex VAX machine directives
159The Vax version of the assembler supports four directives for
160generating Vax floating point constants. They are described in the
161table below.
162
163@cindex wide floating point directives, VAX
164@table @code
165@cindex @code{dfloat} directive, VAX
166@item .dfloat
167This expects zero or more flonums, separated by commas, and
168assembles Vax @code{d} format 64-bit floating point constants.
169
170@cindex @code{ffloat} directive, VAX
171@item .ffloat
172This expects zero or more flonums, separated by commas, and
173assembles Vax @code{f} format 32-bit floating point constants.
174
175@cindex @code{gfloat} directive, VAX
176@item .gfloat
177This expects zero or more flonums, separated by commas, and
178assembles Vax @code{g} format 64-bit floating point constants.
179
180@cindex @code{hfloat} directive, VAX
181@item .hfloat
182This expects zero or more flonums, separated by commas, and
183assembles Vax @code{h} format 128-bit floating point constants.
184
185@end table
186
187@node VAX-opcodes
188@section VAX Opcodes
189
190@cindex VAX opcode mnemonics
191@cindex opcode mnemonics, VAX
192@cindex mnemonics for opcodes, VAX
193All DEC mnemonics are supported. Beware that @code{case@dots{}}
194instructions have exactly 3 operands. The dispatch table that
195follows the @code{case@dots{}} instruction should be made with
196@code{.word} statements. This is compatible with all unix
197assemblers we know of.
198
199@node VAX-branch
200@section VAX Branch Improvement
201
202@cindex VAX branch improvement
203@cindex branch improvement, VAX
204@cindex pseudo-ops for branch, VAX
205Certain pseudo opcodes are permitted. They are for branch
206instructions. They expand to the shortest branch instruction that
207reaches the target. Generally these mnemonics are made by
208substituting @samp{j} for @samp{b} at the start of a DEC mnemonic.
209This feature is included both for compatibility and to help
210compilers. If you do not need this feature, avoid these
211opcodes. Here are the mnemonics, and the code they can expand into.
212
213@table @code
214@item jbsb
215@samp{Jsb} is already an instruction mnemonic, so we chose @samp{jbsb}.
216@table @asis
217@item (byte displacement)
218@kbd{bsbb @dots{}}
219@item (word displacement)
220@kbd{bsbw @dots{}}
221@item (long displacement)
222@kbd{jsb @dots{}}
223@end table
224@item jbr
225@itemx jr
226Unconditional branch.
227@table @asis
228@item (byte displacement)
229@kbd{brb @dots{}}
230@item (word displacement)
231@kbd{brw @dots{}}
232@item (long displacement)
233@kbd{jmp @dots{}}
234@end table
235@item j@var{COND}
236@var{COND} may be any one of the conditional branches
237@code{neq}, @code{nequ}, @code{eql}, @code{eqlu}, @code{gtr},
238@code{geq}, @code{lss}, @code{gtru}, @code{lequ}, @code{vc}, @code{vs},
239@code{gequ}, @code{cc}, @code{lssu}, @code{cs}.
240@var{COND} may also be one of the bit tests
241@code{bs}, @code{bc}, @code{bss}, @code{bcs}, @code{bsc}, @code{bcc},
242@code{bssi}, @code{bcci}, @code{lbs}, @code{lbc}.
243@var{NOTCOND} is the opposite condition to @var{COND}.
244@table @asis
245@item (byte displacement)
246@kbd{b@var{COND} @dots{}}
247@item (word displacement)
248@kbd{b@var{NOTCOND} foo ; brw @dots{} ; foo:}
249@item (long displacement)
250@kbd{b@var{NOTCOND} foo ; jmp @dots{} ; foo:}
251@end table
252@item jacb@var{X}
253@var{X} may be one of @code{b d f g h l w}.
254@table @asis
255@item (word displacement)
256@kbd{@var{OPCODE} @dots{}}
257@item (long displacement)
258@example
259@var{OPCODE} @dots{}, foo ;
260brb bar ;
261foo: jmp @dots{} ;
262bar:
263@end example
264@end table
265@item jaob@var{YYY}
266@var{YYY} may be one of @code{lss leq}.
267@item jsob@var{ZZZ}
268@var{ZZZ} may be one of @code{geq gtr}.
269@table @asis
270@item (byte displacement)
271@kbd{@var{OPCODE} @dots{}}
272@item (word displacement)
273@example
274@var{OPCODE} @dots{}, foo ;
275brb bar ;
276foo: brw @var{destination} ;
277bar:
278@end example
279@item (long displacement)
280@example
281@var{OPCODE} @dots{}, foo ;
282brb bar ;
283foo: jmp @var{destination} ;
284bar:
285@end example
286@end table
287@item aobleq
288@itemx aoblss
289@itemx sobgeq
290@itemx sobgtr
291@table @asis
292@item (byte displacement)
293@kbd{@var{OPCODE} @dots{}}
294@item (word displacement)
295@example
296@var{OPCODE} @dots{}, foo ;
297brb bar ;
298foo: brw @var{destination} ;
299bar:
300@end example
301@item (long displacement)
302@example
303@var{OPCODE} @dots{}, foo ;
304brb bar ;
305foo: jmp @var{destination} ;
306bar:
307@end example
308@end table
309@end table
310
311@node VAX-operands
312@section VAX Operands
313
314@cindex VAX operand notation
315@cindex operand notation, VAX
316@cindex immediate character, VAX
317@cindex VAX immediate character
318The immediate character is @samp{$} for Unix compatibility, not
319@samp{#} as DEC writes it.
320
321@cindex indirect character, VAX
322@cindex VAX indirect character
323The indirect character is @samp{*} for Unix compatibility, not
324@samp{@@} as DEC writes it.
325
326@cindex displacement sizing character, VAX
327@cindex VAX displacement sizing character
328The displacement sizing character is @samp{`} (an accent grave) for
329Unix compatibility, not @samp{^} as DEC writes it. The letter
330preceding @samp{`} may have either case. @samp{G} is not
331understood, but all other letters (@code{b i l s w}) are understood.
332
333@cindex register names, VAX
334@cindex VAX register names
335Register names understood are @code{r0 r1 r2 @dots{} r15 ap fp sp
336pc}. Upper and lower case letters are equivalent.
337
338For instance
339@smallexample
340tstb *w`$4(r5)
341@end smallexample
342
343Any expression is permitted in an operand. Operands are comma
344separated.
345
346@c There is some bug to do with recognizing expressions
347@c in operands, but I forget what it is. It is
348@c a syntax clash because () is used as an address mode
349@c and to encapsulate sub-expressions.
350
351@node VAX-no
352@section Not Supported on VAX
353
354@cindex VAX bitfields not supported
355@cindex bitfields, not supported on VAX
356Vax bit fields can not be assembled with @code{@value{AS}}. Someone
357can add the required code if they really need it.
This page took 0.075725 seconds and 4 git commands to generate.