# Logical Instructions; Logical And (Nc); Logical Or (Oc); Exclusive Or (Xc) - RCA Spectra 70 Training Manual

System
Also See for Spectra 70:

LOGICAL INSTRUCTIONS
INTRODUCTION
The Logical Instructions perform operations on the
individual bits of a byte. The operation works from
the left to right on equal length operands (256 maxi-
mum).
Proper parity is generated for each byte
based upon the eight least-significant bits.
The three principal logical operations are AND
(result is one if and only if both bits are one), OR
(result is one if either or both bits are one), EX-
eLUSIVE OR (result is one if either but not both bits
are one). One additional logical operation is a test
AND INSTRUCTION
The rule of the AND instruction is that a 1 bit in the
same relative bit pOSition of both operands produces
a 1 bit in the same pOSition of the result. Any other
combination of bits produces a zero bit in the result.
Example:
HSM BEFORE
EXECUTION
HSM BEFORE
AND AFTER
EXECUTION
ASSEMBLY
INSTRUCTION
GENERATED
INSTRUCTION
HSl\l AFTER
EXECUTIO~
o
+
0
o
0+1
o
1
+
0
o
1
+
1
1
BIT CONFIGURATION
30
00
01
0000 0000 1001 1010
00
9A
INC
00
01
31
1111 1111 1111 1010
FF FA
OPERATION
OPERAND
NC
OP
L
B1
D1
B2
D2
D4
16
1
110
3000
10
110
3100
10
General Register one contains 0000
0000 0000 1001
10]0
CONDITION CODE
=
1
45
OR INSTRUCTION
This instruction maybe used to insert 1 bit(s) in any
bit position (s) of a byte.
The rule of OR is that a 1 bit in the same relative
position of either field produces a 1 bit in the same
position of the result.
Example:
HSM BEFOHE
AND AFTER
EXECUTION
HSM BEFORE
EXECUTION
ASSEMBLY
INSTRUCTION
GENERATED
INSTRUCTION
HSM AFTER
EXECUTION
0+0
o
o
+
1
1
1 + 0
1
1
+
1
1
('II
BIT CONFIGURATION
0000 0000 0000 0000 0000 0001
BAL
1000 1001 1000 1100
General Register one contains 0000
BAL
0000 0111 1000 1001 1000 1101
CONDITION CODE
=
1
EXCLUSIVE OR INSTRUCTION
The Exclusive Or instruction extracts 1 bit(s) in
specified bit position(s) of one or more bytes.
The Exclusive Or may also be used to alternate des-
ignated bits so that they will have a
value of 1
the
first time and 0 the second time the Exclusive Or in-
struction is performed. In this case the modifying
mask has a one bit in the bit positions where the inter-
change is desired.
The rule of Exclusive Or may be considered the same