5.132 · exercise

Predict: bit manipulation

For each snippet, give the exact value left in the named register. The snippets clear, extract, insert, rotate, count and swap bits.

0 of 6 correct

Predict the result

mov w20, 0x2C
sub w21, w20, 1
and w19, w20, w21

Predict the result

mov w20, 0x1234
ubfx w19, w20, 6, 5

Predict the result

mov w20, 0xFFFF
mov w21, 0
bfi w20, w21, 4, 8

Predict the result

mov w20, 0x5678
movk w20, 0x1234, lsl 16
ror w19, w20, 8

Predict the result

mov x20, 0x100
clz x19, x20

Predict the result

mov w19, 6
mov w20, 9
eor w19, w19, w20
eor w20, w19, w20
eor w19, w19, w20