38. Bitwise Rotation and Counting-I

Question.8

In a task scheduler, each bit in a uint8_t register represents a ready task. Bit 7 is the highest priority. A developer writes code to find the position of the highest-priority ready task:

int highest = -1;
uint8_t temp = task_reg;
while (temp) {
   highest++;
   ___;
}
// highest now holds the bit position of the MSB

What goes in the blank?

Need Help? Refer to the Quick Guide below

Select Answer