setb

Set Boolean

setb RT, BFA

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

Encoding

Binary Layout
31
0:5
RT
6:10
BFA
11:15
/
16:20
128
21:30
/
31
 
Format X-form
Opcode 0x7C000100
Extension Base

Operands

  • RT
    Target
  • BFA
    CR Field

Example

setb r3, cr1

Registers Altered

CR, RT

Related

More in Base

Reference

Description

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.

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.