Files
2024-02-19 00:25:23 -05:00

416 lines
10 KiB
HTML

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from ../texi/as.texinfo on 24 April 1999 -->
<TITLE>Using as - VAX Dependent Features</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_22.html">previous</A>, <A HREF="as_24.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC253" HREF="as_toc.html#TOC253">VAX Dependent Features</A></H1>
<P>
<A NAME="IDX817"></A>
</P>
<H2><A NAME="SEC254" HREF="as_toc.html#TOC254">VAX Command-Line Options</A></H2>
<P>
<A NAME="IDX818"></A>
<A NAME="IDX819"></A>
The Vax version of <CODE>as</CODE> accepts any of the following options,
gives a warning message that the option was ignored and proceeds.
These options are for compatibility with scripts designed for other
people's assemblers.
</P>
<DL COMPACT>
<DT><CODE><CODE>-D</CODE> (Debug)</CODE>
<DD>
<A NAME="IDX820"></A>
<A NAME="IDX821"></A>
<A NAME="IDX822"></A>
<DT><CODE><CODE>-S</CODE> (Symbol Table)</CODE>
<DD>
<DT><CODE><CODE>-T</CODE> (Token Trace)</CODE>
<DD>
These are obsolete options used to debug old assemblers.
<A NAME="IDX823"></A>
<DT><CODE><CODE>-d</CODE> (Displacement size for JUMPs)</CODE>
<DD>
This option expects a number following the <SAMP>`-d'</SAMP>. Like options
that expect filenames, the number may immediately follow the
<SAMP>`-d'</SAMP> (old standard) or constitute the whole of the command line
argument that follows <SAMP>`-d'</SAMP> (GNU standard).
<A NAME="IDX824"></A>
<DT><CODE><CODE>-V</CODE> (Virtualize Interpass Temporary File)</CODE>
<DD>
Some other assemblers use a temporary file. This option
commanded them to keep the information in active memory rather
than in a disk file. <CODE>as</CODE> always does this, so this
option is redundant.
<A NAME="IDX825"></A>
<DT><CODE><CODE>-J</CODE> (JUMPify Longer Branches)</CODE>
<DD>
Many 32-bit computers permit a variety of branch instructions
to do the same job. Some of these instructions are short (and
fast) but have a limited range; others are long (and slow) but
can branch anywhere in virtual memory. Often there are 3
flavors of branch: short, medium and long. Some other
assemblers would emit short and medium branches, unless told by
this option to emit short and long branches.
<A NAME="IDX826"></A>
<DT><CODE><CODE>-t</CODE> (Temporary File Directory)</CODE>
<DD>
Some other assemblers may use a temporary file, and this option
takes a filename being the directory to site the temporary
file. Since <CODE>as</CODE> does not use a temporary disk file, this
option makes no difference. <SAMP>`-t'</SAMP> needs exactly one
filename.
</DL>
<P>
<A NAME="IDX827"></A>
<A NAME="IDX828"></A>
<A NAME="IDX829"></A>
<A NAME="IDX830"></A>
<A NAME="IDX831"></A>
<A NAME="IDX832"></A>
<A NAME="IDX833"></A>
The Vax version of the assembler accepts two options when
compiled for VMS. They are <SAMP>`-h'</SAMP>, and <SAMP>`-+'</SAMP>. The
<SAMP>`-h'</SAMP> option prevents <CODE>as</CODE> from modifying the
symbol-table entries for symbols that contain lowercase
characters (I think). The <SAMP>`-+'</SAMP> option causes <CODE>as</CODE> to
print warning messages if the FILENAME part of the object file,
or any symbol name is larger than 31 characters. The <SAMP>`-+'</SAMP>
option also inserts some code following the <SAMP>`_main'</SAMP>
symbol so that the object file is compatible with Vax-11
"C".
</P>
<H2><A NAME="SEC255" HREF="as_toc.html#TOC255">VAX Floating Point</A></H2>
<P>
<A NAME="IDX834"></A>
<A NAME="IDX835"></A>
Conversion of flonums to floating point is correct, and
compatible with previous assemblers. Rounding is
towards zero if the remainder is exactly half the least significant bit.
</P>
<P>
<CODE>D</CODE>, <CODE>F</CODE>, <CODE>G</CODE> and <CODE>H</CODE> floating point formats
are understood.
</P>
<P>
Immediate floating literals (<EM>e.g.</EM> <SAMP>`S`$6.9'</SAMP>)
are rendered correctly. Again, rounding is towards zero in the
boundary case.
</P>
<P>
<A NAME="IDX836"></A>
<A NAME="IDX837"></A>
The <CODE>.float</CODE> directive produces <CODE>f</CODE> format numbers.
The <CODE>.double</CODE> directive produces <CODE>d</CODE> format numbers.
</P>
<H2><A NAME="SEC256" HREF="as_toc.html#TOC256">Vax Machine Directives</A></H2>
<P>
<A NAME="IDX838"></A>
<A NAME="IDX839"></A>
The Vax version of the assembler supports four directives for
generating Vax floating point constants. They are described in the
table below.
</P>
<P>
<A NAME="IDX840"></A>
<DL COMPACT>
<DT><CODE>.dfloat</CODE>
<DD>
<A NAME="IDX841"></A>
This expects zero or more flonums, separated by commas, and
assembles Vax <CODE>d</CODE> format 64-bit floating point constants.
<A NAME="IDX842"></A>
<DT><CODE>.ffloat</CODE>
<DD>
This expects zero or more flonums, separated by commas, and
assembles Vax <CODE>f</CODE> format 32-bit floating point constants.
<A NAME="IDX843"></A>
<DT><CODE>.gfloat</CODE>
<DD>
This expects zero or more flonums, separated by commas, and
assembles Vax <CODE>g</CODE> format 64-bit floating point constants.
<A NAME="IDX844"></A>
<DT><CODE>.hfloat</CODE>
<DD>
This expects zero or more flonums, separated by commas, and
assembles Vax <CODE>h</CODE> format 128-bit floating point constants.
</DL>
<H2><A NAME="SEC257" HREF="as_toc.html#TOC257">VAX Opcodes</A></H2>
<P>
<A NAME="IDX845"></A>
<A NAME="IDX846"></A>
<A NAME="IDX847"></A>
All DEC mnemonics are supported. Beware that <CODE>case...</CODE>
instructions have exactly 3 operands. The dispatch table that
follows the <CODE>case...</CODE> instruction should be made with
<CODE>.word</CODE> statements. This is compatible with all unix
assemblers we know of.
</P>
<H2><A NAME="SEC258" HREF="as_toc.html#TOC258">VAX Branch Improvement</A></H2>
<P>
<A NAME="IDX848"></A>
<A NAME="IDX849"></A>
<A NAME="IDX850"></A>
Certain pseudo opcodes are permitted. They are for branch
instructions. They expand to the shortest branch instruction that
reaches the target. Generally these mnemonics are made by
substituting <SAMP>`j'</SAMP> for <SAMP>`b'</SAMP> at the start of a DEC mnemonic.
This feature is included both for compatibility and to help
compilers. If you do not need this feature, avoid these
opcodes. Here are the mnemonics, and the code they can expand into.
</P>
<DL COMPACT>
<DT><CODE>jbsb</CODE>
<DD>
<SAMP>`Jsb'</SAMP> is already an instruction mnemonic, so we chose <SAMP>`jbsb'</SAMP>.
<DL COMPACT>
<DT>(byte displacement)
<DD>
<KBD>bsbb ...</KBD>
<DT>(word displacement)
<DD>
<KBD>bsbw ...</KBD>
<DT>(long displacement)
<DD>
<KBD>jsb ...</KBD>
</DL>
<DT><CODE>jbr</CODE>
<DD>
<DT><CODE>jr</CODE>
<DD>
Unconditional branch.
<DL COMPACT>
<DT>(byte displacement)
<DD>
<KBD>brb ...</KBD>
<DT>(word displacement)
<DD>
<KBD>brw ...</KBD>
<DT>(long displacement)
<DD>
<KBD>jmp ...</KBD>
</DL>
<DT><CODE>j<VAR>COND</VAR></CODE>
<DD>
<VAR>COND</VAR> may be any one of the conditional branches
<CODE>neq</CODE>, <CODE>nequ</CODE>, <CODE>eql</CODE>, <CODE>eqlu</CODE>, <CODE>gtr</CODE>,
<CODE>geq</CODE>, <CODE>lss</CODE>, <CODE>gtru</CODE>, <CODE>lequ</CODE>, <CODE>vc</CODE>, <CODE>vs</CODE>,
<CODE>gequ</CODE>, <CODE>cc</CODE>, <CODE>lssu</CODE>, <CODE>cs</CODE>.
<VAR>COND</VAR> may also be one of the bit tests
<CODE>bs</CODE>, <CODE>bc</CODE>, <CODE>bss</CODE>, <CODE>bcs</CODE>, <CODE>bsc</CODE>, <CODE>bcc</CODE>,
<CODE>bssi</CODE>, <CODE>bcci</CODE>, <CODE>lbs</CODE>, <CODE>lbc</CODE>.
<VAR>NOTCOND</VAR> is the opposite condition to <VAR>COND</VAR>.
<DL COMPACT>
<DT>(byte displacement)
<DD>
<KBD>b<VAR>COND</VAR> ...</KBD>
<DT>(word displacement)
<DD>
<KBD>b<VAR>NOTCOND</VAR> foo ; brw ... ; foo:</KBD>
<DT>(long displacement)
<DD>
<KBD>b<VAR>NOTCOND</VAR> foo ; jmp ... ; foo:</KBD>
</DL>
<DT><CODE>jacb<VAR>X</VAR></CODE>
<DD>
<VAR>X</VAR> may be one of <CODE>b d f g h l w</CODE>.
<DL COMPACT>
<DT>(word displacement)
<DD>
<KBD><VAR>OPCODE</VAR> ...</KBD>
<DT>(long displacement)
<DD>
<PRE>
<VAR>OPCODE</VAR> ..., foo ;
brb bar ;
foo: jmp ... ;
bar:
</PRE>
</DL>
<DT><CODE>jaob<VAR>YYY</VAR></CODE>
<DD>
<VAR>YYY</VAR> may be one of <CODE>lss leq</CODE>.
<DT><CODE>jsob<VAR>ZZZ</VAR></CODE>
<DD>
<VAR>ZZZ</VAR> may be one of <CODE>geq gtr</CODE>.
<DL COMPACT>
<DT>(byte displacement)
<DD>
<KBD><VAR>OPCODE</VAR> ...</KBD>
<DT>(word displacement)
<DD>
<PRE>
<VAR>OPCODE</VAR> ..., foo ;
brb bar ;
foo: brw <VAR>destination</VAR> ;
bar:
</PRE>
<DT>(long displacement)
<DD>
<PRE>
<VAR>OPCODE</VAR> ..., foo ;
brb bar ;
foo: jmp <VAR>destination</VAR> ;
bar:
</PRE>
</DL>
<DT><CODE>aobleq</CODE>
<DD>
<DT><CODE>aoblss</CODE>
<DD>
<DT><CODE>sobgeq</CODE>
<DD>
<DT><CODE>sobgtr</CODE>
<DD>
<DL COMPACT>
<DT>(byte displacement)
<DD>
<KBD><VAR>OPCODE</VAR> ...</KBD>
<DT>(word displacement)
<DD>
<PRE>
<VAR>OPCODE</VAR> ..., foo ;
brb bar ;
foo: brw <VAR>destination</VAR> ;
bar:
</PRE>
<DT>(long displacement)
<DD>
<PRE>
<VAR>OPCODE</VAR> ..., foo ;
brb bar ;
foo: jmp <VAR>destination</VAR> ;
bar:
</PRE>
</DL>
</DL>
<H2><A NAME="SEC259" HREF="as_toc.html#TOC259">VAX Operands</A></H2>
<P>
<A NAME="IDX851"></A>
<A NAME="IDX852"></A>
<A NAME="IDX853"></A>
<A NAME="IDX854"></A>
The immediate character is <SAMP>`$'</SAMP> for Unix compatibility, not
<SAMP>`#'</SAMP> as DEC writes it.
</P>
<P>
<A NAME="IDX855"></A>
<A NAME="IDX856"></A>
The indirect character is <SAMP>`*'</SAMP> for Unix compatibility, not
<SAMP>`@'</SAMP> as DEC writes it.
</P>
<P>
<A NAME="IDX857"></A>
<A NAME="IDX858"></A>
The displacement sizing character is <SAMP>``'</SAMP> (an accent grave) for
Unix compatibility, not <SAMP>`^'</SAMP> as DEC writes it. The letter
preceding <SAMP>``'</SAMP> may have either case. <SAMP>`G'</SAMP> is not
understood, but all other letters (<CODE>b i l s w</CODE>) are understood.
</P>
<P>
<A NAME="IDX859"></A>
<A NAME="IDX860"></A>
Register names understood are <CODE>r0 r1 r2 ... r15 ap fp sp
pc</CODE>. Upper and lower case letters are equivalent.
</P>
<P>
For instance
<PRE>
tstb *w`$4(r5)
</PRE>
<P>
Any expression is permitted in an operand. Operands are comma
separated.
</P>
<H2><A NAME="SEC260" HREF="as_toc.html#TOC260">Not Supported on VAX</A></H2>
<P>
<A NAME="IDX861"></A>
<A NAME="IDX862"></A>
Vax bit fields can not be assembled with <CODE>as</CODE>. Someone
can add the required code if they really need it.
</P>
<P><HR><P>
Go to the <A HREF="as_1.html">first</A>, <A HREF="as_22.html">previous</A>, <A HREF="as_24.html">next</A>, <A HREF="as_27.html">last</A> section, <A HREF="as_toc.html">table of contents</A>.
</BODY>
</HTML>