nor
NOR - 7C 00 00 F8
nor

Instruction Syntax

Mnemonic Format Flags
nor rA,rS,rB Rc = 0
nor. rA,rS,rB Rc = 1

Instruction Encoding

0
1
1
1
1
1
S
S
S
S
S
A
A
A
A
A
B
B
B
B
B
0
0
0
0
0
0
0
0
0
Rc

Field Bits Description
Primary Opcode 0-5 011111 (0x1F)
rS 6-10 Source register
rA 11-15 Destination register
rB 16-20 Source register
Reserved 21-29 000000000
Rc 30-31 Record Condition Register

Operation

rA ← ¬((rS) | (rB))

The logical NOR of (rS) and (rB) is placed into rA.

Note: The nor instruction performs a logical NOR operation, which is equivalent to NOT(OR(rS, rB)).

Affected Registers

Condition Register (CR0 field)

(if Rc = 1)

Note: CR0 field reflects the result of the logical operation.

Examples

Basic NOR Operation

nor r3, r1, r2     # r3 = NOT(r1 OR r2)
nor. r3, r1, r2    # Same as above, but also sets condition register

Bit Clearing

# Clear specific bits in r1 using a mask in r2
nor r3, r1, r2     # r3 = NOT(r1 OR r2)
# This can be used to clear bits that are set in r2

Logical Operations

# NOR can be used to implement other logical operations
# NOT r1: nor r2, r1, r1    # r2 = NOT(r1)
# NAND r1, r2: nor r3, r1, r2  # r3 = NOT(r1 AND r2)

Related Instructions

or, and, xor, orc, nand

Back to Index