Consider a new instruction named branch-on-bit-set (mnemonic bbs). The…

PYQ GATE 2006

Consider a new instruction named branch-on-bit-set (mnemonic bbs). The instruction “bbs reg, pos, label” jumps to label if bit in position pos of register operand reg is one. A register is 32 bits wide and the bits are numbered 0 to 31, bit in position 0 being the least significant. Consider the following emulation of this instruction on a processor that does not have bbs implemented. temp¬reg & mask Branch to label if temp is non-zero. The variable temp is a temporary register. For correct emulation, the variable mask must be generated by:

  1. A.

    mask ← 0 x 1 ο pos

  2. B.

    mask ← 0 x ffffffff ο pos

  3. C.

    mask ← pos

  4. D.

    mask ← 0 × f

Attempted by 35 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…