CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
3
You visited us 3 times! Enjoying our articles? Unlock Full Access!
Question

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 and 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

A
mask pos
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
mask 0xf
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
mask 0x 1 << pos
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
mask 0x ffffff >> pos
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C mask 0x 1 << pos
bbs reg, pos, label

temp reg and mask

Branch to label if temp is non zero. If we shift one position left by pos of 0x1 then it evaluate the bbs instruction and mask 0x1 << pos

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Introduction to Outsourcing
BUSINESS STUDIES
Watch in App
Join BYJU'S Learning Program
CrossIcon