crand

Condition Register AND

crand BT, BA, BB

Performs a bitwise AND between two bits in the Condition Register.

Encoding

Binary Layout
19
0:5
BT
6:10
BA
11:15
BB
16:20
257
21:30
/
31
 
Format XL-form
Opcode 0x4C000202
Extension Base

Operands

  • BT
    Target Bit (0-31)
  • BA
    Source Bit A
  • BB
    Source Bit B

Example

crand 4*cr0+eq, 4*cr1+lt, 4*cr2+gt

// If (cr1.lt AND cr2.gt), set cr0.eq.

Registers Altered

CR

Related

More in Base

Reference

Description

The bit in the Condition Register specified by BA+32 is ANDed with the bit in the Condition Register specified by BB+32, and the result is placed into the bit in the Condition Register specified by BT+32.

Operation

CR[BT] <- CR[BA] & CR[BB]

Programming Note

The crand instruction performs a bitwise AND operation on specific bits of the Condition Register (CR). It's commonly used to combine condition flags from different operations. Ensure that the BA, BB, and BT fields are correctly set to avoid unintended results. This instruction operates at user privilege level.