Alto Hardware Manual Section 3: Emulator
15
The
alert reader will detect that the
SK
field
is
microcoded.
The
skip condition
can
be described as:
skip =
(SK[2):;e0)
XOR
«SK[O):;eO
AND
result =
0)
OR
(sK[l):;eO
AND
carryResult= 0))
where
SK[O)
is the first
bit
of
the
field,
SK[1]
the second
and
SK[2]the third.
The
NL
bit
in the instruction controls the operation
of
the switch
in
the illustration.
If
NL=
1,
neither
the
destination accumulator nor the carry
bit
is
loaded; otherwise
the
destination accumulator is loaded from
Result
and
the carry bit from carryResult The "no-load" feature is useful for instructions whose only
use is testing some value.
The
character #
is
appended
to
the mnemonic for operations
if
the
NL
bit
is
to
be
set
The
AFUnc
operations are described below. Note
that
"Result" will
be
stored
into
the destination
accumulator
(DeStAc)
unless
NL=l.
Mnemonic
AFUnc
Operation
Description
COM
NEG
MOV
INC
ADC
SUB
ADD
AND
o
1
2
3
4
5
6
7
COMPLEMENT
The function generator produces the logical complement
of
Ac(srcAc).
It
passes the carry
bit
unaffected.
NEGATE
The function generator produces
the
two's complement
of
Ac(srcAc).
If
Ac(srcAc) contains zero, complement
the value
of
the carry supplied to the function generator,
otherwise supply the specified value.
MOVE
The function generator passes Ac(srcAc) and
the
carry
bit unaffected.
INCREMENT
The Result produced ·.is
AC(SrcAC)
+ 1; the carry is
complemented
if
Ac(srcAc) = 177777B.
ADD
COMPLEMENT
The Result produced is the
sum
of
AC(DeStAc)
and
the logical complement
of
AC(SfCAC).
The
carry
bit
is
complemented
if
the addition generates a carry.
SUBTRACT
Subtracts
by
adding the two's complement
of
Ac(srcAc)
to
AC(DeStAc).
The
carry
bit
is complemented
if
the
addition generates a carry
..
ADD
Adds Ac(srcAC) to AC(DestAc).
The
carry
bit
is
complemented
if
the addition generates a carry.
AND
The Result is the logical
and
of
Ac(srcAC)
and
AC(DeStAc).
The
carry is passed unaffected.
The
arithmetic instructions are written by citing. the
AFUnc
mnemonic, followed optionally
by
the
CY
mnemonic, followed optionally by the
SH
mnemonic, followed optionally
by
the
NL
mnemonic.
Then
after a space, the source accumulator number
is
given, the destination accumulator number,
and
optionally an
SK
mnemonic.
For
example:
SUB
0 0
MOVZ
2 1
SUBZL
1 1
ADC
0 0
SUB#
2 3
SNR
COM#
1 1
SZR
SUBZ#
1 0
SZC
ADCZ#
1 0
SZC
Zero
ACO
by
subtracting
it
from
itself
Move
AC2
to
AC1,
and
zero
C
Set
AC1
to
1
Set
ACO
to
177777B
Skips
if
AC2
and
AC3
are
unequal
but
affects
neither
Skips
if
AC1
is
177777B
but
leaves
it
unchanged
Skips
if
ACO(AC1
unsigned.
Skips
if
ACOiAC1
unsigned
To
subtract the constant 1 from
Ac1: