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
7 @chapter VAX Dependent Features
12 @node Machine Dependencies
13 @chapter VAX Dependent Features
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
30 @section VAX Command-Line Options
32 @cindex command-line options ignored, VAX
33 @cindex VAX command-line options ignored
34 The Vax version of @code{@value{AS}} accepts any of the following options,
35 gives a warning message that the option was ignored and proceeds.
36 These options are for compatibility with scripts designed for other
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)
46 These are obsolete options used to debug old assemblers.
48 @cindex @code{-d}, VAX option
49 @item @code{-d} (Displacement size for JUMPs)
50 This option expects a number following the @samp{-d}. Like options
51 that expect filenames, the number may immediately follow the
52 @samp{-d} (old standard) or constitute the whole of the command line
53 argument that follows @samp{-d} (@sc{gnu} standard).
55 @cindex @code{-V}, redundant on VAX
56 @item @code{-V} (Virtualize Interpass Temporary File)
57 Some other assemblers use a temporary file. This option
58 commanded them to keep the information in active memory rather
59 than in a disk file. @code{@value{AS}} always does this, so this
62 @cindex @code{-J}, ignored on VAX
63 @item @code{-J} (JUMPify Longer Branches)
64 Many 32-bit computers permit a variety of branch instructions
65 to do the same job. Some of these instructions are short (and
66 fast) but have a limited range; others are long (and slow) but
67 can branch anywhere in virtual memory. Often there are 3
68 flavors of branch: short, medium and long. Some other
69 assemblers would emit short and medium branches, unless told by
70 this option to emit short and long branches.
72 @cindex @code{-t}, ignored on VAX
73 @item @code{-t} (Temporary File Directory)
74 Some other assemblers may use a temporary file, and this option
75 takes a filename being the directory to site the temporary
76 file. Since @code{@value{AS}} does not use a temporary disk file, this
77 option makes no difference. @samp{-t} needs exactly one
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
86 The Vax version of the assembler accepts additional options when
90 @cindex @samp{-h} option, VAX/VMS
92 External symbol or section (used for global variables) names are not
93 case sensitive on VAX/VMS and always mapped to upper case. This is
94 contrary to the C language definition which explicitly distinguishes
95 upper and lower case. To implement a standard conforming C compiler,
96 names must be changed (mapped) to preserve the case information. The
97 default mapping is to convert all lower case characters to uppercase and
98 adding an underscore followed by a 6 digit hex value, representing a 24
99 digit binary value. The one digits in the binary value represent which
100 characters are uppercase in the original symbol name.
102 The @samp{-h @var{n}} option determines how we map names. This takes
103 several values. No @samp{-h} switch at all allows case hacking as
104 described above. A value of zero (@samp{-h0}) implies names should be
105 upper case, and inhibits the case hack. A value of 2 (@samp{-h2})
106 implies 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
108 unused. The @code{-H} option directs @code{@value{AS}} to display
109 every mapped symbol during assembly.
111 Symbols whose names include a dollar sign @samp{$} are exceptions to the
112 general name mapping. These symbols are normally only used to reference
113 VMS library names. Such symbols are always mapped to upper case.
115 @cindex @samp{-+} option, VAX/VMS
117 The @samp{-+} option causes @code{@value{AS}} to truncate any symbol
118 name larger than 31 characters. The @samp{-+} option also prevents some
119 code following the @samp{_main} symbol normally added to make the object
120 file compatible with Vax-11 "C".
122 @cindex @samp{-1} option, VAX/VMS
124 This option is ignored for backward compatibility with @code{@value{AS}}
127 @cindex @samp{-H} option, VAX/VMS
129 The @samp{-H} option causes @code{@value{AS}} to print every symbol
130 which was changed by case mapping.
134 @section VAX Floating Point
136 @cindex VAX floating point
137 @cindex floating point, VAX
138 Conversion of flonums to floating point is correct, and
139 compatible with previous assemblers. Rounding is
140 towards zero if the remainder is exactly half the least significant bit.
142 @code{D}, @code{F}, @code{G} and @code{H} floating point formats
145 Immediate floating literals (@emph{e.g.} @samp{S`$6.9})
146 are rendered correctly. Again, rounding is towards zero in the
149 @cindex @code{float} directive, VAX
150 @cindex @code{double} directive, VAX
151 The @code{.float} directive produces @code{f} format numbers.
152 The @code{.double} directive produces @code{d} format numbers.
155 @section Vax Machine Directives
157 @cindex machine directives, VAX
158 @cindex VAX machine directives
159 The Vax version of the assembler supports four directives for
160 generating Vax floating point constants. They are described in the
163 @cindex wide floating point directives, VAX
165 @cindex @code{dfloat} directive, VAX
167 This expects zero or more flonums, separated by commas, and
168 assembles Vax @code{d} format 64-bit floating point constants.
170 @cindex @code{ffloat} directive, VAX
172 This expects zero or more flonums, separated by commas, and
173 assembles Vax @code{f} format 32-bit floating point constants.
175 @cindex @code{gfloat} directive, VAX
177 This expects zero or more flonums, separated by commas, and
178 assembles Vax @code{g} format 64-bit floating point constants.
180 @cindex @code{hfloat} directive, VAX
182 This expects zero or more flonums, separated by commas, and
183 assembles Vax @code{h} format 128-bit floating point constants.
190 @cindex VAX opcode mnemonics
191 @cindex opcode mnemonics, VAX
192 @cindex mnemonics for opcodes, VAX
193 All DEC mnemonics are supported. Beware that @code{case@dots{}}
194 instructions have exactly 3 operands. The dispatch table that
195 follows the @code{case@dots{}} instruction should be made with
196 @code{.word} statements. This is compatible with all unix
197 assemblers we know of.
200 @section VAX Branch Improvement
202 @cindex VAX branch improvement
203 @cindex branch improvement, VAX
204 @cindex pseudo-ops for branch, VAX
205 Certain pseudo opcodes are permitted. They are for branch
206 instructions. They expand to the shortest branch instruction that
207 reaches the target. Generally these mnemonics are made by
208 substituting @samp{j} for @samp{b} at the start of a DEC mnemonic.
209 This feature is included both for compatibility and to help
210 compilers. If you do not need this feature, avoid these
211 opcodes. Here are the mnemonics, and the code they can expand into.
215 @samp{Jsb} is already an instruction mnemonic, so we chose @samp{jbsb}.
217 @item (byte displacement)
219 @item (word displacement)
221 @item (long displacement)
226 Unconditional branch.
228 @item (byte displacement)
230 @item (word displacement)
232 @item (long displacement)
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}.
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:}
253 @var{X} may be one of @code{b d f g h l w}.
255 @item (word displacement)
256 @kbd{@var{OPCODE} @dots{}}
257 @item (long displacement)
259 @var{OPCODE} @dots{}, foo ;
266 @var{YYY} may be one of @code{lss leq}.
268 @var{ZZZ} may be one of @code{geq gtr}.
270 @item (byte displacement)
271 @kbd{@var{OPCODE} @dots{}}
272 @item (word displacement)
274 @var{OPCODE} @dots{}, foo ;
276 foo: brw @var{destination} ;
279 @item (long displacement)
281 @var{OPCODE} @dots{}, foo ;
283 foo: jmp @var{destination} ;
292 @item (byte displacement)
293 @kbd{@var{OPCODE} @dots{}}
294 @item (word displacement)
296 @var{OPCODE} @dots{}, foo ;
298 foo: brw @var{destination} ;
301 @item (long displacement)
303 @var{OPCODE} @dots{}, foo ;
305 foo: jmp @var{destination} ;
312 @section VAX Operands
314 @cindex VAX operand notation
315 @cindex operand notation, VAX
316 @cindex immediate character, VAX
317 @cindex VAX immediate character
318 The immediate character is @samp{$} for Unix compatibility, not
319 @samp{#} as DEC writes it.
321 @cindex indirect character, VAX
322 @cindex VAX indirect character
323 The indirect character is @samp{*} for Unix compatibility, not
324 @samp{@@} as DEC writes it.
326 @cindex displacement sizing character, VAX
327 @cindex VAX displacement sizing character
328 The displacement sizing character is @samp{`} (an accent grave) for
329 Unix compatibility, not @samp{^} as DEC writes it. The letter
330 preceding @samp{`} may have either case. @samp{G} is not
331 understood, but all other letters (@code{b i l s w}) are understood.
333 @cindex register names, VAX
334 @cindex VAX register names
335 Register names understood are @code{r0 r1 r2 @dots{} r15 ap fp sp
336 pc}. Upper and lower case letters are equivalent.
343 Any expression is permitted in an operand. Operands are comma
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.
352 @section Not Supported on VAX
354 @cindex VAX bitfields not supported
355 @cindex bitfields, not supported on VAX
356 Vax bit fields can not be assembled with @code{@value{AS}}. Someone
357 can add the required code if they really need it.