1 @c Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
6 @chapter VAX Dependent Features
11 @node Machine Dependencies
12 @chapter VAX Dependent Features
18 * Vax-Opts:: VAX Command-Line Options
19 * VAX-float:: VAX Floating Point
20 * VAX-directives:: Vax Machine Directives
21 * VAX-opcodes:: VAX Opcodes
22 * VAX-branch:: VAX Branch Improvement
23 * VAX-operands:: VAX Operands
24 * VAX-no:: Not Supported on VAX
29 @section VAX Command-Line Options
31 @cindex command-line options ignored, VAX
32 @cindex VAX command-line options ignored
33 The Vax version of @code{@value{AS}} accepts any of the following options,
34 gives a warning message that the option was ignored and proceeds.
35 These options are for compatibility with scripts designed for other
39 @cindex @code{-D}, ignored on VAX
40 @cindex @code{-S}, ignored on VAX
41 @cindex @code{-T}, ignored on VAX
42 @item @code{-D} (Debug)
43 @itemx @code{-S} (Symbol Table)
44 @itemx @code{-T} (Token Trace)
45 These are obsolete options used to debug old assemblers.
47 @cindex @code{-d}, VAX option
48 @item @code{-d} (Displacement size for JUMPs)
49 This option expects a number following the @samp{-d}. Like options
50 that expect filenames, the number may immediately follow the
51 @samp{-d} (old standard) or constitute the whole of the command line
52 argument that follows @samp{-d} (@sc{gnu} standard).
54 @cindex @code{-V}, redundant on VAX
55 @item @code{-V} (Virtualize Interpass Temporary File)
56 Some other assemblers use a temporary file. This option
57 commanded them to keep the information in active memory rather
58 than in a disk file. @code{@value{AS}} always does this, so this
61 @cindex @code{-J}, ignored on VAX
62 @item @code{-J} (JUMPify Longer Branches)
63 Many 32-bit computers permit a variety of branch instructions
64 to do the same job. Some of these instructions are short (and
65 fast) but have a limited range; others are long (and slow) but
66 can branch anywhere in virtual memory. Often there are 3
67 flavors of branch: short, medium and long. Some other
68 assemblers would emit short and medium branches, unless told by
69 this option to emit short and long branches.
71 @cindex @code{-t}, ignored on VAX
72 @item @code{-t} (Temporary File Directory)
73 Some other assemblers may use a temporary file, and this option
74 takes a filename being the directory to site the temporary
75 file. Since @code{@value{AS}} does not use a temporary disk file, this
76 option makes no difference. @samp{-t} needs exactly one
80 @cindex VMS (VAX) options
81 @cindex options for VAX/VMS
82 @cindex VAX/VMS options
83 @cindex @code{-h} option, VAX/VMS
84 @cindex @code{-+} option, VAX/VMS
85 @cindex Vax-11 C compatibility
86 @cindex symbols with lowercase, VAX/VMS
87 @c FIXME! look into "I think" below, correct if needed, delete.
88 The Vax version of the assembler accepts two options when
89 compiled for VMS. They are @samp{-h}, and @samp{-+}. The
90 @samp{-h} option prevents @code{@value{AS}} from modifying the
91 symbol-table entries for symbols that contain lowercase
92 characters (I think). The @samp{-+} option causes @code{@value{AS}} to
93 print warning messages if the FILENAME part of the object file,
94 or any symbol name is larger than 31 characters. The @samp{-+}
95 option also inserts some code following the @samp{_main}
96 symbol so that the object file is compatible with Vax-11
100 @section VAX Floating Point
102 @cindex VAX floating point
103 @cindex floating point, VAX
104 Conversion of flonums to floating point is correct, and
105 compatible with previous assemblers. Rounding is
106 towards zero if the remainder is exactly half the least significant bit.
108 @code{D}, @code{F}, @code{G} and @code{H} floating point formats
111 Immediate floating literals (@emph{e.g.} @samp{S`$6.9})
112 are rendered correctly. Again, rounding is towards zero in the
115 @cindex @code{float} directive, VAX
116 @cindex @code{double} directive, VAX
117 The @code{.float} directive produces @code{f} format numbers.
118 The @code{.double} directive produces @code{d} format numbers.
121 @section Vax Machine Directives
123 @cindex machine directives, VAX
124 @cindex VAX machine directives
125 The Vax version of the assembler supports four directives for
126 generating Vax floating point constants. They are described in the
129 @cindex wide floating point directives, VAX
131 @cindex @code{dfloat} directive, VAX
133 This expects zero or more flonums, separated by commas, and
134 assembles Vax @code{d} format 64-bit floating point constants.
136 @cindex @code{ffloat} directive, VAX
138 This expects zero or more flonums, separated by commas, and
139 assembles Vax @code{f} format 32-bit floating point constants.
141 @cindex @code{gfloat} directive, VAX
143 This expects zero or more flonums, separated by commas, and
144 assembles Vax @code{g} format 64-bit floating point constants.
146 @cindex @code{hfloat} directive, VAX
148 This expects zero or more flonums, separated by commas, and
149 assembles Vax @code{h} format 128-bit floating point constants.
156 @cindex VAX opcode mnemonics
157 @cindex opcode mnemonics, VAX
158 @cindex mnemonics for opcodes, VAX
159 All DEC mnemonics are supported. Beware that @code{case@dots{}}
160 instructions have exactly 3 operands. The dispatch table that
161 follows the @code{case@dots{}} instruction should be made with
162 @code{.word} statements. This is compatible with all unix
163 assemblers we know of.
166 @section VAX Branch Improvement
168 @cindex VAX branch improvement
169 @cindex branch improvement, VAX
170 @cindex pseudo-ops for branch, VAX
171 Certain pseudo opcodes are permitted. They are for branch
172 instructions. They expand to the shortest branch instruction that
173 reaches the target. Generally these mnemonics are made by
174 substituting @samp{j} for @samp{b} at the start of a DEC mnemonic.
175 This feature is included both for compatibility and to help
176 compilers. If you do not need this feature, avoid these
177 opcodes. Here are the mnemonics, and the code they can expand into.
181 @samp{Jsb} is already an instruction mnemonic, so we chose @samp{jbsb}.
183 @item (byte displacement)
185 @item (word displacement)
187 @item (long displacement)
192 Unconditional branch.
194 @item (byte displacement)
196 @item (word displacement)
198 @item (long displacement)
202 @var{COND} may be any one of the conditional branches
203 @code{neq}, @code{nequ}, @code{eql}, @code{eqlu}, @code{gtr},
204 @code{geq}, @code{lss}, @code{gtru}, @code{lequ}, @code{vc}, @code{vs},
205 @code{gequ}, @code{cc}, @code{lssu}, @code{cs}.
206 @var{COND} may also be one of the bit tests
207 @code{bs}, @code{bc}, @code{bss}, @code{bcs}, @code{bsc}, @code{bcc},
208 @code{bssi}, @code{bcci}, @code{lbs}, @code{lbc}.
209 @var{NOTCOND} is the opposite condition to @var{COND}.
211 @item (byte displacement)
212 @kbd{b@var{COND} @dots{}}
213 @item (word displacement)
214 @kbd{b@var{NOTCOND} foo ; brw @dots{} ; foo:}
215 @item (long displacement)
216 @kbd{b@var{NOTCOND} foo ; jmp @dots{} ; foo:}
219 @var{X} may be one of @code{b d f g h l w}.
221 @item (word displacement)
222 @kbd{@var{OPCODE} @dots{}}
223 @item (long displacement)
225 @var{OPCODE} @dots{}, foo ;
232 @var{YYY} may be one of @code{lss leq}.
234 @var{ZZZ} may be one of @code{geq gtr}.
236 @item (byte displacement)
237 @kbd{@var{OPCODE} @dots{}}
238 @item (word displacement)
240 @var{OPCODE} @dots{}, foo ;
242 foo: brw @var{destination} ;
245 @item (long displacement)
247 @var{OPCODE} @dots{}, foo ;
249 foo: jmp @var{destination} ;
258 @item (byte displacement)
259 @kbd{@var{OPCODE} @dots{}}
260 @item (word displacement)
262 @var{OPCODE} @dots{}, foo ;
264 foo: brw @var{destination} ;
267 @item (long displacement)
269 @var{OPCODE} @dots{}, foo ;
271 foo: jmp @var{destination} ;
278 @section VAX Operands
280 @cindex VAX operand notation
281 @cindex operand notation, VAX
282 @cindex immediate character, VAX
283 @cindex VAX immediate character
284 The immediate character is @samp{$} for Unix compatibility, not
285 @samp{#} as DEC writes it.
287 @cindex indirect character, VAX
288 @cindex VAX indirect character
289 The indirect character is @samp{*} for Unix compatibility, not
290 @samp{@@} as DEC writes it.
292 @cindex displacement sizing character, VAX
293 @cindex VAX displacement sizing character
294 The displacement sizing character is @samp{`} (an accent grave) for
295 Unix compatibility, not @samp{^} as DEC writes it. The letter
296 preceding @samp{`} may have either case. @samp{G} is not
297 understood, but all other letters (@code{b i l s w}) are understood.
299 @cindex register names, VAX
300 @cindex VAX register names
301 Register names understood are @code{r0 r1 r2 @dots{} r15 ap fp sp
302 pc}. Upper and lower case letters are equivalent.
309 Any expression is permitted in an operand. Operands are comma
312 @c There is some bug to do with recognizing expressions
313 @c in operands, but I forget what it is. It is
314 @c a syntax clash because () is used as an address mode
315 @c and to encapsulate sub-expressions.
318 @section Not Supported on VAX
320 @cindex VAX bitfields not supported
321 @cindex bitfields, not supported on VAX
322 Vax bit fields can not be assembled with @code{@value{AS}}. Someone
323 can add the required code if they really need it.