.\" Copyright (c) 1982 The Regents of the University of California.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" @(#)asdocs1.me 5.1 (Berkeley) 4/17/91
\**Preparation of this paper supported in part
by the National Science Foundation under grant MCS #78-07291.
Electronics Research Laboratory
This document describes the usage and input syntax
of the \*(UX \*(VX-11 assembler
is designed for assembling the code produced by the
certain concessions have been made to handle code written
but in general little sympathy has been extended.
This document is intended only for the writer of a compiler or a maintainer
.SH 2 "Assembler Revisions since November 5, 1979"
There has been one major change to
has been updated to assemble the new instructions and
as well as the new queue instructions.
.SH 2 "Features Supported, but No Longer Encouraged as of \*(TD"
are supported, but no longer encouraged.
The colon operator for field initialization is likely to disappear.
is invoked with these command arguments:
flag instructs the assembler to save labels beginning with a
in the symbol table portion of the
Labels are not saved by default,
as the default action of the link editor
is to discard them anyway.
flag tells the assembler to place its interpass temporary
file into virtual memory.
the system manager will decide where the temporary file should lie.
with very large temporary files show that placing the temporary
file into virtual memory will save about 13% of the assembly time,
where the size of the temporary file is about 350K bytes.
Most assembler sources will not be this long.
turns of all warning error reporting.
flag forces \*(UX style pseudo\-branch
instructions with destinations further away than a
turned into jump instructions with 4 byte offsets.
(See \(sc8.4, and future work described in \(sc11)
This obviates the need to run editor scripts on assembler source to
fix initialized data segments.
is still assembled into the data or bss segments.
flag specifies the number of bytes
which the assembler should allow for a displacement when the value of the
displacement expression is undefined in the first pass.
the assembler uses 4 bytes
flag causes the assembler to place its single temporary file
flag causes the output to be placed on the file
the output of the assembler is placed in the file
in the current directory.
The input to the assembler is normally taken from the standard input.
then the input is taken sequentially from the files
$name sub 2~...~name sub n$
This is not to say that the files are assembled separately;
$name sub 1$ is effectively concatenated to $name sub 2$,
so multiple definitions cannot occur amongst the input sources.
flags enable assembler trace information,
provided that the assembler has been compiled with
the debugging code enabled.
The information printed is long and boring,
but useful when debugging the assembler.
.SH 1 "Lexical conventions"
Assembler tokens include identifiers (alternatively,
An identifier consists of a sequence of alphanumeric characters
The first character may not be numeric.
Identifiers may be (practically) arbitrary long;
all characters are significant.
All scalar (non floating point)
constants are (potentially) 128 bits wide.
Such constants are interpreted as two's complement numbers.
Note that 64 bit (quad words) and 128 bit (octal word) integers
are only partially supported by the \*(VX hardware.
128 bit integers are only supported by the extended \*(VX architecture.
supports 64 and 128 bit integers
only so they can be used as immediate constants
or to fill initialized data space.
can not perform arithmetic on constants larger than 32 bits.
Scalar constants are initially evaluated to a full 128 bits,
but are pared down by discarding high order copies of the sign bit
and categorizing the number as a long, quad or octal integer.
Numbers with less precision than 32 bits are treated as 32 bit quantities.
.q 0123456789abcdefABCDEF
An octal constant consists of a sequence of digits with a leading zero.
A decimal constant consists of a sequence of digits without a leading zero.
A hexadecimal constant consists of the characters
followed by a sequence of digits.
A single-character constant consists of a single quote
followed by an \*(AC character,
The constant's value is the code for the
.SH 3 "Floating Point Constants"
Floating point constants are internally represented
in the \*(VX floating point format
that is specified by the lexical form of the constant.
Using the meta notation that
[dec] is a decimal digit (\c
[expt] is a type specification character (\c,
[expe] is a exponent delimiter and type specification character (\c,
$x sup roman "*"$ means 0 or more occurences of $x$,
$x sup +$ means 1 or more occurences of $x$,
then the general lexical form of a floating point number is:
0[expe]([+-])$roman "[dec]" sup +$(.)($roman "[dec]" sup roman "*"$)([expt]([+-])($roman "dec]" sup +$))
The standard semantic interpretation is used for the
signed integer, fraction and signed power of 10 exponent.
If the exponent delimiter is specified,
or must agree with the initial type specification character that is used.
The type specification character specifies
the type and representation of the constructed number, as follows:
type character floating representation size (bits)
f, F F format floating 32
d, D D format floating 64
g, G G format floating 64
h, H H format floating 128
format floating point numbers are not supported
by all implementations of the \*(VX architecture.
does not require the augmented architecture in order to run.
The assembler uses the library routine
and uses its own conversion routine
and believed to be numerically accurate)
all floating point numbers,
together with quad and octal scalars are called
a 32 bit scalar quantity may also be used.
A string constant is defined using
the same syntax and semantics as the \*(CL language uses.
Strings begin and end with a
The \*(DM assembler conventions for flexible string quoting is
All \*(CL backslash conventions are observed;
the backslash conventions
peculiar to the \*(PD assembler are not observed.
Strings are known by their value and their length;
the assembler does not implicitly end strings with a null byte.
There are several single-character
may be interspersed freely between tokens,
but may not be used within tokens (except character constants).
A blank or tab is required to separate adjacent
identifiers or constants not otherwise separated.
.SH 2 "Scratch Mark Comments"
which extends through the end of the line on which it appears.
Comments starting in column 1,
.q "# $expression~~string$" ,
are interpreted as an indication that the assembler is now assembling
Thus, one can use the \*(CL preprocessor on an assembly language source file,
(Note that there may not be an assembler comment starting in column
1 if the assembler source is given to the \*(CL preprocessor,
as it will be interpreted by the preprocessor in a way not intended.)
Comments are otherwise ignored by the assembler.
.SH 2 "\*(CL Style Comments"
The assembler will recognize \*(CL style comments,
introduced with the prologue
and ending with the epilogue
\*(CL style comments may extend across multiple lines,
and are the preferred comment style
to use if one chooses to use the \*(CL preprocessor.
.SH 1 "Segments and Location Counters"
Assembled code and data fall into three segments: the text segment,
The \*(UX operating system makes
some assumptions about the content of these segments;
Within the text and data segments there are a number of sub-segments,
distinguished by number (\c
Currently there are four subsegments each in text and data.
The subsegments are for programming convenience only.
Before writing the output file,
the assembler zero-pads each text subsegment to a multiple of four
bytes and then concatenates the subsegments in order to form the text segment;
an analogous operation is done for the data segment.
Requesting that the loader define symbols and storage regions is the only
action allowed by the assembler with respect to the bss segment.
Associated with each (sub)segment is an implicit location counter which
begins at zero and is incremented by 1 for each byte assembled into the
There is no way to explicitly reference a location counter.
Note that the location counters of subsegments other than
behave peculiarly due to the concatenation used to form
the text and data segments.