setb

Set Boolean

setb RT, BFA

Sets the target register based on the condition register field BFA.

Details

If bit 0 of CR field BFA is set to 1, the contents of register RT are set to 0xFFFF_FFFF_FFFF_FFFF. If bit 1 of CR field BFA is set to 1, the contents of register RT are set to 0x0000_0000_0000_0001. Otherwise, the contents of register RT are set to 0x0000_0000_0000_0000.

Pseudocode Operation

if CR4×BFA+32=1 then
    RT ←0xFFFF_FFFF_FFFF_FFFF
else if CR4×BFA+33=1 then
    RT ←0x0000_0000_0000_0001
else
    RT ←0x0000_0000_0000_0000

Programming Note

The setb instruction is commonly used to conditionally set a register based on the state of specific bits in the CR (Condition Register). Ensure that the BFA field correctly reflects the desired condition before executing this instruction. This instruction operates at user privilege level and does not generate exceptions under normal conditions.

Example

setb r3, cr1

Encoding

Binary Layout
31
0
RT
6
BFA
11
/
14
128
/
 
Format X-form
Opcode 0x7C000100
Extension Base
Registers Altered CR, RT

Operands

  • RT
    Target
  • BFA
    CR Field