Skip to main content

Practice ยท 3 of 4

Shifts for Powers of Two

CHALLENGE
Difficulty: advanced+25 XP

Implement unsigned int by_shift(unsigned int x) returning x * 8 using a left shift, and unsigned int by_mul(unsigned int x) returning x * 8 with multiplication. Values agree for every input below 2^29 (no overflow); the *dump* differs โ€” the test pins the arithmetic contract, your hint explains the emission difference.

Back to lesson: Practice: Assembly Evidence Drills