English
Language : 

UPD17134A Datasheet, PDF (112/292 Pages) NEC – 4-BIT SINGLE-CHIP MICROCONTROLLER
CHAPTER 11 ARITHMETIC AND LOGIC UNIT (ALU)
11.4 LOGICAL OPERATIONS
As shown in Table 11-4, logical operations consist of logical OR, logical AND, and logical XOR. Accordingly, the
logical operation instructions are OR, AND, and XOR.
The OR, AND, and XOR instructions can be performed on either the general register and data memory, or on data
memory and immediate data. The operands of these instructions are specified in the same way as for arithmetic
operations (“r, m” or “m, #n4”).
Logical operations are not affected by the BCD or CMP flags in the program status word (PSWORD). Logical
operations do not cause either the CY or Z flag in the program status word (PSWORD) to be set. However, when
the index enable flag (IXE) is set (1), index modification is performed using the index register.
Table 11-4. Logical Operations
Logical
operation
Logical OR
Logical AND
Logical XOR
General register and data memory
Data memory and immediate data
General register and data memory
Data memory and immediate data
General register and data memory
Data memory and immediate data
OR r, m
OR m, #n4
AND r, m
AND m, #n4
XOR r, m
XOR m, #n4
Table 11-5. Table of True Values for Logical Operations
Logical AND
C = A AND B
ABC
0
0
0
0
1
0
1
0
0
1
1
1
Logical OR
C = A OR B
ABC
0
0
0
0
1
1
1
0
1
1
1
1
Logical XOR
C = A XOR B
ABC
0
0
0
0
1
1
1
0
1
1
1
0
93