28. Bit Field Operations-i

Question.2

A developer wants to update the MODE field (bits 12–15) in a 16-bit register from 0xA to 0x5. The register currently holds 0xA3F5. He writes:

reg |= (0x05 << 12);

What is wrong with this code?

Need Help? Refer to the Quick Guide below

Select Answer