<s>
The	O
WD16	B-General_Concept
is	O
a	O
16-bit	O
microprocessor	O
introduced	O
by	O
Western	O
Digital	O
in	O
October	O
1976	O
.	O
</s>
<s>
It	O
is	O
based	O
on	O
the	O
MCP-1600	B-General_Concept
chipset	O
,	O
which	O
formed	O
the	O
basis	O
of	O
the	O
DEC	O
LSI-11	O
low-end	O
minicomputer	B-Architecture
and	O
the	O
Pascal	B-Device
MicroEngine	I-Device
processor	O
designed	O
specifically	O
to	O
run	O
the	O
UCSD	B-Language
p-System	I-Language
efficiently	O
.	O
</s>
<s>
The	O
WD16	B-General_Concept
implements	O
an	O
extension	O
of	O
the	O
PDP-11	B-Device
instruction	I-Device
set	I-Device
architecture	I-Device
but	O
is	O
not	O
machine	B-Language
code	I-Language
compatible	O
with	O
the	O
PDP-11	O
.	O
</s>
<s>
The	O
WD16	B-General_Concept
is	O
an	O
example	O
of	O
orthogonal	B-General_Concept
CISC	B-Architecture
architecture	I-Architecture
.	O
</s>
<s>
The	O
WD16	B-General_Concept
is	O
implemented	O
in	O
five	O
40-pin	O
DIP	B-Algorithm
packages	O
.	O
</s>
<s>
The	O
WD16	B-General_Concept
is	O
best	O
known	O
for	O
its	O
use	O
in	O
Alpha	O
Microsystems	O
 '	O
AM-100	O
and	O
AM-100/T	O
processor	O
boards	O
.	O
</s>
<s>
As	O
of	O
1981	O
there	O
were	O
at	O
least	O
5,000	O
Alpha	O
Micro	O
computers	O
based	O
on	O
the	O
WD16	B-General_Concept
.	O
</s>
<s>
As	O
late	O
as	O
1982	O
,	O
WD16-based	O
Alpha	O
Micros	O
were	O
still	O
being	O
characterized	O
as	O
"	O
supermicros.	O
"	O
</s>
<s>
The	O
WD16	B-General_Concept
was	O
superseded	O
by	O
the	O
Motorola	B-Device
68000	I-Device
in	O
June	O
1982	O
.	O
</s>
<s>
The	O
smallest	O
unit	O
of	O
addressable	O
and	O
writable	O
memory	O
is	O
the	O
8-bit	O
byte	B-Application
.	O
</s>
<s>
Bytes	B-Application
can	O
also	O
be	O
held	O
in	O
the	O
lower	O
half	O
of	O
registers	B-General_Concept
R0	O
through	O
R5	O
.	O
</s>
<s>
16-bit	O
words	O
are	O
stored	O
little-endian	O
with	O
least	O
significant	O
bytes	B-Application
at	O
the	O
lower	O
address	O
.	O
</s>
<s>
Words	O
can	O
be	O
held	O
in	O
registers	B-General_Concept
R0	O
through	O
R7	O
.	O
</s>
<s>
Floating	B-Algorithm
point	I-Algorithm
values	I-Algorithm
are	O
48	O
bits	O
long	O
and	O
can	O
only	O
be	O
stored	O
in	O
memory	O
.	O
</s>
<s>
This	O
format	O
is	O
half-way	O
between	O
single	O
and	O
double	O
precision	O
floating	B-Algorithm
point	I-Algorithm
formats	I-Algorithm
.	O
</s>
<s>
Floating	B-Algorithm
point	I-Algorithm
values	I-Algorithm
are	O
always	O
aligned	O
to	O
even	O
addresses	O
.	O
</s>
<s>
The	O
first	O
word	O
contains	O
the	O
sign	O
,	O
exponent	O
,	O
and	O
high	O
byte	B-Application
of	O
the	O
mantissa	O
.	O
</s>
<s>
The	O
next	O
higher	O
address	O
contains	O
the	O
middle	O
two	O
bytes	B-Application
of	O
the	O
mantissa	O
,	O
and	O
the	O
next	O
higher	O
address	O
contains	O
the	O
lowest	O
two	O
bytes	B-Application
of	O
the	O
mantissa	O
.	O
</s>
<s>
A	O
1	O
bit	O
sign	O
for	O
the	O
entire	O
number	O
which	O
is	O
zero	B-Algorithm
for	O
positive	O
.	O
</s>
<s>
The	O
only	O
legal	O
number	O
with	O
an	O
exponent	O
of	O
-128	O
is	O
true	O
zero	B-Algorithm
(	O
all	O
zeros	O
)	O
.	O
</s>
<s>
The	O
WD16	B-General_Concept
's	O
16-bit	O
addresses	O
can	O
directly	O
access	O
64KB	O
memory	O
.	O
</s>
<s>
The	O
WD16	B-General_Concept
does	O
not	O
offer	O
any	O
inherent	O
memory	O
management	O
or	O
protection	O
.	O
</s>
<s>
In	O
the	O
AM-100	O
application	O
,	O
the	O
last	O
256	O
memory	O
locations	O
are	O
mapped	O
to	O
port	B-Architecture
space	O
.	O
</s>
<s>
As	O
most	O
AM-100	O
computers	O
were	O
used	O
as	O
multi-user	O
computers	O
,	O
the	O
memory	O
would	O
usually	O
be	O
expanded	O
past	O
64K	O
with	O
bank	B-General_Concept
switching	I-General_Concept
.	O
</s>
<s>
In	O
1981	O
an	O
optional	O
AM-700	O
memory	O
management	O
unit	O
was	O
offered	O
for	O
the	O
AM-100/T	O
which	O
allowed	O
memory	B-General_Concept
segmentation	I-General_Concept
in	O
256	O
byte	B-Application
increments	O
.	O
</s>
<s>
The	O
CPU	O
contains	O
eight	O
general-purpose	O
16-bit	O
registers	B-General_Concept
,	O
R0	O
to	O
R7	O
.	O
</s>
<s>
The	O
registers	B-General_Concept
can	O
be	O
used	O
for	O
any	O
purpose	O
with	O
these	O
exceptions	O
:	O
Register	O
R7	O
is	O
the	O
program	B-General_Concept
counter	I-General_Concept
(	O
PC	O
)	O
.	O
</s>
<s>
Rn	O
means	O
one	O
of	O
the	O
eight	O
registers	B-General_Concept
,	O
written	O
R0	O
through	O
R7	O
.	O
</s>
<s>
Their	O
effects	O
when	O
applied	O
to	O
R6	O
(	O
the	O
stack	O
pointer	O
,	O
SP	O
)	O
and	O
R7	O
(	O
the	O
program	B-General_Concept
counter	I-General_Concept
,	O
PC	O
)	O
are	O
set	O
out	O
separately	O
in	O
the	O
following	O
sections	O
.	O
</s>
<s>
Autoincrement	O
and	O
autodecrement	O
operations	O
on	O
a	O
register	O
are	O
by	O
1	O
in	O
byte	B-Application
instructions	O
,	O
by	O
2	O
in	O
word	O
instructions	O
,	O
and	O
by	O
2	O
whenever	O
a	O
deferred	O
mode	O
is	O
used	O
,	O
since	O
the	O
quantity	O
the	O
register	O
addresses	O
is	O
a	O
(	O
word	O
)	O
pointer	O
.	O
</s>
<s>
When	O
R7	O
(	O
the	O
program	B-General_Concept
counter	I-General_Concept
)	O
is	O
specified	O
,	O
four	O
of	O
the	O
addressing	O
modes	O
naturally	O
yield	O
useful	O
effects	O
:	O
</s>
<s>
The	O
other	O
is	O
to	O
specify	O
input/output	O
registers	B-General_Concept
in	O
port	B-Architecture
space	O
,	O
as	O
the	O
registers	B-General_Concept
for	O
each	O
device	O
have	O
specific	O
memory	O
addresses	O
.	O
</s>
<s>
A	O
program	O
that	O
uses	O
relative	O
mode	O
(	O
and	O
relative	O
deferred	O
mode	O
)	O
exclusively	O
for	O
internal	O
references	O
is	O
position-independent	B-Operating_System
;	O
it	O
contains	O
no	O
assumptions	O
about	O
its	O
own	O
location	O
,	O
so	O
it	O
can	O
be	O
loaded	O
into	O
an	O
arbitrary	O
memory	O
location	O
,	O
or	O
even	O
moved	O
,	O
with	O
no	O
need	O
for	O
its	O
addresses	O
to	O
be	O
adjusted	O
to	O
reflect	O
its	O
location	O
.	O
</s>
<s>
In	O
computing	O
such	O
addresses	O
relative	O
to	O
the	O
current	O
location	O
,	O
the	O
processor	O
performs	O
relocation	B-Library
on	O
the	O
fly	O
.	O
</s>
<s>
When	O
the	O
auxiliary	O
word	O
is	O
in	O
the	O
instruction	O
,	O
the	O
PC	O
for	O
the	O
next	B-General_Concept
instruction	I-General_Concept
is	O
automatically	O
incremented	O
past	O
the	O
auxiliary	O
word	O
.	O
</s>
<s>
As	O
PC	O
always	O
points	O
to	O
words	O
,	O
the	O
autoincrement	O
operation	O
is	O
always	O
by	O
a	O
stride	B-Data_Structure
of	O
2	O
.	O
</s>
<s>
A	O
convention	O
enforced	O
by	O
the	O
set	O
of	O
addressing	O
modes	O
the	O
WD16	B-General_Concept
provides	O
is	O
that	O
a	O
stack	O
grows	O
downward	O
—	O
toward	O
lower	O
addresses	O
—	O
as	O
items	O
are	O
pushed	O
onto	O
it	O
.	O
</s>
<s>
Although	O
software	O
stacks	O
can	O
contain	O
bytes	B-Application
,	O
SP	O
always	O
points	O
to	O
a	O
stack	O
of	O
words	O
.	O
</s>
<s>
Autoincrement	O
and	O
autodecrement	O
operations	O
on	O
SP	O
are	O
always	O
by	O
a	O
stride	B-Data_Structure
of	O
2	O
.	O
</s>
<s>
Most	O
of	O
the	O
WD16	B-General_Concept
instructions	O
operate	O
on	O
bytes	B-Application
and	O
words	O
.	O
</s>
<s>
Bytes	B-Application
are	O
specified	O
by	O
a	O
register	O
number	O
—	O
identifying	O
the	O
register	O
's	O
low-order	O
byte	B-Application
—	O
or	O
by	O
a	O
memory	O
location	O
.	O
</s>
<s>
Words	O
are	O
specified	O
by	O
a	O
register	O
number	O
or	O
by	O
the	O
memory	O
location	O
of	O
the	O
low-order	O
byte	B-Application
,	O
which	O
must	O
be	O
an	O
even	O
number	O
.	O
</s>
<s>
In	O
the	O
lists	O
in	O
the	O
following	O
sections	O
,	O
the	O
letter	O
B	O
is	O
appended	O
to	O
the	O
instruction	O
symbol	O
to	O
specify	O
a	O
byte	B-Application
operation	O
,	O
for	O
example	O
,	O
MOV	O
becomes	O
MOVB	O
.	O
</s>
<s>
The	O
high-order	O
ten	O
bits	O
specify	O
the	O
operation	O
to	O
be	O
performed	O
,	O
with	O
bit	O
15	O
generally	O
selecting	O
byte	B-Application
versus	O
word	O
addressing	O
.	O
</s>
<s>
Two	O
groups	O
of	O
three	O
bits	O
specify	O
the	O
source	O
and	O
destination	O
registers	B-General_Concept
.	O
</s>
<s>
In	O
all	O
cases	O
the	O
source	O
register	O
contains	O
the	O
address	O
of	O
the	O
first	O
word	O
or	O
byte	B-Application
of	O
memory	O
to	O
be	O
moved	O
,	O
and	O
the	O
destination	O
register	O
contains	O
the	O
address	O
of	O
the	O
first	O
word	O
or	O
byte	B-Application
of	O
memory	O
to	O
receive	O
the	O
data	O
being	O
moved	O
.	O
</s>
<s>
The	O
number	O
of	O
words	O
or	O
bytes	B-Application
being	O
moved	O
is	O
contained	O
in	O
R0	O
as	O
a	O
unsigned	O
integer	O
.	O
</s>
<s>
The	O
high-order	O
byte	B-Application
of	O
the	O
instruction	O
specifies	O
the	O
operation	O
.	O
</s>
<s>
The	O
low-order	O
byte	B-Application
is	O
a	O
signed	O
word	O
offset	O
relative	O
to	O
the	O
current	O
location	O
of	O
the	O
program	B-General_Concept
counter	I-General_Concept
.	O
</s>
<s>
In	O
contrast	O
to	O
Intel	O
processors	O
in	O
the	O
x86	B-Operating_System
architecture	I-Operating_System
,	O
MOV	O
instructions	O
set	O
them	O
too	O
,	O
so	O
a	O
branch	O
instruction	O
could	O
be	O
used	O
to	O
branch	O
depending	O
on	O
whether	O
the	O
value	O
moved	O
was	O
zero	B-Algorithm
or	O
negative	B-Algorithm
.	O
</s>
<s>
The	O
specified	O
register	O
is	O
decremented	O
by	O
1	O
,	O
and	O
if	O
the	O
result	O
is	O
not	O
zero	B-Algorithm
,	O
a	O
reverse	O
branch	O
is	O
taken	O
based	O
on	O
the	O
6-bit	O
word	O
offset	O
.	O
</s>
<s>
The	O
JSR	O
PC	O
,	O
@(SP )	O
+	O
form	O
can	O
be	O
used	O
to	O
implement	O
coroutines	B-Architecture
.	O
</s>
<s>
Initially	O
,	O
the	O
entry	O
address	O
of	O
the	O
coroutine	B-Architecture
is	O
placed	O
on	O
the	O
stack	O
and	O
from	O
that	O
point	O
the	O
JSR	O
PC	O
,	O
@(SP )	O
+	O
instruction	O
is	O
used	O
for	O
both	O
the	O
call	O
and	O
the	O
return	O
statements	O
.	O
</s>
<s>
Bus	O
activity	O
ceases.0008	O
RSVC	O
Return	O
from	O
supervisor	O
call	O
(	O
B	O
or	O
C	B-Algorithm
)	O
:	O
REST	O
,	O
SP	O
←	O
SP	O
+	O
2	O
,	O
RTT0009	O
RRTT	O
Restore	O
and	O
return	O
from	O
trap	O
:	O
REST	O
,	O
RTT000A	O
SAVE	O
Save	O
registers	B-General_Concept
:	O
-(SP )	O
←	O
R5	O
,	O
-(SP )	O
←	O
R4	O
,	O
-(SP )	O
←	O
R3	O
,	O
-(SP )	O
←	O
R2	O
,	O
-(SP )	O
←	O
R1	O
,	O
-(SP )	O
←	O
R0000B	O
SAVS	O
Save	O
status	O
:	O
SAVE	O
,	O
-(SP )	O
←	O
(	O
002E	O
)	O
,	O
(	O
002E	O
)	O
←	O
(	O
002E	O
)	O
∨	O
Mask	O
,	O
MSKO	O
,	O
IEN	O
.	O
</s>
<s>
C	B-Algorithm
indicating	O
a	O
carry	B-Algorithm
condition	O
.	O
</s>
<s>
WD16	B-General_Concept
processor	O
speed	O
varies	O
by	O
clock	O
speed	O
,	O
memory	O
configuration	O
,	O
op	O
code	O
,	O
and	O
addressing	O
modes	O
.	O
</s>
<s>
Floating	B-Algorithm
point	I-Algorithm
is	O
significantly	O
slower	O
.	O
</s>
<s>
The	O
WD16	B-General_Concept
's	O
precision	O
is	O
a	O
compromise	O
between	O
traditional	O
single	O
and	O
double	O
precision	O
floats	B-Algorithm
.	O
</s>
<s>
A	O
single-precision	O
floating	O
add	O
instruction	O
executed	O
by	O
the	O
FP11-C	O
co-processor	O
could	O
range	O
from	O
0.9	O
to	O
2.5	O
microseconds	O
plus	O
time	O
to	O
fetch	O
the	O
operands	O
which	O
could	O
range	O
up	O
to	O
4.2	O
microseconds	O
.	O
</s>
<s>
The	O
WD16	B-General_Concept
block	O
transfer	O
instructions	O
approximately	O
double	O
the	O
speed	O
of	O
moves	O
and	O
block	O
I/O	O
.	O
</s>
<s>
The	O
Creative	O
Computing	O
Benchmark	O
of	O
May	O
1984	O
placed	O
the	O
WD16	B-General_Concept
(	O
in	O
the	O
AM-100T	O
application	O
)	O
as	O
number	O
34	O
out	O
of	O
183	O
machines	O
tested	O
.	O
</s>
<s>
The	O
elapsed	O
time	O
was	O
10	O
seconds	O
,	O
compared	O
to	O
24	O
seconds	O
for	O
the	O
IBM	B-Device
PC	I-Device
.	O
</s>
<s>
Virtual	O
Alpha	O
Micro	O
is	O
an	O
open	O
source	O
WD16	B-General_Concept
emulator	O
.	O
</s>
<s>
Written	O
in	O
C	B-Algorithm
,	O
it	O
emulates	O
the	O
WD16	B-General_Concept
processor	O
and	O
the	O
Alpha	O
Micro	O
AM-100	O
hardware	O
environment	O
.	O
</s>
