SetB: ldrb w3, [x0] and w1, w1, 3 // value &= 3 lsl w1, w1, 1 mov w2, 6 mvn w2, w2 and w3, w3, w2 // B is cleared orr w3, w3, w1 strb w3, [x0] ret