Follow a Copy Chain Through mov

Easy

Finish the relay function so the value passed in is copied through the chain of locals: first into second, then second into third. The program prints relay(42) and relay(7). Once your output is correct, read the assembly panel and trace the mov instructions that implement the chain: the immediate-to-register mov that loads 42 in main, and the load/store pairs (mov DWORD PTR -8[rbp], eax) that shuttle the value between stack slots at -O0.

Success Criteria

Your code must pass 1 test case(s) to complete this exercise. 3 hint(s) are available if you need help.

Sign in to track your progress

You can work on exercises as a guest, but sign in to track your progress and save your submissions.

This platform is built by its community

Every lesson, project, and tool on HelloC++ is funded by sponsors. Join them and help shape what we build next.

Become a Patron