orc
OR with Complement - 7C 00 00 38
orc
Instruction Syntax
Mnemonic | Format | Flags |
orc | rA,rS,rB | Rc = 0 |
orc. | 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 OR of (rS) and the complement of (rB) is placed into rA.
Note: The orc instruction performs a logical OR operation between rS and the bitwise complement of rB.
Affected Registers
Condition Register (CR0 field)
(if Rc = 1)
- LT (Less Than)
- GT (Greater Than)
- EQ (Equal)
- SO (Summary Overflow)
Note: CR0 field reflects the result of the logical operation.
Examples
Basic ORC Operation
orc r3, r1, r2 # r3 = r1 OR NOT(r2) orc. r3, r1, r2 # Same as above, but also sets condition register
Bit Manipulation
# Set bits in r1 that are NOT set in r2 orc r1, r1, r2 # r1 = r1 OR NOT(r2)
Logical Operations
# ORC can be used to implement other logical operations # NOT r1: orc r2, r0, r1 # r2 = 0 OR NOT(r1) = NOT(r1) # (assuming r0 contains 0)