LOGICAL
INSTRUCTIONS
INTRODUCTION
DATA FORMAT
• Logical
instructions
are
used to
manipulate
data.
The
operands
are
usually
treated
as
eight-bit bytes. Some logical operations
require
a
single eight-bit
byte
specified
as
an
operand;
others
may
have variable-
length
operands
composed
of
many
eight-bit bytes. Some
instructions
oper-
ate
on
the
zone
portion
only,
or
on
the
digit
portion only,
of
the
bytes
of
a variable-length operand. Some
instructions
have
an
operand
that
is
part
of
the
immediate
instruction
being executed. Finally,
there
is a
group
of
instructions
that
provide
for
bit
shifting.
Operands
are
in
either
main
memory
or
general
registers.
Processing
of
data
in
main
memory is
from
left-to-right
starting
at
any
byte
location.
Processing
in
general
registers
usually involves
the
entire
contents
of
a
general
register,
or
in some cases, two
general
registers.
The
Edit
instruction
is
the
only
instruction
which requires
that
the
data
be
in
packed decimal
data.
The
Edit
instruction
converts packed
decimal
data
into alphanumeric
characters
with
editing
under
the
control
of
a
mask
pattern.
The
logical
instruction
set
includes moving, comparing,
bit
testing,
translating,
editing,
shifting,
and
bit
connecting.
The condition code is
set
by all
instructions
except
the
moving,
trans-
lating,
and
shifting
instructions.
•
Data
in
general
registers
usually involves
the
entire
32 bits.
There
is
no distinction made between
sign
and
numeric bits.
In
some operations,
only
the
least significant eight
bits
of
the
general
register
are
involved,
and
in
another
case,
the
least
significant 24
bits
are
involved.
In
addition,
there
are
some
shift
operations
in
which
an
even/odd
numbered
pair
of
general
registers
is involved.
The
storage
data
in
memory-to-register operations resides
in
either
a
32-bit
word
or
an
eight-bit byte. A word
must
be oriented on
word
boundaries (i.e.,
the
address
of
the
32-bit
word
must
have
the
two low-order
bits
zero).
The
storage
data
in
memory-to-memory operations have a
variable
length
format
and
can have a field size
of
up to 256 bytes
starting
at
any
byte
location. Processing is
from
left
to
right.
Instructions
that
specify
an
operand
that
is
part
of
the
immediate
instruction
being executed
are
restricted
to a field size
of
one eight-bit byte.
The
Translate
and
Test
and
the
Edit
and
Mark
instructions
imply
the
use
of
General
Register
1
*.
An
address
of
24
bits
may
be placed
in
this
register
during
the
execution
of
these instructions. The
Translate
and
Test
instruction
also implies
the
use
of
General
Register
2
where
an
insertion
of
an
eight-bit
function
byte
may
be placed
during
the
execution
of
the
instruction.
Overlapping
of
fields
in
memory-to-memory operations
mayor
may
not
affect
the
operands
of
the
various instructions.
The
execution
of
some
*
When
these
instructions
are
executed
in
P31
General
Registers
13
and
14
are
used;
in
P
41
General
Registers
9
and
10
are
used.
167